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

refactoring: migration to poetry #25

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

samidarko
Copy link
Contributor

@samidarko samidarko commented Jan 21, 2025

Overview

This pull request focuses on migrating the repository to use [Poetry](https://python-poetry.org/) as the dependency and package management tool. This change brings modern tooling and simplifies managing dependencies, scripts, and environments.

Note that I forked from #22

Key Changes

  1. Migration to Poetry:

    • The repository is now fully managed with Poetry, including dependencies and script automation.
    • A pyproject.toml file has been configured to replace legacy dependency management tools.
    • Renamed src to videotuna
  2. Removal of Bash Scripts:

    • Existing bash scripts have been replaced with Poetry scripts. This approach standardizes the workflow and integrates better with modern Python tooling.
  3. Added Development Workflow Commands:
    The following commands have been defined in pyproject.toml:

    • coverage-report: Generates a test coverage report.
    • format: Automatically formats code using a standard formatter (e.g., black).
    • format-check: Verifies adherence to formatting rules without modifying code.
    • lint: Performs static analysis to detect code quality issues.
    • test: Executes the test suite.
    • type-check: Validates type annotations using a type checker (e.g., mypy).
  4. CI Integration:

    • These commands are now ready to be integrated into CI pipelines, such as GitHub Actions, to ensure consistent and automated code quality checks.

Benefits

  • Consistency: All scripts and commands are managed through Poetry, reducing reliance on ad-hoc bash scripts.
  • Simplified CI/CD Integration: Commands like lint, test, and coverage-report can be directly used in CI workflows.
  • Developer Experience: Using Poetry enhances dependency resolution, environment isolation, and script management, making it easier for contributors to get started.

Next Steps

  • Update the repository's documentation (README.md) to reflect the migration to Poetry and provide usage instructions for the new commands.
  • Integrate the defined commands into GitHub Actions for automated CI/CD workflows.

How to Test

  1. Install Poetry if not already installed:
    curl -sSL https://install.python-poetry.org | python3 -
  2. Install dependencies:
    poetry install
  3. Run the newly defined commands:
    poetry run lint
    poetry run test
    poetry run coverage-report
    poetry run type-check
    poetry run format
    poetry run format-check

References

This migration marks an important step in modernizing the repository, streamlining workflows, and preparing for robust CI/CD integration.

@samidarko samidarko force-pushed the poetry-migration branch 2 times, most recently from 646f762 to 6c7608a Compare January 21, 2025 09:51
@YingqingHe YingqingHe merged commit 98579ae into VideoVerses:main Jan 28, 2025
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.

2 participants