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:
Henry Schreiner
2021-03-24 23:23:27 +01:00
committed by GitHub
co-authored by Yannick Jadoul Joe Rickerby
parent 96aa38b56c
commit 5cbe3e2254
12 changed files with 35 additions and 47 deletions
+6 -7
View File
@@ -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