From 03cc3be9da0f1d31a3e4f2272d3ebb28ed761b35 Mon Sep 17 00:00:00 2001 From: Dweep Shah Date: Mon, 26 Oct 2015 16:45:04 -0400 Subject: Unload all pkg_resources modules and not just the main module. Fixes #453. --- ez_setup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ez_setup.py b/ez_setup.py index 50e0dfc6..bbfe0544 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -125,7 +125,12 @@ def _do_download(version, download_base, to_dir, download_delay): # Remove previously-imported pkg_resources if present (see # https://bitbucket.org/pypa/setuptools/pull-request/7/ for details). if 'pkg_resources' in sys.modules: - del sys.modules['pkg_resources'] + del_modules = [ + name for name in sys.modules + if name.startswith('pkg_resources') + ] + for mod_name in del_modules: + del sys.modules[mod_name] import setuptools setuptools.bootstrap_install_from = egg -- cgit v1.2.3 From dca452f0ed773557f5a5013cd77f76edfcbbb74e Mon Sep 17 00:00:00 2001 From: Dweep Shah Date: Tue, 27 Oct 2015 16:35:06 -0400 Subject: Uses an existing method to delete pkg_resources --- ez_setup.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index bbfe0544..a1977155 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -125,12 +125,7 @@ def _do_download(version, download_base, to_dir, download_delay): # Remove previously-imported pkg_resources if present (see # https://bitbucket.org/pypa/setuptools/pull-request/7/ for details). if 'pkg_resources' in sys.modules: - del_modules = [ - name for name in sys.modules - if name.startswith('pkg_resources') - ] - for mod_name in del_modules: - del sys.modules[mod_name] + _unload_pkg_resources() import setuptools setuptools.bootstrap_install_from = egg -- cgit v1.2.3 From 5b72c2587563f6190db732cb5b49e1868fa546e2 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Thu, 5 Nov 2015 11:37:38 +1300 Subject: Fix EBNF for package specifications. --- docs/pkg_resources.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pkg_resources.txt b/docs/pkg_resources.txt index 6c6405a8..3d40a1a2 100644 --- a/docs/pkg_resources.txt +++ b/docs/pkg_resources.txt @@ -592,7 +592,7 @@ Requirements Parsing The syntax of a requirement specifier can be defined in EBNF as follows:: - requirement ::= project_name versionspec? extras? + requirement ::= project_name extras? versionspec? versionspec ::= comparison version (',' comparison version)* comparison ::= '<' | '<=' | '!=' | '==' | '>=' | '>' | '~=' | '===' extras ::= '[' extralist? ']' -- cgit v1.2.3 From 32237eae19b3722b2a1c87bc0a74613c5f12d6fd Mon Sep 17 00:00:00 2001 From: sunpoet Date: Fri, 20 Nov 2015 05:54:41 +0800 Subject: Fix package list inconsistency caused by namespace package on Python 3.5 namespace package will be skipped during installation. Since Python 3.5, .pyo files are removed and new .opt-1.pyc (and .opt-2.pyc) files are introduced [1]. However setuptools does not understand that new naming therefore the corresponding foo.opt-1.pyc is still added into package list (via --record). The inconsistency leads to a packaging error. [1] https://www.python.org/dev/peps/pep-0488/ --- setuptools/command/install_lib.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index 9b772227..78fe6891 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -79,6 +79,8 @@ class install_lib(orig.install_lib): base = os.path.join('__pycache__', '__init__.' + imp.get_tag()) yield base + '.pyc' yield base + '.pyo' + yield base + '.opt-1.pyc' + yield base + '.opt-2.pyc' def copy_tree( self, infile, outfile, -- cgit v1.2.3