-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
- Loading branch information
1 parent
b00799f
commit 3fb569a
Showing
2 changed files
with
120 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,17 +148,17 @@ def test_rewrite_requires(which, input_tpl, expected, tmpdir): | |
'name = pkg\n', | ||
'[metadata]\n' | ||
'name = pkg\n' | ||
'version = 1.0\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n' | ||
'\n' | ||
'[bdist_wheel]\n' | ||
'universal = true\n', | ||
'name = pkg\n' | ||
'version = 1.0\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n' | ||
'\n' | ||
'[bdist_wheel]\n' | ||
'universal = true\n', | ||
id='orders fields and sections', | ||
), | ||
|
@@ -174,20 +174,20 @@ def test_rewrite_requires(which, input_tpl, expected, tmpdir): | |
'where = src\n', | ||
'[metadata]\n' | ||
'name = pkg\n' | ||
'version = 1.0\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n' | ||
'\n' | ||
'[options.packages.find]\n' | ||
'where = src\n' | ||
'\n' | ||
'[bdist_wheel]\n' | ||
'universal = true\n', | ||
'name = pkg\n' | ||
'version = 1.0\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n' | ||
'\n' | ||
'[options.packages.find]\n' | ||
'where = src\n' | ||
'\n' | ||
'[bdist_wheel]\n' | ||
'universal = true\n', | ||
id='orders sections (options.packages.find)', | ||
), | ||
|
@@ -217,16 +217,16 @@ def test_rewrite_requires(which, input_tpl, expected, tmpdir): | |
' License :: OSI Approved :: MIT License\n' | ||
' Programming Language :: Python :: 3 :: Only\n', | ||
'[metadata]\n' | ||
'name = pkg\n' | ||
'version = 1.0\n' | ||
'classifiers =\n' | ||
' License :: OSI Approved :: MIT License\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n', | ||
'[metadata]\n' | ||
'name = pkg\n' | ||
'version = 1.0\n' | ||
'classifiers =\n' | ||
' License :: OSI Approved :: MIT License\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n', | ||
id='sorts classifiers', | ||
), | ||
|
@@ -240,18 +240,18 @@ def test_rewrite_requires(which, input_tpl, expected, tmpdir): | |
'author = john\n', | ||
'[metadata]\n' | ||
'name = pkg\n' | ||
'author = john\n' | ||
'author_email = [email protected]\n' | ||
'maintainer = jane\n' | ||
'maintainer_email = [email protected]\n' | ||
'license = foo\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n', | ||
'name = pkg\n' | ||
'author = john\n' | ||
'author_email = [email protected]\n' | ||
'maintainer = jane\n' | ||
'maintainer_email = [email protected]\n' | ||
'license = foo\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n', | ||
id='orders authors and maintainers', | ||
), | ||
|
@@ -262,15 +262,15 @@ def test_rewrite_requires(which, input_tpl, expected, tmpdir): | |
'maintainer-email = [email protected]\n', | ||
'[metadata]\n' | ||
'name = pkg\n' | ||
'author_email = [email protected]\n' | ||
'maintainer_email = [email protected]\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n', | ||
'name = pkg\n' | ||
'author_email = [email protected]\n' | ||
'maintainer_email = [email protected]\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n', | ||
id='normalize dashes to underscores in keys', | ||
), | ||
|
@@ -492,16 +492,13 @@ def test_license_does_not_set_when_licenses_matches(tmpdir): | |
'\n' \ | ||
'[options]\n' \ | ||
'python_requires = >=3.7\n' | ||
|
||
tmpdir.join('LICENSE').write('COPYRIGHT (C) 2019 ME') | ||
setup_cfg = tmpdir.join('setup.cfg') | ||
setup_cfg.write(s) | ||
|
||
assert not main((str(setup_cfg),)) | ||
|
||
|
||
|
||
|
||
|
||
def test_license_does_set_when_licenses_mismatches(tmpdir): | ||
tmpdir.join('LICENSE').write('COPYRIGHT (C) 2019 ME') | ||
|
@@ -521,11 +518,11 @@ def test_license_does_set_when_licenses_mismatches(tmpdir): | |
'version = 1.0\n' | ||
'license_file = LICENSE\n' | ||
'license_files = LICENSES\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'\n' | ||
'[options]\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n' | ||
) | ||
|
||
|
@@ -546,17 +543,17 @@ def test_rewrite_sets_license_type_and_classifier(tmpdir): | |
|
||
assert setup_cfg.read() == ( | ||
'[metadata]\n' | ||
'name = pkg\n' | ||
'version = 1.0\n' | ||
'license = MIT\n' | ||
'license_file = LICENSE\n' | ||
'classifiers =\n' | ||
' License :: OSI Approved :: MIT License\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n' | ||
'name = pkg\n' | ||
'version = 1.0\n' | ||
'license = MIT\n' | ||
'license_file = LICENSE\n' | ||
'classifiers =\n' | ||
' License :: OSI Approved :: MIT License\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n' | ||
) | ||
|
||
|
||
|
@@ -599,12 +596,12 @@ def test_rewrite_identifies_license(tmpdir): | |
'license = Zlib\n' | ||
'license_file = LICENSE\n' | ||
'classifiers =\n' | ||
' License :: OSI Approved :: zlib/libpng License\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n' | ||
' License :: OSI Approved :: zlib/libpng License\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n' | ||
) | ||
|
||
|
||
|
@@ -676,9 +673,9 @@ def test_strips_empty_options_and_sections(tmpdir, section, expected): | |
'[metadata]\n' | ||
'name = pkg\n' | ||
'version = 1.0\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
f'{section}', | ||
) | ||
|
||
|
@@ -687,9 +684,9 @@ def test_strips_empty_options_and_sections(tmpdir, section, expected): | |
'[metadata]\n' | ||
'name = pkg\n' | ||
'version = 1.0\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
f'{expected}' | ||
) | ||
|
||
|
@@ -772,20 +769,20 @@ def test_guess_python_requires_tox_ini_py310(tmpdir): | |
|
||
assert setup_cfg.read() == ( | ||
'[metadata]\n' | ||
'name = pkg\n' | ||
'version = 1.0\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
' Programming Language :: Python :: 3.7\n' | ||
' Programming Language :: Python :: 3.8\n' | ||
' Programming Language :: Python :: 3.9\n' | ||
' Programming Language :: Python :: 3.10\n' | ||
' Programming Language :: Python :: 3.11\n' | ||
' Programming Language :: Python :: Implementation :: CPython\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n' | ||
'name = pkg\n' | ||
'version = 1.0\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
' Programming Language :: Python :: 3.7\n' | ||
' Programming Language :: Python :: 3.8\n' | ||
' Programming Language :: Python :: 3.9\n' | ||
' Programming Language :: Python :: 3.10\n' | ||
' Programming Language :: Python :: 3.11\n' | ||
' Programming Language :: Python :: Implementation :: CPython\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n' | ||
) | ||
|
||
|
||
|
@@ -800,19 +797,19 @@ def test_guess_python_requires_ignores_insufficient_version_envs(tmpdir): | |
' Programming Language :: Python :: Implementation :: CPython\n', | ||
) | ||
|
||
assert main((str(setup_cfg), '--max-py-version=3.7',)) | ||
assert main((str(setup_cfg), '--max-py-version=3.7')) | ||
|
||
assert setup_cfg.read() == ( | ||
'[metadata]\n' | ||
'name = pkg\n' | ||
'version = 1.0\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
' Programming Language :: Python :: Implementation :: CPython\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
' Programming Language :: Python :: Implementation :: CPython\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n' | ||
) | ||
|
||
|
||
|
@@ -1049,12 +1046,12 @@ def test_rewrite_extras(tmpdir): | |
setup_cfg_content = ( | ||
'[metadata]\n' | ||
'name = test\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n' | ||
'[options.extras_require]\n' | ||
'dev =\n' | ||
' pytest\n' | ||
|
@@ -1072,12 +1069,12 @@ def test_rewrite_extras(tmpdir): | |
assert setup_cfg.read() == ( | ||
'[metadata]\n' | ||
'name = test\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n' | ||
'classifiers =\n' | ||
' Programming Language :: Python :: 3\n' | ||
' Programming Language :: Python :: 3 :: Only\n' | ||
'\n' | ||
'[options]\n' | ||
'python_requires = >=3.7\n' | ||
'\n' | ||
'[options.extras_require]\n' | ||
'ci =\n' | ||
|
@@ -1281,10 +1278,10 @@ def test_leaves_casing_of_unrelated_settings(tmpdir): | |
'python_requires = >=3.7\n' | ||
'\n' | ||
'[tool:pytest]\n' | ||
'DJANGO_SETTINGS_MODULE = test.test\n' | ||
'DJANGO_SETTINGS_MODULE = test.test\n', | ||
) | ||
|
||
assert not main((str(setup_cfg),)) | ||
assert not main((str(setup_cfg),)) | ||
|
||
|
||
def test_natural_sort(): | ||
|