Skip to content

Commit e4d8d76

Browse files
committed
Complete renaming to to pkginfo2
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent 03db0cd commit e4d8d76

11 files changed

Lines changed: 33 additions & 34 deletions

pkginfo2/commandline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def finish(self):
210210
}
211211

212212
def main(args=None):
213-
"""Entry point for pkginfo tool
213+
"""Entry point for pkginfo2 tool
214214
"""
215215
options, paths = _parse_options(args)
216216
format = getattr(options, 'output', 'simple')

pkginfo2/tests/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ def _checkSample(testcase, installed):
77
except ImportError: # no setuptools :(
88
pass
99
else:
10-
version = pkg_resources.require('pkginfo')[0].version
10+
version = pkg_resources.require('pkginfo2')[0].version
1111
testcase.assertEqual(installed.version, version)
12-
testcase.assertEqual(installed.name, 'pkginfo')
12+
testcase.assertEqual(installed.name, 'pkginfo2')
1313
testcase.assertEqual(installed.keywords,
1414
'distribution sdist installed metadata' )
1515
testcase.assertEqual(list(installed.supported_platforms), [])
@@ -20,7 +20,6 @@ def _checkClassifiers(testcase, installed):
2020
'Intended Audience :: Developers',
2121
'License :: OSI Approved :: MIT License',
2222
'Operating System :: OS Independent',
23-
'Programming Language :: Python :: 2.7',
2423
'Programming Language :: Python :: 3.6',
2524
'Programming Language :: Python :: 3.7',
2625
'Programming Language :: Python :: 3.8',

pkginfo2/tests/test_bdist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class BDistTests(unittest.TestCase):
44

55
def _getTargetClass(self):
6-
from pkginfo.bdist import BDist
6+
from pkginfo2.bdist import BDist
77
return BDist
88

99
def _makeOne(self, filename=None, metadata_version=None):

pkginfo2/tests/test_commandline.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
class Test__parse_options(unittest.TestCase):
44

55
def _callFUT(self, args):
6-
from pkginfo.commandline import _parse_options
6+
from pkginfo2.commandline import _parse_options
77
return _parse_options(args)
88

99
def test_empty(self):
1010
import io
1111
import sys
12-
from pkginfo.commandline import __doc__ as usage
12+
from pkginfo2.commandline import __doc__ as usage
1313
firstline = usage.splitlines()[0]
1414

1515
# parse_args emits "native" error output.
@@ -29,7 +29,7 @@ def test_nonempty(self):
2929
class BaseTests(unittest.TestCase):
3030

3131
def _getTargetClass(self):
32-
from pkginfo.commandline import Base
32+
from pkginfo2.commandline import Base
3333
return Base
3434

3535
def _makeOne(self, options):
@@ -66,7 +66,7 @@ def _no_output(self, simple, meta):
6666
class SimpleTests(unittest.TestCase, _FormatterBase):
6767

6868
def _getTargetClass(self):
69-
from pkginfo.commandline import Simple
69+
from pkginfo2.commandline import Simple
7070
return Simple
7171

7272
def _makeOne(self, options):
@@ -100,7 +100,7 @@ def test___call___w_skip_but_values_explicit_fields(self):
100100
class SingleLineTests(unittest.TestCase, _FormatterBase):
101101

102102
def _getTargetClass(self):
103-
from pkginfo.commandline import SingleLine
103+
from pkginfo2.commandline import SingleLine
104104
return SingleLine
105105

106106
def _makeOne(self, options):
@@ -131,7 +131,7 @@ def test___call__w_fields_w_list(self):
131131
class CSVTests(unittest.TestCase, _FormatterBase):
132132

133133
def _getTargetClass(self):
134-
from pkginfo.commandline import CSV
134+
from pkginfo2.commandline import CSV
135135
return CSV
136136

137137
def _makeOne(self, options):
@@ -161,7 +161,7 @@ def test___call__w_fields_w_list(self):
161161
class INITests(unittest.TestCase, _FormatterBase):
162162

163163
def _getTargetClass(self):
164-
from pkginfo.commandline import INI
164+
from pkginfo2.commandline import INI
165165
return INI
166166

167167
def _makeOne(self, options):
@@ -199,7 +199,7 @@ def test___call___w_fields_w_list(self):
199199
class JSONtests(unittest.TestCase, _FormatterBase):
200200

201201
def _getTargetClass(self):
202-
from pkginfo.commandline import JSON
202+
from pkginfo2.commandline import JSON
203203
return JSON
204204

205205
def _makeOne(self, options):
@@ -255,8 +255,8 @@ def test___call___output(self):
255255
class Test_main(unittest.TestCase):
256256

257257
def _callFUT(self, args, monkey='simple'):
258-
from pkginfo.commandline import main
259-
from pkginfo.commandline import _FORMATTERS
258+
from pkginfo2.commandline import main
259+
from pkginfo2.commandline import _FORMATTERS
260260
before = _FORMATTERS[monkey]
261261
dummy = _Formatter()
262262
_FORMATTERS[monkey] = lambda *options: dummy
@@ -267,7 +267,7 @@ def _callFUT(self, args, monkey='simple'):
267267
return dummy
268268

269269
def test_w_mising_dist(self):
270-
from pkginfo import commandline as MUT
270+
from pkginfo2 import commandline as MUT
271271
def _get_metadata(path_or_module, md_version):
272272
self.assertEqual(path_or_module, 'foo')
273273
self.assertEqual(md_version, None)
@@ -278,7 +278,7 @@ def _get_metadata(path_or_module, md_version):
278278
self.assertTrue(formatter._finished)
279279

280280
def test_w_dist_wo_download_url(self):
281-
from pkginfo import commandline as MUT
281+
from pkginfo2 import commandline as MUT
282282
meta = _Meta(download_url=None)
283283
def _get_metadata(path_or_module, md_version):
284284
self.assertEqual(path_or_module, '/path/to/foo')
@@ -292,7 +292,7 @@ def _get_metadata(path_or_module, md_version):
292292
self.assertEqual(meta.download_url, 'http://example.com/foo')
293293

294294
def test_w_dist_w_download_url(self):
295-
from pkginfo import commandline as MUT
295+
from pkginfo2 import commandline as MUT
296296
meta = _Meta(download_url='http://example.com/dist/foo')
297297
def _get_metadata(path_or_module, md_version):
298298
self.assertEqual(path_or_module, '/path/to/foo')

pkginfo2/tests/test_develop.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
class DevelopTests(unittest.TestCase):
44

55
def _getTargetClass(self):
6-
from pkginfo.develop import Develop
6+
from pkginfo2.develop import Develop
77
return Develop
88

99
def _makeOne(self, dirname=None):
1010
return self._getTargetClass()(dirname)
1111

1212
def test_ctor_w_path(self):
13-
from pkginfo.tests import _checkSample
13+
from pkginfo2.tests import _checkSample
1414
develop = self._makeOne('.')
1515
_checkSample(self, develop)
1616

pkginfo2/tests/test_distribution.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class DistributionTests(unittest.TestCase):
44

55
def _getTargetClass(self):
6-
from pkginfo.distribution import Distribution
6+
from pkginfo2.distribution import Distribution
77
return Distribution
88

99
def _makeOne(self, metadata_version='1.0'):
@@ -59,44 +59,44 @@ def test_read_raises_NotImplementedError(self):
5959
self.assertRaises(NotImplementedError, dist.read)
6060

6161
def test_parse_given_unicode(self):
62-
from pkginfo._compat import u
62+
from pkginfo2._compat import u
6363
dist = self._makeOne()
6464
dist.parse(u('Metadata-Version: 1.0\nName: lp722928_c3')) # no raise
6565

6666
def test_parse_Metadata_Version_1_0(self):
67-
from pkginfo.distribution import HEADER_ATTRS_1_0
67+
from pkginfo2.distribution import HEADER_ATTRS_1_0
6868
dist = self._makeOne(None)
6969
dist.parse('Metadata-Version: 1.0')
7070
self.assertEqual(dist.metadata_version, '1.0')
7171
self.assertEqual(list(dist),
7272
[x[1] for x in HEADER_ATTRS_1_0])
7373

7474
def test_parse_Metadata_Version_1_1(self):
75-
from pkginfo.distribution import HEADER_ATTRS_1_1
75+
from pkginfo2.distribution import HEADER_ATTRS_1_1
7676
dist = self._makeOne(None)
7777
dist.parse('Metadata-Version: 1.1')
7878
self.assertEqual(dist.metadata_version, '1.1')
7979
self.assertEqual(list(dist),
8080
[x[1] for x in HEADER_ATTRS_1_1])
8181

8282
def test_parse_Metadata_Version_1_2(self):
83-
from pkginfo.distribution import HEADER_ATTRS_1_2
83+
from pkginfo2.distribution import HEADER_ATTRS_1_2
8484
dist = self._makeOne(None)
8585
dist.parse('Metadata-Version: 1.2')
8686
self.assertEqual(dist.metadata_version, '1.2')
8787
self.assertEqual(list(dist),
8888
[x[1] for x in HEADER_ATTRS_1_2])
8989

9090
def test_parse_Metadata_Version_2_1(self):
91-
from pkginfo.distribution import HEADER_ATTRS_2_1
91+
from pkginfo2.distribution import HEADER_ATTRS_2_1
9292
dist = self._makeOne(None)
9393
dist.parse('Metadata-Version: 2.1')
9494
self.assertEqual(dist.metadata_version, '2.1')
9595
self.assertEqual(list(dist),
9696
[x[1] for x in HEADER_ATTRS_2_1])
9797

9898
def test_parse_Metadata_Version_2_2(self):
99-
from pkginfo.distribution import HEADER_ATTRS_2_2
99+
from pkginfo2.distribution import HEADER_ATTRS_2_2
100100
dist = self._makeOne(None)
101101
dist.parse('Metadata-Version: 2.2')
102102
self.assertEqual(dist.metadata_version, '2.2')

pkginfo2/tests/test_index.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class IndexTests(unittest.TestCase):
44

55
def _getTargetClass(self):
6-
from pkginfo.index import Index
6+
from pkginfo2.index import Index
77
return Index
88

99
def _makeOne(self):
@@ -17,7 +17,7 @@ def test_empty(self):
1717
self.assertEqual(len(index.items()), 0)
1818

1919
def _makeDummy(self):
20-
from pkginfo.distribution import Distribution
20+
from pkginfo2.distribution import Distribution
2121
class DummyDistribution(Distribution):
2222
name = 'dummy'
2323
version = '1.0'

pkginfo2/tests/test_installed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class InstalledTests(unittest.TestCase):
44

55
def _getTargetClass(self):
6-
from pkginfo.installed import Installed
6+
from pkginfo2.installed import Installed
77
return Installed
88

99
def _makeOne(self, filename=None, metadata_version=None):

pkginfo2/tests/test_sdist.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class SDistTests(unittest.TestCase):
66

77
def _getTargetClass(self):
8-
from pkginfo.sdist import SDist
8+
from pkginfo2.sdist import SDist
99
return SDist
1010

1111
def _makeOne(self, filename=None, metadata_version=None):
@@ -116,7 +116,7 @@ def tearDown(self):
116116
super(UnpackedMixin, self).tearDown()
117117

118118
def _getTargetClass(self):
119-
from pkginfo.sdist import UnpackedSDist
119+
from pkginfo2.sdist import UnpackedSDist
120120
return UnpackedSDist
121121

122122
def _getTopDirectory(self):

pkginfo2/tests/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class Test_get_metadata(unittest.TestCase):
44

55
def _callFUT(self, path, metadata_version=None):
6-
from pkginfo.utils import get_metadata
6+
from pkginfo2.utils import get_metadata
77
if metadata_version is not None:
88
return get_metadata(path, metadata_version)
99
return get_metadata(path)

0 commit comments

Comments
 (0)