ramstk icon indicating copy to clipboard operation
ramstk copied to clipboard

build: move from poetry to hatch

Open weibullguy opened this issue 1 year ago • 1 comments

Does this PR introduce a breaking change?

  • [ ] Yes
  • [X] No

Describe the purpose of this pull request.

To move the build system from Poetry to Hatch.

Describe how this was implemented.

Making necessary updates to pyproject.toml and Makefile.

Describe any particular area(s) reviewers should focus on.

None

Provide any other pertinent information.

Pull Request Checklist

  • Code Style

    • [x] Code is following code style guidelines.
  • Static Checks

    • [x] Failing static checks are only applicable to code outside the scope of this PR.
  • Tests

    • [x] At least one test for all newly created functions/methods?
  • Chores

    • [x] Issue(s) have been raised for problem areas outside the scope of this PR. These problem areas have been decorated with an ISSUE: # comment.

Summary by Sourcery

Move the project's build system from Poetry to Hatch, updating configuration files and removing Poetry-specific commands from the Makefile. Enhance file operation functions by replacing shutil and dir_util with copyfile and copytree, and update Python version support in the Makefile.

Enhancements:

  • Update Python version support in the Makefile to include versions 3.10, 3.11, and 3.12.
  • Replace shutil and dir_util functions with copyfile and copytree for file operations, adding dirs_exist_ok parameter for better error handling.

Build:

  • Switch the build system from Poetry to Hatch, updating the Makefile and pyproject.toml accordingly.

weibullguy avatar Oct 06 '24 05:10 weibullguy

Reviewer's Guide by Sourcery

This pull request moves the build system from Poetry to Hatch. The changes primarily affect the Makefile, with updates to the pyproject.toml file (not shown in the diff). The PR also includes some minor updates to Python files for improved compatibility and code style.

Architecture diagram for build system migration from Poetry to Hatch

graph TD;
    A[Makefile] -->|Removed Poetry commands| B[Build System];
    A -->|Updated Python versions| C[Python Environment];
    B -->|New Build System| D[Hatch];
    C -->|Supported Versions| E[3.10, 3.11, 3.12];

File-Level Changes

Change Details Files
Removed Poetry-specific targets and commands from Makefile
  • Removed targets for managing dependencies (requirements, depends, upgrade)
  • Removed targets for running tests and coverage (test.unit, test.integration, coverage.unit, etc.)
  • Updated Python versions to 3.10, 3.11, and 3.12
  • Removed variables related to testing (TESTFILE, TESTOPTS, COVDIR)
Makefile
Updated file operations in Python code
  • Replaced shutil.copytree with copytree function, adding dirs_exist_ok parameter
  • Replaced shutil.rmtree with rmtree function
  • Updated error handling for file operations
tests/conftest.py
src/ramstk/configuration.py
Minor updates to database-related code
  • Added return statement in do_build_database_url method
  • Updated type hint for database parameter in do_connect method
src/ramstk/models/db/basedatabase.py
src/ramstk/models/db/basedatabase.pyi

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

  • Contact our support team for questions or feedback.
  • Visit our documentation for detailed guides and information.
  • Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.

sourcery-ai[bot] avatar Oct 06 '24 05:10 sourcery-ai[bot]