Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
640b283a
Commit
640b283a
authored
Mar 07, 2020
by
Jason R. Coombs
Committed by
GitHub
Mar 07, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1890 from rotu/patch-1
Remove module importing hack
parents
8a821dd9
278e0273
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
14 deletions
+23
-14
changelog.d/1890.change.rst
changelog.d/1890.change.rst
+1
-0
pkg_resources/extern/__init__.py
pkg_resources/extern/__init__.py
+0
-7
setuptools/extern/__init__.py
setuptools/extern/__init__.py
+0
-7
setuptools/tests/test_extern.py
setuptools/tests/test_extern.py
+22
-0
No files found.
changelog.d/1890.change.rst
0 → 100644
View file @
640b283a
Fix vendored dependencies so importing ``setuptools.extern.some_module`` gives the same object as ``setuptools._vendor.some_module``. This makes Metadata picklable again.
\ No newline at end of file
pkg_resources/extern/__init__.py
View file @
640b283a
...
...
@@ -43,13 +43,6 @@ class VendorImporter:
__import__
(
extant
)
mod
=
sys
.
modules
[
extant
]
sys
.
modules
[
fullname
]
=
mod
# mysterious hack:
# Remove the reference to the extant package/module
# on later Python versions to cause relative imports
# in the vendor package to resolve the same modules
# as those going through this importer.
if
prefix
and
sys
.
version_info
>
(
3
,
3
):
del
sys
.
modules
[
extant
]
return
mod
except
ImportError
:
pass
...
...
setuptools/extern/__init__.py
View file @
640b283a
...
...
@@ -43,13 +43,6 @@ class VendorImporter:
__import__
(
extant
)
mod
=
sys
.
modules
[
extant
]
sys
.
modules
[
fullname
]
=
mod
# mysterious hack:
# Remove the reference to the extant package/module
# on later Python versions to cause relative imports
# in the vendor package to resolve the same modules
# as those going through this importer.
if
sys
.
version_info
>=
(
3
,
):
del
sys
.
modules
[
extant
]
return
mod
except
ImportError
:
pass
...
...
setuptools/tests/test_extern.py
0 → 100644
View file @
640b283a
import
importlib
import
pickle
from
setuptools
import
Distribution
from
setuptools.extern
import
ordered_set
from
setuptools.tests
import
py3_only
def
test_reimport_extern
():
ordered_set2
=
importlib
.
import_module
(
ordered_set
.
__name__
)
assert
ordered_set
is
ordered_set2
def
test_orderedset_pickle_roundtrip
():
o1
=
ordered_set
.
OrderedSet
([
1
,
2
,
5
])
o2
=
pickle
.
loads
(
pickle
.
dumps
(
o1
))
assert
o1
==
o2
@
py3_only
def
test_distribution_picklable
():
pickle
.
loads
(
pickle
.
dumps
(
Distribution
()))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment