diff --git a/.gitignore b/.gitignore index 6cee59b..9b735f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +cmocean/_version.py cmocean/rgb/drafts/ dist *.pyc diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2f9f032 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,61 @@ +[build-system] +build-backend = "setuptools.build_meta" +requires = [ + "setuptools>=42", + "setuptools_scm", + "wheel", +] + +[project] +name = "cmocean" +description = "Colormaps for Oceanography" +readme = "README.md" +license = {file = "LICENSE.txt"} +maintainers = [ + {name = "Kristen Thyng", email = "kthyng@gmail.com"}, +] +requires-python = ">=3.8" +classifiers = [ + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] +dynamic = [ + "dependencies", + "version", +] +[project.optional-dependencies] +tests = [ + "pytest", +] +plots = [ + "colorspacious", + "viscm", +] + +[project.urls] +documentation = "https://matplotlib.org/cmocean/" +homepage = "https://github.com/matplotlib/cmocean" +repository = "https://github.com/matplotlib/cmocean" + +[tool.setuptools] +packages = ["cmocean"] +include-package-data = true + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} + +[tool.setuptools_scm] +write_to = "cmocean/_version.py" +write_to_template = "__version__ = '{version}'" +tag_regex = "^(?Pv)?(?P[^\\+]+)(?P.*)?$" + +[tool.pytest.ini_options] +filterwarnings = [ + "error:::cmocean.*", + "ignore::UserWarning", + "ignore::RuntimeWarning", +] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 498ec14..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[metadata] -license_file = LICENSE.txt diff --git a/setup.py b/setup.py deleted file mode 100644 index 2bd7d75..0000000 --- a/setup.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env python - -""" -setup.py for cmocean - -""" -import sys -from setuptools import setup # to support "develop" mode -from setuptools.command.test import test as TestCommand - -class PyTest(TestCommand): - def finalize_options(self): - TestCommand.finalize_options(self) - self.verbose = True - - def run_tests(self): - import pytest - errno = pytest.main(self.test_args) - sys.exit(errno) - -extras_require={ - 'plots': ["colorspacious", "viscm"], -} -# # in case I add more later -# extras_require['complete'] = sorted(set(sum(extras_require.values(), []))) - -setup( - name = "cmocean", - version = "v4.0.3", - author = "Kristen Thyng", - author_email = "kthyng@gmail.com", - url = 'https://github.com/matplotlib/cmocean', - # download_url = 'https://github.com/matplotlib/cmocean/tarball/2.0', - description = ("Colormaps for Oceanography"), - long_description=open('README.md').read(), - long_description_content_type='text/markdown', - classifiers=[ - "Development Status :: 3 - Alpha", - ], - package_data={ - 'cmocean': ['rgb/*.txt', 'rgb/inverted/*.txt'], - }, - packages = ["cmocean"], - ext_package='cmocean', - keywords = ['colormaps', 'oceanography', 'plotting', 'visualization'], - setup_requires=['setuptools'], - install_requires=['matplotlib', 'numpy', 'packaging'], - tests_require=['pytest'], - python_requires=">=3.8", - extras_require=extras_require - )