-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,531 additions
and
2,166 deletions.
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Build Docs | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: ["main"] | ||
|
||
jobs: | ||
docs: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.9" | ||
- name: Install dependencies | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python - --version 1.3.2 | ||
poetry install --with docs --all-extras | ||
echo "PYTHONPATH=`pwd`" >> $GITHUB_ENV | ||
- name: Build Docs | ||
run: | | ||
sudo apt-get update -y && sudo apt-get install -y pandoc python3-pkg-resources python3-setuptools | ||
poetry run sphinx-build -b html -a docs docs/site | ||
- name: Deploy docs | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./docs/site |
File renamed without changes.
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 |
---|---|---|
|
@@ -143,3 +143,4 @@ docs/**/*.png | |
docs/**/*.jpg | ||
docs/**/*.gif | ||
docs/site/ | ||
docs/_examples/ |
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
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,52 @@ | ||
# Contributing | ||
|
||
PyDicer welcomes any and all contributions in the way of new functionality, bug fixes or documentation. This document provides some guidance to developers who would like to contribute to the project. | ||
|
||
## Git | ||
|
||
Create a branch off of **main** while you make your changes or implement your new tool. | ||
Once complete, head to [GitHub to create a pull | ||
request](https://github.com/australiancancerdatanetwork/pydicer/compare) to merge your changes | ||
into the **main** branch. At this point the automated tests will run and maintainers will review | ||
your submission before merging. | ||
|
||
## Poetry | ||
|
||
PyDicer uses poetry to manage dependencies. Instructions for installing poetry are available | ||
[here](https://python-poetry.org/docs/#installation). Once installed, you can easily install the | ||
libraries required to develop for PyDicer using the following command: | ||
|
||
```bash | ||
poetry install --with dev,docs --all-extras | ||
``` | ||
|
||
This will automatically create a virtual environment managed by poetry. To run a script within this | ||
environment, use the `poetry run` followed by what to run. For example, to run a test.py script: | ||
|
||
```bash | ||
poetry run python test.py | ||
``` | ||
|
||
## Coding standards | ||
|
||
Code in PyDicer must conform to Python's PEP-8 standards to ensure consistent formatting between contributors. To ensure this, pylint is used to check code conforms to these standards before a Pull Request can be merged. You can run pylint from the command line using the following command: | ||
|
||
```bash | ||
pylint pydicer | ||
``` | ||
|
||
But a better idea is to ensure you are using a Python IDE which supports linting (such as [VSCode](https://code.visualstudio.com/docs/python/linting) or PyCharm). Make sure you resolve all suggestions from pylint before submitting your pull request. | ||
|
||
If you're new to using pylint, you may like to [read this guide](https://docs.pylint.org/en/v2.11.1/tutorial.html). | ||
|
||
## Automated tests | ||
|
||
A test suite is included in PyDicer which ensures that code contributed to the repository functions as expected and continues to function as further development takes place. Any code submitted via a pull request should include appropriate automated tests for the new code. | ||
|
||
pytest is used as a testing library. Running the tests from the command line is really easy: | ||
|
||
```bash | ||
pytest | ||
``` | ||
|
||
Add your tests to the appropriate file in the `tests/` directory. See the [pytest documention](https://docs.pytest.org/en/6.2.x/getting-started.html) for more information. |
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
Oops, something went wrong.