From 2e2c142331315221d2e180a8009b16230d9e3730 Mon Sep 17 00:00:00 2001 From: kamangir Date: Wed, 22 May 2024 20:24:28 -0700 Subject: [PATCH] -> pypi - kamangir/bolt#746 --- .abcli/hubble.sh | 24 +++++++++---------- MANIFEST.in | 1 + README.md | 7 +++--- {hubble => hubblescope}/__init__.py | 4 ++-- {hubble => hubblescope}/__main__.py | 8 +++---- {hubble => hubblescope}/datasets.py | 2 +- {hubble => hubblescope}/fits.py | 4 ++-- {hubble => hubblescope}/ingest.py | 6 ++--- {hubble => hubblescope}/logger.py | 2 +- {hubble => hubblescope}/tests/test_version.py | 2 +- {hubble => hubblescope}/urls.py | 0 pyproject.toml | 6 +++++ requirements.txt | 1 + setup.py | 8 +++---- 14 files changed, 41 insertions(+), 34 deletions(-) create mode 100644 MANIFEST.in rename {hubble => hubblescope}/__init__.py (78%) rename {hubble => hubblescope}/__main__.py (88%) rename {hubble => hubblescope}/datasets.py (97%) rename {hubble => hubblescope}/fits.py (97%) rename {hubble => hubblescope}/ingest.py (85%) rename {hubble => hubblescope}/logger.py (68%) rename {hubble => hubblescope}/tests/test_version.py (56%) rename {hubble => hubblescope}/urls.py (100%) create mode 100644 pyproject.toml diff --git a/.abcli/hubble.sh b/.abcli/hubble.sh index 8e3c7ff..2f40392 100755 --- a/.abcli/hubble.sh +++ b/.abcli/hubble.sh @@ -4,6 +4,10 @@ function hubble() { abcli_hubble "$@" } +function hubblescope() { + abcli_hubble "$@" +} + function abcli_hubble() { local task=$(abcli_unpack_keyword $1 help) @@ -11,15 +15,6 @@ function abcli_hubble() { abcli_hubble_download "$@" abcli_hubble_list "$@" abcli_hubble_select "$@" - - local task - for task in pylint pytest test; do - abcli_hubble $task "$@" - done - - if [ "$(abcli_keyword_is $2 verbose)" == true ]; then - python3 -m hubble --help - fi return fi @@ -40,9 +35,14 @@ function abcli_hubble() { return fi - python3 -m hubble \ - $task \ - "${@:2}" + if [[ "|pypi|" == *"|$task|"* ]]; then + abcli_${task} "$2" \ + plugin=hubble,$3 \ + "${@:4}" + return + fi + + python3 -m hubble "$@" } function abcli_hubble_get() { diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..540b720 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include requirements.txt \ No newline at end of file diff --git a/README.md b/README.md index 44ab270..f016fee 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# hubble 🔭 +# hubble (hubblescope) 🔭 -`hubble` 🔭 is a set of tools to access and process [Hubble Space Telescope imagery](https://registry.opendata.aws/hst/) and other datasets on [AWS Open Data Registry](https://registry.opendata.aws/). +`hubble` 🔭 is a set of tools to access and process [Hubble Space Telescope imagery](https://registry.opendata.aws/hst/) and other datasets on [AWS Open Data Registry](https://registry.opendata.aws/). --- @@ -26,7 +26,6 @@ hubble select [object] `hubble` supports `list`ing `dataset`s and the `objects`s in them and downloading the `object`s. here is an example use for ingesting the object `public/u4ge/u4ge0106r` from the dataset [Hubble Space Telescope](https://registry.opendata.aws/hst/) (`hst`), - ```bash abcli select; open . hubble select dataset hst @@ -38,4 +37,4 @@ hubble download ~dryrun ![image](./assets/hst/2023-09-15-19-34-36-01196.png) -also see [`./notebooks/hst.ipynb`](./notebooks/hst.ipynb) \ No newline at end of file +also see [`./notebooks/hst.ipynb`](./notebooks/hst.ipynb) diff --git a/hubble/__init__.py b/hubblescope/__init__.py similarity index 78% rename from hubble/__init__.py rename to hubblescope/__init__.py index ea7b441..c8e393c 100644 --- a/hubble/__init__.py +++ b/hubblescope/__init__.py @@ -1,7 +1,7 @@ -NAME = "hubble" +NAME = "hubblescope" ICON = "🔭" DESCRIPTION = f"{ICON} tools to access and process Hubble Space Telescope imagery and other datasets on AWS Open Data Registry." -VERSION = "3.331.1" +VERSION = "4.3.1" diff --git a/hubble/__main__.py b/hubblescope/__main__.py similarity index 88% rename from hubble/__main__.py rename to hubblescope/__main__.py index 4c64ac8..6d91e88 100644 --- a/hubble/__main__.py +++ b/hubblescope/__main__.py @@ -1,8 +1,8 @@ import argparse -from hubble.datasets import get -from hubble.ingest import ingest -from hubble import NAME, VERSION, DESCRIPTION -from hubble.logger import logger +from hubblescope.datasets import get +from hubblescope.ingest import ingest +from hubblescope import NAME, VERSION, DESCRIPTION +from hubblescope.logger import logger parser = argparse.ArgumentParser(NAME, description=f"{NAME}-{VERSION}") parser.add_argument( diff --git a/hubble/datasets.py b/hubblescope/datasets.py similarity index 97% rename from hubble/datasets.py rename to hubblescope/datasets.py index 878b177..0be57ae 100644 --- a/hubble/datasets.py +++ b/hubblescope/datasets.py @@ -2,7 +2,7 @@ from abcli import env, file from typing import Any from abcli import string -from hubble.logger import logger +from hubblescope.logger import logger # https://registry.opendata.aws/hst/ diff --git a/hubble/fits.py b/hubblescope/fits.py similarity index 97% rename from hubble/fits.py rename to hubblescope/fits.py index d20723e..c0588d7 100644 --- a/hubble/fits.py +++ b/hubblescope/fits.py @@ -4,8 +4,8 @@ import matplotlib.pyplot as plt from abcli import file, path from abcli.plugins.graphics.gif import generate_animated_gif -from hubble import NAME -from hubble.logger import logger +from hubblescope import NAME +from hubblescope.logger import logger def load_fit_file( diff --git a/hubble/ingest.py b/hubblescope/ingest.py similarity index 85% rename from hubble/ingest.py rename to hubblescope/ingest.py index 316ca81..30c711b 100644 --- a/hubble/ingest.py +++ b/hubblescope/ingest.py @@ -1,9 +1,9 @@ -from hubble import NAME +from hubblescope import NAME from tqdm import tqdm from abcli import file -from hubble.fits import load_fit_file +from hubblescope.fits import load_fit_file from abcli.modules import objects -from hubble.logger import logger +from hubblescope.logger import logger def ingest( diff --git a/hubble/logger.py b/hubblescope/logger.py similarity index 68% rename from hubble/logger.py rename to hubblescope/logger.py index 0b890fd..4cf64ae 100644 --- a/hubble/logger.py +++ b/hubblescope/logger.py @@ -1,4 +1,4 @@ from abcli.logger import get_logger -from hubble import ICON +from hubblescope import ICON logger = get_logger(ICON) diff --git a/hubble/tests/test_version.py b/hubblescope/tests/test_version.py similarity index 56% rename from hubble/tests/test_version.py rename to hubblescope/tests/test_version.py index 30da9dd..ad4e7f3 100644 --- a/hubble/tests/test_version.py +++ b/hubblescope/tests/test_version.py @@ -1,4 +1,4 @@ -from hubble import VERSION +from hubblescope import VERSION def test_version(): diff --git a/hubble/urls.py b/hubblescope/urls.py similarity index 100% rename from hubble/urls.py rename to hubblescope/urls.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..53767f9 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[build-system] +requires = [ + "setuptools>=42", + "wheel", + "blueness", +] diff --git a/requirements.txt b/requirements.txt index 3c83c22..d1fe112 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +blueness abcli astropy[recommended] boto3 diff --git a/setup.py b/setup.py index 7f80c3f..b5dc9ef 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,10 @@ -from setuptools import setup - -from hubble import NAME, VERSION, DESCRIPTION +from hubblescope import NAME, VERSION, DESCRIPTION +from blueness.pypi import setup setup( + filename=__file__, + repo_name="hubble", name=NAME, - author="arash@kamangir.net", version=VERSION, description=DESCRIPTION, packages=[NAME],