From 0eccc5a39c6f529b45a2e771f5832b6e79abfb7d Mon Sep 17 00:00:00 2001 From: Ivan Ogasawara Date: Mon, 29 Apr 2024 08:18:55 -0400 Subject: [PATCH 1/5] docs: Fix contributing guide --- .github/workflows/docs.yaml | 52 ++++++++++++++++++++++++++++++++++ docs/contributing.md | 54 ++++++++++++++++++----------------- docs/example.ipynb | 56 ------------------------------------- mkdocs.yaml | 5 ++-- 4 files changed, 82 insertions(+), 85 deletions(-) create mode 100644 .github/workflows/docs.yaml delete mode 100644 docs/example.ipynb diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 0000000..e8bfefb --- /dev/null +++ b/.github/workflows/docs.yaml @@ -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.8" + + - 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/actions-gh-pages@v3.5.9 + if: ${{ github.event_name == 'workflow_dispatch' }} + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build/ diff --git a/docs/contributing.md b/docs/contributing.md index aaa8901..4905f8d 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -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 git@github.com:your_name_here/growth-forge.git +```bash +$ git clone git@github.com: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. @@ -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 @@ -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: diff --git a/docs/example.ipynb b/docs/example.ipynb deleted file mode 100644 index ad98994..0000000 --- a/docs/example.ipynb +++ /dev/null @@ -1,56 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Growth Forge\n", - "\n", - "Growth Forge is Python library that aims to do ...\n", - "\n", - "## Getting Started\n", - "\n", - "First, check our documentation about the [installation](/installation).\n", - "\n", - "Now, let's import our library:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import growth_forge" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.11" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -} diff --git a/mkdocs.yaml b/mkdocs.yaml index 5f1a2e8..fd08216 100644 --- a/mkdocs.yaml +++ b/mkdocs.yaml @@ -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: @@ -12,7 +12,6 @@ nav: - Changelog: changelog.md - Contributing: contributing.md - API: api/references.md - - Notebook page: example.ipynb theme: name: material features: From 008ccad234a5be88a4b855b1c6b66ee2441098ed Mon Sep 17 00:00:00 2001 From: Ivan Ogasawara Date: Mon, 29 Apr 2024 08:19:56 -0400 Subject: [PATCH 2/5] fix pr template typo --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index d9a7b67..e26e0d9 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -3,7 +3,7 @@ ## How to test these changes From 5c0f107fee9c62c3b4cb27ea5184b116672a0864 Mon Sep 17 00:00:00 2001 From: Ivan Ogasawara Date: Mon, 29 Apr 2024 08:22:08 -0400 Subject: [PATCH 3/5] fix python version for doc job --- .github/workflows/docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index e8bfefb..947060c 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -34,7 +34,7 @@ jobs: activate-environment: growth-forge auto-update-conda: true conda-solver: libmamba - python-version: "3.8" + python-version: "3.10" - name: Install deps run: | From 4106bf52b9200ebc3d41a62e44a9297137a7d0b5 Mon Sep 17 00:00:00 2001 From: Ivan Ogasawara Date: Mon, 29 Apr 2024 08:22:53 -0400 Subject: [PATCH 4/5] fix python version in the conda file --- conda/dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda/dev.yaml b/conda/dev.yaml index e3b2111..8446cb7 100644 --- a/conda/dev.yaml +++ b/conda/dev.yaml @@ -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 From 207024d95c834a417d6abc67bbf27254b2d5c68c Mon Sep 17 00:00:00 2001 From: Ivan Ogasawara Date: Mon, 29 Apr 2024 08:28:39 -0400 Subject: [PATCH 5/5] fix docs generation --- .makim.yaml | 2 +- docs/api/references.md | 3 --- docs/api/references.rst | 8 -------- mkdocs.yaml | 1 - 4 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 docs/api/references.md delete mode 100644 docs/api/references.rst diff --git a/.makim.yaml b/.makim.yaml index 20376f1..6400046 100644 --- a/.makim.yaml +++ b/.makim.yaml @@ -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 diff --git a/docs/api/references.md b/docs/api/references.md deleted file mode 100644 index 0ffbc47..0000000 --- a/docs/api/references.md +++ /dev/null @@ -1,3 +0,0 @@ -# Api references - -::: growth_forge diff --git a/docs/api/references.rst b/docs/api/references.rst deleted file mode 100644 index 419e33c..0000000 --- a/docs/api/references.rst +++ /dev/null @@ -1,8 +0,0 @@ -API references -============== - -.. automodule:: growth_forge - :members: - -.. automodule:: growth_forge.growth_forge - :members: diff --git a/mkdocs.yaml b/mkdocs.yaml index fd08216..11dad6f 100644 --- a/mkdocs.yaml +++ b/mkdocs.yaml @@ -11,7 +11,6 @@ nav: - Installation: installation.md - Changelog: changelog.md - Contributing: contributing.md - - API: api/references.md theme: name: material features: