twtxt
twtxt copied to clipboard
Add support of Python 3.7+
Problem: Generator-based coroutines are deprecated and scheduled for removal in Python 3.11 (docs). Due to that, twtxt doesn't work with Python 3.7+.
Solution: I have changed gererator-based coroutines to async-def coroutines. Other dependencies have also been updated to current versions. Important: breaking changes, won't work with Python 3.6 or lower.
Passed tests: https://github.com/win0err/twtxt/actions/runs/2009500872 I'll create a PR with integration with GitHub Actions in a separate PR.
Closes #140, closes #141, closes #161, closes #162, closes #163
P.S. Please, test the changes manually.
@buckket, do you have some plans about releasing version 1.3.0?
This is stopping me installing and using twtxt, would love a merge
This is stopping me installing and using twtxt, would love a merge
You may install this version from a local directory. You need to have git
and pip
installed on your system.
git clone https://github.com/win0err/twtxt.git
cd twtxt/
git checkout feature/python-3-7-plus
pip install -e .
Hmm I installed following your instructions but get this error when trying to run quickstart
allie@allie-desktop:~/Programs/twtxt$ twtxt quickstart
Traceback (most recent call last):
File "/home/allie/.local/bin/twtxt", line 11, in <module>
load_entry_point('twtxt', 'console_scripts', 'twtxt')()
File "/home/allie/.local/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/home/allie/.local/lib/python3.8/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/home/allie/.local/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/allie/.local/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/allie/.local/lib/python3.8/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/allie/Programs/twtxt/twtxt/cli.py", line 283, in quickstart
width = click.get_terminal_size()[0]
AttributeError: module 'click' has no attribute 'get_terminal_size'
click=8.1.0
removed get_terminal_size
. It now must be imported from shutil
click=8.1.0
removedget_terminal_size
. It now must be imported from shutil
@KAction, thank you, I've merged your changes to my fork.
@ChildishGiant, please, run git pull
the changes and install the updated version using pip install -e .
Thanks! I’ve modified the code slightly to work without nest_asyncio.