Git is the distributed version control system used to develop OceanSpy, while GitHub is the website hosting the oceanspy/
repository.
Go to GitHub:
- If you don't have an account yet, Sign up. Otherwise, Sign in.
- Go to the OceanSpy GitHub repository, then fork the project using the fork button.
Move to your terminal:
Set your GitHub username and email address using the following commands:
$ git config --global user.email "you@example.com" $ git config --global user.name "Your Name"
Create a local clone:
$ git clone https://github.com/your_username_here/oceanspy.git
Move into your local clone directory, then set up a remote that points to the original:
$ cd oceanspy $ git remote add upstream https://github.com/hainegroup/oceanspy.git
Make a new branch from
upstream/main
:$ git fetch upstream $ git checkout -b name_of_your_new_branch
Make sure that your new branch is up-to-date:
$ git merge upstream/main
Edit and/or add new files:
To stage files ready for a commit, use the following command:
$ git add .
To save changes, use the following command:
$ git commit -m "Message describing your edits"
You can repeat
git add
andgit commit
multiple times before pushing the branch online.
- To push the branch online, use the following command:
$ git push -u origin name_of_your_branch
- Go to your OceanSpy fork on GitHub (https://github.com/your_username_here/oceanspy) and click on
Compare and Pull
. - Finally, click on
Send pull request
button to finish creating the pull request.
The documentation is built with Sphinx and hosted by Read the Docs. It is written in reStructuredText.
First, you need a local clone of
oceanspy
and a branch (follow the instruction in :ref:`using_git`).Move into the directory containing the documentation:
$ cd oceanspy/docs
In order to build the documentation, you need to create a Conda environment:
$ conda config --set channel_priority strict $ conda config --prepend channels conda-forge $ conda env create -f environment.yml
Activate the
ospy_docs
environment:$ conda activate ospy_docs
Edit and/or add new files.
To build the documentation, use the following command:
$ make html
If you want to start from a clean build, run
make clean
beforemake html
.You can find the HTML output in
oceanspy/docs/_build/html
.Use git to
add
,commit
, andpush
as explained in :ref:`using_git`.
Continuous Integration and Test Coverage links:
First, you need a local clone of
oceanspy
and a branch (follow the instructions in :ref:`using_git`).If you are not already into your local clone directory, move there:
$ cd oceanspy
Create a test environment:
$ conda config --set channel_priority strict $ conda config --prepend channels conda-forge $ conda env create -f ci/environment.yml
Activate the test environment:
$ conda activate ospy_tests
Install OceanSpy in development mode:
$ pip install -e .
Edit and/or add new files.
Use git to
add
,commit
, andpush
as explained in :ref:`using_git`.Make sure that the code is well tested by adding or improving tests in the
oceanspy/tests
repository. The python package used to test OceanSpy is pytest. Use the following command to run the test and measure the code coverage:$ py.test oceanspy -v --cov=oceanspy --cov-config .coveragerc --cov-report term-missing
You can install and use pytest-html to produce a test report in html format.
Make sure that the code follows the style guide using the following commands:
$ conda install -c conda-forge pre-commit $ pre-commit run --allNote
Run the following command to automatically run black and flake8 each time git commit is used:
$ pre-commit install
- Update
HISTORY.rst
- Issue a new release on GitHub
- The release on PyPI is done automatically
- Merge the oceanspy-feedstock PR automatically opened by conda-forge