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

Replace poetry by hatch #3

Merged
merged 17 commits into from
Jun 7, 2024
Merged

Replace poetry by hatch #3

merged 17 commits into from
Jun 7, 2024

Conversation

fschuch
Copy link
Owner

@fschuch fschuch commented Feb 27, 2024

Summary by CodeRabbit

  • New Features

    • Introduced GitHub Actions workflows for dependency updates, release preparation, tagging, CI/CD, documentation deployment, and pre-commit updates.
    • Added CHANGELOG.md for documenting project changes.
    • Introduced towncrier for managing changelogs.
    • Added new pre-commit hooks for code quality checks.
  • Bug Fixes

    • Updated .gitignore to exclude specific files and directories.
    • Reorganized VSCode settings and extensions for better development experience.
  • Documentation

    • Enhanced README.md with updated instructions and tooling changes.
    • Improved documentation structure and deployment using Jupyter Book.
  • Refactor

    • Replaced Poetry with Hatch for package management.
    • Updated project configuration in pyproject.toml.
  • Chores

    • Added configuration files for GitHub workflows and Dependabot.
    • Updated pre-commit configurations and dependencies.

Copy link

coderabbitai bot commented May 22, 2024

Warning

Rate limit exceeded

@fschuch has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 42 minutes and 50 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between 449f3b6 and aa6f371.

Walkthrough

The project introduces comprehensive updates, primarily focusing on enhancing the GitHub Actions workflows, transitioning from Poetry to Hatch for package management, and refining the documentation setup. Key changes include new workflows for dependency updates, release preparation, CI/CD processes, and documentation deployment. Additionally, pre-commit hooks were updated, and significant modifications were made to the project configuration files, enhancing development workflows and quality assurance.

Changes

Files/Paths Summary
.github/dependabot.yml New configuration for updating dependencies in GitHub Actions and Python packages on a weekly basis.
.github/workflows/1-prepare-release.yaml New workflow for preparing a release, including version input, changelog update, and PR creation.
.github/workflows/2-tag-release.yaml New workflow for creating a tag upon PR acceptance on main or release/** branches.
.github/workflows/check-links.yaml Added parameters folder-path: "docs/" and file-path: "README.md" to a job configuration.
.github/workflows/ci.yaml New CI workflow for QA, testing, building packages, and releasing to PyPI, with triggers for various events.
.github/workflows/docs.yaml New workflow for building and deploying documentation using Jupyter Book.
.github/workflows/update-pre-commits.yaml Added configuration for Python version and caching settings.
.gitignore Removed space before .python-version, added .hatch/ and **/_version.py to ignore list.
.pre-commit-config.yaml Added new hooks, updated existing hooks, and modified arguments for ruff hook.
.vscode/extensions.json Removed ms-python.vscode-pylance and njpwerner.autodocstring from recommended extensions.
.vscode/settings.json Updated editor rulers, removed --no-cov, and added "python.envFile": "${workspaceFolder}/.venv/wizard-template".
CHANGELOG.md New file documenting notable changes using Keep a Changelog format.
README.md Replaced Poetry with Hatch, updated QA tools, documentation setup, and enhanced the quick start guide.
changelog.d/... Multiple new files documenting changes, including new hooks, release workflow enhancements, and tool changes.
docs/_toc.yml Reorganized chapters in the table of contents.
docs/markdown-notebooks.md Adjusted numbering of elements in the description of MyST Markdown notebooks.
hatch.toml Introduced configurations for different environments, dependencies, and scripts.
pyproject.toml Replaced tool.poetry with project, updated project metadata and tool configurations.
scripts/rename_project_content.py Added new functions and updated regex patterns for renaming project content.
tests/test_core.py Updated parameter format within @pytest.mark.parametrize.
towncrier.toml New configuration settings for the towncrier tool.
wizard_template/__init__.py Changed import of __version__ to a different module.
wizard_template/core.py Introduced a new custom exception class NotAnIntegerError.
.github/release.yml Reorganized changelog categories and adjusted associated labels.

Sequence Diagram(s) (Beta)

Poem

In the land of code, changes abound,
With workflows and docs, improvements are found.
Hatch takes the helm, Poetry's replaced,
Quality assured, tests are embraced.
GitHub Actions dance, dependencies in line,
A project refined, simply divine.
🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@fschuch fschuch marked this pull request as ready for review June 4, 2024 22:50
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 17a5721 and ff27fed.

Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
Files selected for processing (28)
  • .github/dependabot.yml (1 hunks)
  • .github/workflows/1-prepare-release.yaml (1 hunks)
  • .github/workflows/2-tag-release.yaml (1 hunks)
  • .github/workflows/check-links.yaml (1 hunks)
  • .github/workflows/ci.yaml (1 hunks)
  • .github/workflows/docs.yaml (1 hunks)
  • .github/workflows/update-pre-commits.yaml (1 hunks)
  • .gitignore (3 hunks)
  • .pre-commit-config.yaml (1 hunks)
  • .vscode/extensions.json (1 hunks)
  • .vscode/settings.json (1 hunks)
  • CHANGELOG.md (1 hunks)
  • README.md (1 hunks)
  • changelog.d/+26504d7b.added.md (1 hunks)
  • changelog.d/+372e2893.changed.md (1 hunks)
  • changelog.d/+437da835.added.md (1 hunks)
  • changelog.d/+801234df.changed.md (1 hunks)
  • changelog.d/+b04ee6f1.added.md (1 hunks)
  • changelog.d/+ff95a66f.removed.md (1 hunks)
  • docs/_toc.yml (1 hunks)
  • docs/markdown-notebooks.md (1 hunks)
  • hatch.toml (1 hunks)
  • pyproject.toml (2 hunks)
  • scripts/rename_project_content.py (4 hunks)
  • tests/test_core.py (1 hunks)
  • towncrier.toml (1 hunks)
  • wizard_template/init.py (1 hunks)
  • wizard_template/core.py (2 hunks)
Files skipped from review due to trivial changes (17)
  • .github/dependabot.yml
  • .github/workflows/1-prepare-release.yaml
  • .github/workflows/2-tag-release.yaml
  • .github/workflows/check-links.yaml
  • .github/workflows/update-pre-commits.yaml
  • .gitignore
  • .vscode/extensions.json
  • .vscode/settings.json
  • CHANGELOG.md
  • changelog.d/+26504d7b.added.md
  • changelog.d/+437da835.added.md
  • changelog.d/+b04ee6f1.added.md
  • changelog.d/+ff95a66f.removed.md
  • docs/_toc.yml
  • docs/markdown-notebooks.md
  • tests/test_core.py
  • towncrier.toml
Additional comments not posted (25)
changelog.d/+801234df.changed.md (1)

1-1: Change accurately reflects the PR's main objective of replacing Poetry with Hatch.

changelog.d/+372e2893.changed.md (1)

1-1: Enhancement to the release workflow is clearly described and relevant to the PR's objectives.

wizard_template/__init__.py (1)

3-3: Updated import statement reflects the new module structure accurately.

wizard_template/core.py (2)

4-10: Introduction of the custom exception NotAnIntegerError is well-documented and implemented correctly.


36-36: Update in demo_function to use the new custom exception is correctly implemented.

.pre-commit-config.yaml (1)

5-5: Updates to pre-commit hooks and their configurations are consistent with the PR's objectives to enhance automation and dependency management.

Also applies to: 9-18, 20-25, 30-30, 35-35, 41-45

.github/workflows/docs.yaml (1)

1-60: New workflow for documentation deployment is well-structured and includes detailed steps, aligning with the PR's objectives.

hatch.toml (1)

38-38: Dependencies for the documentation environment are well-defined.

pyproject.toml (4)

1-1: Project metadata is correctly updated to reflect the new tooling and project structure.


41-41: Coverage configuration is appropriately set to include all relevant source files.


72-72: Build system dependencies are correctly specified to ensure a smooth build process.


33-33: Ensure the pytest minimum version is compatible with other testing tools used in the project.

.github/workflows/ci.yaml (5)

1-1: The CI workflow is correctly named and triggers are appropriately set for push, pull_request, and schedule events.


36-36: Matrix strategy for testing across different operating systems and Python versions is well-implemented.


66-66: Build job is well-configured to handle package building and artifact uploading.


87-87: Release job conditions are correctly set to trigger only on valid tags, ensuring secure and intended deployments.


26-26: Ensure the QA job uses a secure setup for checking out code and setting up Python.

Verification successful

The QA job in the CI workflow uses actions/checkout@v4 and actions/setup-python@v5, which are the latest versions and include security updates and best practices.

  • .github/workflows/ci.yaml:
    • actions/checkout@v4
    • actions/setup-python@v5
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify security settings for the QA job in the CI workflow.

# Test: Check for secure practices in checkout and setup-python actions. Expect: Secure practices are used.
grep -A 10 "qa:" .github/workflows/ci.yaml | grep -E "actions/checkout|actions/setup-python"

Length of output: 164

scripts/rename_project_content.py (4)

23-23: The GitInfo class is well-documented and provides a clear structure for storing git information.


48-48: Error handling in from_repo_info_with_fallback provides a good user experience by allowing manual input on failure.


59-59: The main function effectively orchestrates the renaming process, ensuring a smooth user experience.


29-29: Ensure the from_repo_info method robustly handles different git URL formats.

README.md (4)

21-21: Overview section clearly explains the purpose and features of the template.


83-83: Quick Start guide provides a comprehensive step-by-step setup process.


160-160: Dependencies section accurately lists and explains how dependencies are managed.


177-177: Code quality enforcement strategies are well-documented and provide clear instructions for usage.

hatch.toml Outdated Show resolved Hide resolved
hatch.toml Outdated Show resolved Hide resolved
hatch.toml Outdated Show resolved Hide resolved
hatch.toml Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
The project will use Automatically generated release notes from now on
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ff27fed and 449f3b6.

Files selected for processing (3)
  • .github/release.yml (1 hunks)
  • README.md (1 hunks)
  • hatch.toml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • hatch.toml
Additional context used
LanguageTool
README.md

[uncategorized] ~37-~37: In this context, “any time” needs to be split into two words. (AT_ANYTIME)
Context: ...nteractive tutorials. You can check at anytime the environments and scripts that are p...


[uncategorized] ~78-~78: “you” seems less likely than “your” (belonging to you). (AI_HYDRA_LEO_CP_YOU_YOUR)
Context: ...# Use the template as a start point for you own project 1. Click on [Use this temp...


[style] ~84-~84: This phrase is often redundant. Consider writing “I” unless you want to emphasize that you and not someone else will do something. Then, commas might be missing. (I_MYSELF)
Context: ...ing the instructions for your OS. - I personally like to keep the Python environments wi...


[style] ~176-~176: Consider using an alternative to avoid wordiness and strengthen your wording. (FROM_TIME_TO_TIME)
Context: ...to run the checks on the whole codebase from time to time (when a new hook is added or on Pull ...


[typographical] ~207-~207: A comma between “please” and the verb is normally not needed. If you want to signal a pause, consider using an em dash instead. (PLEASE_UNNECESSARY_COMMA)
Context: ...bot.yml)). ### Managing the Changelog Please, refer to [Keep a Changelog](https://keepachan...


[uncategorized] ~224-~224: “an” (indefinite article before a vowel sound) seems less likely than “and” (in addition to, following this). (AI_HYDRA_LEO_CP_AN_AND)
Context: ...covered from the version control system an exported to the file `wizard_template/_...


[style] ~251-~251: In American English, abbreviations like “etc.” require a period. (ETC_PERIOD)
Context: ...e.g., 1.2.3, 0.0.1.rc2, 2023.2.0, etc). The action then: - Process the pe...


[grammar] ~288-~288: Possible agreement error -- use the past participle here. (HAVE_PART_AGREEMENT)
Context: ...hon package can show that it has inline type annotations. These annotations are usef...

Additional comments not posted (10)
.github/release.yml (7)

3-5: LGTM! The "Security" category is well-defined.


6-8: LGTM! The "Removed" category is well-defined.


9-11: LGTM! The "Deprecated" category is well-defined.


12-14: LGTM! The "Added" category is well-defined.


15-17: LGTM! The "Changed" category is well-defined.


18-20: LGTM! The "Fixed" category is well-defined.


21-28: LGTM! The "Internals" category is well-defined, including the addition of "dependencies".

README.md (3)

202-204: LGTM! The continuous integration section is comprehensive and informative.


242-278: LGTM! The publishing section is comprehensive and informative.

Tools
LanguageTool

[style] ~251-~251: In American English, abbreviations like “etc.” require a period. (ETC_PERIOD)
Context: ...e.g., 1.2.3, 0.0.1.rc2, 2023.2.0, etc). The action then: - Process the pe...


282-302: LGTM! The miscellaneous section is comprehensive and informative.

Tools
LanguageTool

[grammar] ~288-~288: Possible agreement error -- use the past participle here. (HAVE_PART_AGREEMENT)
Context: ...hon package can show that it has inline type annotations. These annotations are usef...

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@fschuch fschuch merged commit 68c2a61 into main Jun 7, 2024
23 checks passed
@fschuch fschuch deleted the replace-poetry-by-hatch branch June 7, 2024 20:56
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.

None yet

1 participant