Imported Upstream version 40.1.1 upstream/40.1.1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 14 Jan 2019 01:43:02 +0000 (10:43 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 14 Jan 2019 01:43:02 +0000 (10:43 +0900)
CHANGES.rst
setup.cfg
setup.py
setuptools/command/egg_info.py
setuptools/tests/test_egg_info.py

index cc43156f9782532d140a7df3edc8648c47b10663..5c52e9405fccf1bbf76ca62866dca77ae1355cef 100644 (file)
@@ -1,3 +1,9 @@
+vv40.1.1
+--------
+
+* #1465: Fix regression with `egg_info` command when tagging is used.
+
+
 v40.1.0
 -------
 
index 870d629962d921cd502d5c7c6bac28aa35b0b13c..0304f6ffb0e5cbb61dc4e901598743fcfc19d1aa 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 40.1.0
+current_version = 40.1.1
 commit = True
 tag = True
 
index 526a7ba6d35d11cf4e1637766fcf5b96e2f90407..e01043aadbc4f470ec4acbdee06568ac3ed3195c 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -89,7 +89,7 @@ def pypi_link(pkg_filename):
 
 setup_params = dict(
     name="setuptools",
-    version="40.1.0",
+    version="40.1.1",
     description=(
         "Easily download, build, install, upgrade, and uninstall "
         "Python packages"
index 5fd6c88803bff45bea6067bfca0b256c8f010707..74350cbd1a822cdbd4c16a18a814ad5e250cdda6 100644 (file)
@@ -160,7 +160,9 @@ class egg_info(InfoCommon, Command):
 
     def initialize_options(self):
         self.egg_base = None
+        self.egg_name = None
         self.egg_info = None
+        self.egg_version = None
         self.broken_egg_info = False
 
     ####################################
@@ -188,15 +190,13 @@ class egg_info(InfoCommon, Command):
         egg_info['tag_date'] = 0
         edit_config(filename, dict(egg_info=egg_info))
 
-    @property
-    def egg_name(self):
-        return self.name
-
-    @property
-    def egg_version(self):
-        return self.tagged_version()
-
     def finalize_options(self):
+        # Note: we need to capture the current value returned
+        # by `self.tagged_version()`, so we can later update
+        # `self.distribution.metadata.version` without
+        # repercussions.
+        self.egg_name = self.name
+        self.egg_version = self.tagged_version()
         parsed_version = parse_version(self.egg_version)
 
         try:
index 1a100266eabf0307911908d4dc27a379cf06f861..17d40fb8948a1828f061571a01911815dd4b7ed0 100644 (file)
@@ -570,3 +570,19 @@ class TestEggInfo:
             raise AssertionError(data)
         if output:
             assert output in data
+
+    def test_egg_info_tag_only_once(self, tmpdir_cwd, env):
+        self._create_project()
+        build_files({
+            'setup.cfg': DALS("""
+                              [egg_info]
+                              tag_build = dev
+                              tag_date = 0
+                              tag_svn_revision = 0
+                              """),
+        })
+        self._run_egg_info_command(tmpdir_cwd, env)
+        egg_info_dir = os.path.join('.', 'foo.egg-info')
+        with open(os.path.join(egg_info_dir, 'PKG-INFO')) as pkginfo_file:
+            pkg_info_lines = pkginfo_file.read().split('\n')
+        assert 'Version: 0.0.0.dev0' in pkg_info_lines