Skip to content

Upgrade vendored PyParsing from 2.1.10 to 2.2.0#1450

Merged
pganssle merged 2 commits into
pypa:masterfrom
hugovk:upgrade-pyparsing
Aug 17, 2018
Merged

Upgrade vendored PyParsing from 2.1.10 to 2.2.0#1450
pganssle merged 2 commits into
pypa:masterfrom
hugovk:upgrade-pyparsing

Conversation

@hugovk

@hugovk hugovk commented Aug 9, 2018

Copy link
Copy Markdown
Contributor

Summary of changes

Fixes the first part of #1095 and #1450 (see #1451 for the second part).

Upgrade vendored PyParsing from 2.1.10 to 2.2.0.

  • 2.1.10 was released on Oct 7, 2016
  • 2.2.0 was released on Mar 6, 2017

https://pypi.org/project/pyparsing/#history

Upgrading means these deprecation warnings are fixed:

/usr/local/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py:147: DeprecationWarning: invalid escape sequence \d
  xmlcharref = Regex('&#\d+;')
/usr/local/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py:832: DeprecationWarning: invalid escape sequence \d
  """
/usr/local/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py:2736: DeprecationWarning: invalid escape sequence \d
  """
/usr/local/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py:2914: DeprecationWarning: invalid escape sequence \g
  ret = re.sub(self.escCharReplacePattern,"\g<1>",ret)

Pull Request Checklist

  • Changes have tests: existing tests still pass
  • News fragment added in changelog.d. See documentation for details

@winash12

winash12 commented Aug 9, 2018

Copy link
Copy Markdown

I upgraded PyParsing to 2.2.0 and these warnings still persist.

@hugovk

hugovk commented Aug 9, 2018

Copy link
Copy Markdown
Contributor Author

@winash12 How did you upgrade PyParsing? What did you run to check the warnings?


Here's one way:

master

$ python3 --version
Python 3.7.0
$ find . -name \*.py | xargs python3 -Wall -m py_compile
./setuptools/_vendor/pyparsing.py:147: DeprecationWarning: invalid escape sequence \d
  xmlcharref = Regex('&#\d+;')
./setuptools/_vendor/pyparsing.py:832: DeprecationWarning: invalid escape sequence \d
  """
./setuptools/_vendor/pyparsing.py:2736: DeprecationWarning: invalid escape sequence \d
  """
./setuptools/_vendor/pyparsing.py:2914: DeprecationWarning: invalid escape sequence \g
  ret = re.sub(self.escCharReplacePattern,"\g<1>",ret)
./pkg_resources/_vendor/appdirs.py:130: DeprecationWarning: invalid escape sequence \D
  """
./pkg_resources/_vendor/appdirs.py:235: DeprecationWarning: invalid escape sequence \P
  """
./pkg_resources/_vendor/pyparsing.py:147: DeprecationWarning: invalid escape sequence \d
  xmlcharref = Regex('&#\d+;')
./pkg_resources/_vendor/pyparsing.py:832: DeprecationWarning: invalid escape sequence \d
  """
./pkg_resources/_vendor/pyparsing.py:2736: DeprecationWarning: invalid escape sequence \d
  """
./pkg_resources/_vendor/pyparsing.py:2914: DeprecationWarning: invalid escape sequence \g
  ret = re.sub(self.escCharReplacePattern,"\g<1>",ret)

This PR

$ python3 --version
Python 3.7.0
find . -name \*.py | xargs python3 -Wall -m py_compile
./pkg_resources/_vendor/appdirs.py:130: DeprecationWarning: invalid escape sequence \D
  """
./pkg_resources/_vendor/appdirs.py:235: DeprecationWarning: invalid escape sequence \P
  """

@winash12

winash12 commented Aug 9, 2018

Copy link
Copy Markdown

I downloaded PyParsing 2.2.0 and I installed it in the following way
python3.6 setup.py install as root.

Then I ran my script and I got those warnings.

@hugovk

hugovk commented Aug 9, 2018

Copy link
Copy Markdown
Contributor Author

@winash12 Please paste your output.

Setuptools doesn't use PyParsing from the usual install location, but packages its own.

You can replace your file at something like /usr/local/lib/python3.6/site-packages/pkg_resources/_vendor/pyparsing.py with the one in this PR.

@winash12

winash12 commented Aug 9, 2018

Copy link
Copy Markdown

/usr/local/lib/python3.6/dist-packages/setuptools-40.0.0-py3.6.egg/pkg_resources/_vendor/appdirs.py:130: DeprecationWarning: invalid escape sequence \D
/usr/local/lib/python3.6/dist-packages/setuptools-40.0.0-py3.6.egg/pkg_resources/_vendor/appdirs.py:235: DeprecationWarning: invalid escape sequence \P
/usr/local/lib/python3.6/dist-packages/setuptools-40.0.0-py3.6.egg/pkg_resources/_vendor/appdirs.py:130: DeprecationWarning: invalid escape sequence \D
/usr/local/lib/python3.6/dist-packages/setuptools-40.0.0-py3.6.egg/pkg_resources/_vendor/appdirs.py:235: DeprecationWarning: invalid escape sequence \P
/usr/local/lib/python3.6/dist-packages/setuptools-40.0.0-py3.6.egg/pkg_resources/_vendor/pyparsing.py:147: DeprecationWarning: invalid escape sequence \d
/usr/local/lib/python3.6/dist-packages/setuptools-40.0.0-py3.6.egg/pkg_resources/_vendor/pyparsing.py:832: DeprecationWarning: invalid escape sequence \d
/usr/local/lib/python3.6/dist-packages/setuptools-40.0.0-py3.6.egg/pkg_resources/_vendor/pyparsing.py:2736: DeprecationWarning: invalid escape sequence \d
/usr/local/lib/python3.6/dist-packages/setuptools-40.0.0-py3.6.egg/pkg_resources/_vendor/pyparsing.py:2914: DeprecationWarning: invalid escape sequence \g
/usr/local/lib/python3.6/dist-packages/setuptools-40.0.0-py3.6.egg/pkg_resources/_vendor/pyparsing.py:147: DeprecationWarning: invalid escape sequence \d
/usr/local/lib/python3.6/dist-packages/setuptools-40.0.0-py3.6.egg/pkg_resources/_vendor/pyparsing.py:832: DeprecationWarning: invalid escape sequence \d
/usr/local/lib/python3.6/dist-packages/setuptools-40.0.0-py3.6.egg/pkg_resources/_vendor/pyparsing.py:2736: DeprecationWarning: invalid escape sequence \d
/usr/local/lib/p

@hugovk

hugovk commented Aug 9, 2018

Copy link
Copy Markdown
Contributor Author

@winash12 Please replace your file at /usr/local/lib/python3.6/dist-packages/setuptools-40.0.0-py3.6.egg/pkg_resources/_vendor/appdirs.py with the one from this PR: https://raw.githubusercontent.com/pypa/setuptools/306d77a044a20e58f2a786da31b6061fabd1f44a/pkg_resources/_vendor/pyparsing.py

@winash12

winash12 commented Aug 9, 2018

Copy link
Copy Markdown

Yes I got that but I do not have that directory under /usr/local/lib/python3.6/dist-packages/setuptools-40.0.0-py3.6.egg

The file etuptools-40.0.0-py3.6.egg is not a directory. Should I download setuptools and reinstall on my own ?

@hugovk

hugovk commented Aug 9, 2018

Copy link
Copy Markdown
Contributor Author

Let's wait for review from a project member :)

@pganssle

Copy link
Copy Markdown
Member

Regardless of the warnings, the tests pass and I see no reason not to upgrade this. Merging.

@pganssle pganssle merged commit 336ff3a into pypa:master Aug 17, 2018
@hugovk hugovk deleted the upgrade-pyparsing branch August 17, 2018 13:43
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.

3 participants