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
don't install tests and benchmarks #1003
don't install tests and benchmarks #1003
Conversation
Codecov ReportBase: 98.18% // Head: 28.60% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1003 +/- ##
===========================================
- Coverage 98.18% 28.60% -69.58%
===========================================
Files 20 10 -10
Lines 3466 1552 -1914
Branches 570 392 -178
===========================================
- Hits 3403 444 -2959
- Misses 47 1099 +1052
+ Partials 16 9 -7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Hi, thanks! An argument could possibly be made for the benchmarks, so probably happy to exclude those, but generally tests should be installed with (any) package, as users may be interested in running the tests against an installed version. |
I don't really agree on that. Running tests of a library that's installed as a dependency somewhere down the stack isn't something that's commonly done by users. If a user wants to do so, they can still choose to include those files, but defaulting to having them not included does make more sense IMO. Installing the tests is not a common practice, and also not the default for the tooling that you're using. |
The test coverage delta is still something that I hadn't forseen and is something that means that this can't be merged here as is. |
Sure it is. See e.g. http://pythonchb.github.io/PythonTopics/where_to_put_tests.html which is just the first Google result, but there have essentially been two camps here for ~10 years at least, and plenty of packages do both.
Hatch is a packaging tool, it doesn't really have an opinion on this, though its author of course has to make a choice one way or the other for hatch itself as a package with tests. Of course if you're packaging for a distro you're welcome to prune the tests if you feel you'd like to, since I agree if some end user gets jsonschema installed they're unlikely to care about it or its tests, but for normal uses (developers who've installed jsonschema while developing some Python package) this is both common and a good practice in my opinion -- we're talking tiny files-- so I'm going to thank you for the PR but decline. |
jsonschema
currently installed the wholejsonschema
subfolder of thisrepository, which includes tests and benchmarks. From my testing, those don't
need to be installed, so here's a patch to not install them.
📚 Documentation preview 📚: https://python-jsonschema--1003.org.readthedocs.build/en/1003/