diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 19e67d75b..3b0674938 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,6 +7,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 # Use the ref you want to point at hooks: + - id: check-toml - id: check-added-large-files args: ["--maxkb=5000"] - id: end-of-file-fixer diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..917d03682 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,63 @@ +[project] +name = "icepyx" +description = "Python tools for obtaining and working with ICESat-2 data" +license = {file = "LICENSE"} +readme = "README.rst" + +requires-python = "~=3.7" +dynamic = ["version", "dependencies"] + +authors = [ + {name = "The icepyx Developers", email = "jbscheick@gmail.com"}, +] +maintainers = [ + {name = "The icepyx Developers", email = "jbscheick@gmail.com"}, +] + +classifiers=[ + "Development Status :: 4 - Beta", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "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", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: GIS", + "Topic :: Software Development :: Libraries", +] + +[project.urls] +Homepage = "https://icepyx.readthedocs.io" +Documentation = "https://icepyx.readthedocs.io" +Repository = "https://github.com/icesat2py/icepyx" +Issues = "https://github.com/icesat2py/icepyx/issues" +Changelog = "https://icepyx.readthedocs.io/en/latest/user_guide/changelog/index.html" + + +[build-system] +build-backend = "setuptools.build_meta" +requires = ["setuptools>=66", "wheel", "setuptools_scm"] + +[tool.setuptools] +py-modules = ["_icepyx_version"] + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} + +[project.optional-dependencies] +viz = ["geoviews >= 1.9.0", "cartopy >= 0.18.0", "scipy"] +complete = ["icepyx[viz]"] + +[tool.setuptools.packages.find] +exclude = ["*tests"] + +[tool.setuptools_scm] +version_file = "_icepyx_version.py" +version_file_template = 'version = "{version}"' +local_scheme = "node-and-date" +fallback_version = "unknown" diff --git a/setup.py b/setup.py deleted file mode 100644 index 003a5043f..000000000 --- a/setup.py +++ /dev/null @@ -1,55 +0,0 @@ -import setuptools - -with open("README.rst", "r") as f: - LONG_DESCRIPTION = f.read() - -with open("requirements.txt") as f: - INSTALL_REQUIRES = f.read().strip().split("\n") - -EXTRAS_REQUIRE = { - "viz": ["geoviews >= 1.9.0", "cartopy >= 0.18.0", "scipy"], -} -EXTRAS_REQUIRE["complete"] = sorted(set(sum(EXTRAS_REQUIRE.values(), []))) -# install with `pip install "icepyx[complete]"` There is no way to use this functionality with conda. - -setuptools.setup( - name="icepyx", - author="The icepyx Developers", - author_email="jbscheick@gmail.com", - maintainer="Jessica Scheick", - maintainer_email="jbscheick@gmail.com", - description="Python tools for obtaining and working with ICESat-2 data", - long_description=LONG_DESCRIPTION, - long_description_content_type="text/x-rst", - url="https://github.com/icesat2py/icepyx.git", - license="BSD 3-Clause", - packages=setuptools.find_packages(exclude=["*tests"]), - install_requires=INSTALL_REQUIRES, - extras_require=EXTRAS_REQUIRE, - python_requires=">=3", - # classifiers are a set of standard descriptions. Possible list: https://pypi.org/pypi?%3Aaction=list_classifiers - classifiers=[ - "Development Status :: 4 - Beta", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: BSD License", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "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", - "Topic :: Scientific/Engineering", - "Topic :: Scientific/Engineering :: GIS", - "Topic :: Software Development :: Libraries", - ], - py_modules=["_icepyx_version"], - use_scm_version={ - "fallback_version": "unknown", - "local_scheme": "node-and-date", - "write_to": "_icepyx_version.py", - "write_to_template": 'version = "{version}"\n', - }, - setup_requires=["setuptools>=30.3.0", "wheel", "setuptools_scm"], -)