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

Warnings traced when installed with pyparsing 2.4.1 #170

Closed
chrahunt opened this issue Jul 22, 2019 · 8 comments
Closed

Warnings traced when installed with pyparsing 2.4.1 #170

chrahunt opened this issue Jul 22, 2019 · 8 comments

Comments

@chrahunt
Copy link
Member

chrahunt commented Jul 22, 2019

This impacts packaging 19.0.

Issue: Importing packaging.requirements outputs warnings

Expected: Importing packaging.requirements does not output warnings

Context: pyparsing 2.4.1 was released yesterday and unfortunately caused our CI runs to fail because of the warning output to stdout on invocation of tox (which internally imports packaging.requirements). See pypa/pip#6767.

To reproduce:

$ docker run --rm -it python:3.6 bash -xc 'pip install packaging && python -c "import packaging.requirements"'
+ pip install packaging
Collecting packaging
  Downloading https://files.pythonhosted.org/packages/91/32/58bc30e646e55eab8b21abf89e353f59c0cc02c417e42929f4a9546e1b1d/packaging-19.0-py2.py3-none-any.whl
Collecting pyparsing>=2.0.2 (from packaging)
  Downloading https://files.pythonhosted.org/packages/9f/dc/b205465a60baca8e04a1555a84d9c79f910661765056f071fb6fc2db4841/pyparsing-2.4.1-py2.py3-none-any.whl (65kB)
     |████████████████████████████████| 71kB 15.3MB/s
Collecting six (from packaging)
  Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: pyparsing, six, packaging
Successfully installed packaging-19.0 pyparsing-2.4.1 six-1.12.0
+ python -c 'import packaging.requirements'
/usr/local/lib/python3.6/site-packages/packaging/requirements.py:57: UserWarning: warn_ungrouped_named_tokens_in_collection: setting results name 'specifier' on And expression collides with '_original_end' on contained expression
  VERSION_SPEC = originalTextFor(_VERSION_SPEC)("specifier")
/usr/local/lib/python3.6/site-packages/packaging/requirements.py:60: UserWarning: warn_ungrouped_named_tokens_in_collection: setting results name 'marker' on And expression collides with '_original_end' on contained expression
  MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")

Available workarounds:

Either pin pyparsing to 2.4.0 or set the warnings filter to include ignore:warn_ungrouped_named_tokens_in_collection (e.g. PYTHONWARNINGS=ignore:warn_ungrouped_named_tokens_in_collection).

@chrahunt
Copy link
Member Author

Related to tox-dev/tox#1375.

@paulmcg-iio
Copy link

Pyparsing 2.4.2 (pushed to PyPI this evening) disables these warnings by default

@pradyunsg
Copy link
Member

Awesome! I'll close this then.

@ssbarnea
Copy link

Thanks! I wonder if it would not worth even hiding the 2.4.1 version from pypi.

@fungi
Copy link

fungi commented Oct 23, 2021

Pyparsing 2.4.2 (pushed to PyPI this evening) disables these warnings by default

Pyparsing 3.0.0 (released an hour ago) un-hid this again when warnings are enabled in the interpreter, so it might be worth reopening the issue if this indicates a problem which should be fixed. It's not entirely clear to me why pyparsing objects to the implementation in packaging.requirements however.

Also, it's likely enhancement #468 will make it irrelevant if that's the direction packaging goes in.

@CAM-Gerlach
Copy link

I can confirm this, and in particular, this causes builds with python -W error -m build to fail across our CIs, which is rather problematic.

@fungi
Copy link

fungi commented Nov 1, 2021

According to pyparsing/pyparsing#110 it will be fixed in pyparsing 3.0.5 (not yet released).

@fungi
Copy link

fungi commented Nov 7, 2021

pyparsing 3.0.5 was released today correcting this.

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

No branches or pull requests

6 participants