Skip to content

Commit 0c67c61

Browse files
committed
Migrate project metadata from setup.py to pyproject.toml following PEP621
1 parent cd7a62e commit 0c67c61

File tree

2 files changed

+40
-59
lines changed

2 files changed

+40
-59
lines changed

pyproject.toml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,44 @@
11
[build-system]
2-
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
2+
requires = ["setuptools>=61", "setuptools_scm[toml]>=6.2"]
33
build-backend = "setuptools.build_meta"
44

5+
[project]
6+
name = "pygmt"
7+
description = "A Python interface for the Generic Mapping Tools"
8+
readme = "README.rst"
9+
requires-python = ">=3.8"
10+
license = {text = "BSD License"}
11+
authors = [{name = "The PyGMT Developers", email = "[email protected]"}]
12+
maintainers = [{name = "The PyGMT Developers", email = "[email protected]"}]
13+
keywords = []
14+
classifiers = [
15+
"Development Status :: 4 - Beta",
16+
"Intended Audience :: Science/Research",
17+
"Intended Audience :: Developers",
18+
"Intended Audience :: Education",
19+
"Topic :: Scientific/Engineering",
20+
"Topic :: Software Development :: Libraries",
21+
"Programming Language :: Python :: 3.8",
22+
"Programming Language :: Python :: 3.9",
23+
"Programming Language :: Python :: 3.10",
24+
"License :: OSI Approved :: BSD License",
25+
]
26+
dependencies = ["numpy>=1.19", "pandas", "xarray", "netCDF4", "packaging"]
27+
dynamic = ["version"]
28+
29+
[project.urls]
30+
homepage = "https://www.pygmt.org"
31+
documentation = "https://www.pygmt.org"
32+
repository = "https://github.com/GenericMappingTools/pygmt"
33+
changelog = "https://www.pygmt.org/latest/changes.html"
34+
35+
[tool.setuptools]
36+
platforms = ["Any"]
37+
38+
[tool.setuptools.packages.find]
39+
include = ["pygmt*"]
40+
exclude = ["doc"]
41+
542
[tool.setuptools_scm]
643
local_scheme = "node-and-date"
744
fallback_version = "unknown"

setup.py

Lines changed: 2 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,3 @@
1-
"""
2-
Build and install the project.
3-
"""
4-
from setuptools import find_packages, setup
1+
from setuptools import setup
52

6-
NAME = "pygmt"
7-
FULLNAME = "PyGMT"
8-
AUTHOR = "The PyGMT Developers"
9-
AUTHOR_EMAIL = "[email protected]"
10-
MAINTAINER = AUTHOR
11-
MAINTAINER_EMAIL = AUTHOR_EMAIL
12-
LICENSE = "BSD License"
13-
URL = "https://github.com/GenericMappingTools/pygmt"
14-
DESCRIPTION = "A Python interface for the Generic Mapping Tools"
15-
KEYWORDS = ""
16-
with open("README.rst", "r", encoding="utf8") as f:
17-
LONG_DESCRIPTION = "".join(f.readlines())
18-
19-
PACKAGES = find_packages(exclude=["doc"])
20-
SCRIPTS = []
21-
PACKAGE_DATA = {"pygmt.tests": ["data/*", "baseline/*"]}
22-
23-
CLASSIFIERS = [
24-
"Development Status :: 4 - Beta",
25-
"Intended Audience :: Science/Research",
26-
"Intended Audience :: Developers",
27-
"Intended Audience :: Education",
28-
"Topic :: Scientific/Engineering",
29-
"Topic :: Software Development :: Libraries",
30-
"Programming Language :: Python :: 3.8",
31-
"Programming Language :: Python :: 3.9",
32-
"Programming Language :: Python :: 3.10",
33-
f"License :: OSI Approved :: {LICENSE}",
34-
]
35-
PLATFORMS = "Any"
36-
PYTHON_REQUIRES = ">=3.8"
37-
INSTALL_REQUIRES = ["numpy>=1.19", "pandas", "xarray", "netCDF4", "packaging"]
38-
39-
if __name__ == "__main__":
40-
setup(
41-
name=NAME,
42-
fullname=FULLNAME,
43-
description=DESCRIPTION,
44-
long_description=LONG_DESCRIPTION,
45-
author=AUTHOR,
46-
author_email=AUTHOR_EMAIL,
47-
maintainer=MAINTAINER,
48-
maintainer_email=MAINTAINER_EMAIL,
49-
license=LICENSE,
50-
url=URL,
51-
platforms=PLATFORMS,
52-
scripts=SCRIPTS,
53-
packages=PACKAGES,
54-
package_data=PACKAGE_DATA,
55-
classifiers=CLASSIFIERS,
56-
keywords=KEYWORDS,
57-
python_requires=PYTHON_REQUIRES,
58-
install_requires=INSTALL_REQUIRES,
59-
)
3+
setup()

0 commit comments

Comments
 (0)