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

Modernize setup to use pyproject.toml #116

Merged
merged 13 commits into from
Nov 13, 2023
Merged

Modernize setup to use pyproject.toml #116

merged 13 commits into from
Nov 13, 2023

Conversation

pydanny
Copy link
Contributor

@pydanny pydanny commented Nov 1, 2023

  • Ensures we match dependencies between environments (main, dev, and docs)
  • Simplifies the configuration
  • Makes it MUCH easier to break this up into multiple packages

Note: Even though the project in theory had been converted to ruff for linting and formatting, this PR uncovered that some modules were formatted with it and others were not. Hence the volume of files changed.

Why main, dev, and docs for dependencies?

  • "Main" is the project.dependencies setting and is the PyPI deployed project expects
  • Development and tests require the same dependencies, might as well combine them
  • Docs are isolated from development and tests in order to speed up docs generation on Read the Docs. When checking if docs are building or failing, it's really nice to have a fast configuration.

Copy link
Contributor

@codeinthehole codeinthehole left a comment

Choose a reason for hiding this comment

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

Couple of small comments.

There's still a few references to setup.py in the codebase to factor out too.

Would be good to see this repo harmonise with https://github.com/octoenergy/cookiecutter-kraken-package - we could backport some of the docs set-up to there.

pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
tests/storage/test_files.py Show resolved Hide resolved
@pydanny pydanny force-pushed the move-to-pyproject.toml branch from acb31c5 to 4ec5f5e Compare November 3, 2023 14:40
This does the following:

- Combines setup.py, setup.cfg into pyproject.toml
- Configures documentation site
- Fully executes on the formatting changes we thought we had introduced when we migrated to ruff
Version now tracked and pull from pyproject.toml
@pydanny pydanny force-pushed the move-to-pyproject.toml branch from 4ec5f5e to 59df684 Compare November 3, 2023 14:48
As these have been replaced by ruff now.
Copying the approach from the CookieCutterPackage repo.
As this is more useful than having the CI job abort after the first
fail.
To run the simplest jobs first.
As it's not really useful.
@@ -16,22 +16,6 @@ repos:
stages: [commit]
- id: trailing-whitespace # Trims trailing whitespace.


- repo: https://github.com/timothycrosley/isort
Copy link
Contributor Author

@pydanny pydanny Nov 9, 2023

Choose a reason for hiding this comment

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

General comment: Thanks for the catch on pre-commit. My VSCode doesn't search in this file. Need to fix that.

@@ -7,28 +7,22 @@ jobs:
steps:
Copy link
Contributor Author

@pydanny pydanny Nov 9, 2023

Choose a reason for hiding this comment

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

General comment: Looking at this I like the bold changes. I think I get too timid with these kinds of chores, trying to keep them tiny in scope.

@@ -17,12 +17,16 @@ jobs:
- run:
name: Test
command: make test
when: always
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TIL

@codeinthehole codeinthehole force-pushed the move-to-pyproject.toml branch from aad3bb2 to 6f7b478 Compare November 9, 2023 17:05
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Copy link
Contributor

Choose a reason for hiding this comment

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

We should add support for Python 3.12 at some point too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, created #121.

@pydanny pydanny requested a review from codeinthehole November 9, 2023 23:35
@pydanny pydanny merged commit 1238889 into main Nov 13, 2023
@pydanny pydanny deleted the move-to-pyproject.toml branch November 13, 2023 15:29
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