Skip to content

setup: disable test command #4107

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

Merged

Conversation

bastimeyer
Copy link
Member

See #4102
Let's keep that issue thread open though, so that package maintainers who are running tests incorrectly in their package configs can see it.

  1. Is there a better way to disable this other than checking "test" in sys.argv?
  2. Is the error message worded well enough? We could also add links to the respective docs for example.

@gravyboat
Copy link
Member

  1. I don't think there is, this seems pretty good for forcing people's hand.
  2. I think the error message is worded well, maybe a doc link, and maybe a link to the Streamlink issue? I don't know if that's going too far.

@bastimeyer
Copy link
Member Author

I think the message is fine without any links.


I already mentioned earlier that I want to move most of the metadata defined imperatively in setup.py into the declarative setup.cfg format and clean up everything. The package metadata is a bit messy right now and hasn't been touched in ages. There were a lot of changes in the past years in regards to python packaging standards, and we should stay up2date. It's a bit difficult though following and understanding all the changes here while having the supported python versions, dependencies and downstream system packages in mind.

After looking at the setuptools keywords docs, I found the following about the test_suite keyword, which is relevant for this PR/issue:

test_suite
A string naming a unittest.TestCase subclass (or a package or module containing one or more of them, or a method of such a subclass), or naming a function that can be called with no arguments and returns a unittest.TestSuite. If the named suite is a module, and the module has an additional_tests() function, it is called and the results are added to the tests to be run. If the named suite is a package, any submodules and subpackages are recursively added to the overall test suite.

Specifying this argument enables use of the test command to run the specified test suite, e.g. via setup.py test. See the section on the test command below for more details.

New in 41.5.0: Deprecated the test command.

Should we remove it in this PR, or should we do this when cleaning up the package metadata? Removing it instead of adding the sys.exit call doesn't have any effect though, despite what the documentation is saying. Either way, it should be removed at some point.

@gravyboat
Copy link
Member

Should we remove it in this PR, or should we do this when cleaning up the package metadata?

Doing it in the clean up PR makes more sense. I think this is fine so I'm going to merge it in now.

@gravyboat gravyboat merged commit 06eba3b into streamlink:master Oct 20, 2021
@bastimeyer bastimeyer deleted the tests/disable-setuptools-test-command branch October 20, 2021 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants