Skip to content

Conversation

@jsf9k
Copy link
Member

@jsf9k jsf9k commented Oct 28, 2025

🗣 Description

This pull request updates our project packaging configuration from using a setup.py file to using a pyproject.toml file with a hatchling build backend.

💭 Motivation and context

Resolves #163.

🧪 Testing

All automated tests pass.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All new and existing tests pass.
  • Bump major, minor, patch, pre-release, and/or build versions as appropriate via the bump_version script if this repository is versioned and the changes in this PR warrant a version bump.
  • Create a pre-release (necessary if and only if the pre-release version was bumped).

✅ Pre-merge checklist

  • Finalize version.

✅ Post-merge checklist

  • Create a release (necessary if and only if the version was bumped).

@jsf9k jsf9k self-assigned this Oct 28, 2025
@jsf9k jsf9k added the improvement This issue or pull request will add or improve functionality, maintainability, or ease of use label Oct 28, 2025
@jsf9k jsf9k moved this to In Progress in Next Kraken Oct 28, 2025
@github-actions github-actions bot added dependencies Pull requests that update a dependency file python Pull requests that update Python code labels Oct 28, 2025
@jsf9k jsf9k force-pushed the improvement/use-pyproject-toml-file branch from 540a8db to 336618a Compare October 28, 2025 17:26
@jsf9k jsf9k moved this from In progress to Review in progress in Skeleton Maintenance Oct 28, 2025
@jsf9k jsf9k added the kraken 🐙 This pull request is ready to merge during the next Lineage Kraken release label Oct 28, 2025
@github-actions github-actions bot added the test This issue or pull request adds or otherwise modifies test code label Oct 28, 2025
@jsf9k
Copy link
Member Author

jsf9k commented Oct 28, 2025

@mcdonnnj - I'm not sure what kind of version bump to apply here, if any.

@jsf9k
Copy link
Member Author

jsf9k commented Oct 28, 2025

The flake8 config could be moved to the pyproject.toml file as well, but that would require the pyproject-flake8 Python package.

The bandit config is only used when pre-commit runs bandit against the Python test code; otherwise, we use the default configuration for bandit.

@jsf9k jsf9k marked this pull request as ready for review October 28, 2025 17:59
@jsf9k jsf9k requested review from dav3r and mcdonnnj as code owners October 28, 2025 17:59
example = "example.example:main"

[project.urls]
Mission = "https://www.cisa.gov/cybersecurity"
Copy link
Member Author

Choose a reason for hiding this comment

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

This URL was specified in setup.py, but I didn't have a particular place to put it in pyproject.toml. I'm open to changing Mission to something else or removing this URL altogether.

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 on board with what you have here.

@jsf9k
Copy link
Member Author

jsf9k commented Oct 28, 2025

I realize that we want wheel and pip to be the latest versions, but should we now remove setuptools from setup-env? If so then this would be an upstream change in cisagov/skeleton-generic.

jsf9k added 3 commits October 28, 2025 14:51
This is because this file now contains configurations for test tools.

Also remove test tool config files that no longer exist.
These may be of use to folks who are editing pyproject.toml for a
descendant of this skeleton repository.
Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

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

This all looks like a solid start to me. Thanks for getting us switched over to pyproject.toml. 🎉

@dav3r dav3r requested a review from Copilot October 29, 2025 19:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request migrates the project from a setup.py-based build configuration to a modern pyproject.toml-based configuration using the Hatchling build backend. This modernization consolidates configuration files and follows current Python packaging best practices (PEP 517/518).

  • Migrates from setup.py to pyproject.toml with Hatchling as the build backend
  • Consolidates pytest.ini and .isort.cfg configurations into pyproject.toml
  • Updates GitHub labeler configuration to reference the new configuration file

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
setup.py Removed legacy setup.py file (116 lines)
pytest.ini Removed standalone pytest configuration file
.isort.cfg Removed standalone isort configuration file
pyproject.toml Added comprehensive project configuration including build system, dependencies, tool configurations, and metadata
.github/labeler.yml Updated file references from setup.py, .isort.cfg, and pytest.ini to pyproject.toml

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file improvement This issue or pull request will add or improve functionality, maintainability, or ease of use kraken 🐙 This pull request is ready to merge during the next Lineage Kraken release python Pull requests that update Python code test This issue or pull request adds or otherwise modifies test code

Projects

Status: In Progress
Status: Review in progress

Development

Successfully merging this pull request may close these issues.

Upgrade from setup.py to pyproject.toml

3 participants