Skip to content

Conversation

@cesarcoatl
Copy link
Member

@cesarcoatl cesarcoatl commented Dec 10, 2025

Summary by Sourcery

Restructure the project layout and tooling around a single top-level java-api package and stubs subpackage, and update documentation to match.

Build:

  • Update pre-commit configuration, tox settings, and commitizen version files to reflect the new src and stubs paths and shared top-level config files.

CI:

  • Adjust CI and publish workflows to use the new project structure, paths, and working directories for src, tests, and stubs.

Documentation:

  • Rewrite the main README with usage, installation, project structure, and contributor information for the java-api package.
  • Add badges and improve the README for the java-api-stubs package under the new stubs directory.

Chores:

  • Remove duplicated package metadata files under the old java-api directory in favor of a consolidated top-level configuration.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 10, 2025

Reviewer's Guide

Restructures the project from nested java-api/java-api-stubs packages into a flat src/ and stubs/ layout, updates tooling/config paths accordingly, modernizes tox and mypy wiring, and refreshes documentation to match the new structure and packaging story.

File-Level Changes

Change Details Files
Restructure repository layout from nested java-api and java-api-stubs subprojects to a flat top-level src/ and stubs/ structure.
  • Replace references to java-api/src and java-api-stubs/stubs with src and stubs/stubs across configuration files.
  • Remove duplicated per-subproject metadata files such as java-api/README.md, java-api/LICENSE, and java-api/CHANGELOG.md now that the root docs cover the project.
  • Adjust GitHub Actions workflows to run tox and linting from the repository root and stubs directory instead of subproject working directories.
.github/workflows/pr-build.yml
.github/workflows/ci.yml
.github/workflows/publish.yml
java-api/CHANGELOG.md
java-api/LICENSE
java-api/README.md
Update pre-commit and linting configuration to target the new layout and centralized configuration files.
  • Change pre-commit hook file patterns from java-api/ and java-api-stubs/ paths to src/ and stubs/ paths.
  • Point isort, flake8, docformatter, and pydocstyle hooks to use root-level tox.ini and stubs/tox.ini instead of per-subproject tox.ini files.
  • Simplify pylint configuration to use root src/ path and drop java-api-specific rcfile path.
.pre-commit-config.yaml
.github/workflows/ci.yml
Modernize tox and type-checking configuration to work with the new layout and a shared mypy configuration source.
  • Move java-api/tox.ini to root-level tox.ini and update commands to operate on src and stubs paths.
  • Inline the [type] factor into testenv:typecheck and testenv:stubgen by specifying base_python and dependency list directly.
  • Switch mypy[python2] dependencies from pinned sdist versions to git-based installs for both main package and stubs tox environments.
  • Adjust stubgen output path from java-api-stubs/stubs to stubs/stubs to reflect the new stubs package location.
tox.ini
stubs/tox.ini
Align automation/versioning config with the new flat packaging layout.
  • Update Commitizen version_files entries to reference setup.cfg and stubs/pyproject.toml instead of per-subproject setup/pyproject files.
  • Adjust publish workflow to upload java-api from the repo root and java-api-stubs from the stubs working directory.
.cz.toml
.github/workflows/publish.yml
Refresh README documentation to describe the single java-api package, installation for Python 2.7, and the restructured project layout, and enhance stubs README with badges.
  • Rewrite root README.md from a multi-project description to a focused java-api package README with usage examples, project structure section, contribution info, and standard links.
  • Document the new src/java and src/javax package structure and link to the Java 17 API docs.
  • Update stubs README.md path and add project badges while keeping the existing description of the stub package.
README.md
stubs/README.md

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:

  • The .devcontainer.json file is now effectively empty; if devcontainer support is still desired, consider either restoring its previous configuration with updated paths or removing the file entirely to avoid confusion.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `.devcontainer.json` file is now effectively empty; if devcontainer support is still desired, consider either restoring its previous configuration with updated paths or removing the file entirely to avoid confusion.

## Individual Comments

### Comment 1
<location> `README.md:39-40` </location>
<code_context>
+### Installing with `pip`
+
+> [!NOTE]
+> For the stubs for this packages, look for [`java-api-stubs`].
+
+The preferred method is to install it by running `pip`. It requires Python
</code_context>

<issue_to_address>
**issue (typo):** Fix grammar in note about stubs package.

Please update the note to use the singular form, e.g. "For the stubs for this package" or "For stub files for this package," to correct the grammar and improve clarity.

```suggestion
> [!NOTE]
> For stub files for this package, look for [`java-api-stubs`].
```
</issue_to_address>

### Comment 2
<location> `README.md:35` </location>
<code_context>
+
+## Installation and usage
+
+To use java-api, you may install it by doing any of the following.
+
+### Installing with `pip`
</code_context>

<issue_to_address>
**suggestion (typo):** Clarify wording about installation methods.

Since only pip installation is documented, consider changing "any of the following" to "the following" or "the following method" to avoid implying multiple options.

```suggestion
To use java-api, you may install it using the following method.
```
</issue_to_address>

### Comment 3
<location> `README.md:49` </location>
<code_context>
+python2 -m pip install java-api
+```
+
+This will install it as package to your Python installation, which will allow
+you to call Ignition Scripting functions from Python's REPL, and get code
+completion using an IDE such as PyCharm and Visual Studio Code.
</code_context>

<issue_to_address>
**issue (typo):** Improve grammar in description of installation result.

Consider rephrasing to: “This will install it as a package in your Python installation,” to correct the article and preposition.

```suggestion
This will install it as a package in your Python installation, which will allow
```
</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.

python2 -m pip install java-api
```

This will install it as package to your Python installation, which will allow
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (typo): Improve grammar in description of installation result.

Consider rephrasing to: “This will install it as a package in your Python installation,” to correct the article and preposition.

Suggested change
This will install it as package to your Python installation, which will allow
This will install it as a package in your Python installation, which will allow

cesarcoatl and others added 2 commits December 10, 2025 12:41
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@cesarcoatl cesarcoatl merged commit 6bf39e5 into main Dec 10, 2025
5 checks passed
@cesarcoatl cesarcoatl deleted the chore/restructure-project branch December 10, 2025 20:45
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