-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorg README, improve findability of documentation, separate dev docs (…
- Loading branch information
1 parent
9d95ec7
commit 484eb5e
Showing
2 changed files
with
160 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
# Development docs | ||
|
||
## Getting started | ||
|
||
Thank you for helping us to improve Nextstrain! | ||
|
||
##### [To get started, please see the contributing guide for useful information about how to pick an issue, submit your contributions, and so on.](https://github.com/nextstrain/.github/blob/master/CONTRIBUTING.md) | ||
|
||
|
||
This project strictly adheres to the [Contributor Covenant Code of Conduct](https://github.com/nextstrain/.github/blob/master/CODE_OF_CONDUCT.md). | ||
|
||
Please see the [project board](https://github.com/orgs/nextstrain/projects/6) for currently available issues. | ||
|
||
## Contributing code | ||
We currently target compatibility with Python 3.4 and higher. This may be | ||
increased to in the future. | ||
|
||
Versions for this project from 3.0.0 onwards aim to follow the [Semantic | ||
Versioning rules](https://semver.org). | ||
|
||
### Running with local changes | ||
|
||
From within a clone of the git repository you can run `./bin/augur` to test your local changes without installing them. | ||
(Note that `./bin/augur` is not the script that gets installed by pip as `augur`; that script is generated by the `entry_points` configuration in `setup.py`.) | ||
|
||
You can also install augur from source as an "editable" package so that your global `augur` command always uses your local source code copy: | ||
|
||
pip install -e .[dev] | ||
|
||
This is not recommended if you want to be able to compare output from a stable version of augur to a development version (e.g. comparing output of `augur` installed with pip and `./bin/augur` from your local source code). | ||
|
||
### Testing | ||
|
||
Run doctests and unit tests for augur from Python 3 with pytest from the top-level of the augur repository. | ||
|
||
pytest -c pytest.python3.ini | ||
|
||
Or, run tests for augur from Python 2. | ||
|
||
pytest -c pytest.python2.ini | ||
|
||
As tests run on the development code in the augur repository, your environment should not have an existing augur installation that could cause a conflict in pytest. | ||
|
||
### Releasing | ||
|
||
New releases are tagged in git using an "annotated" tag. If the git option | ||
`user.signingKey` is set, the tag will also be [signed][]. Signed tags are | ||
preferred, but it can be hard to setup GPG correctly. The `release` branch | ||
should always point to the latest release tag. Source and wheel (binary) | ||
distributions are uploaded to [the nextstrain-augur project on | ||
PyPi](https://pypi.org/project/nextstrain-augur). | ||
|
||
There is a `./devel/release` script which will prepare a new release from your | ||
local repository. It ends with instructions for you on how to push the release | ||
commit/tag/branch and how to upload the built distributions to PyPi. You'll | ||
need [a PyPi account][] and [twine][] installed to do the latter. | ||
|
||
[signed]: https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work | ||
[a PyPi account]: https://pypi.org/account/register/ | ||
[twine]: https://pypi.org/project/twine | ||
|
||
### Travis CI | ||
|
||
Branches and PRs are tested by Travis CI jobs configured in `.travis.yml`. | ||
|
||
New releases, via pushes to the `release` branch, trigger a new [docker-base][] | ||
build to keep the Docker image up-to-date. | ||
|
||
[docker-base]: https://github.com/nextstrain/docker-base | ||
|
||
|
||
## Contributing documentation | ||
|
||
[Documentation](https://nextstrain-augur.readthedocs.io) is built using [Sphinx](http://sphinx-doc.org/) and hosted on [Read The Docs](https://readthedocs.org/). | ||
Versions of the documentation for each augur release and git branch are available and preserved. | ||
Read The Docs is updated automatically from commits and releases on GitHub. | ||
|
||
Documentation is mostly written as [reStructuredText](http://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html) (.rst) files, but they can also be Markdown (.md) files. | ||
There are advantages to both formats: | ||
* reStructuredText enables python-generated text to fill your documentation as in the auto-importing of modules or usage of plugins like `sphinx-argparse` (see below). | ||
* Markdown is more intuitive to write and is widely used outside of python development. | ||
* If you don't need autogeneration of help documentaiton, then you may want to stick with writing Markdown. | ||
|
||
|
||
Sphinx, coupled with reStructuredText, can be tricky to learn. | ||
Here's a [subset of reStructuredText worth committing to memory](https://simonwillison.net/2018/Aug/25/restructuredtext/) to help you get started writing these files. | ||
|
||
|
||
Many Sphinx reStructuredText files contain a [directive](http://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html) to add relations between single files in the documentation known as a Table of Contents Tree ([TOC Tree](https://documentation.help/Sphinx/toctree.html)). | ||
|
||
Human-readable augur and augur subcommand documentation is written using a Sphinx extension called [sphinx-argparse](https://sphinx-argparse.readthedocs.io/en/latest/index.html). | ||
|
||
|
||
### Folder structure | ||
|
||
The documentation source-files are located in `./docs`, with `./docs/index.rst` being the main entry point. | ||
Each subsection of the documentation is a subdirectory inside `./docs`. | ||
For instance, the tutorials are all found in `./docs/tutorials` and are included in the documentation website via the directive in `./docs/index.rst`. | ||
|
||
|
||
### Building documentation | ||
|
||
Building the documentation locally is useful to test changes. | ||
First, make sure you have the development dependencies of augur installed: | ||
|
||
pip install -e .[dev] | ||
|
||
(This installs packages listed in the `dev` section of `extras_require` in _setup.py_, in addition to any normal augur dependencies as necessary.) | ||
|
||
|
||
Then build the HTML output format by running: | ||
|
||
make -C docs html | ||
|
||
You can see other available formats by running: | ||
|
||
make -C docs help | ||
|
||
To update the API documentation after adding or removing an augur submodule, autogenerate a new API file as follows. | ||
|
||
sphinx-apidoc -T -f -MeT -o docs/api augur | ||
|
||
Sphinx caches built documentation by default, which is generally great, but can cause the sidebar of pages to be stale. You can clean out the cache with: | ||
|
||
make -C docs clean | ||
|
||
To view the generated documentation in your browser, Mac users should run: | ||
|
||
open docs/_build/html/index.html | ||
|
||
Linux users can view the docs by running: | ||
|
||
xdg-open docs/_build/html/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters