From 980c2c5afd20fb9f7e50cb8ec0c42abc664da352 Mon Sep 17 00:00:00 2001 From: Tim Heap Date: Thu, 15 Dec 2016 10:11:37 +1100 Subject: Revert "Fix #849 global-exclude globbing" This reverts commit 23aba916e1070d3cf9723af85a6ce07c89053931. --- setuptools/command/egg_info.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'setuptools/command/egg_info.py') diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 8a06e496..6f8fd874 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -457,7 +457,7 @@ class FileList(_FileList): """ if self.allfiles is None: self.findall() - match = translate_pattern(os.path.join('**', '*' + pattern)) + match = translate_pattern(os.path.join('**', pattern)) found = [f for f in self.allfiles if match.match(f)] self.extend(found) return bool(found) @@ -466,7 +466,7 @@ class FileList(_FileList): """ Exclude all files anywhere that match the pattern. """ - match = translate_pattern(os.path.join('**', '*' + pattern)) + match = translate_pattern(os.path.join('**', pattern)) return self._remove_files(match.match) def append(self, item): -- cgit v1.2.3 From 249f870f2c6fb60734e9db34e44f7e44cd35c914 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 1 Jan 2017 10:08:00 -0500 Subject: Drop support for 'tag_svn_version' distribution option. Fixes #619. --- setuptools/command/egg_info.py | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'setuptools/command/egg_info.py') diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 6f8fd874..98a87300 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -32,11 +32,6 @@ from setuptools.glob import glob from pkg_resources.extern import packaging -try: - from setuptools_svn import svn_utils -except ImportError: - pass - def translate_pattern(glob): """ @@ -147,7 +142,6 @@ class egg_info(Command): self.egg_base = None self.egg_info = None self.tag_build = None - self.tag_svn_revision = 0 self.tag_date = 0 self.broken_egg_info = False self.vtags = None @@ -165,7 +159,6 @@ class egg_info(Command): # when PYTHONHASHSEED=0 egg_info['tag_build'] = self.tags() egg_info['tag_date'] = 0 - egg_info['tag_svn_revision'] = 0 edit_config(filename, dict(egg_info=egg_info)) def finalize_options(self): @@ -282,22 +275,10 @@ class egg_info(Command): version = '' if self.tag_build: version += self.tag_build - if self.tag_svn_revision: - warnings.warn( - "tag_svn_revision is deprecated and will not be honored " - "in a future release" - ) - version += '-r%s' % self.get_svn_revision() if self.tag_date: version += time.strftime("-%Y%m%d") return version - @staticmethod - def get_svn_revision(): - if 'svn_utils' not in globals(): - return "0" - return str(svn_utils.SvnInfo.load(os.curdir).get_revision()) - def find_sources(self): """Generate SOURCES.txt manifest file""" manifest_filename = os.path.join(self.egg_info, "SOURCES.txt") -- cgit v1.2.3 From ff371f18f0076bc63da05334f7e551c1cc29e10d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 1 Jan 2017 22:34:28 -0500 Subject: Strip out vendored packages and require them instead. Ref #581. --- setuptools/command/egg_info.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'setuptools/command/egg_info.py') diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 98a87300..2bc57b18 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -16,8 +16,8 @@ import warnings import time import collections -from setuptools.extern import six -from setuptools.extern.six.moves import map +import six +from six.moves import map from setuptools import Command from setuptools.command.sdist import sdist @@ -30,7 +30,7 @@ from pkg_resources import ( import setuptools.unicode_utils as unicode_utils from setuptools.glob import glob -from pkg_resources.extern import packaging +import packaging def translate_pattern(glob): -- cgit v1.2.3 From dc8683bd8e8600680a7581fd3a2d34ba8f1fa0ab Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 2 Jan 2017 09:29:42 -0500 Subject: More aggressively remove references to 'tag_svn_revision' option in egg_info. Ref #619. --- setuptools/command/egg_info.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'setuptools/command/egg_info.py') diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 98a87300..e3578074 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -121,18 +121,13 @@ class egg_info(Command): user_options = [ ('egg-base=', 'e', "directory containing .egg-info directories" " (default: top of the source tree)"), - ('tag-svn-revision', 'r', - "Add subversion revision ID to version number"), ('tag-date', 'd', "Add date stamp (e.g. 20050528) to version number"), ('tag-build=', 'b', "Specify explicit tag to add to version number"), - ('no-svn-revision', 'R', - "Don't add subversion revision ID [default]"), ('no-date', 'D', "Don't include date stamp [default]"), ] - boolean_options = ['tag-date', 'tag-svn-revision'] + boolean_options = ['tag-date'] negative_opt = { - 'no-svn-revision': 'tag-svn-revision', 'no-date': 'tag-date', } @@ -148,8 +143,8 @@ class egg_info(Command): def save_version_info(self, filename): """ - Materialize the values of svn_revision and date into the - build tag. Install these keys in a deterministic order + Materialize the value of date into the + build tag. Install build keys in a deterministic order to avoid arbitrary reordering on subsequent builds. """ # python 2.6 compatibility -- cgit v1.2.3 From b848627d17328cab9bdce4fabd314c76d5f7d96e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 2 Jan 2017 09:56:47 -0500 Subject: Add a no-op property for 'tag_svn_revision' to suppress errors when distutils attempts to detect and set these values based on settings in setup.cfg as found in sdists built by earlier versions of setuptools. Ref #619. --- setuptools/command/egg_info.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'setuptools/command/egg_info.py') diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index e3578074..ca6a4348 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -141,6 +141,18 @@ class egg_info(Command): self.broken_egg_info = False self.vtags = None + #################################### + # allow the 'tag_svn_revision' to be detected and + # set, supporting sdists built on older Setuptools. + @property + def tag_svn_revision(self): + pass + + @tag_svn_revision.setter + def tag_svn_revision(self, value): + pass + #################################### + def save_version_info(self, filename): """ Materialize the value of date into the -- cgit v1.2.3 From 56274b32724933cd2016488c4e667e86d30572ef Mon Sep 17 00:00:00 2001 From: Hatem Nassrat Date: Mon, 23 Jan 2017 18:07:21 +0000 Subject: fixes #935 - allows for glob syntax in graft --- setuptools/command/egg_info.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'setuptools/command/egg_info.py') diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 5ab54dc7..62bf00aa 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -429,7 +429,9 @@ class FileList(_FileList): def graft(self, dir): """Include all files from 'dir/'.""" - found = distutils.filelist.findall(dir) + found = [] + for match_dir in glob(dir): + found += distutils.filelist.findall(match_dir) self.extend(found) return bool(found) -- cgit v1.2.3 From 9cb83c3711d737fa3bff56f55e4def8267bae83c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 23 Jan 2017 17:01:33 -0500 Subject: Prefer list comprehension to init/append loop. Ref #936. --- setuptools/command/egg_info.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'setuptools/command/egg_info.py') diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 62bf00aa..1a6ea9cb 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -429,9 +429,11 @@ class FileList(_FileList): def graft(self, dir): """Include all files from 'dir/'.""" - found = [] - for match_dir in glob(dir): - found += distutils.filelist.findall(match_dir) + found = [ + item + for match_dir in glob(dir) + for item in distutils.filelist.findall(match_dir) + ] self.extend(found) return bool(found) -- cgit v1.2.3 From 3d0cc355fb5e8012cb8c72f0e25042a5a44f31d6 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 24 Feb 2017 11:49:51 -0500 Subject: Revert "Merge pull request #933 from pypa/feature/581-depend-not-bundle" This reverts commit 089cdeb489a0fa94d11b7307b54210ef9aa40511, reversing changes made to aaec654d804cb78dbb6391afff721a63f26a71cd. --- setuptools/command/egg_info.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'setuptools/command/egg_info.py') diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 1a6ea9cb..a32c42f8 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -16,8 +16,8 @@ import warnings import time import collections -import six -from six.moves import map +from setuptools.extern import six +from setuptools.extern.six.moves import map from setuptools import Command from setuptools.command.sdist import sdist @@ -30,7 +30,7 @@ from pkg_resources import ( import setuptools.unicode_utils as unicode_utils from setuptools.glob import glob -import packaging +from pkg_resources.extern import packaging def translate_pattern(glob): -- cgit v1.2.3 From 1955e5b0df67cc1aa389b8c655199958a6fcc6a0 Mon Sep 17 00:00:00 2001 From: Stefano Miccoli Date: Thu, 13 Apr 2017 22:57:56 +0200 Subject: addresses #436 --- setuptools/command/egg_info.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'setuptools/command/egg_info.py') diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 1a6ea9cb..21bbfb72 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -564,8 +564,6 @@ class manifest_maker(sdist): rcfiles = list(walk_revctrl()) if rcfiles: self.filelist.extend(rcfiles) - elif os.path.exists(self.manifest): - self.read_manifest() ei_cmd = self.get_finalized_command('egg_info') self.filelist.graft(ei_cmd.egg_info) -- cgit v1.2.3 From 1163c86b3b62258f28964c2aee8483631a85c892 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 18 Apr 2017 17:52:44 -0500 Subject: Revert "addresses #436". Fixes #1016. This reverts commit 1955e5b0df67cc1aa389b8c655199958a6fcc6a0. --- setuptools/command/egg_info.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'setuptools/command/egg_info.py') diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 21bbfb72..1a6ea9cb 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -564,6 +564,8 @@ class manifest_maker(sdist): rcfiles = list(walk_revctrl()) if rcfiles: self.filelist.extend(rcfiles) + elif os.path.exists(self.manifest): + self.read_manifest() ei_cmd = self.get_finalized_command('egg_info') self.filelist.graft(ei_cmd.egg_info) -- cgit v1.2.3 From f1a9711815acab7e2d9c77b86b43117f72c5c78f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 18 Apr 2017 18:32:40 -0500 Subject: Pass flags programmatically, avoiding deprecating trailing pattern flags syntax revealed in #1015. --- setuptools/command/egg_info.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'setuptools/command/egg_info.py') diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 1a6ea9cb..151e495b 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -112,7 +112,8 @@ def translate_pattern(glob): if not last_chunk: pat += sep - return re.compile(pat + r'\Z(?ms)') + pat += r'\Z' + return re.compile(pat, flags=re.MULTILINE|re.DOTALL) class egg_info(Command): -- cgit v1.2.3 From 4fc60ed1e47f725a833dd63656ceec981a58e1a0 Mon Sep 17 00:00:00 2001 From: Marc Abramowitz Date: Sat, 30 Jul 2016 08:15:53 -0700 Subject: Add new long_description_content_type kwarg This is used to populate the new `Description-Content-Type` field. `Description-Content-Type` is described at https://github.com/pypa/python-packaging-user-guide/pull/258 --- setuptools/command/egg_info.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'setuptools/command/egg_info.py') diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 6c00b0b7..a183d15d 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -599,6 +599,10 @@ def write_pkg_info(cmd, basename, filename): metadata = cmd.distribution.metadata metadata.version, oldver = cmd.egg_version, metadata.version metadata.name, oldname = cmd.egg_name, metadata.name + metadata.long_description_content_type = getattr( + cmd.distribution, + 'long_description_content_type' + ) try: # write unescaped data to PKG-INFO, so older pkg_resources # can still parse it -- cgit v1.2.3