Skip to content

feat(cli): convert to python cli ready for pypi publishing - #8

Merged
stdavis merged 8 commits into
mainfrom
feat/python-cli
Aug 5, 2026
Merged

feat(cli): convert to python cli ready for pypi publishing#8
stdavis merged 8 commits into
mainfrom
feat/python-cli

Conversation

@stdavis

@stdavis stdavis commented Jul 28, 2026

Copy link
Copy Markdown
Member

No description provided.

@stdavis
stdavis requested a review from Copilot July 28, 2026 20:38
@stdavis
stdavis enabled auto-merge (rebase) July 28, 2026 20:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 utrans CLI entry point with a get-recent-edits subcommand.
  • 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_edits to support a configurable prog for 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 requires arcpy because it’s imported at module load time. Since --help only needs argparse, defer the arcpy import (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.

Comment thread cli/src/utrans/cli.py
Comment thread cli/src/utrans/cli.py Outdated
Comment thread cli/README.md
Comment thread cli/pyproject.toml Outdated
Comment thread README.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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"

@stdavis
stdavis enabled auto-merge (rebase) July 30, 2026 22:42
@stdavis
stdavis requested a review from acneville July 30, 2026 22:42
Comment thread cli/src/utrans/recent_edits.py
@stdavis
stdavis merged commit 047890c into main Aug 5, 2026
2 checks passed
@stdavis
stdavis deleted the feat/python-cli branch August 5, 2026 16:01
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.

4 participants