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

Feat/upgrade tox and ci setup #223

Merged
merged 13 commits into from
Dec 17, 2024
Merged

Conversation

vinitkumar
Copy link
Owner

@vinitkumar vinitkumar commented Dec 17, 2024

Summary by Sourcery

Upgrade the CI setup by updating GitHub Actions workflows and introducing a pre-commit configuration. Enhance the build system by transitioning to pyproject.toml for project metadata and build configuration. Update tox configuration to support newer Python versions and improve test execution.

New Features:

  • Introduce a pre-commit configuration to automate code formatting and checks.

Enhancements:

  • Upgrade the CI workflow to use the latest versions of actions and tools, including setup-python and checkout actions.
  • Switch to using 'uv' for dependency installation and caching in the CI workflow.
  • Update the tox configuration to include newer Python versions and improve test command execution.

Build:

  • Add a pyproject.toml file to define the build system and project metadata, replacing setup.py.

CI:

  • Revise the GitHub Actions workflow to separate build and coverage jobs, improving the CI process.

Copy link

sourcery-ai bot commented Dec 17, 2024

Reviewer's Guide by Sourcery

This PR modernizes the project's build system and CI setup by migrating to pyproject.toml-based configuration, implementing tox with UV package manager, and adding comprehensive pre-commit hooks. The CI workflow has been restructured to use parallel test execution with centralized coverage reporting.

Class diagram for pyproject.toml configuration

classDiagram
    class BuildSystem {
        +String[] requires
        +String build-backend
    }
    class Project {
        +String name
        +String version
        +String description
        +String readme
        +String requires-python
        +License license
        +String[] keywords
        +Author[] authors
        +String[] classifiers
        +Dependency[] dependencies
        +URL[] urls
        +OptionalDependency[] optional-dependencies
    }
    class Author {
        +String name
        +String email
    }
    class License {
        +String text
    }
    class Dependency {
        +String name
        +String version
    }
    class URL {
        +String Homepage
    }
    class OptionalDependency {
        +String[] test
    }
    BuildSystem --> Project
    Project --> Author
    Project --> License
    Project --> Dependency
    Project --> URL
    Project --> OptionalDependency
Loading

File-Level Changes

Change Details Files
Modernized project configuration by migrating to pyproject.toml
  • Moved package metadata and dependencies from setup.py to pyproject.toml
  • Simplified setup.py to use declarative configuration
  • Added build system configuration for setuptools
  • Defined project metadata including version, description, and classifiers
setup.py
pyproject.toml
Enhanced CI workflow with modern tooling and parallel test execution
  • Replaced pip with UV package manager for faster dependency installation
  • Implemented parallel test execution across Python versions
  • Added separate coverage job that combines results from all test runs
  • Set up coverage reporting with 90% minimum threshold
  • Added coverage artifacts and HTML report generation
.github/workflows/pythonpackage.yml
Updated tox configuration for modern testing practices
  • Updated Python version support to 3.10+ and PyPy
  • Added strict warning handling for ResourceWarning, DeprecationWarning, and PendingDeprecationWarning
  • Integrated coverage reporting into test execution
tox.ini
Added comprehensive pre-commit hook configuration
  • Set up various code quality checks including file formatting and conflict detection
  • Added Python code formatters (black, isort)
  • Configured type checking with mypy
  • Added documentation formatters and RST checkers
  • Set up automatic PR fixes and monthly updates
.pre-commit-config.yaml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @vinitkumar - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@vinitkumar vinitkumar merged commit 76e2ebf into master Dec 17, 2024
19 of 20 checks passed
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.

1 participant