-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement tests with tox-conda (#92)
* added configuration for tox-conda * run tests with tox-conda * data file locations and test skips * make tests run in workflow * add pytest-cov * removed codestyle env typo * added codestyle to envlist * tox-conda version for codestyle * added python version to codestyle workflow * codestyle on 3.10 specifically * flake8 fixes * do not install everything for codestyle * added temp fix for flaky sklearn install * modified installation and testing instructions * update action versions * remove inapplicable parts of astropy cookie cutter, mention conda env in INSTALL.rst * add make to conda deps
- Loading branch information
1 parent
97ce5d7
commit 7f6ec6a
Showing
15 changed files
with
369 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
numpy | ||
scipy | ||
pandas | ||
scikit-learn | ||
pyyaml | ||
py-bobyqa | ||
packaging | ||
tqdm | ||
portalocker | ||
dill | ||
fuzzywuzzy | ||
astropy | ||
camb | ||
cosmopower | ||
getdist | ||
cobaya | ||
pyccl | ||
sacc | ||
fgspectra @ git+https://github.com/simonsobs/fgspectra@act_sz_x_cib#egg=fgspectra | ||
mflike @ git+https://github.com/simonsobs/lat_mflike@master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,41 @@ | ||
# example cobaya-compliant SO likelihood package; | ||
# adapted from github.com/cobayasampler/example_external_likelihood | ||
#!/usr/bin/env python | ||
# Licensed under a 3-clause BSD style license - see LICENSE.rst | ||
|
||
# NOTE: The configuration for the package, including the name, version, and | ||
# other information are set in the setup.cfg file. | ||
|
||
import os | ||
import sys | ||
|
||
from setuptools import setup | ||
|
||
setup( | ||
name="soliket", | ||
version="0.0", | ||
description="SO Likelihoods & Theories", | ||
zip_safe=False, | ||
packages=["soliket", "soliket.tests", "soliket.clusters"], | ||
package_data={ | ||
"soliket": [ | ||
"*.yaml", | ||
"*.bibtex", | ||
# "data/simulated*/*.txt", | ||
"clusters/data/*", | ||
"clusters/data/selFn_equD56/*", | ||
"lensing/data/*.txt", | ||
] | ||
}, | ||
install_requires=[ | ||
"astropy", | ||
"scikit-learn", | ||
"cobaya", | ||
"sacc", | ||
"pyccl", | ||
"fgspectra @ git+https://github.com/simonsobs/fgspectra@act_sz_x_cib#egg=fgspectra", # noqa E501 | ||
"mflike @ git+https://github.com/simonsobs/lat_mflike@master" | ||
], | ||
extras_requires=[ | ||
"cosmopower" | ||
], | ||
test_suite="soliket.tests", | ||
include_package_data=True, | ||
) | ||
|
||
# First provide helpful messages if contributors try and run legacy commands | ||
# for tests or docs. | ||
|
||
TEST_HELP = """ | ||
Note: running tests is no longer done using 'python setup.py test'. Instead | ||
you will need to run: | ||
tox -e test | ||
If you don't already have tox-conda installed, you can install it with: | ||
pip install tox-conda | ||
If you only want to run part of the test suite, you can also pass pytest | ||
args through directly following a '--': | ||
tox -e test -- -k name_of_my_test | ||
For more information, see: | ||
https://github.com/simonsobs/SOLikeT#running-tests | ||
""" | ||
|
||
VERSION_TEMPLATE = """ | ||
# Note that we need to fall back to the hard-coded version if either | ||
# setuptools_scm can't be imported or setuptools_scm can't determine the | ||
# version, so we catch the generic 'Exception'. | ||
try: | ||
from setuptools_scm import get_version | ||
version = get_version(root='..', relative_to=__file__) | ||
except Exception: | ||
version = '{version}' | ||
""".lstrip() | ||
|
||
setup(use_scm_version={'write_to': os.path.join('.', 'version.py'), | ||
'write_to_template': VERSION_TEMPLATE}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: soliket-tests | ||
channels: | ||
- conda-forge | ||
- nodefaults | ||
dependencies: | ||
- python>=3.7,<3.11 | ||
- pip | ||
- pytest-cov | ||
- compilers | ||
- make | ||
- cmake | ||
- swig | ||
- gsl | ||
- fftw | ||
- cython | ||
- mpi4py | ||
- pip: | ||
- -r requirements.txt |
Oops, something went wrong.