From 7a00f652ab090a5a958074b7dcc823de9f815828 Mon Sep 17 00:00:00 2001 From: Emily Davis Date: Tue, 10 Sep 2024 11:28:14 -0600 Subject: [PATCH 1/2] Add twine check and add README_PYTHON.rst to doc8 linting --- .github/workflows/build-and-test.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 3fb4f2000..94f4118ec 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -46,8 +46,8 @@ jobs: # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide python -m flake8 src --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - check-history-rst-syntax: - name: Check HISTORY RST syntax + check-rst-syntax: + name: Check RST syntax runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -63,7 +63,7 @@ jobs: - name: Lint with doc8 run: | # Skip line-too-long errors (D001) - python -m doc8 --ignore D001 HISTORY.rst + python -m doc8 --ignore D001 HISTORY.rst README_PYTHON.rst run-model-tests: name: Run model tests @@ -193,6 +193,12 @@ jobs: # natcap.invest from source and that it imports. python -c "from natcap.invest import *" + - name: Set up environment + run: pip install twine + + - name: Check long description with twine + run: twine check $(find dist -name "natcap[._-]invest*") + - uses: actions/upload-artifact@v3 with: name: Source distribution From 49ec5c43d29daf225c2507a01c134ef85bf4766e Mon Sep 17 00:00:00 2001 From: Emily Davis Date: Tue, 10 Sep 2024 12:29:33 -0600 Subject: [PATCH 2/2] Moves twine install to setup_env step --- .github/workflows/build-and-test.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 94f4118ec..2b59cd2f5 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -170,7 +170,7 @@ jobs: with: python-version: ${{ matrix.python-version }} requirements-files: requirements.txt - requirements: ${{ env.CONDA_DEFAULT_DEPENDENCIES }} + requirements: ${{ env.CONDA_DEFAULT_DEPENDENCIES }} twine - name: Build source distribution run: | @@ -193,9 +193,6 @@ jobs: # natcap.invest from source and that it imports. python -c "from natcap.invest import *" - - name: Set up environment - run: pip install twine - - name: Check long description with twine run: twine check $(find dist -name "natcap[._-]invest*")