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
CI: Use pip and setuptools to install pycalphad instead of Anaconda #331
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #331 +/- ##
===========================================
- Coverage 87.34% 84.52% -2.83%
===========================================
Files 46 46
Lines 4521 4524 +3
===========================================
- Hits 3949 3824 -125
- Misses 572 700 +128
Continue to review full report at Codecov.
|
|
Switching to testing the installed package is breaking coverage. Need to check whether pytest-cov supports coverage of installed versions |
It doesn't look like it. We run a |
For coverage, the code getting covered are in Our options are 1) Pass the site package path to coveragecoverage has support for this in that we need to specify the However, the tricky aspect is that both these examples assume some kind of local virtual environment where the site packages directory can be found within the local directory. The way it's set up, it's installed to wherever on the machine (platform dependent) the site packages are installed. Since I don't think it's possible to be able to set that path for any machine from a global config file, we need to have some kind of local environment, so either a tool like Note that this method still allows for coverage to be run on the local 2) Test the local package instead of or in addition to the installed versionMaybe we just add another CI task specfically for coverage that uses a smaller build matrix and tests against the local version? We'd just need to decide which platforms and versions of Python to test. My preference is for option 1) and setting up a virtual environment using the built-in |
I think we can use |
I ended up going the virtual environment route and put the requiste coverage.py settings in pyproject.toml (also moved our pytest settings over from setup.cfg). Seems like we no longer cover Do we want to make a decision here on depending on |
I think depending on pytest and pytest-cov is fine. |
An alternative would be to use the extras feature to do something like |
Don't install in CI separately
The new minimizer (#329) allowed us to drop IPOPT as a solver. All our remaining package dependencies are pure Python or have wheels shipped on PyPI (specifically, SymEngine), so installing all our dependencies from pip is now possible.
This PR:
pycalphad.tests
package--import-mode=append
and--pyargs pycalphad
flags to ensure that we test the installed version of the package and not the local version in the working directory.I (accidentally) verified that we test the installed package because pytest didn't discover the tests until I packaged them in
setup.py
.Things to consider:
tox
to automate this process and make it easier to build and test the installed version locally. That is probably overengineering it - I don't think we've hit any issues yet to justify our need, but it is an alternative.