style: apply some cleanups from Sourcery.ai (#626)
* style: apply some fixes from Sorcery * Apply suggestions from code review Co-authored-by: Yannick Jadoul <yannick.jadoul@belgacom.net> Co-authored-by: Joe Rickerby <joerick@mac.com> Co-authored-by: Yannick Jadoul <yannick.jadoul@belgacom.net> Co-authored-by: Joe Rickerby <joerick@mac.com>
This commit is contained in:
co-authored by
Yannick Jadoul
Joe Rickerby
parent
96aa38b56c
commit
5cbe3e2254
@@ -40,11 +40,10 @@ VERSION_REGEX = r'([\w-]+)==([^\s]+)'
|
||||
def get_versions_from_constraint_file(constraint_file):
|
||||
constraint_file_text = constraint_file.read_text(encoding='utf8')
|
||||
|
||||
versions = {}
|
||||
for package, version in re.findall(VERSION_REGEX, constraint_file_text):
|
||||
versions[package] = version
|
||||
|
||||
return versions
|
||||
return {
|
||||
package: version
|
||||
for package, version in re.findall(VERSION_REGEX, constraint_file_text)
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize('python_version', ['2.7', '3.5', '3.6', '3.8'])
|
||||
@@ -91,7 +90,7 @@ def test_pinned_versions(tmp_path, python_version):
|
||||
build_environment[env_name] = constraint_versions[package]
|
||||
|
||||
cibw_environment_option = ' '.join(
|
||||
[f'{k}={v}' for k, v in build_environment.items()]
|
||||
f'{k}={v}' for k, v in build_environment.items()
|
||||
)
|
||||
|
||||
# build and test the wheels
|
||||
@@ -154,7 +153,7 @@ def test_dependency_constraints_file(tmp_path, python_version):
|
||||
build_environment[env_name] = version
|
||||
|
||||
cibw_environment_option = ' '.join(
|
||||
[f'{k}={v}' for k, v in build_environment.items()]
|
||||
f'{k}={v}' for k, v in build_environment.items()
|
||||
)
|
||||
|
||||
# build and test the wheels
|
||||
|
||||
Reference in New Issue
Block a user