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

Add twine check and add README_PYTHON.rst to doc8 linting #1625

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Changes from 1 commit
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
12 changes: 9 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be worth including twine under the requirements list up above, when we're using the actions setup_env step? I don't think it'd be strictly necessary, but I think it might avoid the need to re-resolve the dependencies, which could potentially save some small amount of time. I think the bigger benefit might be just having all of the python dependencies in once place.

So I'm thinking something like this up above:

      - uses: ./.github/actions/setup_env
        with:
          python-version: ${{ matrix.python-version }}
          requirements-files: requirements.txt
          requirements: ${{ env.CONDA_DEFAULT_DEPENDENCIES }} twine

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea, thanks!


- name: Check long description with twine
run: twine check $(find dist -name "natcap[._-]invest*")

- uses: actions/upload-artifact@v3
with:
name: Source distribution
Expand Down
Loading