From e473eecb717def04807915c8b5dc950962e61107 Mon Sep 17 00:00:00 2001 From: "Michael S. P. Kelley" Date: Fri, 8 Mar 2024 09:48:25 -0500 Subject: [PATCH 1/2] Migrate to pyproject.toml --- .gitignore | 3 ++- LICENSE | 2 +- MANIFEST.in | 5 +++++ README.md | 2 +- calviacat/__init__.py | 8 ++++++++ pyproject.toml | 37 +++++++++++++++++++++++++++++++++++++ setup.py | 11 +---------- 7 files changed, 55 insertions(+), 13 deletions(-) create mode 100644 MANIFEST.in create mode 100644 pyproject.toml diff --git a/.gitignore b/.gitignore index 369bb52..29b85fa 100644 --- a/.gitignore +++ b/.gitignore @@ -105,4 +105,5 @@ venv.bak/ *~ examples/lco.fits -examples/cat.db \ No newline at end of file +examples/cat.db +calviacat/_version.py \ No newline at end of file diff --git a/LICENSE b/LICENSE index ba48312..affbf63 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018-2019 University of Maryland and the calviacat contributors +Copyright (c) 2018-2024 University of Maryland and the calviacat contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..fedad5f --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,5 @@ +prune build +prune docs/_build +prune docs/api +prune examples +global-exclude *.pyc *.o diff --git a/README.md b/README.md index b28da97..2c0aaab 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# calviacat v1.3.0 +# calviacat v1.3.1 Calibrate star photometry by comparison to a catalog. PanSTARRS 1, ATLAS-RefCat2, SkyMapper, and Gaia catalogs currently implemented. Catalog queries are cached so that subsequent calibrations of the same or similar fields can be more quickly executed. ## Attribution and license diff --git a/calviacat/__init__.py b/calviacat/__init__.py index ba55cb8..50dccba 100644 --- a/calviacat/__init__.py +++ b/calviacat/__init__.py @@ -1,5 +1,13 @@ +# Licensed with the MIT License, see LICENSE for details +from importlib.metadata import version as _version, PackageNotFoundError + from .catalog import * from .panstarrs1 import PanSTARRS1 from .skymapper import SkyMapper from .refcat2 import RefCat2 from .gaia import Gaia + +try: + __version__ = _version(__name__) +except PackageNotFoundError: + pass diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b0aa7e2 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,37 @@ +[project] +name = "calviacat" +description = "Calibrate star photometry by comparison to a catalog." +keywords = ["astronomy", "astrophysics", "space", "science"] +readme = "README.md" +authors = [ + { name = "Michael S. P. Kelley", email = "msk@astro.umd.edu" }, + { name = "Tim Lister", email = "tlister@lco.global" } +] +license = { text = "MIT" } +requires-python = ">=3.8" +dependencies = [ + "astropy>=4.3", + "numpy", + "requests", + "astroquery>=0.4.5" +] +dynamic = [ "version" ] + +[project.urls] +homepage = "https://github.com/mkelley/calviacat" + +[build-system] +requires = [ + "setuptools>=45", + "setuptools_scm[toml]>=6.2", + "wheel", +] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +write_to = "calviacat/_version.py" + +[tool.setuptools] +zip-safe = false + +[tool.setuptools.packages.find] diff --git a/setup.py b/setup.py index fd06906..36f7fe7 100755 --- a/setup.py +++ b/setup.py @@ -1,13 +1,4 @@ #!/usr/bin/env python3 from setuptools import setup -setup(name='calviacat', - version='1.3.0', - description='Calibrate star photometry by comparison to a catalog.', - author='Michael S. P. Kelley', - author_email='msk@astro.umd.edu', - url='https://github.com/mkelley/calviacat', - packages=['calviacat'], - install_requires=['astropy', 'numpy', 'requests', 'astroquery'], - license='MIT' - ) +setup() From ab4ca12401ef746253edcf091e3b5c7ff2bd658c Mon Sep 17 00:00:00 2001 From: "Michael S. P. Kelley" Date: Fri, 8 Mar 2024 09:57:28 -0500 Subject: [PATCH 2/2] Keep example files in distribution --- MANIFEST.in | 1 - 1 file changed, 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index fedad5f..2b737d8 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,4 @@ prune build prune docs/_build prune docs/api -prune examples global-exclude *.pyc *.o