Repository navigation
Conversation
click.Path gives the taxsim command a str, and TaxsimRunner called .exists() on it, so every --taxsim-path run failed with "'str' object has no attribute 'exists'". Coerce the argument to an absolute Path in __init__. Absolute matters too: the runner pipes input through the shell, which searches PATH for a bare name such as "taxsimtest-osx.exe" and reports "command not found". The __init__ lines match the run-provenance branch (#1412) exactly, so either can merge first without a conflict. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
MaxGhenis
marked this pull request as ready for review
November 11, 2026 05:13
Contributor
Author
|
Sweep status (PR sweep of 2026-11-11): an independent Opus 5.5 review approved head c30d4bf. Every check passes except |
This branch was successfully deployed
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.
Summary
policyengine-taxsim taxsim <file> --taxsim-path <binary>failed on every run (reproduced at549beade, current main):click.Pathhands the command astr, andTaxsimRunner.__init__stored it as is._validate_executablethen calledself.taxsim_path.exists()on it. Python callers passing astrhit the same error.A second bug sat behind it. With a
Pathobject (which gets past the first bug), a bare name liketaxsimtest-osx.exerun from the binary's own folder failed with/bin/sh: taxsimtest-osx.exe: command not found._execute_taxsimpipes the input through the shell, and the shell searchesPATHfor a name with no directory in it.Fix
TaxsimRunner.__init__now storesPath(taxsim_path).absolute(). These lines are byte-for-byte the ones #1412 (run-provenance) adds, so the PRs can merge in either order. I checked locally:absolute()hunk drops out as already applied.Tests
New
tests/test_taxsim_path.pyruns the bundled taxsimtest binary for this OS on two pre-2021 records (2019 CA single; 2020 NY married with two children). These need no PolicyEngine run.test_runner_accepts_every_path_spellingpasses the executable four ways: absolutestr, absolutePath, a relative path with a directory, and a bare name. Each case checks that:taxsim_pathis an absolutePathpointing at the bundled binary;run(), so the path must already be fixed at construction;fiitax/siitax/ficaexactly match a run whereTaxsimRunnerfinds the binary itself.test_cli_taxsim_path_optionruns the reported command through click'sCliRunnerwith-o out.csv, once with an absolute path and once with a bare name. It checks for exit 0, both output rows, and outputs that exactly match the default-binary run.test_runner_reports_missing_str_pathchecks that astrpath to a missing file raisesFileNotFoundErrornaming the path, notAttributeError.ficaon every record (all have wages), so the equality checks cannot pass on an empty or all-zero run.Verification:
AttributeError. The absolute-Pathcase passes either way and serves as the control..absolute()fails the relative-with-directory and bare-name runner cases and the CLI bare-name case (command not found).tests/test_taxsim_path.py,tests/test_public_contract.pyandtests/test_cli_entry_point.pygive 12 passed. CI runs the new tests on ubuntu, macOS and Windows.Invariants
These hold for any way a caller can name an existing executable (
strorPath, absolute or relative, with or without a directory):TaxsimRunner.taxsim_pathis an absolutepathlib.Path.run()is called.The four spellings cover every case these depend on, and the tests check each one exhaustively. A property-based generator would add nothing over that.
axiom: n/a: CLI/runner path handling, no policy logicChangelog:
changelog.d/taxsim-path-str.fixed.md.🤖 Generated with Claude Code