-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Switch from docopt to docopt-ng #454
Conversation
Running dotdrop under recent releases of Python — 3.12 and 3.13 — [outputs syntax warnings] when from the docopt module. [outputs syntax warnings]: https://docs.python.org/3/whatsnew/3.12.html#other-language-changes <details> <summary>Output with syntax warnings on Python 3.12 and 3.13</summary> Command to run `dotdrop` with Python 3.12: rm -rf ~/.cache/uv \ && ~/.local/bin/uv tool run --python=python3.12 dotdrop install --profile=default Output: ``` Built docopt==0.6.2 Installed 15 packages in 7ms /home/maxwell-k/.cache/uv/archive-v0/IhmhuswofFs7ywBBC0kJs/lib64/python3.12/site-packages/docopt.py:165: SyntaxWarning: invalid escape sequence '\S' name = re.findall('(<\S*?>)', source)[0] /home/maxwell-k/.cache/uv/archive-v0/IhmhuswofFs7ywBBC0kJs/lib64/python3.12/site-packages/docopt.py:166: SyntaxWarning: invalid escape sequence '\[' value = re.findall('\[default: (.*)\]', source, flags=re.I) /home/maxwell-k/.cache/uv/archive-v0/IhmhuswofFs7ywBBC0kJs/lib64/python3.12/site-packages/docopt.py:207: SyntaxWarning: invalid escape sequence '\[' matched = re.findall('\[default: (.*)\]', description, flags=re.I) /home/maxwell-k/.cache/uv/archive-v0/IhmhuswofFs7ywBBC0kJs/lib64/python3.12/site-packages/docopt.py:456: SyntaxWarning: invalid escape sequence '\S' split = re.split('\n *(<\S+?>|-\S+?)', doc)[1:] _ _ _ __| | ___ | |_ __| |_ __ ___ _ __ / _` |/ _ \| __/ _` | '__/ _ \| '_ | \__,_|\___/ \__\__,_|_| \___/| .__/ v1.14.2 |_| 0 dotfile(s) installed. ``` The output is similar using `python3.13`. </details> [docopt] hasn't had a [release to PyPI] in 10 years. [No wheels] are published to PyPI. `docopt` is used throughout the [dotdrop] code base. Advice online suggests adopting [docopt-ng] instead. [docopt]: https://github.com/docopt/docopt [no wheels]: docopt/docopt#502 [release to PyPI]: https://pypi.org/project/docopt/#history [docopt-ng]: https://github.com/jazzband/docopt-ng [dotdrop]: https://github.com/deadc0de6/dotdrop
Based on <#435>
At first I didn't notice #435 ; this pull request is effectively the same. The syntax warnings appear in Python 3.12 and later. The relevant section of the Python 3.12 change log is:
A example syntax warning, output when using dotdrop is:
I'm not sure about changing the PKGBUILD files; they do not appear to be up to date with recent releases of dotdrop. I include changes here so that this PR contains everything from #435. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #454 +/- ##
==========================================
- Coverage 90.83% 90.77% -0.07%
==========================================
Files 23 23
Lines 4780 4780
==========================================
- Hits 4342 4339 -3
- Misses 438 441 +3 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
@maxwell-k thanks a lot for this and for the explanations! |
Running dotdrop under recent releases of Python — 3.12 and 3.13 — outputs syntax warnings from the docopt module.
Output with syntax warnings on Python 3.12 and 3.13
Command to run
dotdrop
with Python 3.12:Output:
The output is similar using
python3.13
.docopt hasn't had a release to PyPI in 10 years. No wheels are published to PyPI.
docopt
is used throughout the dotdrop code base. Advice online suggests adopting docopt-ng instead.