-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add instructions to run tests + build docs locally #44
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f092130
add _build
navidcy 456059f
add instructions to build docs locally
navidcy 3a8c1ab
add pip instructions for docs
navidcy 78d0afc
Merge branch 'main' into ncc/add-instructions-to-build-docs
navidcy 770f195
use first person plural
navidcy f3b5aa6
use first person plural
navidcy 8b8da46
better code formatting
navidcy a1763e9
Merge branch 'ncc/add-instructions-to-build-docs' of github.com:COSIM…
navidcy a9962be
add pytest_cache and env
navidcy 5257230
add instructions to run tests locally
navidcy 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 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,5 +1,8 @@ | ||
__pycache__ | ||
.ipynb_checkpoints | ||
build | ||
_build | ||
mom6_regional/_version.py | ||
mom6_regional.egg-info | ||
.pytest_cache | ||
env |
This file contains 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,65 @@ | ||
Instructions for Contributors | ||
============================= | ||
|
||
Before you submit a [pull request](https://github.com/COSIMA/mom6-regional/pulls) it's always a | ||
good idea to run the tests locally and catch any potential bugs/errors that might have been | ||
introduced. Also, sometimes it's also a good idea to build the documentation locally to see | ||
how new docstrings or any new bits of documentation that you may have added look like. | ||
|
||
|
||
## Testing | ||
|
||
To run the tests from a local clone of the repository we first need to create a conda | ||
environment with all the dependencies required. From the repositories local clone main | ||
directory do | ||
|
||
```{code-block} bash | ||
conda env create --prefix ./env --file environment-ci.yml | ||
``` | ||
|
||
and then activate it | ||
|
||
```{code-block} bash | ||
conda activate ./env | ||
``` | ||
|
||
Now we need to install the package in this environment as well as `pytest` | ||
|
||
```{code-block} bash | ||
python -m pip install . | ||
python -m pip install pytest | ||
``` | ||
|
||
Now we can run the test with | ||
|
||
```{code-block} bash | ||
python -m pytest tests/ | ||
``` | ||
|
||
## Documentation | ||
|
||
To build the docs from a local clone of the repository we first need to create a conda | ||
environment. Navigate to the `docs` directory of your local repository clone (e.g., `cd docs`) | ||
and then | ||
|
||
```{code-block} bash | ||
cd docs | ||
conda create --name docs-env --file requirements.txt | ||
``` | ||
|
||
Then activate this environment and run `make`: | ||
|
||
```{code-block} bash | ||
conda activate docs-env | ||
make html | ||
``` | ||
|
||
and open `_build/html/index.html` in your favorite browser. | ||
|
||
Alternatively, we can also install the dependencies needed for the docs via `pip`. | ||
|
||
```{code-block} bash | ||
cd docs | ||
pip install -r docs/requirements.txt | ||
make html | ||
``` |
This file contains 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 |
---|---|---|
|
@@ -5,6 +5,7 @@ Welcome to MOM6 Regional's documentation! | |
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
contributing | ||
api | ||
|
||
|
||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work, would be just
pip install -r requirements.txt
since you changed intodocs
in the previous line.