diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..375b7c7 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + + # Maintain dependencies for GitHub Actions (main) + - package-ecosystem: "github-actions" + directory: "/" + target-branch: "main" + schedule: + interval: "weekly" + diff --git a/.github/workflows/tests_scheduled.yml b/.github/workflows/tests_scheduled.yml index 6cb81b0..b395bd7 100644 --- a/.github/workflows/tests_scheduled.yml +++ b/.github/workflows/tests_scheduled.yml @@ -20,7 +20,7 @@ concurrency: jobs: test: - if: (github.repository == 'spacetelescope/costools' && (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'Weekly CI'))) + if: (github.repository == 'spacetelescope/costools' && (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'run devdeps tests'))) uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 with: envs: | diff --git a/.gitignore b/.gitignore index cb3a762..ae59e40 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ docs/build dist __pycache__ pip-wheel-metadata +**/version.py diff --git a/costools/__init__.py b/costools/__init__.py index d837073..174df7d 100644 --- a/costools/__init__.py +++ b/costools/__init__.py @@ -1,12 +1,8 @@ from __future__ import absolute_import, division # confidence high -from pkg_resources import get_distribution, DistributionNotFound -try: - __version__ = get_distribution(__name__).version -except DistributionNotFound: - # package is not installed - __version__ = 'UNKNOWN' +from importlib.metadata import version +__version__ = version(__name__) from . import timefilter from . import splittag @@ -16,4 +12,5 @@ # upon importing this package. import os from stsci.tools import teal + teal.print_tasknames(__name__, os.path.dirname(__file__)) diff --git a/pyproject.toml b/pyproject.toml index 113da5d..d674227 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,71 @@ +[project] +name = "costools" +description = "Tools for COS (Cosmic Origins Spectrograph)" +authors = [ + { name = "Warren Hack" }, + { name = "Nadezhda Dencheva" }, + { name = "Phil Hodge" }, +] +classifiers = [ + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Topic :: Scientific/Engineering :: Astronomy", + "Topic :: Software Development :: Libraries :: Python Modules", +] +dependencies = [ + "astropy", + "calcos", + "numpy>=2.0.0rc1", + "stsci.tools", +] +dynamic = [ + "version", +] + +[project.readme] +file = "README.md" +content-type = "text/markdown" + +[project.license] +file = "LICENSE.txt" +content-type = "text/plain" + +[project.scripts] +timefilter = "costools.timefilter:main" +add_cos_s_region = "costools.add_cos_s_region:call_main" + +[project.optional-dependencies] +docs = [ + "sphinx", + "numpydoc", +] +test = [ + "pytest", + "pytest-cov", +] + [build-system] requires = [ "setuptools>=38.2.5", "setuptools_scm", "wheel", + "numpy>=2.0.0rc1", +] +build-backend = "setuptools.build_meta" + +[tool.setuptools] +include-package-data = false + +[tool.setuptools.packages.find] +namespaces = false + +[tool.setuptools.package-data] +costools = [ + "pars/*", + "*.help", ] + +[tool.setuptools_scm] +version_file = "costools/version.py" diff --git a/requirements-dev.txt b/requirements-dev.txt index 842ffc5..7adb03f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,6 +3,6 @@ # Use Bi-weekly numpy/scipy dev builds --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple -numpy>=0.0.dev0 +numpy>=2.0.0b1 scipy>=0.0.dev0 diff --git a/setup.py b/setup.py deleted file mode 100755 index 0da78a8..0000000 --- a/setup.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python -from setuptools import find_packages -from setuptools import setup - - -PACKAGENAME = 'costools' - -setup( - name=PACKAGENAME, - use_scm_version={'write_to': 'costools/version.py'}, - setup_requires=['setuptools_scm'], - install_requires=[ - 'astropy', - 'calcos', - 'numpy', - 'stsci.tools', - ], - extras_require={ - 'docs': [ - 'sphinx', - 'numpydoc', - ], - 'test': [ - 'pytest', - 'pytest-cov', - ], - }, - packages=find_packages(), - package_data={ - PACKAGENAME: [ - 'pars/*', - '*.help', - ], - }, - entry_points={ - 'console_scripts': [ - 'timefilter = {0}.timefilter:main'.format(PACKAGENAME), - 'add_cos_s_region = {}.add_cos_s_region:call_main'.format(PACKAGENAME), - ], - }, - scripts=[ - 'costools/add_cos_s_region.py', - ], - author='Warren Hack, Nadezhda Dencheva, Phil Hodge', - author_email='help@stsci.edu', - description='Tools for COS (Cosmic Origins Spectrograph)', - long_description='README.md', - long_description_content_type='text/x-rst', - url='https://github.com/spacetelescope/costools', - license='BSD', - classifiers=[ - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: BSD License', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Topic :: Scientific/Engineering :: Astronomy', - 'Topic :: Software Development :: Libraries :: Python Modules', - ], -)