There are two primary ways to help:
- Using the issue tracker, and
- Changing the code-base.
Use the issue tracker to suggest feature requests, report bugs, and ask questions. This is also a great way to connect with the developers of the project as well as others who are interested in this solution.
Use the issue tracker to find ways to contribute. Find a bug or a feature, mention in the issue that you will take on that effort, then follow the Changing the code-base guidance below.
Generally speaking, you should fork this repository, make changes in your own fork, and then submit a pull request. All new code should have associated unit tests that validate implemented features and the presence or lack of defects. Additionally, the code should follow any stylistic and architectural guidelines prescribed by the project.
In general, we suggest contributors fork the repository, create a new branch, and submit a PR. This consists of three main steps:
- Fork, Clone, and Branch (
git
related things) - Setup development and develop
- Open a pull request
-
Fork repository. This creates a copy for yourself under your username and is done on GitHub.
-
Clone your fork. Make a local copy of your fork
git clone [email protected]:{{ user.name }}/hydrotools.git && cd hydrotools
- Create a new branch. Open a new branch off of
master
for which you will work
git checkout -b new_feature_branch
- Setup and activate virtual environment.
# Create virtual environment
python -m venv env
# Activate virtual environement
./env/bin/activate
- Install development version of package
NOTE: pip install -e .
will not work if install entire namespace package. Use the following:
python setup.py develop
- Develop
Once you are done/ready to start the pull request process!
Before you submit a pull request, please verify that you meet the guidelines
outlined in PULL_REQUEST_TEMPLATE.md
.
Additionally, the following guidelines should also be met:
- If the pull request introduces code or changes to existing code, tests
should be included. This project supports the usage of both
pytest
andunittest
. - Pull requests must pass all GitHub Actions CI test.
- Usage of non-standard python packages should be kept to a minimum.
- Black
pytest
orunittest
for testing- New tools should be added as subpackages
This project uses python native namespace
packaging as outlined introduced in PEP 420. This allows all or just pieces of the package be installed by a user. To maintain this functionality the following guidelines must be followed:
- New subpackages should be added under the
/python
in a directory with their given name. Example:nwis_client
. - The structure of the subpackage should look as follows:
python
└── my_subpackage/
├── src/
│ └── hydrotools/
│ └── my_subpackage/
│ ├── __init__.py
│ ├── foo.py
│ └── _version.py
├── tests/
├── CONTRIBUTION.md -> ../../CONTRIBUTION.md
├── LICENSE -> ../../LICENSE
├── SECURITY.md -> ../../SECURITY.md
├── TERMS.md -> ../../TERMS.md
├── README.md
├── pyproject.toml
├── pytest.ini -> ../../pytest.ini
└── setup.cfg
- The package's
setup.cfg
should use the following template:
[metadata]
name = hydrotools.{{ SUBPACKAGE_NAME }}
version = attr: hydrotools.{{ SUBPACKAGE_NAME }}._version.__version__
author = {{ AUTHOR }}
author_email = {{ AUTHOR_EMAIL }}
description = {{ SHORT_DESCRIPTION }}
long_description = file: README.md
long_description_content_type = text/markdown; charset=UTF-8
license = USDOC
license_files =
LICENSE
url = https://github.com/NOAA-OWP/hydrotools
project_urls =
Documentation = https://noaa-owp.github.io/hydrotools/hydrotools.{{ SUBPACKAGE_NAME }}.html
Source = https://github.com/NOAA-OWP/hydrotools/tree/main/python/nwm_client
Tracker = https://github.com/NOAA-OWP/hydrotools/issues
classifiers =
Development Status :: 3 - Alpha
Intended Audience :: Education
Intended Audience :: Science/Research
License :: Free To Use But Restricted
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Topic :: Scientific/Engineering :: Hydrology
Operating System :: OS Independent
[options]
packages = find_namespace:
package_dir =
=src
install_requires =
{{ PACKAGE_REQUIREMENTS }}
python_requires = >=3.7
include_package_data = True
[options.packages.find]
where = src
[options.extras_require]
develop =
pytest
- The package's
pyproject.toml
should use the following template and add any build-system requirements:
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=42",
"wheel",
]
_version.py
should use the following template:
__version__ = "0.0.1"
__init__.py
must start with the following:
# removing __version__ import will cause build to fail. see: https://github.com/pypa/setuptools/issues/1724#issuecomment-627241822
from ._version import __version__
Further explanation of the rational behind this pattern and more verbose explanation can be found in #12.