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

Move package metadata and tool configuration to pyproject.toml #1158

Merged
merged 11 commits into from
Nov 7, 2023

Conversation

matt-graham
Copy link
Collaborator

@matt-graham matt-graham commented Oct 11, 2023

Fixes #1126 and fixes #1156

Moves from setup.py / setup.cfg based approach of specifying package metadata and tool configuration to more modern pyproject.toml based approach.

This allows getting rid of various separate configuration / metadata files (.coveragerc, requirements/*.in, setup.cfg, setup.py) in favour having all configuration centralized in pyproject.toml.

This PR also removes the previous .bumpversion.cfg file in favour of moving to setuptools-scm to automatically set package version based on Git metadata / tags (default versioning scheme is described here).

The tox check environment is updated to use Ruff in place of flake8 as Ruff is a lot quicker and supports pyproject.toml which flake8 currently doesn't. For now to keep the changes minimal here, I've added a series of rules to ignore that cause the Ruff check to fail. In a separate PR we probably want to either move to adding specific # noqa: ... overrides at the relevant places if we think what we have in the code is correct or fix the violations.

I've also removed the previous requirements/Makefile in favour of adding a new requirements tox environment that updates the requirements files using pip-compile (with input requirements now sourced from dependencies specified in pyproject.toml, including optional dev dependencies). I've also regenerated the requirements files so that the commented sources / generation command align with new structure but as far as I can see from a quick check this hasn't led to any changes in resolved packages. (EDIT: Beyond a few changes from adding ruff to development dependencies).

EDIT: Now also adds pylint to checks, as for ruff disabling rules that currently cause checks to fail with intention of fixing actual violations in separate PRs and/or adding specific # noqa: ... overrides.

@matt-graham matt-graham force-pushed the mmg/modernize-packaging branch from a192c8d to 34de588 Compare October 11, 2023 13:33
@matt-graham matt-graham requested a review from tamuri October 11, 2023 13:34
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@matt-graham matt-graham force-pushed the mmg/modernize-packaging branch from 8295703 to ff0e70e Compare November 6, 2023 17:10
@tbhallett
Copy link
Collaborator

Thanks for this one @matt-graham. Just noting that this one is the critical one for the first release with the paper submission

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
3 participants