We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a6f6503 commit 7ce6f39Copy full SHA for 7ce6f39
pkg_resources/__init__.py
@@ -2832,9 +2832,7 @@ def _get_metadata(self, name):
2832
2833
def _get_version(self):
2834
lines = self._get_metadata(self.PKG_INFO)
2835
- version = _version_from_file(lines)
2836
-
2837
- return version
+ return _version_from_file(lines)
2838
2839
def activate(self, path=None, replace=False):
2840
"""Ensure distribution is importable on `path` (default=sys.path)"""
setuptools/command/bdist_rpm.py
@@ -30,11 +30,10 @@ def run(self):
30
31
def _make_spec_file(self):
32
spec = orig.bdist_rpm._make_spec_file(self)
33
- spec = [
+ return [
34
line.replace(
35
"setup.py install ",
36
"setup.py install --single-version-externally-managed ",
37
).replace("%setup", "%setup -n %{name}-%{unmangled_version}")
38
for line in spec
39
]
40
- return spec
setuptools/command/easy_install.py
@@ -1474,9 +1474,7 @@ def get_site_dirs():
1474
with contextlib.suppress(AttributeError):
1475
sitedirs.extend(site.getsitepackages())
1476
1477
- sitedirs = list(map(normalize_path, sitedirs))
1478
1479
- return sitedirs
+ return list(map(normalize_path, sitedirs))
1480
1481
1482
def expand_paths(inputs): # noqa: C901 # is too complex (11) # FIXME
setuptools/installer.py
@@ -107,10 +107,9 @@ def _fetch_build_egg_no_warn(dist, req): # noqa: C901 # is too complex (16) #
107
dist_metadata = pkg_resources.PathMetadata(
108
dist_location, os.path.join(dist_location, 'EGG-INFO')
109
)
110
- dist = pkg_resources.Distribution.from_filename(
+ return pkg_resources.Distribution.from_filename(
111
dist_location, metadata=dist_metadata
112
113
- return dist
114
115
116
def strip_marker(req):
setuptools/tests/server.py
@@ -84,5 +84,4 @@ def path_to_url(path, authority=None):
84
base = 'file:'
85
if authority is not None:
86
base += '//' + authority
87
- url = urllib.parse.urljoin(base, urllib.request.pathname2url(path))
88
- return url
+ return urllib.parse.urljoin(base, urllib.request.pathname2url(path))
setuptools/tests/test_build_ext.py
@@ -98,12 +98,11 @@ def dist_with_example(self):
98
ext3 = Extension("ext3", ["c-extension/ext3.c"])
99
100
path.build(files)
101
- dist = Distribution({
+ return Distribution({
102
"script_name": "%test%",
103
"ext_modules": [ext1, ext2, ext3],
104
"package_dir": {"": "src"},
105
})
106
def test_get_outputs(self, tmpdir_cwd, monkeypatch):
monkeypatch.setenv('SETUPTOOLS_EXT_SUFFIX', '.mp3') # make test OS-independent
setuptools/tests/test_core_metadata.py
@@ -64,7 +64,7 @@ def __read_test_cases():
64
65
params = functools.partial(dict, base)
66
67
- test_cases = [
68
('Metadata version 1.0', params()),
69
(
70
'Metadata Version 1.0: Short long description',
@@ -156,8 +156,6 @@ def __read_test_cases():
156
),
157
158
159
- return test_cases
160
161
162
@pytest.mark.parametrize('name,attrs', __read_test_cases())
163
def test_read_metadata(name, attrs):
@@ -209,7 +207,7 @@ def merge_dicts(d1, d2):
209
207
210
208
return d1
211
212
213
('No author, no maintainer', attrs.copy()),
214
215
'Author (no e-mail), no maintainer',
@@ -267,8 +265,6 @@ def merge_dicts(d1, d2):
267
265
('Maintainer unicode', merge_dicts(attrs, {'maintainer': 'Jan Łukasiewicz'})),
268
266
269
270
271
272
273
@pytest.mark.parametrize('name,attrs', __maintainer_test_cases())
274
def test_maintainer_author(name, attrs, tmpdir):
0 commit comments