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

Fix marker parsing with pyparsing 3.0.5 #487

Closed
wants to merge 1 commit into from

Conversation

9999years
Copy link

Closes #486

Context in pyparsing: pyparsing/pyparsing#110 (comment)

Equivalent to #485

@brettcannon
Copy link
Member

@9999years @layday we now have competing PRs for the same fix. What are the pro/cons of each?

@layday
Copy link
Member

layday commented Nov 9, 2021

The end result is the same, this one's using the expanded callback signature, which isn't necessary since we're only manipulating the token, and item instead of attribute access, which is less transparent.

@layday
Copy link
Member

layday commented Nov 9, 2021

Which is to say, feel free to merge either one ;)

@TimB87
Copy link

TimB87 commented Nov 14, 2021

Just a note: having setuptools-scm installed will still break the build with this patch.

@ptmcg
Copy link

ptmcg commented Nov 14, 2021

Just a note: having setuptools-scm installed will still break the build with this patch.

Please use pyparsing 3.0.6, as it restores compatibility with the previous parse action implementation.

@TimB87
Copy link

TimB87 commented Nov 14, 2021

This is with pyparsing 3.0.6 and this patch against packaging version 21.2

With setuptools-scm installed, it looks like this

❯ doas prt-get update -fr python3-packaging
prt-get: updating /usr/ports/opt/python3-packaging
=======> Building '/home/pkgmk/packages_thor/python3-packaging#21.2-1.pkg.tar.xz'.
bsdtar -p -o -C /home/ramdisk/python3-packaging/src -xf /home/pkgmk/distfiles/packaging-21.2.tar.gz
cp 487.patch /home/ramdisk/python3-packaging/src
+ build
+ cd packaging-21.2
+ patch -Np1 -i /home/ramdisk/python3-packaging/src/487.patch
patching file packaging/requirements.py
+ /usr/bin/python3 setup.py build
Traceback (most recent call last):
  File "/home/ramdisk/python3-packaging/src/packaging-21.2/setup.py", line 40, in <module>
    setup(
  File "/usr/lib/python3.9/site-packages/setuptools/__init__.py", line 159, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.9/distutils/core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "/usr/lib/python3.9/site-packages/setuptools/dist.py", line 453, in __init__
    _Distribution.__init__(
  File "/usr/lib/python3.9/distutils/dist.py", line 292, in __init__
    self.finalize_options()
  File "/usr/lib/python3.9/site-packages/setuptools/dist.py", line 830, in finalize_options
    for ep in sorted(loaded, key=by_order):
  File "/usr/lib/python3.9/site-packages/setuptools/dist.py", line 829, in <lambda>
    loaded = map(lambda e: e.load(), filtered)
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2454, in load
    self.require(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2477, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 782, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (pyparsing 3.0.6 (/usr/lib/python3.9/site-packages), Requirement.parse('pyparsing<3,>=2.0.2'), {'packaging'})
=======> ERROR: Building '/home/pkgmk/packages_thor/python3-packaging#21.2-1.pkg.tar.xz' failed.

-- Packages where update failed
python3-packaging

When I remove setuptools-scm temporarily it will build just fine, with or without the patch

@9999years 9999years closed this Nov 15, 2021
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.

Parsing markers/requirements fails with pyparsing 3.0.5
5 participants