Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a warning for the deprecated test_suit #74

Merged
merged 1 commit into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ jobs:
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install package
run: pip install -e .
run: pip install -e .[test]
- name: Run tests
run: python -bb -X dev -W ignore::UserWarning:setuptools.dist -m unittest -v pyroma.tests
2 changes: 1 addition & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changelog
3.2.2 (unreleased)
------------------

- Nothing changed yet.
- Add a deprecation for `test_suite`


3.2.1 (2022-03-27)
Expand Down
11 changes: 11 additions & 0 deletions pyroma/ratings.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,16 @@ def message(self):
return "You should have three or more owners of the project on PyPI."


class TestSuitDeprecation(BaseTest):
weight = 50

def test(self, data):
return "test_suite" not in data
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, this check doesn't actually work, since as mentioned on #72 , this is a Setuptools-specific option (under the [options] section in setup.cfg, or the [tool.setuptools] table in pyproject.toml), not anything in the standardized core metadata like everything else you check here.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, right, it only works when the metadata is fetched by patching setuptools. So it's useful in Pyroma 3 (which this was) but for Pyroma 4 it's pointless, true. So I can already remove it again. :-)


def message(self):
return "The `setup.py test` command and accompanying `test_suit` field has been deprecated."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why this typo is everywhere, but the term and corresponding option is test_suite, not test_suit 😆

Copy link
Owner Author

@regebro regebro Mar 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

facepalm

Edit: phew I only made that mistake there. So I won't fix it, as the test is pointless in the 4x branch anyway. :-)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phew I only made that mistake there. It gets to stay, as the test in pointless in the 4x branch...



ALL_TESTS = [
Name(),
Version(),
Expand All @@ -411,6 +421,7 @@ def message(self):
ValidREST(),
BusFactor(),
DevStatusClassifier(),
TestSuitDeprecation(),
]


Expand Down
1 change: 0 additions & 1 deletion pyroma/testdata/complete/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@
tests_require=["six"],
setup_requires=["setuptools"],
zip_safe=True,
test_suite="complete",
)
Binary file modified pyroma/testdata/distributions/complete-1.0.dev1.tar
Binary file not shown.
Binary file modified pyroma/testdata/distributions/complete-1.0.dev1.tar.bz2
Binary file not shown.
Binary file modified pyroma/testdata/distributions/complete-1.0.dev1.tar.gz
Binary file not shown.
Binary file modified pyroma/testdata/distributions/complete-1.0.dev1.zip
Binary file not shown.
1 change: 0 additions & 1 deletion pyroma/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"project_urls": {"Source Code": "https://github.com/regebro/pyroma"},
"license": "MIT",
"zip_safe": True,
"test_suite": "complete",
}


Expand Down
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ include_package_data = True
packages = find:
package_dir =
= .
test_suite = pyroma.tests
install_requires =
setuptools
docutils
Expand All @@ -44,6 +43,7 @@ where = .
test =
pytest
pytest-cov
setuptools>=60

[options.entry_points]
console_scripts =
Expand All @@ -66,4 +66,3 @@ testpaths =
ignore =
.pre-commit-hooks.yaml
fetch_classifiers.py