Skip to content

Conversation

@cesarcoatl
Copy link
Member

@cesarcoatl cesarcoatl commented Dec 8, 2025

igniton-api 8.3.1.post2 now depends on java-api

Summary by Sourcery

Update ignition-related stubs and tooling to support the new java-api dependency and adjust type-checking configuration for Python 3.12 while preserving Python 2 type checking where needed.

Bug Fixes:

  • Align TransactionManager database type annotations with Python 2 expectations by allowing both str and unicode.

Enhancements:

  • Bump ignition-api-stubs to 8.3.1.post2 and relax types-enum34 requirement formatting.
  • Point flake8 linting to a specific Git repository revision instead of a pinned PyPI version.

Build:

  • Regenerate incendium-stubs requirements without hash locking and add java-api-stubs as a transitive dependency.
  • Simplify uv pip configuration by disabling hash generation for requirements output.

Tests:

  • Rework tox type-checking and stub generation environments to use Python 3.12 with explicit mypy[python2] and ignition-api-stubs dependencies.

igniton-api 8.3.1.post2 now depends on java-api
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 8, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates stubs and tooling to align with ignition-api-stubs 8.3.1.post2’s new dependency on java-api and adjusts type hints and tox configs accordingly.

Class diagram for updated TransactionManager type hints

classDiagram
    class TransactionManager {
        +str transaction_id
        +__init__(database: Union[str, unicode], isolation_level: Optional[int], timeout: Optional[int]) None
    }
Loading

Flow diagram for updated tox typecheck and stubgen environments

flowchart LR
    dev["Developer runs tox"] --> tox["tox"]

    tox --> typecheck_env["testenv:typecheck (python3.12)"]
    tox --> stubgen_env["testenv:stubgen (python3.12)"]
    tox --> stubs_typecheck_env["incendium-stubs testenv:typecheck"]

    typecheck_env --> deps_typecheck["deps: ignition-api-stubs>=8.3, mypy[python2]==0.971"]
    deps_typecheck --> mypy_src["mypy src"]

    stubgen_env --> deps_stubgen["deps: mypy[python2]==0.971"]
    deps_stubgen --> stubgen_cmd["stubgen src -> incendium-stubs/stubs"]

    stubs_typecheck_env --> deps_stubs_typecheck["deps: requirements.txt, mypy[python2]==0.971"]
    deps_stubs_typecheck --> mypy_stubs["mypy stubs"]
Loading

File-Level Changes

Change Details Files
Refresh incendium-stubs lockfile to new ignition-api-stubs version and its java-api-stubs dependency while simplifying constraints.
  • Bump ignition-api-stubs from 8.3.1.post1 to 8.3.1.post2 in requirements
  • Add explicit java-api-stubs==17.25.0b5 dependency pulled in via ignition-api-stubs
  • Drop hash-pinning and several mypy-related transient dependencies from the generated requirements
  • Keep types-enum34 but remove its hash pins
incendium-stubs/requirements.txt
Adjust tox configs to stop sharing a generic [type] env, pin mypy for Python 2 type checking, and use an internal flake8 fork.
  • Set base_python=python3.12 directly for typecheck and stubgen environments instead of referencing [type] section
  • Inline deps for typecheck and stubgen, including ignition-api-stubs>=8.3 and mypy[python2]==0.971
  • Change flake8 dependency to install from a specific GitHub repo and ref 5.0.4
  • Remove the shared [type] section from tox.ini and add mypy[python2]==0.971 to incendium-stubs tox env deps
incendium/tox.ini
incendium-stubs/tox.ini
Tighten type hints to treat database argument as text-compatible in TransactionManager and its stub.
  • Change TransactionManager.init signature in implementation to use typed arguments with Union[str, unicode] for database and Optional[int] for isolation_level/timeout, switching the comment type to # type: (...) -> None for Python 2 compatibility
  • Update the corresponding stub .pyi file to use Union[str, unicode] for the database parameter
incendium/src/incendium/db.py
incendium-stubs/stubs/incendium/db.pyi
Relax uv pip compile settings for stubs generation.
  • Remove generate-hashes from uv.toml so the compiled requirements are not hash-pinned anymore
incendium-stubs/uv.toml

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. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the 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 exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard 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

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • Dropping generate-hashes and all the --hash pins from incendium-stubs/requirements.txt weakens reproducibility/supply-chain guarantees; if this isn’t intentional, consider keeping hashes or explaining why they’re no longer needed.
  • The mypy[python2]==0.971 and base_python = python3.12 settings are now duplicated across multiple tox envs; consider reintroducing a shared section or factor to avoid drift if these need to change later.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Dropping `generate-hashes` and all the `--hash` pins from `incendium-stubs/requirements.txt` weakens reproducibility/supply-chain guarantees; if this isn’t intentional, consider keeping hashes or explaining why they’re no longer needed.
- The `mypy[python2]==0.971` and `base_python = python3.12` settings are now duplicated across multiple tox envs; consider reintroducing a shared section or factor to avoid drift if these need to change later.

## Individual Comments

### Comment 1
<location> `incendium/tox.ini:48` </location>
<code_context>
     black
     docformatter
-    flake8==5.0.4
+    flake8@ git+https://github.com/coatl-dev/flake8.git@5.0.4
     isort
     pydoclint
</code_context>

<issue_to_address>
**suggestion:** Pinning flake8 to a commit hash instead of a tag would improve reproducibility.

Tags like `@5.0.4` can be retagged, which may change the resolved code over time. For fully reproducible linting, prefer pinning to a specific commit SHA (e.g. `@<commit-hash>`) and, if helpful, noting which release that SHA corresponds to.

Suggested implementation:

```
    flake8@ git+https://github.com/coatl-dev/flake8.git@<flake8-5.0.4-commit-sha>  # flake8 5.0.4

```

You’ll need to:
1. Look up the exact commit SHA that corresponds to the `5.0.4` tag in `https://github.com/coatl-dev/flake8.git`.
2. Replace `<flake8-5.0.4-commit-sha>` with that full SHA (e.g. `a1b2c3d4e5f6...`).
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

black
docformatter
flake8==5.0.4
flake8@ git+https://github.com/coatl-dev/flake8.git@5.0.4
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Pinning flake8 to a commit hash instead of a tag would improve reproducibility.

Tags like @5.0.4 can be retagged, which may change the resolved code over time. For fully reproducible linting, prefer pinning to a specific commit SHA (e.g. @<commit-hash>) and, if helpful, noting which release that SHA corresponds to.

Suggested implementation:

    flake8@ git+https://github.com/coatl-dev/flake8.git@<flake8-5.0.4-commit-sha>  # flake8 5.0.4

You’ll need to:

  1. Look up the exact commit SHA that corresponds to the 5.0.4 tag in https://github.com/coatl-dev/flake8.git.
  2. Replace <flake8-5.0.4-commit-sha> with that full SHA (e.g. a1b2c3d4e5f6...).

@cesarcoatl cesarcoatl merged commit 9909e20 into main Dec 8, 2025
9 checks passed
@cesarcoatl cesarcoatl deleted the build/pip/ignition-api-8.3.1.post2-java-api branch December 8, 2025 23:19
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