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

Conversation

emilyanndavis
Copy link
Member

Description

Resolves #1582.

  1. Added twine check task, which validates the source distribution and raises an error if there are problems in the long description that will prevent proper rendering on PyPI. (See twine check example output from an intentionally failed run.)
  2. Also updated the check-history-rst-syntax so that it also lints README_PYTHON.rst. While twine check seems to bail after the first syntax error it encounters, doc8 reports all issues, which would be helpful in the (albeit unlikely) scenario in which README_PYTHON.rst is updated and ends up with multiple syntax issues. (See doc8 example output from an intentionally failed run.)

I realize there's a lot of overlap between these two tasks, so I'm open to other options if folks think it's not worthwhile to include both.

Checklist

- [ ] Updated HISTORY.rst and link to any relevant issue (if these changes are user-facing)
- [ ] Updated the user's guide (if needed)
- [ ] Tested the Workbench UI (if relevant)

@emilyanndavis emilyanndavis marked this pull request as ready for review September 10, 2024 17:59
Copy link
Member

@phargogh phargogh left a comment

Choose a reason for hiding this comment

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

Makes sense to me! I just had one very minor suggestion about moving the twine requirement to the environment setup step, but please do let me know if this doesn't make sense or is better the way you have it!

Comment on lines 196 to 197
- 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!

Copy link
Member

@phargogh phargogh left a comment

Choose a reason for hiding this comment

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

Thanks @emilyanndavis !

@phargogh phargogh merged commit 2eee3c3 into natcap:main Sep 10, 2024
29 checks passed
@emilyanndavis emilyanndavis deleted the 1582-gh-action-check-long-desc branch September 10, 2024 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a github action to check python setup.py --long-description
2 participants