-
Notifications
You must be signed in to change notification settings - Fork 4
Documentation before the first release #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dgarciabriseno
merged 38 commits into
Helioviewer-Project:main
from
akash5100:documentation
Aug 3, 2022
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
2c1a6ba
docs before first release
akash5100 20f7531
Update docs/index.rst
akash5100 5ddf66e
Update docs/installation.rst
akash5100 9773641
Update docs/installation.rst
akash5100 d022b1a
Update docs/installation.rst
akash5100 b0d03f4
Update docs/installation.rst
akash5100 1265dbe
Update docs/installation.rst
akash5100 31e1b72
Update docs/installation.rst
akash5100 bc4424a
Update docs/installation.rst
akash5100 f510b41
Update docs/installation.rst
akash5100 96af191
Update docs/installation.rst
akash5100 a680778
Update docs/installation.rst
akash5100 2e237fc
add building docs guide
akash5100 51938d0
fix typos
akash5100 3e630cd
Update docs/index.rst
akash5100 09404f2
Update docs/guide.rst
akash5100 4cebc15
Update docs/installation.rst
akash5100 318abc8
Update docs/installation.rst
akash5100 468582e
Update docs/installation.rst
akash5100 14e0f2f
Update docs/installation.rst
akash5100 fb722b0
Update docs/installation.rst
akash5100 24facb9
Update docs/installation.rst
akash5100 8da27cb
Update docs/installation.rst
akash5100 2e0abe3
Update docs/installation.rst
akash5100 1f2bb62
Update docs/installation.rst
akash5100 a17ae19
Update docs/installation.rst
akash5100 d4a01b7
suggested changes
akash5100 9697099
Apply suggestions from code review
akash5100 3a9abd9
add dev guide rst
akash5100 c130990
fix merge conflict
akash5100 ae46c72
add testing guide
akash5100 845d8ce
Add new doc files to toctree
akash5100 2aced23
Apply suggestions from code review
akash5100 4890c88
Applying suggested changes
akash5100 9811925
Apply suggestions from code review
akash5100 2069b7c
Move building docs after testing
akash5100 035910f
refactor docs for contribution
akash5100 c3cdb2d
Merge branch 'main' into documentation
akash5100 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,97 @@ | ||
| .. _dev_guide: | ||
|
|
||
| ***************** | ||
| Developer's Guide | ||
| ***************** | ||
|
|
||
| Testing Guidelines | ||
| ------------------ | ||
|
|
||
| This section describes how to test the ``hvpy`` package. | ||
| The testing framework used by ``hvpy`` is the `pytest <https://docs.pytest.org/>`__ framework. | ||
|
|
||
| .. _running-tests: | ||
|
|
||
| Running Tests | ||
| ^^^^^^^^^^^^^ | ||
|
|
||
| There are currently two different ways to invoke ``hvpy`` tests. | ||
|
|
||
| ``tox`` | ||
| ======= | ||
|
|
||
| The most robust way to run the tests (which can also be the slowest) is to make use of `Tox <https://tox.readthedocs.io/en/latest/>`__, which is a general purpose tool for automating Python testing. | ||
| One of the benefits of ``tox`` is that it first creates a source distribution of the package being tested, and installs it into a new virtual environment, along with any dependencies that are declared in the package, before running the tests. | ||
| This can therefore catch issues related to undeclared package data, or missing dependencies. | ||
| Since we use tox to run many of the tests on continuous integration services, it can also be used in many cases to reproduce issues seen on those services. | ||
|
|
||
| To run the tests with ``tox``, first make sure that ``tox`` is installed:: | ||
|
|
||
| pip install tox | ||
|
|
||
| You can see a list of available test environments with:: | ||
|
|
||
| tox -l -v | ||
|
|
||
| which will also explain what each of them does. | ||
|
|
||
| You can also run checks or commands not directly related to tests - for instance:: | ||
|
|
||
| tox -e codestyle | ||
|
|
||
| will run checks on the code style using precommit hooks. | ||
|
|
||
| ``pytest`` | ||
| ========== | ||
|
|
||
| The test suite can also be run directly from the native ``pytest`` command, which is generally faster than using tox for iterative development. | ||
| In this case, it is important for developers to be aware that they must manually rebuild any extensions by running:: | ||
|
|
||
| pip install -e ".[test]" | ||
|
|
||
| before running the test with pytest with:: | ||
|
|
||
| pytest | ||
|
|
||
| To run all the test in the ``hvpy`` package, you can use:: | ||
|
|
||
| pytest -c hvpy | ||
|
|
||
| you can also run specific test functions with:: | ||
|
|
||
| pytest -c hvpy -k test_function | ||
|
|
||
| .. _hvpy-doc-building: | ||
|
|
||
| Building Documentation | ||
| ---------------------- | ||
|
|
||
| .. note:: | ||
|
|
||
| Building the documentation is not necessary unless you are writing new documentation or do not have internet access, because the latest versions of ``hvpy``'s should be available at `hvpy.readthedocs.io <https://hvpy.readthedocs.io/>`__. | ||
|
|
||
| This does not include `Graphviz <http://www.graphviz.org>`__. | ||
| If you do not install this package separately then the documentation build process will produce a very large number of lengthy warnings (which can obscure bona fide warnings) and also not generate inheritance graphs. | ||
|
|
||
| Building | ||
| ^^^^^^^^ | ||
|
|
||
| There are two ways to build the ``hvpy`` documentation. | ||
| The easiest way is to execute the following tox command (from the ``hvpy`` source directory):: | ||
|
|
||
| tox -e build_docs | ||
|
|
||
| If you do this, you do not need to install any of the documentation dependencies as this will be done automatically. | ||
| The documentation will be built in the ``docs/_build/html`` directory, and can be read by pointing a web browser to ``docs/_build/html/index.html``. | ||
|
|
||
| Alternatively, you can do:: | ||
|
|
||
| cd docs | ||
| make html | ||
|
|
||
| And the documentation will be generated in the same location. | ||
| Note that this uses the installed version of ``hvpy``, so if you want to make sure the current repository version is used, you will need to install it with:: | ||
|
|
||
| pip install -e ".[docs]" | ||
|
|
||
| before changing to the ``docs`` directory. | ||
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1,11 +1,32 @@ | ||
| ****************** | ||
| hvpy Documentation | ||
| ****************** | ||
| ********************** | ||
| ``hvpy`` Documentation | ||
| ********************** | ||
|
|
||
| This is the documentation for ``hvpy``. | ||
| ``hvpy`` is a Python package which provides a high-level interface the `helioviewer.org <https://helioviewer.org>`__ `API <https://api.helioviewer.org/docs/v2/>`__. | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 2 | ||
|
|
||
| installation | ||
| guide | ||
| api | ||
| dev_guide | ||
|
|
||
| Contribute to ``hvpy`` | ||
| ---------------------- | ||
|
|
||
| Reporting Issues or Requesting Features | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| If you have found a bug in ``hvpy`` please report it. | ||
| The preferred way to report issues is to create an issue on the ``hvpy`` `GitHub Issue page <https://github.com/Helioviewer-Project/python-api/issues>`__. | ||
|
|
||
| Contribute code or documentation | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| People who wish to contribute to this package should fork the `GitHub repository <https://github.com/Helioviewer-Project/python-api>`__. | ||
|
|
||
| You need to install the development version of the package in order to make and test changes. | ||
| See the :ref:`obtaining_the_source` section for details. | ||
|
|
||
| You may also want to familiarize yourself with the :ref:`dev_guide` for ``hvpy``. |
This file contains hidden or 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,50 @@ | ||
| .. _installation: | ||
|
|
||
| ************ | ||
| Installation | ||
| ************ | ||
|
|
||
| If you are new to Python and/or do not have familiarity with `Python virtual environments <https://docs.python.org/3/tutorial/venv.html>`__, then we recommend starting by installing `miniforge <https://github.com/conda-forge/miniforge#miniforge3>`__. | ||
| This works on all platforms (Linux, Mac, Windows) and installs a full-featured Python environment in your user directory without requiring root privileges. | ||
dgarciabriseno marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Using pip | ||
| --------- | ||
|
|
||
| To install ``hvpy`` with `pip <https://pip.pypa.io/en/stable/>`__, run :: | ||
|
|
||
| pip install hvpy | ||
|
|
||
| .. _conda_install: | ||
|
|
||
| Using Conda | ||
| ----------- | ||
|
|
||
| To install ``hvpy`` using `conda <https://docs.conda.io/projects/conda/en/latest/>`__ run :: | ||
dgarciabriseno marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| conda install -c conda-forge hvpy | ||
|
|
||
| .. _obtaining_the_source: | ||
|
|
||
| Obtaining the Source Package | ||
| ---------------------------- | ||
|
|
||
| Source Package | ||
| ^^^^^^^^^^^^^^ | ||
|
|
||
| The latest stable source package for ``hvpy`` can be `downloaded at pypi.org <https://pypi.org/project/hvpy>`__. | ||
|
|
||
| Development Repository | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| The latest development version of ``hvpy`` can be cloned from `GitHub <https://github.com/Helioviewer-Project/python-api/>`__. :: | ||
|
|
||
| git clone git@github.com:Helioviewer-Project/python-api.git | ||
|
|
||
| Installing from Source | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| To build and install ``hvpy`` (from the root of the source tree) :: | ||
|
|
||
| pip install -e ".[tests,dev]" | ||
|
|
||
| which installs ``hvpy`` in development mode, this means that a change in the source code is immediately reflected. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.