Skip to content

Latest commit

 

History

History
130 lines (83 loc) · 3.18 KB

CONTRIBUTING.md

File metadata and controls

130 lines (83 loc) · 3.18 KB

Contributing

Setting up a development environment

  • Install development dependencies.

    python3 -m pip install -r requirements-dev.txt
    
  • Install pre-commit hooks.

    python3 -m pre_commit install
    

Running Pylint

Use Pylint to check for some types of errors.

./lint

To disable warnings, use:

./lint --disable=W

Running Black

Use Black to format code.

black gnomad

Running pydocstyle

Use pydocstyle to check that docstrings conform to PEP 257.

pydocstyle gnomad

Running tests

Run tests using pytest.

python -m pytest

Building documentation

See instructions in docs/README.md.

Publishing a release

https://packaging.python.org/guides/distributing-packages-using-setuptools/#packaging-your-project

  • Update version in setup.py and commit. Push changes to the master branch on GitHub or submit a pull request. The new version number should be based on changes since the last release.

    https://semver.org/

    https://packaging.python.org/guides/distributing-packages-using-setuptools/#semantic-versioning-preferred

  • Once the version has been updated in the master branch on GitHub, tag the release. The version tag should be applied to a commit on the master branch.

    The version number in the tag must match the version number in setup.py.

    git checkout master
    git pull
    
    git tag v<version>
    git push origin v<version>
    

    When a v<VERSION_NUMBER> tag is pushed to GitHub, an Actions workflow will automatically publish the tagged code to PyPI.

    New releases will automatically be posted in the #gnomad_notifications Slack channel (via the RSS Slack app).

  • A GitHub Release will be automatically created with release notes generated from pull requests.

    Check the Releases page to make sure the generated release notes look ok and edit them if necessary.

    If needed, to see commits since the last release, use:

    LAST_RELEASE_TAG=$(git tag --list --sort=-committerdate | head -n1)
    git log $LAST_RELEASE_TAG..
    

    Especially if there are many changes in the release, organize the changelog by type.

    See https://keepachangelog.com/en/1.0.0/#how for more information.

Manually publishing a release

  • Install tools.

    python -m pip install --upgrade setuptools wheel twine
    
  • Remove any old builds.

    rm -r ./dist
    
  • Build source distribution and wheel.

    python setup.py sdist bdist_wheel
    
  • Upload using twine.

    twine upload dist/*