-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Drop python-telegram-bot-raw
And Switch to pyproject.toml
Based Packaging
#4288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey! Looks like you edited the (optional) requirements or the pre-commit hooks. I'm just a friendly reminder to keep the additional dependencies for the hooks in sync with the requirements :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey! Looks like you edited README.rst or README_RAW.rst. I'm just a friendly reminder to apply relevant changes to both of those files :)
# Conflicts: # requirements-dev.txt
python-telegram-bot-raw
And Switch to pyproject.toml
Based Packagingpython-telegram-bot-raw
And Switch to pyproject.toml
Based Packaging
RTD seems to run fine & other tests as well. Marking as ready for review. |
# Conflicts: # README_RAW.rst
# Conflicts: # README_RAW.rst # telegram/__init__.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
found a couple of things to look at again
Co-authored-by: Harshil <[email protected]>
Co-authored-by: Harshil <[email protected]>
Co-authored-by: Harshil <[email protected]>
Co-authored-by: Harshil <[email protected]>
Just tried to upload to test-pypi and this threw the following error: (venv311) ~\PycharmProjects\python-telegram-bot git:[hatch-based-packaging]
twine upload --repository testpypi dist/*
Uploading distributions to https://test.pypi.org/legacy/
Enter your API token:
Uploading python_telegram_bot-21.3-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 662.4/662.4 kB • 00:01 • 1.9 MB/s
WARNING Error during upload. Retry with the --verbose option for more details.
ERROR HTTPError: 400 Bad Request from https://test.pypi.org/legacy/
Can't have direct dependency: furo-sphinx-search@ git+https://github.com/harshil21/[email protected] ; extra == "dev-all". See
https://packaging.python.org/specifications/core-metadata for more information. Apparently PyPi doesn't accept dependencies to git repos & sim as dependencies. TBF, the optional dependencies
I took a bit to write up the choices here and I think while typing I've already made up my mind for Option 4 :D |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently PyPi doesn't accept dependencies to git repos & sim as dependencies
surprising, but understandable.
drop using the fork and use the original (does that work?) or none at all
the original one is just buggy, has less features, and bad design compared to this "furo compatible" one.
I took a bit to write up the choices here and I think while typing I've already made up my mind for Option 4
the only reasonable choice. Also makes it easier to update our local environment I think.
Can you install pip install -i https://test.pypi.org/simple/ python-telegram-bot==21.3 in a fresh venv and run a few of our examples for double checking that everything works as expected?
it fails because httpx doesn't have a test pypi release, so it can't find the distribution. The correct command is: pip install -i https://test.pypi.org/simple --extra-index-url https://pypi.org/simple python-telegram-bot==21.3
?
Though I'm not sure which ptb version it installed, the one from test pypi or real pypi (because test pypi one fails)?
Interesting! I did a new release 21.4rc0 to have something unique and that seems to work now: (.venv) ~\PycharmProjects\aiorem git:[master]
pip install -i https://test.pypi.org/simple --extra-index-url https://pypi.org/simple python-telegram-bot==21.4rc0 --no-cache --force --verbose
Using pip 24.0 from C:\Users\hinri\PycharmProjects\aiorem\.venv\Lib\site-packages\pip (python 3.12)
Looking in indexes: https://test.pypi.org/simple, https://pypi.org/simple
Collecting python-telegram-bot==21.4rc0
Obtaining dependency information for python-telegram-bot==21.4rc0 from https://test-files.pythonhosted.org/packages/70/cb/f1b28a9ad2f70a91a55f243386c4aeeb434a2a7c7f6ecf4951055f7a6dd4/python_telegram_bot-21.4rc0-py3-none-any.whl.metadata
Downloading https://test-files.pythonhosted.org/packages/70/cb/f1b28a9ad2f70a91a55f243386c4aeeb434a2a7c7f6ecf4951055f7a6dd4/python_telegram_bot-21.4rc0-py3-none-any.whl.metadata (15 kB)
Collecting httpx~=0.27 (from python-telegram-bot==21.4rc0)
Obtaining dependency information for httpx~=0.27 from https://files.pythonhosted.org/packages/41/7b/ddacf6dcebb42466abd03f368782142baa82e08fc0c1f8eaa05b4bae87d5/httpx-0.27.0-py3-none-any.whl.metadata
Downloading httpx-0.27.0-py3-none-any.whl.metadata (7.2 kB)
Collecting anyio (from httpx~=0.27->python-telegram-bot==21.4rc0)
Obtaining dependency information for anyio from https://files.pythonhosted.org/packages/7b/a2/10639a79341f6c019dedc95bd48a4928eed9f1d1197f4c04f546fc7ae0ff/anyio-4.4.0-py3-none-any.whl.metadata
Downloading anyio-4.4.0-py3-none-any.whl.metadata (4.6 kB)
Collecting certifi (from httpx~=0.27->python-telegram-bot==21.4rc0)
Obtaining dependency information for certifi from https://files.pythonhosted.org/packages/5b/11/1e78951465b4a225519b8c3ad29769c49e0d8d157a070f681d5b6d64737f/certifi-2024.6.2-py3-none-any.whl.metadata
Downloading certifi-2024.6.2-py3-none-any.whl.metadata (2.2 kB)
Collecting httpcore==1.* (from httpx~=0.27->python-telegram-bot==21.4rc0)
Obtaining dependency information for httpcore==1.* from https://files.pythonhosted.org/packages/78/d4/e5d7e4f2174f8a4d63c8897d79eb8fe2503f7ecc03282fee1fa2719c2704/httpcore-1.0.5-py3-none-any.whl.metadata
Downloading httpcore-1.0.5-py3-none-any.whl.metadata (20 kB)
Collecting idna (from httpx~=0.27->python-telegram-bot==21.4rc0)
Obtaining dependency information for idna from https://files.pythonhosted.org/packages/e5/3e/741d8c82801c347547f8a2a06aa57dbb1992be9e948df2ea0eda2c8b79e8/idna-3.7-py3-none-any.whl.metadata
Downloading idna-3.7-py3-none-any.whl.metadata (9.9 kB)
Collecting sniffio (from httpx~=0.27->python-telegram-bot==21.4rc0)
Obtaining dependency information for sniffio from https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl.metadata
Downloading sniffio-1.3.1-py3-none-any.whl.metadata (3.9 kB)
Collecting h11<0.15,>=0.13 (from httpcore==1.*->httpx~=0.27->python-telegram-bot==21.4rc0)
Obtaining dependency information for h11<0.15,>=0.13 from https://files.pythonhosted.org/packages/95/04/ff642e65ad6b90db43e668d70ffb6736436c7ce41fcc549f4e9472234127/h11-0.14.0-py3-none-any.whl.metadata
Downloading h11-0.14.0-py3-none-any.whl.metadata (8.2 kB)
Downloading https://test-files.pythonhosted.org/packages/70/cb/f1b28a9ad2f70a91a55f243386c4aeeb434a2a7c7f6ecf4951055f7a6dd4/python_telegram_bot-21.4rc0-py3-none-any.whl (635 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 635.4/635.4 kB 3.6 MB/s eta 0:00:00
Downloading httpx-0.27.0-py3-none-any.whl (75 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 75.6/75.6 kB 4.4 MB/s eta 0:00:00
Downloading httpcore-1.0.5-py3-none-any.whl (77 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.9/77.9 kB 4.2 MB/s eta 0:00:00
Downloading anyio-4.4.0-py3-none-any.whl (86 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 86.8/86.8 kB 5.1 MB/s eta 0:00:00
Downloading idna-3.7-py3-none-any.whl (66 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 66.8/66.8 kB ? eta 0:00:00
Downloading sniffio-1.3.1-py3-none-any.whl (10 kB)
Downloading certifi-2024.6.2-py3-none-any.whl (164 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 164.4/164.4 kB 9.6 MB/s eta 0:00:00
Downloading h11-0.14.0-py3-none-any.whl (58 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.3/58.3 kB 3.2 MB/s eta 0:00:00
Installing collected packages: sniffio, idna, h11, certifi, httpcore, anyio, httpx, python-telegram-bot
Attempting uninstall: sniffio
Found existing installation: sniffio 1.3.1
Uninstalling sniffio-1.3.1:
Removing file or directory c:\users\hinri\pycharmprojects\aiorem\.venv\lib\site-packages\sniffio-1.3.1.dist-info\
Removing file or directory c:\users\hinri\pycharmprojects\aiorem\.venv\lib\site-packages\sniffio\
Successfully uninstalled sniffio-1.3.1
Attempting uninstall: idna
Found existing installation: idna 3.7
Uninstalling idna-3.7:
Removing file or directory c:\users\hinri\pycharmprojects\aiorem\.venv\lib\site-packages\idna-3.7.dist-info\
Removing file or directory c:\users\hinri\pycharmprojects\aiorem\.venv\lib\site-packages\idna\
Successfully uninstalled idna-3.7
Attempting uninstall: h11
Found existing installation: h11 0.14.0
Uninstalling h11-0.14.0:
Removing file or directory c:\users\hinri\pycharmprojects\aiorem\.venv\lib\site-packages\h11-0.14.0.dist-info\
Removing file or directory c:\users\hinri\pycharmprojects\aiorem\.venv\lib\site-packages\h11\
Successfully uninstalled h11-0.14.0
Attempting uninstall: certifi
Found existing installation: certifi 2024.6.2
Uninstalling certifi-2024.6.2:
Removing file or directory c:\users\hinri\pycharmprojects\aiorem\.venv\lib\site-packages\certifi-2024.6.2.dist-info\
Removing file or directory c:\users\hinri\pycharmprojects\aiorem\.venv\lib\site-packages\certifi\
Successfully uninstalled certifi-2024.6.2
Attempting uninstall: httpcore
Found existing installation: httpcore 1.0.5
Uninstalling httpcore-1.0.5:
Removing file or directory c:\users\hinri\pycharmprojects\aiorem\.venv\lib\site-packages\httpcore-1.0.5.dist-info\
Removing file or directory c:\users\hinri\pycharmprojects\aiorem\.venv\lib\site-packages\httpcore\
Successfully uninstalled httpcore-1.0.5
Attempting uninstall: anyio
Found existing installation: anyio 4.4.0
Uninstalling anyio-4.4.0:
Removing file or directory c:\users\hinri\pycharmprojects\aiorem\.venv\lib\site-packages\anyio-4.4.0.dist-info\
Removing file or directory c:\users\hinri\pycharmprojects\aiorem\.venv\lib\site-packages\anyio\
Successfully uninstalled anyio-4.4.0
Attempting uninstall: httpx
Found existing installation: httpx 0.27.0
Uninstalling httpx-0.27.0:
Removing file or directory c:\users\hinri\pycharmprojects\aiorem\.venv\lib\site-packages\httpx-0.27.0.dist-info\
Removing file or directory c:\users\hinri\pycharmprojects\aiorem\.venv\lib\site-packages\httpx\
Removing file or directory c:\users\hinri\pycharmprojects\aiorem\.venv\scripts\httpx.exe
Successfully uninstalled httpx-0.27.0
Attempting uninstall: python-telegram-bot
Found existing installation: python-telegram-bot 21.3
Uninstalling python-telegram-bot-21.3:
Removing file or directory c:\users\hinri\pycharmprojects\aiorem\.venv\lib\site-packages\python_telegram_bot-21.3.dist-info\
Removing file or directory c:\users\hinri\pycharmprojects\aiorem\.venv\lib\site-packages\telegram\
Successfully uninstalled python-telegram-bot-21.3
Successfully installed anyio-4.4.0 certifi-2024.6.2 h11-0.14.0 httpcore-1.0.5 httpx-0.27.0 idna-3.7 python-telegram-bot-21.4rc0 sniffio-1.3.1 Note that the url for ptb explicitly says Running echobot worked fine for me, installing extra dependencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a new release 21.4rc0 to have something unique and that seems to work now
can verify it also works for me now.
🚀
] | ||
webhooks = [ | ||
# tornado is rather stable, but let's not allow the next major release without prior testing | ||
"tornado~=6.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"tornado~=6.4", | |
"tornado~=6.4.1", |
we can take the opportunity to bump this here or another PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is on purpose, i.e. we also want to allow 6.x
, x>=4 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh ok, then why is cachetools on ~=5.3.3, won't that block a 5.4 release then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we did that back then b/c we hadn't had that much experience with cachetools yet and wanted to be on the save side …
Closes #4129 once ready. closes #4296
First draft, install work okay locally. Let's see how the the tests behave. definitely needs to be tested locally.
Must not be merged before we make a final ptb-raw release including #4270!