Skip to content

Commit c2510bb

Browse files
authored
update contributor guidelines and dev docs (geopython#2032) (geopython#2052)
* update contributor guidelines (geopython#2032) * fix PR comments * fix typo
1 parent 53418d7 commit c2510bb

File tree

3 files changed

+96
-63
lines changed

3 files changed

+96
-63
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Your contribution will be under our [license](https://github.com/geopython/pygeo
6565
* Pull requests may include copyright in the source code header by the contributor if the contribution is significant or the contributor wants to claim copyright on their contribution.
6666
* All contributors shall be listed at https://github.com/geopython/pygeoapi/graphs/contributors
6767
* Unclaimed copyright, by default, is assigned to the main copyright holders as specified in https://github.com/geopython/pygeoapi/blob/master/LICENSE.md
68+
* further notes can be found in the `documentation <https://docs.pygeoapi.io/en/latest/development.html#testing>`_
6869

6970
### Version Control Branching
7071

@@ -89,16 +90,23 @@ Your contribution will be under our [license](https://github.com/geopython/pygeo
8990
while, __make sure you rebase or merge to latest ``master``__ to ensure a
9091
speedier resolution.
9192

93+
### Testing
94+
95+
* testing is performed using `pytest <https://pytest.org>`_ and covers all major components (API core, providers, formatters, managers, etc.)
96+
* additional information can be found in the `documentation <https://docs.pygeoapi.io/en/latest/development.html#testing>`_
97+
98+
9299
### Documentation
93100

94101
* documentation is managed in `docs/`, in reStructuredText format
95102
* [Sphinx](https://www.sphinx-doc.org) is used to generate the documentation
96103
* See the [reStructuredText Primer](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html) on rST markup and syntax
104+
* additional information can be found in the `documentation <https://docs.pygeoapi.io/en/latest/development.html#building-the-documentation>`_
97105

98106

99107
### Wiki
100108

101-
* the [pygeoapi wiki](https://github.com/geopython/pygeoapi/wiki) provides working level documentation
109+
* the [pygeoapi wiki](https://github.com/geopython/pygeoapi/wiki) provides working level documentation and various community resources
102110

103111

104112
### Code Formatting
@@ -107,7 +115,8 @@ Your contribution will be under our [license](https://github.com/geopython/pygeo
107115
* pygeoapi follows the [PEP-8](http://www.python.org/dev/peps/pep-0008/) guidelines
108116
* 80 characters
109117
* spaces, not tabs
110-
* pygeoapi, instead of PyGeoAPI, pygeoAPI, etc.
118+
* pygeoapi, NOT PyGeoAPI, pygeoAPI, etc.
119+
* additional information can be found in the `documentation <https://docs.pygeoapi.io/en/latest/development.html#linting>`_
111120

112121
## Suggesting Enhancements
113122

docs/source/contributing.rst

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,5 @@
33
Contributing
44
============
55

6-
Building the documentation
7-
--------------------------
8-
9-
To build the documentation in pygeoapi we use `Sphinx`_. The documentation is located in the docs folder.
10-
11-
.. note::
12-
For the following instructions to work, you must be located in the root folder of pygeoapi.
13-
14-
Install the dependencies necessary for building the documentation using the following command:
15-
16-
.. code-block:: bash
17-
18-
pip3 install -r docs/requirements.txt
19-
20-
After installing the requirements, build the documentation using the ``sphinx-build`` command:
21-
22-
.. code-block:: bash
23-
24-
sphinx-build -M html docs/source docs/build
25-
26-
27-
Or using the following ``make`` command:
28-
29-
.. code-block:: bash
30-
31-
make -C docs html
32-
33-
After building the documentation, the folder ``docs/build`` will contain the website generated with the documentation.
34-
Add the folder to a web server or open the file ``docs/build/html/index.html`` file in a web browser to see the contents of the documentation.
35-
36-
The documentation is hosted on `readthedocs`_. It is automatically generated from the contents of the ``master`` branch on GitHub.
37-
38-
The file ``.readthedocs.yaml`` contains the configuration of the readthedocs build. Refer to the `readthedocs configuration file`_ documentation for more information.
39-
40-
Contributing GitHub page
41-
------------------------
42-
436
Please see the `Contributing page <https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md>`_
447
for information on contributing to the project.
45-
46-
.. _`Sphinx`: https://www.djangoproject.com
47-
.. _`readthedocs`: https://docs.readthedocs.io/en/stable/index.html
48-
.. _readthedocs configuration file: https://docs.readthedocs.io/en/stable/config-file/v2.html

docs/source/development.rst

Lines changed: 85 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ Codebase
88

99
The pygeoapi codebase exists at https://github.com/geopython/pygeoapi.
1010

11+
Pull Requests and GitHub Actions
12+
--------------------------------
13+
14+
A given GitHub Pull Request is evaluated against the following GitHub actions:
15+
16+
- main: mainline testing harness (as defined in ``tests``)
17+
- flake8: code linting
18+
- docs: documentation updates (for files updated in ``docs/**.rst``)
19+
- vulnerabilities: Trivy vulnerability scanning
1120

1221
Testing
1322
-------
@@ -22,6 +31,78 @@ Tests can be run locally as part of development workflow. They are also run on
2231
To run all tests, simply run ``pytest`` in the repository. To run a specific test file,
2332
run ``pytest tests/api/test_itemtypes.py``, for example.
2433

34+
Some provider tests are subject to external service provisioning and setup (i.e Elasticsearch,
35+
PostgreSQL). See the `GitHub Action main workflow <https://github.com/geopython/pygeoapi/blob/master/.github/workflows/main.yml>`_
36+
to review the setups taken in order to run provider tests requiring additional infrastructure.
37+
38+
.. _pre-commit:
39+
40+
Linting
41+
-------
42+
43+
pygeoapi follows PEP8 for linting Python source code. All commits and GitHub Pull Requests
44+
perform ``flake8`` linting compliance prior to approval and/or merge into the codebase. Running linting
45+
compliance prior to submitting a GitHub Pull Request is recommended.
46+
47+
Using flake8
48+
^^^^^^^^^^^^
49+
50+
Simply running `flake8` against the repository tree will assess the code for linting compliance.
51+
52+
.. note::
53+
54+
Ensure flake8 is installed (``pip3 install flake8`` or ``pip3 install -r requirements.txt``)
55+
56+
Using pre-commit
57+
^^^^^^^^^^^^^^^^
58+
59+
You may optionally use `pre-commit`_ in order to check for linting and other static issues
60+
before committing changes. Pygeoapi's repo includes a ``.pre-commit.yml``
61+
file, check the pre-commit docs on how to set it up - in a nutshell:
62+
63+
- pre-commit is mentioned in pygeoapi's ``requirements-dev.txt`` file, so it will be included
64+
when you pip install those
65+
- run ``pre-commit install`` once in order to install its git commit hooks.
66+
- optionally, run ``pre-commit run --all-files``, which will run all pre-commit hooks for all files in the repo.
67+
This also prepares the pre-commit environment.
68+
- from now on, whenever you do a ``git commit``, the pre-commit hooks will run and the commit
69+
will only be done if all checks pass
70+
71+
Building the documentation
72+
--------------------------
73+
74+
To build the documentation in pygeoapi we use `Sphinx`_. The documentation is located in the docs folder.
75+
76+
.. note::
77+
For the following instructions to work, you must be located in the root folder of pygeoapi.
78+
79+
Install the dependencies necessary for building the documentation using the following command:
80+
81+
.. code-block:: bash
82+
83+
pip3 install -r docs/requirements.txt
84+
85+
After installing the requirements, build the documentation using the ``sphinx-build`` command:
86+
87+
.. code-block:: bash
88+
89+
sphinx-build -M html docs/source docs/build
90+
91+
92+
Or using the following ``make`` command:
93+
94+
.. code-block:: bash
95+
96+
make -C docs html
97+
98+
After building the documentation, the folder ``docs/build`` will contain the website generated with the documentation.
99+
Add the folder to a web server or open the file ``docs/build/html/index.html`` file in a web browser to see the contents of the documentation.
100+
101+
The documentation is hosted on `Read the Docs`_. It is automatically generated from the contents of the ``master`` branch on GitHub.
102+
103+
The file ``.readthedocs.yaml`` contains the configuration of the Read the Docs build. Refer to the `Read the Docs configuration file`_ documentation for more information.
104+
105+
25106
Working with Spatialite on OSX
26107
------------------------------
27108

@@ -66,24 +147,8 @@ Set the variable for the Spatialite library under OSX:
66147
67148
SPATIALITE_LIBRARY_PATH=/usr/local/lib/mod_spatialite.dylib
68149
69-
150+
.. _`flake8`: https://flake8.pycqa.org
70151
.. _`GitHub Actions setup`: https://github.com/geopython/pygeoapi/blob/master/.github/workflows/main.yml
71-
72-
73-
Using pre-commit
74-
----------------
75-
76-
You may optionally use `pre-commit`_ in order to check for linting and other static issues
77-
before committing changes. Pygeoapi's repo includes a ``.pre-commit.yml``
78-
file, check the pre-commit docs on how to set it up - in a nutshell:
79-
80-
- pre-commit is mentioned in pygeoapi's ``requirements-dev.txt`` file, so it will be included
81-
when you pip install those
82-
- run ``pre-commit install`` once in order to install its git commit hooks.
83-
- optionally, run ``pre-commit run --all-files``, which will run all pre-commit hooks for all files in the repo.
84-
This also prepares the pre-commit environment.
85-
- from now on, whenever you do a ``git commit``, the pre-commit hooks will run and the commit
86-
will only be done if all checks pass
87-
88-
89-
.. _pre-commit:
152+
.. _`Sphinx`: https://www.sphinx-doc.org
153+
.. _`Read the Docs`: https://docs.readthedocs.io/en/stable/index.html
154+
.. _`Read the Docs configuration file`: https://docs.readthedocs.io/en/stable/config-file/v2.html

0 commit comments

Comments
 (0)