feat(cli): convert to python cli ready for pypi publishing - #8
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a Python-based utrans command-line interface intended to replace direct script execution and prepare the CLI for PyPI-style packaging and distribution.
Changes:
- Added a new
utransCLI entry point with aget-recent-editssubcommand. - Added Python packaging scaffolding under
cli/(pyproject, license, docs) plus initial pytest coverage. - Externalized county field-mapping profiles into a JSON profiles file and adjusted
recent_editsto support a configurableprogfor help output.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates top-level docs to point users to the new CLI docs. |
| cli/tests/test_cli.py | Adds initial tests for version metadata and --help output. |
| cli/src/utrans/recent_edits.py | Extends parser/main to accept a custom prog and uses f-string formatting. |
| cli/src/utrans/profiles.json | Adds county profile definitions used by recent-edits change detection. |
| cli/src/utrans/cli.py | Introduces the top-level CLI dispatcher for utrans. |
| cli/src/utrans/init.py | Adds package version exported from distribution metadata. |
| cli/README.md | Adds CLI installation/development/usage docs. |
| cli/pyproject.toml | Adds packaging and tooling configuration (hatchling/pytest/ruff). |
| cli/LICENSE | Adds MIT license text for the CLI package. |
| .vscode/settings.json | Adds spelling dictionary entries for the new CLI/tooling terms. |
Comments suppressed due to low confidence (2)
cli/src/utrans/cli.py:33
- After removing the eager import, this branch needs to import the subcommand implementation locally before calling it.
if arguments[0] == "get-recent-edits":
return recent_edits.main(arguments[1:], prog="utrans get-recent-edits")
cli/src/utrans/recent_edits.py:361
utrans get-recent-edits --help(and any import of this module) currently requiresarcpybecause it’s imported at module load time. Since--helponly needs argparse, defer thearcpyimport (or guard it with a clear RuntimeError) so help/tests can run in non-ArcGIS environments and users get a friendly error only when executing GIS operations.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
cli/README.md:30
- The usage example uses
--county Carbon, but county keys are documented/validated as case-sensitive and the bundled profiles use lowercase keys (e.g.,"carbon"). As written, the example will fail for users.
utrans get-recent-edits --county Carbon --update-features "Z:\Documents\gdb\Carbon20231019.gdb\Roads" --base-features "Z:\Documents\gdb\Carbon20230208.gdb\CC_Roads"
These were causing linting errors and are not worth trying to overcome.
stdavis
enabled auto-merge (rebase)
July 30, 2026 22:42
acneville
requested changes
Aug 4, 2026
acneville
approved these changes
Aug 5, 2026
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.
No description provided.