albumentations-team / albucore

A high-performance image processing library designed to optimize and extend the Albumentations library with specialized functions for advanced image transformations. Perfect for developers working in computer vision who require efficient and scalable image augmentation.
MIT License
12 stars 3 forks source link

Updated build code #38

Closed ternaus closed 3 weeks ago

ternaus commented 3 weeks ago

Summary by Sourcery

Refactor setup.py to streamline version retrieval and package requirement selection, update dependencies, and modify package metadata. Update pre-commit hook versions in the configuration file.

Enhancements:

Build:

CI:

sourcery-ai[bot] commented 3 weeks ago

Reviewer's Guide by Sourcery

This pull request updates the build code, focusing on the setup.py file and the pre-commit configuration. The changes include refactoring the version retrieval method, simplifying the package setup process, and updating dependencies.

Class diagram for updated setup.py functions

classDiagram
    class Setup {
        +List~str~ INSTALL_REQUIRES
        +str MIN_OPENCV_VERSION
        +List~Tuple~ CHOOSE_INSTALL_REQUIRES
        +List~str~ get_install_requirements(List~str~ install_requires, List~Tuple~ choose_install_requires)
    }
    class Version {
        +str get_version()
    }
    class Requirement {
        +str choose_requirement(Tuple~str~ mains, str secondary)
    }
    Setup --> Version : uses
    Setup --> Requirement : uses
    note for Version "Refactored to use os.path.join instead of Path"
    note for Requirement "Simplified logic for choosing requirements"

File-Level Changes

Change Details Files
Refactored version retrieval method
  • Replaced Path with os.path for file operations
  • Simplified regex matching for version string
  • Removed error handling for version not found
setup.py
Simplified package setup process
  • Removed long description retrieval
  • Removed package metadata (description, author, license, etc.)
  • Simplified package discovery with explicit include
  • Removed classifiers and keywords
setup.py
Updated dependency management
  • Updated numpy requirement to >=1.24.4
  • Modified choose_requirement function to always return a chosen requirement
  • Simplified logic in get_install_requirements function
setup.py
Updated pre-commit hooks
  • Updated pyproject-fmt to version 2.4.3
  • Updated ruff to version 0.7.0
.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](https://app.sourcery.ai) 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](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).