-
Notifications
You must be signed in to change notification settings - Fork 37
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 conda dev env and pytest settings in setup.cfg
#784
Conversation
- These tests are written using Python Unittest, not pytest.
Hey @lee1043 @acordonez, this PR is ready for review. You can follow the usage commands to test the changes. |
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.
Thanks @tomvothecoder. Success with both usage commands. My pytest results look just like yours.
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 wonder cdat_info
and MV
should be included in the dev.yml, or they are implicitly installed through cdms2
.
@lee1043 which metrics use MV2? Since I've got the environment set up I can try running them and see if they work. |
Both packages are installed through An easy way to test: conda activate pcmdi_metrics_dev
python
>>> import MV2
>>> import cdat_info Since |
Actually |
I think most of metrics use MV2: mean climate, modes of variability, mjo, monsoon_sperber and monsoon_wang. But good to learn that installing cdms2 implicitly installs MV2 as well. |
@tomvothecoder can this eof package added to the dependency list? it's been used as a part of the modes of variability metric. It looks like the eofs is on conda-forge: https://anaconda.org/conda-forge/eofs |
@lee1043 and @acordonez Thanks for the review, I will go ahead and merge this PR. |
Nevermind, I can't merge since the CircleCI checks are required (and I'm not sure if I have admin privilege to merge). Those two checks will need to be disabled in the repo settings. |
@tomvothecoder thanks for this PR. I will disable circle ci requirement and merge the PR. |
Related to #774 and #776 (task 4 Add local conda development environment and task 5 Add unit testing infrastructure).
Adds the conda development env for use in local development and in the GH Actions CI/CD workflow(s).
conda env create -f conda-env/dev.yml
conda-env/dev.yml
reflect those listed inmeta.yaml.in
from here: https://github.com/PCMDI/pcmdi_metrics/blob/8993d51c23cf8dd7abcc418acc5bbc8ef90fe645/recipe/meta.yaml.inAdds
pytest
andpytest-cov
(code coverage report tool).pytest
pytest-cov
coverage reports are outputted to the console. The reports can also be found undertests_coverage_reports/htmlcov/index.html
ortests_coverage_reports/coverage.xml
(this one is used for uploading to the Codecov service if desired).setup.cfg
.Move existing tests to
tests/deprecated
and ignore withpytest
.