|
| 1 | +CLEX CMS Utility Library |
| 2 | +======================== |
| 3 | + |
| 4 | +.. image:: https://img.shields.io/readthedocs/coecms-util/stable.svg |
| 5 | + :target: https://coecms-util.readthedocs.io |
| 6 | +.. image:: https://img.shields.io/circleci/project/github/coecms/coecms-util.svg |
| 7 | + :target: https://circleci.com/gh/coecms/coecms-util/tree/master |
| 8 | +.. image:: https://img.shields.io/codecov/c/github/coecms/coecms-util.svg |
| 9 | + :target: https://codecov.io/gh/coecms/coecms-util |
| 10 | +.. image:: https://img.shields.io/codacy/grade/3706e7a283fd439fa8b8d2f707f814e4.svg |
| 11 | + :target: https://www.codacy.com/app/ScottWales/coecms-util |
| 12 | +.. image:: https://img.shields.io/conda/v/coecms/coecms-util.svg |
| 13 | + :target: https://anaconda.org/coecms/coecms-util |
| 14 | + |
| 15 | +Development |
| 16 | +----------- |
| 17 | + |
| 18 | +To add to the repository, first create your own fork on Github at https://github.com/coecms/coecms-util/fork, then download new forked repository (either to Raijin or your own computer) |
| 19 | + |
| 20 | +Create and activate a new conda environment so you can work on the library without affecting your other environments, then install the library in development mode using ``pip``:: |
| 21 | + |
| 22 | + # # On Raijin/VDI only: |
| 23 | + # module use /g/data3/hh5/public/modules |
| 24 | + # module load conda |
| 25 | + |
| 26 | + # This creates an environment named 'coecms' |
| 27 | + conda env create -f conda/dev-environment.yml |
| 28 | + |
| 29 | + conda activate coecms |
| 30 | + |
| 31 | + # '-e' installs in editable mode |
| 32 | + pip install -e . |
| 33 | + |
| 34 | +You can then run the tests to confirm everything is working correctly using:: |
| 35 | + |
| 36 | + py.test |
| 37 | + |
| 38 | +Making Changes |
| 39 | +-------------- |
| 40 | + |
| 41 | +Changes need to be done in a new branch as a pull request:: |
| 42 | + |
| 43 | + git checkout -b my-branch |
| 44 | + |
| 45 | + # Make changes... |
| 46 | + |
| 47 | + git push --set-upstream origin my-branch |
| 48 | + |
| 49 | +Then make a pull request at https://github.com/coecms/coecms-util/pull/new |
| 50 | + |
| 51 | +Please make sure code changes include tests and documentation |
| 52 | + |
| 53 | +Changes must be reviewed by someone in the CMS team before they are committed to master |
| 54 | + |
| 55 | +Adding Dependencies |
| 56 | +------------------- |
| 57 | + |
| 58 | +To add a dependency, you need to edit two files: |
| 59 | + |
| 60 | +* conda/meta.yaml: This has the conda package names of dependencies. They might not be the same as the actual Python library names. This is used by `conda build` to create the conda package. Add dependencies to the ``requirements: run:`` list. |
| 61 | + |
| 62 | +* setup.py: This has the Python name of dependencies. This is used if you `pip install` the package locally for testing. Add dependencies to the ``install_requires`` list. |
| 63 | + |
| 64 | +Creating new versions |
| 65 | +--------------------- |
| 66 | + |
| 67 | +To create a new version of the library, use the Github interface at https://github.com/coecms/coecms-util/releases/new |
| 68 | + |
| 69 | +Versions should be named like ``v1.2.3``, using `semantic versioning <https://semver.org/>`_. |
| 70 | + |
| 71 | +The Python and Conda packages will automatically set their version based on the tag that Github creates (you may need to ``git fetch`` the tag first) |
| 72 | + |
| 73 | +To upload a new version to conda, check out the tag (e.g. ``git checkout v1.2.3``) then run:: |
| 74 | + |
| 75 | + conda build --user coecms --python=3.7 ./conda |
| 76 | + |
| 77 | +setting the python version as desired (you will need to be a member of the coecms group on https://anaconda.org to do this) |
0 commit comments