python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.73k stars 2.27k forks source link

poetry 1.1.2 with enable parallel fails to find package from pypi when custom private source is set. #3162

Closed wasdee closed 2 years ago

wasdee commented 4 years ago

Issue

here is my project toml file.

[tool.poetry]
name = "saku"
version = "2.0.0"
description = "an facebook chatbot"
authors = ["Nutchanon Ninyawee <me@nutchanon.org>"]

[[tool.poetry.source]]
url = "https://pypi.fury.io/sakuguru/"
name = "sakupull"

[tool.poetry.dependencies]
python = "^3.8"
fastapi = "^0.58.1"
uvicorn = "^0.11.5"
google-cloud-talent = "^0.6.1"
aiofiles = "^0.5.0"
python-decouple = "^3.3"
pymongo = "^3.10.1"
mongoengine = "^0.20.0"
orjson = { version = "^3.2.2", optional = true }
mixpanel = "^4.6.0"
pytalentsolution = "^0.2.0"
dnspython = "^2.0.0"
Pillow = "^7.2.0"
arrow = "^0.15.8"
jinja2 = "^2.11.2"
furl = "^2.1.0"
songmam = "^1.5.1"
loguru = "^0.5.1"
faker = "^4.1.2"
avajana = "^0.4"
python-multipart = "^0.0.5"
parse_with_dot_access = "^1.17.1"
moshimoshi = "^0.2"
futureboard = "^0.2.0"
motor = "^2.3.0"
python-dotenv = "^0.14.0"

[tool.poetry.dev-dependencies]
pytest = "^5.4.3"
pre-commit = "^2.7.1"

[tool.poetry.extras]
all = ["orjson"]

[tool.black]
exclued = '''
/(
    \.git
  | \.hg
  | \.mypy_cache
  | \.tox
  | \.venv
  | _build
  | buck-out
  | build
  | dist
  | alembic
)/
'''

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

after I upgraded poetry to 1.1.2, I thrilled to see how fast my installation will be. thus I removed and reinstalled pkgs with poetry update.

C:\Users\n2\WinDevs\sakuguru\saku>poetry update
Creating virtualenv saku in C:\Users\n2\WinDevs\sakuguru\saku\.venv
Updating dependencies
Resolving dependencies...

  RepositoryError

  403 Client Error: Forbidden for url: https://pypi.fury.io/sakuguru/pre-commit/

  at ~\.poetry\lib\poetry\repositories\legacy_repository.py:390 in _get
      386โ”‚             if response.status_code == 404:
      387โ”‚                 return
      388โ”‚             response.raise_for_status()
      389โ”‚         except requests.HTTPError as e:
    โ†’ 390โ”‚             raise RepositoryError(e)
      391โ”‚
      392โ”‚         if response.status_code in (401, 403):
      393โ”‚             self._log(
      394โ”‚                 "Authorization error accessing {url}".format(url=url), level="warn"

then I removed the custom source.

[[tool.poetry.source]]
url = "https://pypi.fury.io/sakuguru/"
name = "sakupull"

Things went smoothly**

C:\Users\n2\WinDevs\sakuguru\saku>poetry update
Updating dependencies
Resolving dependencies...

Writing lock file

Package operations: 82 installs, 0 updates, 0 removals

  โ€ข Installing hpack (3.0.0)
  โ€ข Installing hyperframe (5.2.0)
  โ€ข Installing pyasn1 (0.4.8)
  โ€ข Installing six (1.15.0)
  โ€ข Installing cachetools (4.1.1)
  โ€ข Installing certifi (2020.6.20)
  โ€ข Installing chardet (3.0.4)
  โ€ข Installing h2 (3.2.0)
  โ€ข Installing idna (2.10)
  โ€ข Installing colorama (0.4.3)
  โ€ข Installing h11 (0.9.0)
  โ€ข Installing protobuf (3.13.0)
  โ€ข Installing pyasn1-modules (0.2.8)
  โ€ข Installing urllib3 (1.25.10)
  โ€ข Installing sniffio (1.1.0)
  โ€ข Installing rsa (4.6)
  โ€ข Installing win32-setctime (1.0.3)
  โ€ข Installing appdirs (1.4.4)
  โ€ข Installing distlib (0.3.1)
  โ€ข Installing googleapis-common-protos (1.52.0)
  โ€ข Installing grpcio (1.32.0)
  โ€ข Installing httpcore (0.9.1)
  โ€ข Installing orderedmultidict (1.0.1)
  โ€ข Installing pydantic (1.6.1)
  โ€ข Installing pytz (2020.1)
  โ€ข Installing rfc3986 (1.4.0)
  โ€ข Installing parse-with-dot-access (1.17.1)
  โ€ข Installing filelock (3.0.12)
  โ€ข Installing google-auth (1.22.1)
  โ€ข Installing hstspreload (2020.10.6)
  โ€ข Installing requests (2.24.0)
  โ€ข Installing pyparsing (2.4.7)
  โ€ข Installing loguru (0.5.3)

  EnvCommandError

  Command C:\Users\n2\WinDevs\sakuguru\saku\.venv\Scripts\pip.exe install --no-deps C:\Users\n2\AppData\Local\pypoetry\Cache\artifacts\66\65\0d\8e07624a39ae6e7046e31161862247ec1dab0f862863b01450677115b8\grpcio-1.32.0.tar.gz errored with the following return code 1, and output:
  Processing c:\users\n2\appdata\local\pypoetry\cache\artifacts\66\65\0d\8e07624a39ae6e7046e31161862247ec1dab0f862863b01450677115b8\grpcio-1.32.0.tar.gz
  Building wheels for collected packages: grpcio
    Building wheel for grpcio (setup.py): started
    Building wheel for grpcio (setup.py): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\n2\WinDevs\sakuguru\saku\.venv\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\n2\\AppData\\Local\\Temp\\pip-req-build-822bdw3z\\setup.py'"'"'; __file__='"'"'C:\\Users\\n2\\AppData\\Local\\Temp\\pip-req-build-822bdw3z\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__fi
le__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\n2\AppData\Local\Temp\pip-wheel-0wb9243m'
         cwd: C:\Users\n2\AppData\Local\Temp\pip-req-build-822bdw3z\
    Complete output (79 lines):
    ASM Builds for BoringSSL currently not supported on: win-amd64
    Found cython-generated files...
    running bdist_wheel
    running build
    running build_py
    running build_project_metadata
    creating python_build
    creating python_build\lib.win-amd64-3.9
    creating python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_auth.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_channel.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_common.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_compression.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_grpcio_metadata.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_interceptor.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_plugin_wrapping.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_runtime_protos.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_server.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_simple_stubs.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_utilities.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\__init__.py -> python_build\lib.win-amd64-3.9\grpc
    creating python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\_base_call.py -> python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\_base_channel.py -> python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\_base_server.py -> python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\_call.py -> python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\_channel.py -> python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\_interceptor.py -> python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\_metadata.py -> python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\_server.py -> python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\_typing.py -> python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\_utils.py -> python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\__init__.py -> python_build\lib.win-amd64-3.9\grpc\aio
    creating python_build\lib.win-amd64-3.9\grpc\beta
    copying src\python\grpcio\grpc\beta\implementations.py -> python_build\lib.win-amd64-3.9\grpc\beta
    copying src\python\grpcio\grpc\beta\interfaces.py -> python_build\lib.win-amd64-3.9\grpc\beta
    copying src\python\grpcio\grpc\beta\utilities.py -> python_build\lib.win-amd64-3.9\grpc\beta
    copying src\python\grpcio\grpc\beta\_client_adaptations.py -> python_build\lib.win-amd64-3.9\grpc\beta
    copying src\python\grpcio\grpc\beta\_metadata.py -> python_build\lib.win-amd64-3.9\grpc\beta
    copying src\python\grpcio\grpc\beta\_server_adaptations.py -> python_build\lib.win-amd64-3.9\grpc\beta
    copying src\python\grpcio\grpc\beta\__init__.py -> python_build\lib.win-amd64-3.9\grpc\beta
    creating python_build\lib.win-amd64-3.9\grpc\experimental
    copying src\python\grpcio\grpc\experimental\gevent.py -> python_build\lib.win-amd64-3.9\grpc\experimental
    copying src\python\grpcio\grpc\experimental\session_cache.py -> python_build\lib.win-amd64-3.9\grpc\experimental
    copying src\python\grpcio\grpc\experimental\__init__.py -> python_build\lib.win-amd64-3.9\grpc\experimental
    creating python_build\lib.win-amd64-3.9\grpc\framework
    copying src\python\grpcio\grpc\framework\__init__.py -> python_build\lib.win-amd64-3.9\grpc\framework
    creating python_build\lib.win-amd64-3.9\grpc\_cython
    copying src\python\grpcio\grpc\_cython\__init__.py -> python_build\lib.win-amd64-3.9\grpc\_cython
    creating python_build\lib.win-amd64-3.9\grpc\experimental\aio
    copying src\python\grpcio\grpc\experimental\aio\__init__.py -> python_build\lib.win-amd64-3.9\grpc\experimental\aio
    creating python_build\lib.win-amd64-3.9\grpc\framework\common
    copying src\python\grpcio\grpc\framework\common\cardinality.py -> python_build\lib.win-amd64-3.9\grpc\framework\common
    copying src\python\grpcio\grpc\framework\common\style.py -> python_build\lib.win-amd64-3.9\grpc\framework\common
    copying src\python\grpcio\grpc\framework\common\__init__.py -> python_build\lib.win-amd64-3.9\grpc\framework\common
    creating python_build\lib.win-amd64-3.9\grpc\framework\foundation
    copying src\python\grpcio\grpc\framework\foundation\abandonment.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
    copying src\python\grpcio\grpc\framework\foundation\callable_util.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
    copying src\python\grpcio\grpc\framework\foundation\future.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
    copying src\python\grpcio\grpc\framework\foundation\logging_pool.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
    copying src\python\grpcio\grpc\framework\foundation\stream.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
    copying src\python\grpcio\grpc\framework\foundation\stream_util.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
    copying src\python\grpcio\grpc\framework\foundation\__init__.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
    creating python_build\lib.win-amd64-3.9\grpc\framework\interfaces
    copying src\python\grpcio\grpc\framework\interfaces\__init__.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces
    creating python_build\lib.win-amd64-3.9\grpc\framework\interfaces\base
    copying src\python\grpcio\grpc\framework\interfaces\base\base.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces\base
    copying src\python\grpcio\grpc\framework\interfaces\base\utilities.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces\base
    copying src\python\grpcio\grpc\framework\interfaces\base\__init__.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces\base
    creating python_build\lib.win-amd64-3.9\grpc\framework\interfaces\face
    copying src\python\grpcio\grpc\framework\interfaces\face\face.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces\face
    copying src\python\grpcio\grpc\framework\interfaces\face\utilities.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces\face
    copying src\python\grpcio\grpc\framework\interfaces\face\__init__.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces\face
    creating python_build\lib.win-amd64-3.9\grpc\_cython\_cygrpc
    copying src\python\grpcio\grpc\_cython\_cygrpc\__init__.py -> python_build\lib.win-amd64-3.9\grpc\_cython\_cygrpc
    creating python_build\lib.win-amd64-3.9\grpc\_cython\_credentials
    copying src\python\grpcio\grpc\_cython\_credentials\roots.pem -> python_build\lib.win-amd64-3.9\grpc\_cython\_credentials
    running build_ext
    error: [WinError 2] The system cannot find the file specified
    ----------------------------------------
    ERROR: Failed building wheel for grpcio
    Running setup.py clean for grpcio
  Failed to build grpcio
  DEPRECATION: Could not build wheels for grpcio which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
  Installing collected packages: grpcio
      Running setup.py install for grpcio: started
      Running setup.py install for grpcio: finished with status 'error'
      ERROR: Command errored out with exit status 1:
       command: 'C:\Users\n2\WinDevs\sakuguru\saku\.venv\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\n2\\AppData\\Local\\Temp\\pip-req-build-822bdw3z\\setup.py'"'"'; __file__='"'"'C:\\Users\\n2\\AppData\\Local\\Temp\\pip-req-build-822bdw3z\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__
file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\n2\AppData\Local\Temp\pip-record-un95orpr\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\n2\WinDevs\sakuguru\saku\.venv\include\site\python3.9\grpcio'
           cwd: C:\Users\n2\AppData\Local\Temp\pip-req-build-822bdw3z\
      Complete output (82 lines):
      C:\Users\n2\AppData\Local\Temp\pip-req-build-822bdw3z\src\python\grpcio\commands.py:104: SyntaxWarning: "is not" with a literal. Did you mean "!="?
        if exit_code is not 0:
      ASM Builds for BoringSSL currently not supported on: win-amd64
      Cython-generated files are missing...
      We could not find Cython. Setup may take 10-20 minutes.
      running install
      running build
      running build_py
      running build_project_metadata
      creating python_build
      creating python_build\lib.win-amd64-3.9
      creating python_build\lib.win-amd64-3.9\grpc
      copying src\python\grpcio\grpc\_auth.py -> python_build\lib.win-amd64-3.9\grpc
      copying src\python\grpcio\grpc\_channel.py -> python_build\lib.win-amd64-3.9\grpc
      copying src\python\grpcio\grpc\_common.py -> python_build\lib.win-amd64-3.9\grpc
      copying src\python\grpcio\grpc\_compression.py -> python_build\lib.win-amd64-3.9\grpc
      copying src\python\grpcio\grpc\_grpcio_metadata.py -> python_build\lib.win-amd64-3.9\grpc
      copying src\python\grpcio\grpc\_interceptor.py -> python_build\lib.win-amd64-3.9\grpc
      copying src\python\grpcio\grpc\_plugin_wrapping.py -> python_build\lib.win-amd64-3.9\grpc
      copying src\python\grpcio\grpc\_runtime_protos.py -> python_build\lib.win-amd64-3.9\grpc
      copying src\python\grpcio\grpc\_server.py -> python_build\lib.win-amd64-3.9\grpc
      copying src\python\grpcio\grpc\_simple_stubs.py -> python_build\lib.win-amd64-3.9\grpc
      copying src\python\grpcio\grpc\_utilities.py -> python_build\lib.win-amd64-3.9\grpc
      copying src\python\grpcio\grpc\__init__.py -> python_build\lib.win-amd64-3.9\grpc
      creating python_build\lib.win-amd64-3.9\grpc\aio
      copying src\python\grpcio\grpc\aio\_base_call.py -> python_build\lib.win-amd64-3.9\grpc\aio
      copying src\python\grpcio\grpc\aio\_base_channel.py -> python_build\lib.win-amd64-3.9\grpc\aio
      copying src\python\grpcio\grpc\aio\_base_server.py -> python_build\lib.win-amd64-3.9\grpc\aio
      copying src\python\grpcio\grpc\aio\_call.py -> python_build\lib.win-amd64-3.9\grpc\aio
      copying src\python\grpcio\grpc\aio\_channel.py -> python_build\lib.win-amd64-3.9\grpc\aio
      copying src\python\grpcio\grpc\aio\_interceptor.py -> python_build\lib.win-amd64-3.9\grpc\aio
      copying src\python\grpcio\grpc\aio\_metadata.py -> python_build\lib.win-amd64-3.9\grpc\aio
      copying src\python\grpcio\grpc\aio\_server.py -> python_build\lib.win-amd64-3.9\grpc\aio
      copying src\python\grpcio\grpc\aio\_typing.py -> python_build\lib.win-amd64-3.9\grpc\aio
      copying src\python\grpcio\grpc\aio\_utils.py -> python_build\lib.win-amd64-3.9\grpc\aio
      copying src\python\grpcio\grpc\aio\__init__.py -> python_build\lib.win-amd64-3.9\grpc\aio
      creating python_build\lib.win-amd64-3.9\grpc\beta
      copying src\python\grpcio\grpc\beta\implementations.py -> python_build\lib.win-amd64-3.9\grpc\beta
      copying src\python\grpcio\grpc\beta\interfaces.py -> python_build\lib.win-amd64-3.9\grpc\beta
      copying src\python\grpcio\grpc\beta\utilities.py -> python_build\lib.win-amd64-3.9\grpc\beta
      copying src\python\grpcio\grpc\beta\_client_adaptations.py -> python_build\lib.win-amd64-3.9\grpc\beta
      copying src\python\grpcio\grpc\beta\_metadata.py -> python_build\lib.win-amd64-3.9\grpc\beta
      copying src\python\grpcio\grpc\beta\_server_adaptations.py -> python_build\lib.win-amd64-3.9\grpc\beta
      copying src\python\grpcio\grpc\beta\__init__.py -> python_build\lib.win-amd64-3.9\grpc\beta
      creating python_build\lib.win-amd64-3.9\grpc\experimental
      copying src\python\grpcio\grpc\experimental\gevent.py -> python_build\lib.win-amd64-3.9\grpc\experimental
      copying src\python\grpcio\grpc\experimental\session_cache.py -> python_build\lib.win-amd64-3.9\grpc\experimental
      copying src\python\grpcio\grpc\experimental\__init__.py -> python_build\lib.win-amd64-3.9\grpc\experimental
      creating python_build\lib.win-amd64-3.9\grpc\framework
      copying src\python\grpcio\grpc\framework\__init__.py -> python_build\lib.win-amd64-3.9\grpc\framework
      creating python_build\lib.win-amd64-3.9\grpc\_cython
      copying src\python\grpcio\grpc\_cython\__init__.py -> python_build\lib.win-amd64-3.9\grpc\_cython
      creating python_build\lib.win-amd64-3.9\grpc\experimental\aio
      copying src\python\grpcio\grpc\experimental\aio\__init__.py -> python_build\lib.win-amd64-3.9\grpc\experimental\aio
      creating python_build\lib.win-amd64-3.9\grpc\framework\common
      copying src\python\grpcio\grpc\framework\common\cardinality.py -> python_build\lib.win-amd64-3.9\grpc\framework\common
      copying src\python\grpcio\grpc\framework\common\style.py -> python_build\lib.win-amd64-3.9\grpc\framework\common
      copying src\python\grpcio\grpc\framework\common\__init__.py -> python_build\lib.win-amd64-3.9\grpc\framework\common
      creating python_build\lib.win-amd64-3.9\grpc\framework\foundation
      copying src\python\grpcio\grpc\framework\foundation\abandonment.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
      copying src\python\grpcio\grpc\framework\foundation\callable_util.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
      copying src\python\grpcio\grpc\framework\foundation\future.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
      copying src\python\grpcio\grpc\framework\foundation\logging_pool.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
      copying src\python\grpcio\grpc\framework\foundation\stream.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
      copying src\python\grpcio\grpc\framework\foundation\stream_util.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
      copying src\python\grpcio\grpc\framework\foundation\__init__.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
      creating python_build\lib.win-amd64-3.9\grpc\framework\interfaces
      copying src\python\grpcio\grpc\framework\interfaces\__init__.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces
      creating python_build\lib.win-amd64-3.9\grpc\framework\interfaces\base
      copying src\python\grpcio\grpc\framework\interfaces\base\base.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces\base
      copying src\python\grpcio\grpc\framework\interfaces\base\utilities.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces\base
      copying src\python\grpcio\grpc\framework\interfaces\base\__init__.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces\base
      creating python_build\lib.win-amd64-3.9\grpc\framework\interfaces\face
      copying src\python\grpcio\grpc\framework\interfaces\face\face.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces\face
      copying src\python\grpcio\grpc\framework\interfaces\face\utilities.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces\face
      copying src\python\grpcio\grpc\framework\interfaces\face\__init__.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces\face
      creating python_build\lib.win-amd64-3.9\grpc\_cython\_cygrpc
      copying src\python\grpcio\grpc\_cython\_cygrpc\__init__.py -> python_build\lib.win-amd64-3.9\grpc\_cython\_cygrpc
      creating python_build\lib.win-amd64-3.9\grpc\_cython\_credentials
      copying src\python\grpcio\grpc\_cython\_credentials\roots.pem -> python_build\lib.win-amd64-3.9\grpc\_cython\_credentials
      running build_ext
      error: [WinError 2] The system cannot find the file specified
      ----------------------------------------
  ERROR: Command errored out with exit status 1: 'C:\Users\n2\WinDevs\sakuguru\saku\.venv\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\n2\\AppData\\Local\\Temp\\pip-req-build-822bdw3z\\setup.py'"'"'; __file__='"'"'C:\\Users\\n2\\AppData\\Local\\Temp\\pip-req-build-822bdw3z\\setup.py'"'"';f=getattr(t
okenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\n2\AppData\Local\Temp\pip-record-un95orpr\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\n2\WinDevs\sakuguru\saku\.venv\in
clude\site\python3.9\grpcio' Check the logs for full command output.
  WARNING: You are using pip version 20.2.2; however, version 20.2.3 is available.
  You should consider upgrading via the 'C:\Users\n2\WinDevs\sakuguru\saku\.venv\Scripts\python.exe -m pip install --upgrade pip' command.

  at ~\.poetry\lib\poetry\utils\env.py:948 in _run
       944โ”‚                 output = subprocess.check_output(
       945โ”‚                     cmd, stderr=subprocess.STDOUT, **kwargs
       946โ”‚                 )
       947โ”‚         except CalledProcessError as e:
    โ†’  948โ”‚             raise EnvCommandError(e, input=input_)
       949โ”‚
       950โ”‚         return decode(output)
       951โ”‚
       952โ”‚     def execute(self, bin, *args, **kwargs):

There is an error, but that may be unrelated and off-topic.

wasdee commented 4 years ago

seems related to https://github.com/python-poetry/poetry/pull/3117

wasdee commented 4 years ago

seems related to #3117

C:\Users\n2\WinDevs\sakuguru\saku>C:\Users\n2\WinDevs\contribute\poetry\.venv\Scripts\poetry.cmd update
Creating virtualenv saku in C:\Users\n2\WinDevs\sakuguru\saku\.venv
Updating dependencies
Resolving dependencies...

  RepositoryError

  403 Client Error: Forbidden for url: https://pypi.fury.io/sakuguru/pre-commit/

  at ~\WinDevs\contribute\poetry\poetry\repositories\legacy_repository.py:390 in _get
      386โ”‚             if response.status_code == 404:
      387โ”‚                 return
      388โ”‚             response.raise_for_status()
      389โ”‚         except requests.HTTPError as e:
    โ†’ 390โ”‚             raise RepositoryError(e)
      391โ”‚
      392โ”‚         if response.status_code in (401, 403):
      393โ”‚             self._log(
      394โ”‚                 "Authorization error accessing {url}".format(url=url), level="warn"

To no avail, this does not solved this issue .

CaueP commented 2 years ago

I'm facing the same issue described here and when it also worked when the custom source is removed from pyproject.toml. The only difference is that I'm using poetry version 1.1.8,

I was able to reproduce on the following environment: Poetry version: 1.1.8 Python version: 3.7.13

Using a pyproject.toml:

[tool.poetry]
name = "poetry-test"
version = "0.1.0"
description = "Poetry test"
authors = ["Your Name <you@example.com>"]

[tool.poetry.dependencies]
python = "^3.7"
requests = "^2.23.0"

[[tool.poetry.source]]
name = "loggi"
url = "https://pypi.lg.com/abc/"
secondary = true

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

If I try to add a new lib, update lock file or install with the commands below I get the same error error:

Even manually setting the source it tries to use the custom source:

Updating dependencies Resolving dependencies... 1: fact: poetry-test is 0.1.0 1: derived: poetry-test 1: fact: poetry-test depends on requests (^2.23.0) 1: fact: poetry-test depends on oauthlib (^3.2.1) 1: selecting poetry-test (0.1.0) 1: derived: oauthlib (>=3.2.1,<4.0.0) 1: derived: requests (>=2.23.0,<3.0.0) PyPI: No release information found for requests-0.0.1, skipping PyPI: No release information found for requests-0.12.01, skipping PyPI: No release information found for requests-2.15.0, skipping PyPI: 9 packages found for requests >=2.23.0,<3.0.0 1: Version solving took 0.928 seconds. 1: Tried 1 solutions.

Stack trace:

16 ~/.poetry/lib/poetry/_vendor/py3.7/clikit/console_application.py:131 in run 129โ”‚ parsed_args = resolved_command.args 130โ”‚ โ†’ 131โ”‚ status_code = command.handle(parsed_args, io) 132โ”‚ except KeyboardInterrupt: 133โ”‚ status_code = 1

15 ~/.poetry/lib/poetry/_vendor/py3.7/clikit/api/command/command.py:120 in handle 118โ”‚ def handle(self, args, io): # type: (Args, IO) -> int 119โ”‚ try: โ†’ 120โ”‚ status_code = self._do_handle(args, io) 121โ”‚ except KeyboardInterrupt: 122โ”‚ if io.is_debug():

14 ~/.poetry/lib/poetry/_vendor/py3.7/clikit/api/command/command.py:171 in _do_handle 169โ”‚ handler_method = self._config.handler_method 170โ”‚ โ†’ 171โ”‚ return getattr(handler, handler_method)(args, io, self) 172โ”‚ 173โ”‚ def repr(self): # type: () -> str

13 ~/.poetry/lib/poetry/_vendor/py3.7/cleo/commands/command.py:92 in wrap_handle 90โ”‚ self._command = command 91โ”‚ โ†’ 92โ”‚ return self.handle() 93โ”‚ 94โ”‚ def handle(self): # type: () -> Optional[int]

12 ~/.poetry/lib/poetry/console/commands/add.py:173 in handle 171โ”‚ self._installer.whitelist([r["name"] for r in requirements]) 172โ”‚ โ†’ 173โ”‚ status = self._installer.run() 174โ”‚ except BaseException: 175โ”‚ # Using BaseException here as some exceptions, eg: KeyboardInterrupt, do not inherit from Exception

11 ~/.poetry/lib/poetry/installation/installer.py:103 in run 101โ”‚ local_repo = Repository() 102โ”‚ โ†’ 103โ”‚ return self._do_install(local_repo) 104โ”‚ 105โ”‚ def dry_run(self, dry_run=True): # type: (bool) -> Installer

10 ~/.poetry/lib/poetry/installation/installer.py:235 in _do_install 233โ”‚ ) 234โ”‚ โ†’ 235โ”‚ ops = solver.solve(use_latest=self._whitelist) 236โ”‚ else: 237โ”‚ self._io.write_line("Installing dependencies from lock file")

9 ~/.poetry/lib/poetry/puzzle/solver.py:65 in solve 63โ”‚ with self._provider.progress(): 64โ”‚ start = time.time() โ†’ 65โ”‚ packages, depths = self._solve(use_latest=use_latest) 66โ”‚ end = time.time() 67โ”‚

8 ~/.poetry/lib/poetry/puzzle/solver.py:234 in _solve 232โ”‚ try: 233โ”‚ result = resolve_version( โ†’ 234โ”‚ self._package, self._provider, locked=locked, use_latest=use_latest 235โ”‚ ) 236โ”‚

7 ~/.poetry/lib/poetry/mixology/init.py:7 in resolve_version 5โ”‚ solver = VersionSolver(root, provider, locked=locked, use_latest=use_latest) 6โ”‚ โ†’ 7โ”‚ return solver.solve() 8โ”‚

6 ~/.poetry/lib/poetry/mixology/version_solver.py:84 in solve 82โ”‚ while next is not None: 83โ”‚ self._propagate(next) โ†’ 84โ”‚ next = self._choose_package_version() 85โ”‚ 86โ”‚ return self._result()

5 ~/.poetry/lib/poetry/mixology/version_solver.py:372 in _choose_package_version 370โ”‚ dependency = unsatisfied[0] 371โ”‚ else: โ†’ 372โ”‚ dependency = min(*unsatisfied, key=_get_min) 373โ”‚ 374โ”‚ locked = self._get_locked(dependency)

4 ~/.poetry/lib/poetry/mixology/version_solver.py:364 in _get_min 362โ”‚ return ( 363โ”‚ not dependency.marker.is_any(), โ†’ 364โ”‚ len(self._provider.search_for(dependency)), 365โ”‚ ) 366โ”‚ except ValueError:

3 ~/.poetry/lib/poetry/puzzle/provider.py:139 in search_for 137โ”‚ packages = self.search_for_url(dependency) 138โ”‚ else: โ†’ 139โ”‚ packages = self._pool.find_packages(dependency) 140โ”‚ 141โ”‚ packages.sort(

2 ~/.poetry/lib/poetry/repositories/pool.py:170 in find_packages 168โ”‚ packages = [] 169โ”‚ for repo in self._repositories: โ†’ 170โ”‚ packages += repo.find_packages(dependency) 171โ”‚ 172โ”‚ return packages

1 ~/.poetry/lib/poetry/repositories/legacy_repository.py:264 in find_packages 262โ”‚ versions = self._cache.store("matches").get(key) 263โ”‚ else: โ†’ 264โ”‚ page = self._get("/{}/".format(dependency.name.replace(".", "-"))) 265โ”‚ if page is None: 266โ”‚ return []

RepositoryError

403 Client Error: Forbidden for url: https://pypi.lg.com/abc/requests/

at ~/.poetry/lib/poetry/repositories/legacy_repository.py:393 in _get 389โ”‚ if response.status_code == 404: 390โ”‚ return 391โ”‚ response.raise_for_status() 392โ”‚ except requests.HTTPError as e: โ†’ 393โ”‚ raise RepositoryError(e) 394โ”‚ 395โ”‚ if response.status_code in (401, 403): 396โ”‚ self._log( 397โ”‚ "Authorization error accessing {url}".format(url=response.url),

neersighted commented 2 years ago

Hi @CaueP -- you are on a very outdated version of Poetry. I cannot reproduce this on 1.2.x -- if you are able to do so, please open a new issue with a package repository that reproduces it defined/available. There is a user on Discord with a similar issue -- whichever of you manages to reproduce it second, please add your reproduction to the existing issue if it exists.

kristang commented 2 years ago

I was the user on Discord @neersighted referred to. My issue does not seem related to yours @CaueP, but also involves a private feed causing some problems.

I downgraded poetry to 1.1.8 to see if I could replicate your issue, but it works fine for me on Python 3.9. I cannot downgrade my Python to exactly match you unfortunately.

CaueP commented 2 years ago

Hi @CaueP -- you are on a very outdated version of Poetry. I cannot reproduce this on 1.2.x -- if you are able to do so, please open a new issue with a package repository that reproduces it defined/available. There is a user on Discord with a similar issue -- whichever of you manages to reproduce it second, please add your reproduction to the existing issue if it exists.

The error reported doesn't happen on version 1.2.x, but I faced other issues related to setuptools and pip as noted on the version 1.2 announcement that is blocking the update to this version, so this is not a feasible solution.

I updated to the latest 1.1 version (1.1.15), but the same error still happens.

Inspired by this workaround on another issue, I changed the code on the same file to avoid raising the exception when Poetry cannot retrieve a PyPi package from a custom source and it worked as expected. The change I've made:

Current code: https://github.com/python-poetry/poetry/blob/46bf7fd3d1797b75ad9b07adc280039d93414e07/poetry/repositories/legacy_repository.py#L385-L393

Change on line 389 to return when the response is a 403:

    def _get(self, endpoint):  # type: (str) -> Union[Page, None]
        url = self._url + endpoint
        try:
            response = self.session.get(url)
            if response.status_code in (404, 403):
                return
            response.raise_for_status()
        except requests.HTTPError as e:
            raise RepositoryError(e)

@kristang could you try this code change to see if it works for you?

The main problem with this issue is that I'm blocked to do anything that changes poetry.lock file, because it always fails on the dependency resolution even with pre-existing packages. Do you think it's possible to make a patch with this change on version 1.1.x so we can get it fixed? I could work on this issue if needed.

neersighted commented 2 years ago

You should be fine to migrate to 1.2 -- the issue is only when 'split brain' between 1.2 and 1.1. If you're having other issues relating to locking and installing setuptools/pip, that may be a new issue?

We're not planning any releases for the 1.1 branch -- the team is pretty small and we do not have the bandwidth to maintain a third branch with very very different code (and, the intention is that all fixes/changes go into master first, barring exceptional circumstances like the bad cherry-pick last week).

I would suggest evaluating 1.2 and asking for help via Discord/Discussions if there is something truly blocking you from moving over -- there are massive correctness improvements in 1.2.x, and as Poetry adopts a loose versioning-with-deprecations style ala Python in general, putting off moving to new versions for too long is liable to be painful later. We'd much rather make sure that people can stay on the current stable version and fix any blockers they encounter.

github-actions[bot] commented 8 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.