chore: use jython template#314
Conversation
from ignition-devs/copier-templates
Reviewer's GuideAligns the project with the ignition-devs jython copier template by restructuring CI/publish workflows, simplifying tox/pre-commit/stubs configs, updating packaging/metadata, and standardizing Jython install targets and documentation text. Sequence diagram for CI pipeline on pull_requestsequenceDiagram
actor Dev
participant GitHub as GitHub_Actions
participant CI as Workflow_ci_yml
participant PreCommit as Job_pre-commit
participant Pylint as Job_pylint
participant Jython as Job_jython
participant ToxPkg as Job_tox-package
participant ToxStubs as Job_tox-stubs
Dev->>GitHub: open_or_update_pull_request
GitHub->>CI: trigger_ci_workflow
CI->>PreCommit: start_reusable_pre-commit
PreCommit-->>CI: pre-commit_finished
CI->>Pylint: start_reusable_pylint(needs pre-commit)
Pylint-->>CI: pylint_finished
CI->>Jython: start_inline_jython_job
Jython->>Jython: checkout_repository
Jython->>Jython: setup_jython_2_7_3
Jython->>Jython: cache_JYTHON_CACHE_DIR
Jython->>Jython: make_install_with_cache
Jython-->>CI: jython_installation_ok
CI->>ToxPkg: start_reusable_tox-docker
ToxPkg-->>CI: tox_docker_finished
CI->>ToxStubs: start_reusable_tox_stubs
ToxStubs-->>CI: tox_stubs_finished
CI-->>GitHub: report_job_statuses
GitHub-->>Dev: checks_pass_or_fail
Flow diagram for updated Jython Makefile install targetsflowchart TD
Dev[Developer] --> ChooseTarget{Select make target}
ChooseTarget --> TInstall[make install]
ChooseTarget --> TInstallClean[make install-clean]
ChooseTarget --> TInstallForce[make install-force]
ChooseTarget --> TInstallNoCache[make install-nocache]
ChooseTarget --> TInstallNoDeps[make install-nodeps]
subgraph Common_Steps
direction TB
Step_Check[check]
Step_Init[init]
end
TInstall --> Step_Check
TInstall --> Step_Init
Step_Init --> InstallCache[Run jython -m pip install --cache-dir JYTHON_CACHE_DIR .]
TInstallClean --> Step_Check
TInstallClean --> Step_Init
TInstallClean --> Clean[clean]
Clean --> InstallCacheClean[Run jython -m pip install --cache-dir JYTHON_CACHE_DIR .]
TInstallForce --> Step_Check
TInstallForce --> Step_Init
Step_Init --> InstallForce[Run jython -m pip install --force-reinstall --cache-dir JYTHON_CACHE_DIR .]
TInstallNoCache --> Step_Check
Step_Check --> InstallNoCache[Run jython -m pip install --no-cache-dir .]
TInstallNoDeps --> Step_Check
Step_Check --> InstallNoDeps[Run jython -m pip install --no-deps .]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 4 issues, and left some high level feedback:
- In
.github/workflows/publish.yml, bothtox-packageandtox-stubsare gated withif: ${{ github.event_name == 'pull_request' }}even though the workflow only triggers onreleaseevents, so these jobs (and the dependent PyPI publish jobs) will never run; drop thepull_requestcondition or adjust it to match the release trigger.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `.github/workflows/publish.yml`, both `tox-package` and `tox-stubs` are gated with `if: ${{ github.event_name == 'pull_request' }}` even though the workflow only triggers on `release` events, so these jobs (and the dependent PyPI publish jobs) will never run; drop the `pull_request` condition or adjust it to match the release trigger.
## Individual Comments
### Comment 1
<location path=".github/workflows/publish.yml" line_range="9-10" />
<code_context>
+ run: |
+ make install JYTHON_CACHE_DIR=${{ env.JYTHON_CACHE_DIR }}
+
+ tox-package:
+ if: ${{ github.event_name == 'pull_request' }}
+ uses: coatl-dev/workflows/.github/workflows/tox-docker.yml@v6
+
</code_context>
<issue_to_address>
**issue (bug_risk):** Using `if: github.event_name == 'pull_request'` in a release-triggered workflow means `tox-package` (and thus publish jobs that depend on it) will never run.
Because this workflow only runs on `release` events, the `tox-package` and `tox-stubs` jobs are always skipped due to `if: ${{ github.event_name == 'pull_request' }}`. That means `pypi-publish-package` and `pypi-publish-stubs` (which depend on those jobs) can never succeed. Please either remove these `if` conditions or update them to match the `release` event so the publish stage runs on release creation.
</issue_to_address>
### Comment 2
<location path="stubs/tox.ini" line_range="4-5" />
<code_context>
requires =
- tox>=4.25
+ tox>=4.2
env_list =
- typecheck
py3{9-12}
skip_missing_interpreters = true
</code_context>
<issue_to_address>
**suggestion (testing):** The `env_list` includes py39–py312, but only `py312` is explicitly configured, which may run unexpected default environments.
With `env_list = py3{9-12}` and only `[testenv:py312]` defined, tox will run `py39`, `py310`, and `py311` using the implicit `[testenv]` (which you haven’t configured). Those envs may effectively “do nothing” or diverge from `py312` behavior. If you only need 3.12, consider restricting `env_list` to `py312`; otherwise, add explicit sections or a shared `[testenv]` so all Python versions run the same checks.
</issue_to_address>
### Comment 3
<location path="stubs/README.md" line_range="15-16" />
<code_context>
-To use `incendium-stubs`, you may install it with `pip`. It requires Python 3.9
-through 3.12.
+To use incendium, you may install it with `pip`. It requires Python
+3.9 - 3.12.
</code_context>
<issue_to_address>
**issue (typo):** The package name here should likely be "incendium-stubs" to match the project and install command.
Since this README and the install command both reference `incendium-stubs`, updating this line to use the same package name would avoid confusion.
```suggestion
To use `incendium-stubs`, you may install it with `pip`. It requires Python 3.9 through 3.12.
```
</issue_to_address>
### Comment 4
<location path="README.md" line_range="11" />
<code_context>
[](https://github.com/orgs/ignition-devs/discussions)
-Package that extends and wraps some functions from Ignition's Scripting API.
+Package that extends and wraps Ignition Scripting API.
For more information, please refer to the [Wiki].
</code_context>
<issue_to_address>
**nitpick (typo):** Consider adding "the" before "Ignition Scripting API" for smoother grammar.
Suggestion: change this to “Package that extends and wraps the Ignition Scripting API.” to make the sentence grammatically complete.
```suggestion
Package that extends and wraps the Ignition Scripting API.
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| env_list = | ||
| typecheck | ||
| py3{9-12} |
There was a problem hiding this comment.
suggestion (testing): The env_list includes py39–py312, but only py312 is explicitly configured, which may run unexpected default environments.
With env_list = py3{9-12} and only [testenv:py312] defined, tox will run py39, py310, and py311 using the implicit [testenv] (which you haven’t configured). Those envs may effectively “do nothing” or diverge from py312 behavior. If you only need 3.12, consider restricting env_list to py312; otherwise, add explicit sections or a shared [testenv] so all Python versions run the same checks.
from ignition-devs/copier-templates
Summary by Sourcery
Align project configuration and workflows with the shared jython copier template and refresh project metadata.
New Features:
Enhancements:
Documentation: