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

Update version of vendored dependency: packaging #3790

Merged
merged 10 commits into from
Jan 23, 2023

Conversation

abravalheri
Copy link
Contributor

@abravalheri abravalheri commented Jan 23, 2023

Summary of changes

  • Update version of vendored dependency: packaging
  • Remove no longer necessary vendored dependency: pyparsing
  • Adapt existing tests and implementation to deal with the fact that packaging>=23 is more strict
  • As a side-effect of running tox -e vendor jaraco.context also got updated (since it was not a very different release I kept this update)
    • I manually reverted all the other vendored files that got accidentally updated

Related: #3722

(For anyone reviewing the PR, you can ignore all the */_vendor/* but vendored.txt files, since those were changed by an automate process).

Pull Request Checklist

@mgorny
Copy link
Contributor

mgorny commented Jan 23, 2023

Thanks a lot for doing this!

@abravalheri abravalheri marked this pull request as ready for review January 23, 2023 12:00
Invalid marker: "'x'=='x' or os.open('foo')=='y'", parse error at 'or os.op'

>>> print(im("'x' < 'y' < 'z'"))
Invalid marker: "'x' < 'y' < 'z'", parse error at "< 'z'"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this test, the exception raised by the new version of packaging is "less user friendly", they report an expected error for a missing 'y' key.

Since pkg_resources is discouraged, I believe it is easier to skip this test, rather than matching against a non-informative error message...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These examples are relevant to understand the difference in behaviour:

pip-run 'packaging==21' -- -c 'from packaging.markers import Marker; m = Marker(""" "3.5" < python_version < "3.9" """); print(m.evaluate())'
# Collecting packaging==21
#   Using cached packaging-21.0-py3-none-any.whl (40 kB)
# Collecting pyparsing>=2.0.2
#   Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
# Installing collected packages: pyparsing, packaging
# Successfully installed packaging-21.0 pyparsing-3.0.9
# Traceback (most recent call last):
#   File "/tmp/pip-run-ayqz5stg/packaging/markers.py", line 278, in __init__
#     self._markers = _coerce_parse_result(MARKER.parseString(marker))
#   File "/tmp/pip-run-ayqz5stg/pyparsing/core.py", line 1141, in parse_string
#     raise exc.with_traceback(None)
# pyparsing.exceptions.ParseException: Expected string_end, found '<'  (at char 24), (line:1, col:25)

pip-run 'packaging==23' -- -c 'from packaging.markers import Marker; m = Marker(""" "3.5" < python_version < "3.9" """); print(m.evaluate())'                                                             :(
# Collecting packaging==23
#   Using cached packaging-23.0-py3-none-any.whl (42 kB)
# Installing collected packages: packaging
# Successfully installed packaging-23.0
# True

@abravalheri abravalheri merged commit 6510d12 into pypa:main Jan 23, 2023
@abravalheri abravalheri deleted the update-packaging branch January 23, 2023 14:28
@dvzrv
Copy link

dvzrv commented Jan 28, 2023

Can we please have a release with these changes? It blocks downstreams from updating python-packaging.

@jaraco
Copy link
Member

jaraco commented Jan 28, 2023

Releasing as v67.

pierreluctg added a commit to pierreluctg/slash that referenced this pull request Jan 30, 2023
Recent changes to setuptools (pypa/setuptools#3790) released in version 67.0.0 make the `python_requires` check more strick and prevent the  installation of Slash.
pierreluctg added a commit to pierreluctg/slash that referenced this pull request Jan 30, 2023
Recent changes to setuptools (pypa/setuptools#3790) released in version 67.0.0 make the `python_requires` check more strict and prevent the  installation of Slash.
pierreluctg added a commit to pierreluctg/slash that referenced this pull request Jan 30, 2023
Recent changes to setuptools (pypa/setuptools#3790) released in version 67.0.0 make the `python_requires` check more strict and prevent the  installation of Slash.
pierreluctg added a commit to pierreluctg/slash that referenced this pull request Jan 30, 2023
Recent changes to setuptools (pypa/setuptools#3790) released in version 67.0.0 make the `python_requires` check more strict and prevent the  installation of Slash.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants