Local Development

Checklist before publishing the package

  • Install pip install twine --dev
  • Make sure to update REQUIRED and EXTRAS lists in setup.py based on what's required by the library and what's required only for development. To ease local development, we will continue to maintain requirements.txt which includes every package.
  • Bump the version constant VERSION in setup.py
  • Commit the version bump change in setup.py (It is okay to not push, but commit is required)
  • Run setup test
    • python setup.py test
  • Publish package to PyPI
    • python setup.py upload
  • Enter PyPi credentials (note: you must be added to the project as a maintainer)

Generating Documentation

  • Generate on local for testing

    • portray server
  • Publishing the docs to https://localcoinswap.github.io/substrate-utils/

    • Please make sure the docs look as expected on local
    • Checkout to docs-branch branch
      • git checkout docs-branch
      • Only difference between master and docs-branch is that the site/ is not gitignored in docs-branch
    • Merge master into docs-branch
      • git merge master
      • Add the merge commit
    • Run portray as_html --overwrite (Read portray docs to know more)
    • That will generate html docs in site/ directory, it will overwrite the existing content
    • Commit the changes and push to docs-branch
      • git add site/
      • git commit
      • git push origin docs-branch --force
    • Run this nested git command to publish the changes in gh-pages branch (which serves the static html)

    git push origin `git subtree split --prefix site docs-branch`:gh-pages --force