Contributing
There are two primary ways to help:
Using the issue tracker, and
Changing the code-base.
Using the issue tracker
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.
Changing the code-base
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 the absence of such guidelines, mimic the styles and patterns in the existing code-base.
Your contributing guidelines are well-structured and detailed, providing clear steps for contributors. Here are some suggestions to enhance clarity, conciseness, and precision:
Guidelines
If you would like to contribute to our project, please follow these steps from the terminal within the project’s root directory:
Note: Replace anything within angle brackets <>
with your specific information, removing the brackets.
Fork and Clone:
Fork the project on GitHub.
Clone your fork (
git clone <your_username>/gval
).Create a feature branch (
git checkout -b <your_feature>
).
Virtual Environment Setup (Recommended):
gval supports Python versions 3.8 to 3.11.
Ensure your environment is not included in the git commits. Use one of the names listed in
.gitignore
.Options:
venv:
Create:
python -m venv <your_env_dir>
.Activate:
source <your_env_dir>/bin/activate
.Deactivate:
deactivate
.
conda/mamba:
Create:
[conda|mamba] create -n <your_env_name> python=<X.X.X>
.Activate:
[conda|mamba] activate <your_env_name>
.Deactivate:
[conda|mamba] deactivate
.
Dependency Installation:
Activate your virtual environment.
Install Nox:
pip install nox
.Alternatively, install all development dependencies:
pip install -e .[dev]
.
Pre-commit Hooks:
Set up automatic linting tasks:
pre-commit install
.
Making Changes:
Commit your changes:
git add . && git commit
.
Using Nox:
Run linting, pre-commits, tests, coverage, and doc building with Nox.
Run all sessions (time-consuming):
nox
.Variants to save time:
Pre-commits only (linting):
nox -t precommit
.Tests only:
nox -s tests
.Specific Python version:
nox -p 3.8
.Different virtual environment backend:
nox -db mamba
.Extra Python versions:
nox --extra-pythons 3.7
.
Preview docs after running
nox
ornox -s docs
: Opendocs/sphinx/_build/html/index.html
in a browser.
Pushing Changes:
New branch:
git push -u origin <your_branch>
.Existing branch:
git push
.
Pull Request:
Start a PR conforming to the PR template and request a review.
By-passing Nox
You may manually perform steps handled by Nox:
Setup a virtual environment (as above) and run
pip install -e .[dev]
.Linting: Execute
flake8
andblack .
.Testing: Run
pytest
ensuring at least 95% test coverage.Docs: Navigate (
cd docs/sphinx
) and build (make clean && make html
).
Dependencies
Core dependencies are managed within
requirements.txt
.Optional dependencies related to development activities are listed directly within
pyproject.toml
.There are several groups of optional dependencies but
dev
encompasses all of them.
Versioning
The repository adheres to the Semantic Versioning 2.0.0.
Docker Use
A Docker container is available for your convenience.
Note: Anything within angle brackets <>
is meant to be user-specified with the brackets removed. Additionally note that the use of sudo maybe optional dependening on how Docker was setup on your system.
First setup docker instance and in the root directory of the project:
[sudo] docker build -t <your_image_name> --target development .
The default user named ‘user’ with UID 1001 is created. To use the same user and permissions you currently have on your machine override with build arguments:
[sudo] docker build -t <your_image_name> --build-arg UID=$(id -u) --target development .
Standard run examples from the command line (standard, or overriding user with root):
[sudo] docker run -v $(pwd):/home/user/gval --name <your_container_name> <your_image_name>
[sudo] docker run -v $(pwd):/home/user/gval --user root --name <your_container_name> <your_image_name>
If given access keys for retrieving test data you can mount the volume as such:
[sudo] docker run -v ~/.aws:/home/user/.aws -v $(pwd):/home/user/gval --name <your_container_name> <your_image_name>
To keep your container running, try adding tail -f /dev/null
as your command ensuring to detach with -d
:
[sudo] docker run -d -v $(pwd):/home/user/gval --name <your_container_name> <your_image_name> tail -f /dev/null
You can also set up your IDE to run this docker image directly:
If the container already exists you can start as follows:
[sudo] docker start <your_container_name>
To enter the container interactively:
[sudo] docker exec <your_container_name> bash