Skip to content

Contributing

Ashley Smith edited this page Apr 27, 2022 · 12 revisions

Development environment

(If using mamba/conda, could use e.g. mamba create --name vc_dev python=3.10)

git clone https://github.com/ESA-VirES/VirES-Python-Client
pip install -e VirES-Python-Client/[dev]

(beware that this will install nox, which you may not want)

Documentation

  • docs are generated by sphinx on readthedocs from .rst files
  • API documentation is automatically built from the docstrings
  • Use Google-style docstrings: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html
    • (these are processed by the sphinx ext module napoleon)
  • Check docs locally with one of:
    • cd docs; make clean; make html; firefox _build/html/index.html & (if you have sphinx installed and other deps in pyproject.toml - which can be obtained with pip install -e .[docs])
    • Using nox: nox -s docs

Testing

  • Use pytest framework
  • ... todo

Packaging & distribution

Currently on PyPI. I would also like to distribute on conda (this will require putting cdflib on conda too?) - checkout https://github.com/conda-incubator/grayskull to create the recipe.

Instructions for pushing a new release (only I can do the pyPI at the moment):

  1. Test locally...
    • Check tests with pytest and docs as above
    • Check that correct version number is in src/viresclient/__init__.py
  2. Open PR from feature branch to staging / to both staging and master if hotfix
  3. Go to https://github.com/ESA-VirES/VirES-Python-Client/releases
    • Tag with e.g. v0.4.0 and make release
    • (In future this will trigger the flit publish)
  4. Build package and publish it to pypi:
    • Old:
      • build: python setup.py sdist bdist_wheel
      • upload: twine upload dist/*
    • New:
      • In an isolated, untouched repo: flit publish
  5. Increment version number in __init__.py so that new commits go on the next version number
    • Append -alpha to the version number (e.g. 0.5.0-alpha) to indicate pre-release
  6. Check zenodo entry: https://doi.org/10.5281/zenodo.2554162
Clone this wiki locally