-
Poetry skips the 2captcha dependency when resolving awsapilib's dependencies. Poetry says:
The missing dependency causes the awsapilib doesn't manage its dependencies using Poetry, so the library itself doesn't seem to be affected. It affects me when I add awsapilib to my own Poetry project. I can work around the problem by adding Here's a full repro in an empty directory. $ poetry --version
Poetry (version 1.4.0)
$ poetry new .
Created package tmp.2023_05_18.kwpr1amm in .
$ poetry add awsapilib
Creating virtualenv tmp-2023-05-18-kwpr1amm-Kw2CPZUK-py3.8 in /home/isme/.cache/pypoetry/virtualenvs
Using version ^3.1.3 for awsapilib
Updating dependencies
Resolving dependencies... (0.0s)Invalid requirement (2captcha-python>=1.2.0) found in awsapilib-3.1.3 dependencies, skipping
Resolving dependencies... (4.4s)
Writing lock file
Package operations: 19 installs, 0 updates, 0 removals
• Installing six (1.16.0)
• Installing jmespath (1.0.1)
• Installing python-dateutil (2.8.2)
• Installing urllib3 (1.26.15)
• Installing botocore (1.29.135)
• Installing certifi (2023.5.7)
• Installing charset-normalizer (3.1.0)
• Installing idna (3.4)
• Installing s3transfer (0.6.1)
• Installing soupsieve (2.4.1)
• Installing typing-extensions (4.5.0)
• Installing beautifulsoup4 (4.12.2)
• Installing boto3 (1.26.135)
• Installing boto3-type-annotations (0.3.1)
• Installing cachetools (5.3.0)
• Installing opnieuw (2.0.0)
• Installing pyotp (2.8.0)
• Installing requests (2.30.0)
• Installing awsapilib (3.1.3)
$ poetry run python -c 'from awsapilib import AccountManager; print("OK")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/isme/.cache/pypoetry/virtualenvs/tmp-2023-05-18-kwpr1amm-Kw2CPZUK-py3.8/lib/python3.8/site-packages/awsapilib/__init__.py", line 40, in <module>
from .console import AccountManager, PasswordManager
File "/home/isme/.cache/pypoetry/virtualenvs/tmp-2023-05-18-kwpr1amm-Kw2CPZUK-py3.8/lib/python3.8/site-packages/awsapilib/console/__init__.py", line 35, in <module>
from .console import AccountManager, PasswordManager
File "/home/isme/.cache/pypoetry/virtualenvs/tmp-2023-05-18-kwpr1amm-Kw2CPZUK-py3.8/lib/python3.8/site-packages/awsapilib/console/console.py", line 45, in <module>
from awsapilib.captcha import Solver, Iterm, Terminal
File "/home/isme/.cache/pypoetry/virtualenvs/tmp-2023-05-18-kwpr1amm-Kw2CPZUK-py3.8/lib/python3.8/site-packages/awsapilib/captcha/__init__.py", line 34, in <module>
from .captcha import Solver, Iterm, Terminal, Captcha2
File "/home/isme/.cache/pypoetry/virtualenvs/tmp-2023-05-18-kwpr1amm-Kw2CPZUK-py3.8/lib/python3.8/site-packages/awsapilib/captcha/captcha.py", line 40, in <module>
from twocaptcha import TwoCaptcha, ValidationException, TimeoutException
ModuleNotFoundError: No module named 'twocaptcha'
$ poetry add 2captcha-python
Using version ^1.2.0 for 2captcha-python
Updating dependencies
Resolving dependencies... (0.0s)Invalid requirement (2captcha-python>=1.2.0) found in awsapilib-3.1.3 dependencies, skipping
Resolving dependencies... (0.1s)
Writing lock file
Package operations: 1 install, 0 updates, 0 removals
• Installing 2captcha-python (1.2.0)
$ poetry run python -c 'from awsapilib import AccountManager; print("OK")'
OK |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Poetry just does not support packages starting with a digit: According to PEP 508:
Looks like a Poetry bug. |
Beta Was this translation helpful? Give feedback.
-
Thanks, @radoering . That may explain why Poetry fails to process the transitive dependency. ( But why does the same not happen when I depend on the package directly? ( |
Beta Was this translation helpful? Give feedback.
-
Thanks, @radoering . I submitted a PR to allow a leading digit in a dependency. It's my first time contributing to Poetry Core. Can you give me feedback on it? |
Beta Was this translation helpful? Give feedback.
Poetry just does not support packages starting with a digit:
https://github.com/python-poetry/poetry-core/blob/1ba6836a2d9ca4fa1042bc506129e452b7c86955/src/poetry/core/version/grammars/pep508.lark#L13
According to PEP 508:
Looks like a Poetry bug.