Add conda build support
-
Added tests for changed code (n/a) -
Changes have passed CI -
Updated documentation for changed code (n/a) -
Updated version number (n/a) -
Updated meta-data (optional) (n/a)
I have added a Conda build recipe that allows the module to be built as an Anaconda package so that it can be installed directly with conda (since users have to create a conda environment in any case to install assimulo). This avoids mixing of pip
and conda
in the same environment.
If you would like to test it you could install my build into a fresh conda environment:
$ conda create -n mbtest python=3.7 # or python=3.6 (there is no python-libsbml Anaconda package for Python 3.8)
$ conda activate mbtest
$ conda install -c jmrohwer -c sbmlteam modelbase # -c sbmlteam required for python-libsbml, could also use -c bioconda (but not on Win)
To build with conda, inside your conda base environment:
$ conda install conda-build
$ cd <modelbase-src-dir>/packaging/conda
$ conda build .
$ anaconda upload <path-to-your-built-package> # after successful build, refer to build output
Other changes:
- Moved the
tests
directory as a subdirectory ofmodelbase
. This avoids cluttering the top-levelsite-packages
directory withtests
, since on its owntests
is not really a Python module. The CI tests still pass, as do the tests during the conda build (refer tometa.yaml
). These changes are in a separate commit so you can easily undo them if you don't want them.
To test when installed as a proper package, not in development mode, you could do:
$ cd <...>/site-packages/modelbase/tests
$ python -m unittest