Skip to content
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

Use the new typehint syntax #9585

Closed
wants to merge 3 commits into from

Conversation

hexagonrecursion
Copy link
Contributor

This was an automatic fix by https://github.com/asottile/pyupgrade

@uranusjr
Copy link
Member

Aren’t these only available in 3.9? pip needs to support 3.6+

@hexagonrecursion
Copy link
Contributor Author

If so this is a bug in pyupgrade. I'll look into it

@hexagonrecursion
Copy link
Contributor Author

hexagonrecursion commented Feb 10, 2021

Correction: this is triggered because the file contains from __future__ import annotations
see https://github.com/asottile/pyupgrade#pep-585-typing-rewrites

@uranusjr
Copy link
Member

But isn’t from __future__ import annotations only available in 3.7 (according to PEP 563)?

@hexagonrecursion
Copy link
Contributor Author

Is it possible that no one in the past 5 months tried building the documentation using python<3.7?

@hexagonrecursion
Copy link
Contributor Author

Is it possible that no one in the past 5 months tried building the documentation using python<3.7?

Just tried building the docs with python==3.6.12. Got:

Exception occurred:
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/user/pip/docs/docs_feedback_sphinxext.py", line 3
    from __future__ import annotations
                                     ^
SyntaxError: future feature annotations is not defined
full log
$ python --version
Python 3.6.12 :: Anaconda, Inc.
$ tox -e docs
GLOB sdist-make: /home/user/pip/setup.py
docs inst-nodeps: /home/user/pip/.tox/.tmp/package/1/pip-21.1.dev0.zip
docs installed: alabaster==0.7.12,Babel==2.9.0,beautifulsoup4==4.9.3,certifi==2020.12.5,chardet==4.0.0,click==7.1.2,docutils==0.16,furo==2020.12.30b24,idna==2.10,imagesize==1.2.0,incremental==17.5.0,Jinja2==2.11.3,MarkupSafe==1.1.1,packaging==20.9,pip @ file:///home/user/pip/.tox/.tmp/package/1/pip-21.1.dev0.zip,Pygments==2.7.4,pyparsing==2.4.7,pytz==2021.1,requests==2.25.1,setuptools==52.0.0,snowballstemmer==2.1.0,soupsieve==2.2,Sphinx==3.2.1,sphinx-inline-tabs==2020.10.19b4,sphinxcontrib-applehelp==1.0.2,sphinxcontrib-devhelp==1.0.2,sphinxcontrib-htmlhelp==1.0.3,sphinxcontrib-jsmath==1.0.1,sphinxcontrib-qthelp==1.0.3,sphinxcontrib-serializinghtml==1.1.4,sphinxcontrib-towncrier==0.1.0a1,toml==0.10.2,towncrier==19.2.0,urllib3==1.26.3,wheel==0.36.2
docs run-test-pre: PYTHONHASHSEED='562463946'
docs run-test-pre: commands[0] | python -c 'import shutil, sys; shutil.rmtree(sys.argv[1], ignore_errors=True)' /home/user/pip/tests/data/common_wheels
docs run-test-pre: commands[1] | python /home/user/pip/tools/tox_pip.py wheel -w /home/user/pip/tests/data/common_wheels -r /home/user/pip/tools/requirements/tests-common_wheels.txt
Collecting setuptools>=40.8.0
  Using cached setuptools-53.0.0-py3-none-any.whl (784 kB)
Collecting wheel
  Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB)
Collecting coverage>=4.4
  Using cached coverage-5.4-cp36-cp36m-manylinux2010_x86_64.whl (240 kB)
Saved ./tests/data/common_wheels/coverage-5.4-cp36-cp36m-manylinux2010_x86_64.whl
Saved ./tests/data/common_wheels/wheel-0.36.2-py2.py3-none-any.whl
Saved ./tests/data/common_wheels/setuptools-53.0.0-py3-none-any.whl
docs run-test: commands[0] | sphinx-build -W -d /home/user/pip/.tox/docs/tmp/doctrees/html -b html docs/html docs/build/html
Running Sphinx v3.2.1
pip version: 21.1
pip release: 21.1.dev0

Exception occurred:
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/user/pip/docs/docs_feedback_sphinxext.py", line 3
    from __future__ import annotations
                                     ^
SyntaxError: future feature annotations is not defined
The full traceback has been saved in /tmp/sphinx-err-ux3qt0f7.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
ERROR: InvocationError for command /home/user/pip/.tox/docs/bin/sphinx-build -W -d /home/user/pip/.tox/docs/tmp/doctrees/html -b html docs/html docs/build/html (exited with code 2)
___________________________________ summary ____________________________________
ERROR:   docs: commands failed

@uranusjr
Copy link
Member

Ah, so this is only for automation. That makes sense. Automation code is not a part of the pip package, and are used in either CI or development environments, and don’t share the same 3.6+ deployment target.

@uranusjr uranusjr added the skip news Does not need a NEWS file entry (eg: trivial changes) label Feb 10, 2021
@BrownTruck
Copy link
Contributor

Hello!

I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the master branch into this pull request or rebase this pull request against master then it will be eligible for code review and hopefully merging!

@BrownTruck BrownTruck added the needs rebase or merge PR has conflicts with current master label Feb 20, 2021
@pypa-bot pypa-bot removed the needs rebase or merge PR has conflicts with current master label Feb 20, 2021
@BrownTruck
Copy link
Contributor

Hello!

I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the master branch into this pull request or rebase this pull request against master then it will be eligible for code review and hopefully merging!

@BrownTruck BrownTruck added the needs rebase or merge PR has conflicts with current master label Mar 6, 2021
@hexagonrecursion
Copy link
Contributor Author

Closing because docs/docs_feedback_sphinxext.py got deleted by #9693

@hexagonrecursion hexagonrecursion deleted the typehint branch March 30, 2021 13:26
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs rebase or merge PR has conflicts with current master skip news Does not need a NEWS file entry (eg: trivial changes)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants