-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[CI] Run tests against pre-built/installed version of setuptools
#3049
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
base: main
Are you sure you want to change the base?
Conversation
Pytest automatically load `conftest.py` files from directory tests, so it is not necessary to use an in-tree pytest plugin for that. This issue was considered a blocker in pypa#2318.
… if modules are imported before the tested code runs.
Make tests work even if they are unaware what is exactly the folder organisation in the project (i.e. use relative imports and rely more on __name__)
|
@webknjaz I could not find a solution for the test coverage using this approach... Even if I move the source directories to a folder that is not automatically added to the PYTHONPATH (instead of removing it) and maintain 2 separated config files (one for running tox with Do you have any suggestion about that? Edit: it seems that Edit: I solved it using path fixing. The previous |
7ed4cac to
4b5baaa
Compare
| default: | ||
| threshold: 0.5% | ||
| fixes: | ||
| - "src/::" # reduce root e.g., "src/setuptools/" => "setuptools/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the right solution. This setting seems to change how files on Codecov are mapped to GH.
| --installpkg '${{ needs.prepare.outputs.wheel-distribution }}' | ||
| -- --cov-report xml --cov-report term --cov-config .coveragerc.ci | ||
| - name: Publish coverage | ||
| uses: codecov/codecov-action@v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already deprecated, v3 should be used instead.
| uses: codecov/codecov-action@v1 | ||
| with: | ||
| flags: >- # Mark which lines are covered by which envs | ||
| cygwin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be comma-separated
| cygwin | |
| cygwin, |
| author_email = distutils-sig@python.org | ||
| description = Easily download, build, install, upgrade, and uninstall Python packages | ||
| long_description = file:README.rst | ||
| long_description_content_type = text/x-rst |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be great to extract such things into separate PRs.
a85759c to
93ce5a0
Compare
|
This feels like a lot of customization that will conflict with changes upstream (skeleton). I'd feel better about the approach if it could be implemented as an extension (not alteration) of what the skeleton does (even if the skeleton needs to be updated to provide a hook for such behavior). Perhaps it could be implemented as a separate CI workflow. Or maybe this behavior should be implemented in the skeleton and apply to all projects downstream. I'm concerned the added complication will outweigh the benefits. |
Motivation
This an attempt to implement the approach described in #3015 (review), i.e. run a CI pipeline that tests the pre-built/installed version of the package.
Summary of changes
mvthem before running the test suite (see #2318 (comment)).setuptools/tests/{fixtures.py => conftest.py}usedevelop=True.{setuptools,pkg_resources}/testsare moved to a top level directory and the{setuptools,pkg_resources}folders are removed.pytest-perffor PyPy (see #3015 (comment))Closes #2318
Pull Request Checklist
changelog.d/.(See documentation for details)