Skip to content

Conversation

@1pav
Copy link
Collaborator

@1pav 1pav commented Dec 4, 2025

According to pyproject.toml the minimum required python version for the project is 3.6:

requires-python = ">=3.6"

however, uv will pick the first python version that is compatible with the requirement. On my environment (F43), that is python3.14, which seems to be incompatible with some code, e.g. when running tests:

________________________________________________________ ERROR collecting tests/test_registry_query.py _________________________________________________________
tests/test_registry_query.py:8: in <module>
    from flatpak_indexer.registry_query import query_registry_image
flatpak_indexer/registry_query.py:4: in <module>
    from .models import ImageModel
flatpak_indexer/models.py:21: in <module>
    class ImageModel(BaseModel):
flatpak_indexer/json_model.py:277: in __new__
    k: _make_model_field(k, v, getattr(x, k, None)) for k, v in annotations.items()
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
flatpak_indexer/json_model.py:267: in _make_model_field
    raise TypeError(f"{name}: Unsupported type {resolved}")
E   TypeError: pull_spec: Unsupported type <class 'typing.Union'>

The above will work fine with python3.12.

It is usually recommended to pin python version via .python-version. Apparently we are using 3.12 also in CI, so that's what I set it to.

@gemini-code-assist
Copy link

Summary of Changes

Hello @1pav, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a compatibility issue where the project's dependency management tool (uv) could select a Python version newer than 3.12, leading to runtime errors, specifically TypeError with typing.Union. By introducing a .python-version file, the project now explicitly specifies Python 3.12, ensuring a consistent and stable development and testing environment that matches the CI setup.

Highlights

  • Python Version Pinning: The project's Python version has been explicitly pinned to 3.12 to resolve compatibility issues encountered with newer Python versions (e.g., 3.14) that caused TypeError exceptions during testing.
  • Environment Consistency: A .python-version file has been introduced, setting the Python version to 3.12, aligning the local development environment with the version already used in CI.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request pins the Python version to 3.12 by adding a .python-version file, which is a good measure to ensure development environment consistency and resolve the noted incompatibility with Python 3.14. My main feedback is that the requires-python setting in pyproject.toml should also be updated to reflect this stricter version requirement. This will ensure the package's metadata is accurate and prevent installation on unsupported Python versions.

Copy link
Owner

@owtaylor owtaylor left a comment

Choose a reason for hiding this comment

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

Let's update the .python-version in pyproject.toml to 3.12 but leave it as a >=

@1pav 1pav requested a review from owtaylor December 4, 2025 16:01
Copy link
Owner

@owtaylor owtaylor left a comment

Choose a reason for hiding this comment

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

LGTM

@1pav 1pav merged commit 50e5429 into owtaylor:main Dec 9, 2025
2 checks passed
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