1 https://github.com/python-versioneer/python-versioneer/pull/394
3 --- versioneer-0.29/test/git/test_invocations.py.orig
4 +++ versioneer-0.29/test/git/test_invocations.py
6 def make_demolib_sdist(self):
7 # create an sdist of demolib-1.0 . for the *lib*, we only use the
8 # tarball, never the repo.
9 - demolib_sdist = self.subpath("cache", "demolib-1.0.tar")
10 + demolib_sdist = self.subpath("cache", "demolib-1.0.tar.gz")
11 if os.path.exists(demolib_sdist):
13 libdir = self.subpath("build-demolib")
15 self.git("add", "--all", workdir=libdir)
16 self.git("commit", "-m", "comment", workdir=libdir)
17 self.git("tag", "demolib-1.0", workdir=libdir)
18 - self.python("setup.py", "sdist", "--format=tar", workdir=libdir)
19 - created = os.path.join(libdir, "dist", "demolib-1.0.tar")
20 + self.python("setup.py", "sdist", "--format=gztar", workdir=libdir)
21 + created = os.path.join(libdir, "dist", "demolib-1.0.tar.gz")
22 self.assertTrue(os.path.exists(created))
23 shutil.copyfile(created, demolib_sdist)
26 if os.path.exists(unpack_into):
27 shutil.rmtree(unpack_into)
29 - with tarfile.TarFile(sdist) as t:
30 + with tarfile.open(sdist, "r:gz") as t:
31 t.extractall(path=unpack_into)
32 unpacked = os.path.join(unpack_into, "demoappext-2.0")
33 self.assertTrue(os.path.exists(unpacked))
35 def make_setuptools_extension_sdist(self):
36 # create an sdist tarball of demoappext-setuptools at 2.0
37 demoappext_setuptools_sdist = self.subpath("cache", "setuptools",
38 - "demoappext-2.0.tar")
39 + "demoappext-2.0.tar.gz")
40 if os.path.exists(demoappext_setuptools_sdist):
41 return demoappext_setuptools_sdist
42 repodir = self.make_setuptools_extension_repo()
43 - self.python("setup.py", "sdist", "--format=tar", workdir=repodir)
44 - created = os.path.join(repodir, "dist", "demoappext-2.0.tar")
45 + self.python("setup.py", "sdist", "--format=gztar", workdir=repodir)
46 + created = os.path.join(repodir, "dist", "demoappext-2.0.tar.gz")
47 self.assertTrue(os.path.exists(created), created)
48 shutil.copyfile(created, demoappext_setuptools_sdist)
49 return demoappext_setuptools_sdist
51 def make_setuptools_sdist(self):
52 # create an sdist tarball of demoapp2-setuptools at 2.0
53 demoapp2_setuptools_sdist = self.subpath("cache", "setuptools",
55 + "demoapp2-2.0.tar.gz")
56 if os.path.exists(demoapp2_setuptools_sdist):
57 return demoapp2_setuptools_sdist
58 repodir = self.make_setuptools_repo()
59 - self.python("setup.py", "sdist", "--format=tar", workdir=repodir)
60 - created = os.path.join(repodir, "dist", "demoapp2-2.0.tar")
61 + self.python("setup.py", "sdist", "--format=gztar", workdir=repodir)
62 + created = os.path.join(repodir, "dist", "demoapp2-2.0.tar.gz")
63 self.assertTrue(os.path.exists(created), created)
64 shutil.copyfile(created, demoapp2_setuptools_sdist)
65 return demoapp2_setuptools_sdist
67 def make_setuptools_sdist_subproject(self):
68 demoapp2_setuptools_sdist = self.subpath("cache", "setuptools",
69 - "demoapp2-subproject-2.0.tar")
70 + "demoapp2-subproject-2.0.tar.gz")
71 if os.path.exists(demoapp2_setuptools_sdist):
72 return demoapp2_setuptools_sdist
73 projectdir = self.make_setuptools_repo_subproject()
74 - self.python("setup.py", "sdist", "--format=tar", workdir=projectdir)
75 - created = os.path.join(projectdir, "dist", "demoapp2-2.0.tar")
76 + self.python("setup.py", "sdist", "--format=gztar", workdir=projectdir)
77 + created = os.path.join(projectdir, "dist", "demoapp2-2.0.tar.gz")
78 self.assertTrue(os.path.exists(created), created)
79 shutil.copyfile(created, demoapp2_setuptools_sdist)
80 return demoapp2_setuptools_sdist
82 if os.path.exists(unpack_into):
83 shutil.rmtree(unpack_into)
85 - with tarfile.TarFile(sdist) as t:
86 + with tarfile.open(sdist, "r:gz") as t:
87 t.extractall(path=unpack_into)
88 unpacked = os.path.join(unpack_into, "demoapp2-2.0")
89 self.assertTrue(os.path.exists(unpacked))
91 if os.path.exists(unpack_into):
92 shutil.rmtree(unpack_into)
94 - with tarfile.TarFile(sdist) as t:
95 + with tarfile.open(sdist, "r:gz") as t:
96 t.extractall(path=unpack_into)
97 unpacked = os.path.join(unpack_into, "demoapp2-2.0")
98 self.assertTrue(os.path.exists(unpacked))
100 def test_sdist(self):
101 sdist = self.make_setuptools_sdist() # asserts version as a side-effect
102 # make sure we used setuptools/sdist, not distutils/sdist
103 - with tarfile.TarFile(sdist) as t:
104 + with tarfile.open(sdist, "r:gz") as t:
105 self.assertIn("demoapp2-2.0/src/demoapp2.egg-info/PKG-INFO", t.getnames())
107 def test_sdist_subproject(self):
108 sdist = self.make_setuptools_sdist_subproject()
109 # make sure we used setuptools/sdist, not distutils/sdist
110 - with tarfile.TarFile(sdist) as t:
111 + with tarfile.open(sdist, "r:gz") as t:
112 self.assertIn("demoapp2-2.0/src/demoapp2.egg-info/PKG-INFO", t.getnames())
114 def test_pip_install(self):