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

fix: most postgres installs to optional #379

Merged
merged 2 commits into from
Aug 9, 2024
Merged

fix: most postgres installs to optional #379

merged 2 commits into from
Aug 9, 2024

Conversation

jamescalam
Copy link
Member

@jamescalam jamescalam commented Aug 9, 2024

PR Type

Bug fix, Enhancement


Description

  • Updated the release version in docs/source/conf.py from 0.0.57 to 0.0.58.
  • Updated the package version in semantic_router/__init__.py from 0.0.57 to 0.0.58.
  • Updated the package version in pyproject.toml from 0.0.57 to 0.0.58.
  • Made psycopg2 an optional dependency in pyproject.toml.
  • Corrected the postgres extra in pyproject.toml to use psycopg2.

Changes walkthrough 📝

Relevant files
Documentation
conf.py
Update documentation release version to 0.0.58                     

docs/source/conf.py

  • Updated the release version from 0.0.57 to 0.0.58.
+1/-1     
Enhancement
__init__.py
Update package version to 0.0.58                                                 

semantic_router/init.py

  • Updated the package version from 0.0.57 to 0.0.58.
+1/-1     
pyproject.toml
Update version and make psycopg2 optional                               

pyproject.toml

  • Updated the package version from 0.0.57 to 0.0.58.
  • Made psycopg2 an optional dependency.
  • Corrected the postgres extra to use psycopg2.
  • +3/-3     

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    @github-actions github-actions bot added enhancement Enhancement to existing features Bug fix Review effort [1-5]: 2 labels Aug 9, 2024
    Copy link

    github-actions bot commented Aug 9, 2024

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ No key issues to review

    Copy link

    github-actions bot commented Aug 9, 2024

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Ensure consistency in versioning and naming of dependencies

    Ensure that the version number of psycopg2 in the pyproject.toml matches the version
    number in the postgres extra dependencies. The previous version was psycopg2 =
    "^2.9.9", but the postgres extra dependency was incorrectly listed as psycopg. This
    inconsistency can lead to confusion and potential issues with dependency resolution.

    pyproject.toml [47]

    +psycopg2 = {version = "^2.9.9", optional = true}
     
    -
    Suggestion importance[1-10]: 9

    Why: This suggestion addresses a potential issue with dependency resolution by ensuring consistency in versioning and naming of dependencies, which is crucial for maintaining a stable build environment.

    9
    Enhancement
    Use dynamic versioning to maintain consistency across the project

    Update the version variable to dynamically fetch the version from a single
    source of truth, such as pyproject.toml, to avoid discrepancies and manual errors in
    version updates across multiple files.

    semantic_router/init.py [7]

    -__version__ = "0.0.58"
    +from importlib.metadata import version
    +__version__ = version("semantic-router")
     
    Suggestion importance[1-10]: 8

    Why: Dynamically fetching the version helps maintain consistency across the project and reduces the risk of manual errors, which is a significant enhancement for maintainability.

    8
    Implement dynamic version fetching to ensure documentation consistency

    Similar to the suggestion for semantic_router/init.py, use a dynamic approach to
    set the release variable in conf.py to ensure consistency with the project's version
    defined in pyproject.toml.

    docs/source/conf.py [18]

    -release = "0.0.58"
    +from importlib.metadata import version
    +release = version("semantic-router")
     
    Suggestion importance[1-10]: 8

    Why: Implementing dynamic version fetching in the documentation configuration ensures that the documentation always reflects the correct version, enhancing consistency and reducing manual update errors.

    8
    Best practice
    Broaden the version range of psycopg2 to enhance compatibility and flexibility

    For the psycopg2 dependency, consider specifying a broader version range or a
    minimum version rather than pinning to a specific patch version. This can help in
    reducing potential conflicts with other libraries and ease future updates.

    pyproject.toml [47]

    -psycopg2 = {version = "^2.9.9", optional = true}
    +psycopg2 = {version = ">=2.9,<3.0", optional = true}
     
    Suggestion importance[1-10]: 7

    Why: Specifying a broader version range for dependencies can improve compatibility with other libraries and make future updates easier, which is a good practice for dependency management.

    7

    @jamescalam jamescalam merged commit 6d6bc99 into main Aug 9, 2024
    3 of 6 checks passed
    @jamescalam jamescalam deleted the james/v0.0.58 branch August 9, 2024 14:51
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Bug fix enhancement Enhancement to existing features Review effort [1-5]: 2
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants