Skip to content

Commit

Permalink
Fix Poetry entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
king-millez committed Apr 30, 2024
1 parent 9c81453 commit f4c5ccc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
4 changes: 0 additions & 4 deletions main.py

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ loguru = "^0.7.2"
[tool.poetry.dev-dependencies]

[tool.poetry.scripts]
snapmap-archiver = "snapmap_archiver:main"
snapmap-archiver = "snapmap_archiver.__main__:main"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
15 changes: 7 additions & 8 deletions snapmap_archiver/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@
from loguru import logger
from loguru._logger import Logger

from snapmap_archiver import (
DEFAULT_RADIUS,
DEFAULT_WRITE_JSON,
DEFAULT_ZOOM_DEPTH,
ISSUES_URL,
SNAP_PATTERN,
default_output_dir,
)
from snapmap_archiver import (DEFAULT_RADIUS, DEFAULT_WRITE_JSON,
DEFAULT_ZOOM_DEPTH, ISSUES_URL, SNAP_PATTERN,
default_output_dir)
from snapmap_archiver.coordinates import Coordinates
from snapmap_archiver.SnapmapArchiver import SnapmapArchiver

Expand Down Expand Up @@ -124,6 +119,10 @@ def main():
Coordinates(location) for location, in (args.location if args.location else [])
]

if not valid_snap_ids and not coordinates:
logger.error('Some kind of input is required. Run [snapmap-archiver -h] for help.')
sys.exit(1)

sm_archiver = SnapmapArchiver(
logger=logger, # type: ignore
output_dir=args.output_dir,
Expand Down

0 comments on commit f4c5ccc

Please sign in to comment.