Skip to content

GH-180: Adds CLI entry point and migrate build system to Hatch#212

Open
cr2007 wants to merge 4 commits intooriginalankur:mainfrom
cr2007:180-feat-uvx-support
Open

GH-180: Adds CLI entry point and migrate build system to Hatch#212
cr2007 wants to merge 4 commits intooriginalankur:mainfrom
cr2007:180-feat-uvx-support

Conversation

@cr2007
Copy link

@cr2007 cr2007 commented Mar 11, 2026

This PR refactors the script entry point and modernizes the project
packaging setup.

Fixes #180

Changes

  • Extract script logic into a main() function in create_map_poster.py.
  • Add a CLI entry point (maptoposter) via project.scripts.
  • Migrate the build system from setuptools to hatchling.
  • Simplify dependency lists in pyproject.toml and requirements.txt by removing transitive dependencies.
  • Update uv.lock to reflect the new dependency set.

Usage

You can now run the tool directly without cloning the repo using uvx:

uvx --from https://github.com/originalankur/maptoposter \
  maptoposter --city <city> --country <country> [options]

Or install it as a reusable CLI tool:

# Installs it to a persistent environment
uv tool install git+https://github.com/originalankur/maptoposter

maptoposter --city <city> --country <country> [options]

This makes the project easier to install and use as a standalone CLI utility.

Remove packages that are pulled in transitively by core dependencies and
no longer need to be declared explicitly.

This simplifies pyproject.toml and shrinks uv.lock, including dropping
'scipy' and related scientific stack entries.

Addresses: originalankur#180

Signed-off-by: CSK <73425927+cr2007@users.noreply.github.com>
Move script logic into a main() function and call it from
`if __name__ == "__main__"`.

Switch build system from setuptools to hatchling and configure a console
script entry point `maptoposter` pointing to `create_map_poster:main`.

This enables installing the project with a proper CLI command.

Addresses: originalankur#180

Signed-off-by: CSK <73425927+cr2007@users.noreply.github.com>
@cr2007 cr2007 marked this pull request as draft March 11, 2026 18:13
@cr2007
Copy link
Author

cr2007 commented Mar 11, 2026

Updating the README steps. Will mark it as ready once it has been added.

- Reorganized installation instructions for clarity and flow
  1. `uv` recommended usage with `uvx` and CLI install
  2. Local installation options with `uv run`, `uv sync`, and pip+venv
- Updated usage section to prioritize the `maptoposter` CLI first
  followed by `uv run` and manual Python execution
- Improved formatting, examples, and explanatory text for better
  readability

Addresses: originalankur#180

Signed-off-by: CSK <73425927+cr2007@users.noreply.github.com>
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.

Support running maptoposter as a Python tool package callable via uvx

1 participant