Skip to content
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

docs: Fix contributing guide #5

Merged
merged 5 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- Describe the purpose of your PR and the changes you have made. -->

<!-- Which issue this PR aims to resolve or fix? E.g.:
Solve #004
Solve #4
-->

## How to test these changes
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Documentation

on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 15

concurrency:
group: ci-docs-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3

- uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
environment-file: conda/dev.yaml
channels: conda-forge,nodefaults
activate-environment: growth-forge
auto-update-conda: true
conda-solver: libmamba
python-version: "3.10"

- name: Install deps
run: |
poetry config virtualenvs.create false
poetry install

- name: Generate documentation with changes from semantic-release
run: makim --verbose docs.build

- name: GitHub Pages action
uses: peaceiris/[email protected]
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/
2 changes: 1 addition & 1 deletion .makim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ groups:
build:
help: Build documentation
run: |
mkdocs build --config-file docs/mkdocs.yaml
mkdocs build --config-file mkdocs.yaml

preview:
help: Preview documentation page locally
Expand Down
2 changes: 1 addition & 1 deletion conda/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- nodefaults
- conda-forge
dependencies:
- python >=3.8.1,<4
- python >=3.10,<4
- pip
- poetry
- nodejs # used by semantic-release
Expand Down
3 changes: 0 additions & 3 deletions docs/api/references.md

This file was deleted.

8 changes: 0 additions & 8 deletions docs/api/references.rst

This file was deleted.

54 changes: 28 additions & 26 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,34 +65,44 @@ If you are proposing a feature:
Ready to contribute? Here’s how to set up `growth-forge` for local development.

1. Fork the `growth-forge` repo on GitHub.
2. Clone your fork locally:

2. Clone your fork locally::

$ git clone [email protected]:your_name_here/growth-forge.git
```bash
$ git clone [email protected]:your_name_here/growth-forge.git
```

3. Install your local copy into a virtualenv. Assuming you have
virtualenvwrapper installed, this is how you set up your fork for local
development::
3. Install your local copy into a conda virtual environment:

$ mkvirtualenv growth-forge $ cd growth-forge/ $ python setup.py develop
```bash
$ cd growth-forge/ # in the case you are not in the root of the project
$ mamba env create --file conda/dev.yaml
$ conda activate growth-forge
$ poetry install
```

4. Create a branch for local development::
4. Create a branch for local development:

$ git checkout -b name-of-your-bugfix-or-feature
```bash
$ git checkout -b name-of-your-bugfix-or-feature
```

Now you can make your changes locally.

5. When you’re done making changes, check that your changes pass flake8 and the
tests, including testing other Python versions with tox::

$ make lint $ make test
5. When you’re done making changes, check that your changes pass the linter and
the tests:

To get flake8 and tox, just pip install them into your virtualenv.
```bash
$ makim tests.unit
$ makim tests.linter
```

6. Commit your changes and push your branch to GitHub::
6. Commit your changes and push your branch to GitHub:

$ git add . $ git commit -m “Your detailed description of your changes.” $
git push origin name-of-your-bugfix-or-feature
```bash
$ git add .
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature
```

7. Submit a pull request through the GitHub website.

Expand All @@ -106,14 +116,6 @@ Before you submit a pull request, check that it meets these guidelines:
the list in README.rst.
3. The pull request should work for Python >= 3.8.

## Tips

To run a subset of tests::

```
$ pytest tests.test_feedback_linker
```

## Release

This project uses semantic-release in order to cut a new release based on the
Expand Down Expand Up @@ -148,7 +150,7 @@ The table below shows which commit message gets you which release type when
| `fix(pencil): stop graphite breaking when pressure is applied` | Fix Release |
| `feat(pencil): add 'graphiteWidth' option` | Feature Release |
| `perf(pencil): remove graphiteWidth option` | Chore |
| `BREAKING CHANGE: The graphiteWidth option has been removed` | Breaking Release |
| `feat(pencil)!: The graphiteWidth option has been removed` | Breaking Release |

source:
<https://github.com/semantic-release/semantic-release/blob/master/README.md#commit-message-format>
Expand Down
56 changes: 0 additions & 56 deletions docs/example.ipynb

This file was deleted.

6 changes: 2 additions & 4 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
site_name: Growth Forge
site_url: https://opensciencelabs.github.io/growth-forge
repo_url: https://github.com/xmnlab/growth-forge.git
site_url: https://osl-incubator.github.io/growth-forge
repo_url: https://github.com/osl-incubator/growth-forge.git
docs_dir: ./docs
site_dir: ./build
# extra_css:
Expand All @@ -11,8 +11,6 @@ nav:
- Installation: installation.md
- Changelog: changelog.md
- Contributing: contributing.md
- API: api/references.md
- Notebook page: example.ipynb
theme:
name: material
features:
Expand Down
Loading