ci: make the clean-install smoke test import from outside the checkout - #1373
Closed
boai-maker wants to merge 1 commit into
Closed
boai-maker wants to merge 1 commit into
boai-maker wants to merge 1 commit into
Conversation
The smoke-install job installs the package and then runs
python -c "import tradingagents, cli.main"
from the repository root. `python -c` prepends the current directory to
sys.path, so both names resolve to the ./tradingagents and ./cli source
trees rather than to the distribution pip just installed. Verified on a
clean 3.12 venv against the current tree:
# from the repo root (what CI does today)
cli -> <repo>/cli/__init__.py
tradingagents -> <repo>/tradingagents/__init__.py
# from outside the checkout
cli -> site-packages/cli/__init__.py
tradingagents -> site-packages/tradingagents/__init__.py
The package is packaged correctly today, so nothing is currently red --
but the job cannot fail for the reason it exists. A module dropped from
the built artifact or an undeclared runtime dependency (the TauricResearch#994
python-dotenv case named in the comment) would still be satisfied by the
source tree sitting in the working directory, and the job would report
success. `cd "$RUNNER_TEMP"` before the import makes it test the
installed distribution.
Also hardens the workflow while touching it:
- permissions: contents: read -- no job here writes to the repo,
packages or checks, so don't inherit the repository default.
- concurrency: key on the workflow name as well as the ref, and only
cancel in-progress runs for pull_request events, so every commit
landing on main keeps a CI result instead of being cancelled by the
next push.
- pip caching on the test and smoke jobs via setup-python, keyed on
pyproject.toml -- the four matrix legs currently resolve and build
the dev environment from scratch on every run.
- pin ruff instead of `ruff>=0.15`. That constraint already floats a
full minor: it resolves to 0.16.8 today. `ruff check .` still passes
on 0.16.8, so this is not a fix for a current break -- it stops a
future ruff release from adding a rule to the strict select and
reddening main with no commit behind it.
- timeout-minutes on all three jobs, so a hung pytest is cut off in
20 minutes rather than consuming the 6 hour default.
No change to the rule set, the matrix, or what is linted. `ruff format`
is deliberately left out, per the note in pyproject.toml that whole-repo
formatter adoption is deferred until the open-PR backlog clears.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Author
|
Closing this — withdrawing at the author's request. Apologies for the noise. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
smoke-installinstalls the package and then runs the import check from the repository root:python -cprepends the current working directory tosys.path. At the repo root that directory containstradingagents/andcli/, so both names resolve to the source tree, not to the distribution pip just installed.Verified on a clean 3.12 venv against current
main:The package is packaged correctly today, so nothing is currently red — this is a latent gap, not a live break. But the job cannot fail for the reason it exists. A module dropped from the built artifact, or an undeclared runtime dependency (the
#994python-dotenv case the comment names), would still be satisfied by the source tree in the working directory and the job would report success.cd "$RUNNER_TEMP"before the import makes it test the installed distribution.Also hardened while touching the file
permissions: contents: readconcurrencykeyed on workflow name,cancel-in-progressonly forpull_requestmainkeeps a CI result instead of being cancelled by the next pushsetup-python, keyed onpyproject.tomlruff==0.16.8instead ofruff>=0.15ruff check .still passes on it, so this isn't a fix for a break; it stops a future release adding a rule to the strict select and reddeningmainwith no commit behind ittimeout-minuteson all three jobspytestis cut off in 20 min rather than consuming the 6-hour defaultDeliberately not included
ruff format --check—pyproject.tomlnotes that whole-repo formatter adoption is deferred until the open-PR backlog clears, and it would reformat 118 of 160 files today. Left alone.No change to the rule set, the matrix, or what is linted.
Verification
ruff check .passes on 0.16.8 (unchanged behaviour)🤖 Generated with Claude Code