Use the pkgutil-style namespace techniques#22
Merged
Conversation
This commit converts the `configparser` package to use the *pkgutil-style* namespace techniques. It simply applies the changes from [the nixpkgs project][nix-fix], which I found in [configparser issue 17][17]. There is more than one way to create a namespace in Python, [details here][namespaces]. The important detail is that one can not mix *pkgutil-style* and *pkg_resources-style* packages. The `backports` package established the *backports* namespace as `pkgutil-style` ([details here][backports]) and other backports packages have followed its lead. `configparser` using the *pkg_resource-style* has caused many problems, see e.g. [configparser issue #17][17]. After applying the changes from the [nixpkgs project][nix-fix] I updated the `tox.ini` file to use `py27,py36` (the only version I have access to) and I believe that the tests passed (I'm not to `tox`). ``` (alice)[17:30:47]configparser>>tox GLOB sdist-make: /Users/hartzell/tmp/configparser/setup.py py27 create: /Users/hartzell/tmp/configparser/.tox/py27 py27 inst: /Users/hartzell/tmp/configparser/.tox/dist/configparser-3.6.0.zip py27 installed: configparser==3.6.0 py27 runtests: PYTHONHASHSEED='2393890676' py27 runtests: commands[0] | /Users/hartzell/tmp/configparser/.tox/py27/bin/python test_configparser.py .................................................................................................................................................s.................................................................................................................s............................................../Users/hartzell/tmp/configparser/src/backports/configparser/__init__.py:988: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal if key == self.default_section: ........ ---------------------------------------------------------------------- Ran 314 tests in 0.460s OK (skipped=2) py27 runtests: commands[1] | /Users/hartzell/tmp/configparser/.tox/py27/bin/python test_helpers.py py36 create: /Users/hartzell/tmp/configparser/.tox/py36 py36 inst: /Users/hartzell/tmp/configparser/.tox/dist/configparser-3.6.0.zip py36 installed: configparser==3.6.0 py36 runtests: PYTHONHASHSEED='2393890676' py36 runtests: commands[0] | /Users/hartzell/tmp/configparser/.tox/py36/bin/python test_configparser.py .................................................................................................................................................s.................................................................................................................s...........................................ssss....... ---------------------------------------------------------------------- Ran 314 tests in 0.378s 1 # example user config (see 'hg help config' for more info) 1 Use pkgutil-style namespaces OK (skipped=6) py36 runtests: commands[1] | /Users/hartzell/tmp/configparser/.tox/py36/bin/python test_helpers.py ____________________________________________________ summary _____________________________________________________ py27: commands succeeded 1 Use pkgutil-style namespaces py36: commands succeeded congratulations :) (alice)[17:31:05]configparser>> ``` [backports]: https://pypi.org/project/backports/ [namespaces]: https://packaging.python.org/guides/packaging-namespace-packages/ [nix-fix]: https://github.com/FRidh/nixpkgs/blob/master/pkgs/development/python-modules/configparser/0001-namespace-fix.patch [17]: https://bitbucket.org/ambv/configparser/issues/17/importerror-when-used-with-other-backports --HG-- branch : pkgutil-style
This was referenced Jan 23, 2019
Contributor
|
Wonderful! What is the relationship of this repository to the bitbucket repository of @Łukasz Langa? |
Contributor
|
Ah, just dug around on bitbucket a bit, and it looks like you're the new package owner and have migrated the offici{al,ous} repository here. Great. What are your release plans? |
hartzell
pushed a commit
to hartzell/spack
that referenced
this pull request
Jan 24, 2019
This release includes a fix to clean up how configparser used namespaces. I can now install `py-flake8`, load the resulting `py-flake8` module, and have a working `flake8` command (this was the failure case in Chain of details starts here: jaraco/configparser#22 Closes spack#8343, spack#7370
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a resubmit of PR 2 from the original repo by George Hartzell.