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

Upgrade to pyproject, bump pyupgrade #542

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

asears
Copy link

@asears asears commented Dec 19, 2024

This PR uplifts the project a bit. ++ @carltongibson

  • Upgrade to pyproject.toml from setup.cfg and tox.ini
  • Add pytest-cov test coverage settings
  • bump pyupgrade version
  • Add workflow dispatch to allow for tests workflow to be called on demand
  • Add permissions to test workflow as per good security practice
    - Comment the gitignore, add coverage exclusions
  • Added some testing dependencies
  • Added some project URLs

This PR will need a test by someone familiar with the release process and review of the settings for pypi release.

Some further improvements could be made:

  • Add black, flake8, pytest, coverage, security scans to a build pipeline for inline visibility on pr/comments on prs.
  • Some flake8 & ruff warnings to adjust/address
  • One file needs format in the repo according to latest black.
  • If some contributors are testing builds with uv, requires an extra couple lines added to pyproject to allow a wheel build.
  • ruff could be added for future to replace need for isort, black, flake8, flake8-bugbear and autofix issues

@bigfootjon
Copy link
Collaborator

@carltongibson, how do you feel about these changes? These seem reasonable to me, but I'm not terribly familiar with the release process nor any opinions you might have about the tools in-use

@carltongibson
Copy link
Member

@bigfootjon Yes, thanks. I have a few thoughts before merging this.

(I need to think them through fully yet 😅)

Copy link
Member

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

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

OK, I had a closer look.

TBH I'd rather scope this down to just the smaller project data move, and the pyupgrade shift, leaving the tool configuration where it is.

We could have a .flake8 and move the pytest etc maybe, but I want to keep the tox config where it is.

.gitignore Outdated
Copy link
Member

Choose a reason for hiding this comment

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

I'm not seeing the value of the changes to this file.

e.g. this adds nothing:

# Tox
/.tox

Copy link
Author

@asears asears Jan 7, 2025

Choose a reason for hiding this comment

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

Generally I would lean towards commenting the gitignores so if and when you switch tooling you can update.

Github's template provides this example comment for tox though I don't think that's quite accurate.

# Unit test / coverage reports
https://github.com/github/gitignore/blob/main/Python.gitignore

I'll remove them though, feel free to edit the PR.

.pre-commit-config.yaml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@carltongibson
Copy link
Member

@asears This is looking good thanks. I just need a moment to pull it locally and I will bring it in. Nice one. 🎁

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.

3 participants