Skip to content

Commit cd7a62e

Browse files
authored
Migrate build system settings to pyproject.toml following pep517 and pep518 (#1845)
1 parent 22676d8 commit cd7a62e

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

.github/workflows/publish-to-pypi.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
# Change setuptools-scm local_scheme to "no-local-version" so the
4444
# local part of the version isn't included, making the version string
4545
# compatible with PyPI.
46-
sed --in-place "s/node-and-date/no-local-version/g" setup.py
46+
sed --in-place "s/node-and-date/no-local-version/g" pyproject.toml
4747
4848
- name: Build source and wheel distributions
4949
run: |

pyproject.toml

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
[build-system]
2+
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools_scm]
6+
local_scheme = "node-and-date"
7+
fallback_version = "unknown"
8+
19
[tool.coverage.run]
210
omit = ["*/tests/*", "*pygmt/__init__.py"]
311

setup.py

-5
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,13 @@
3535
PLATFORMS = "Any"
3636
PYTHON_REQUIRES = ">=3.8"
3737
INSTALL_REQUIRES = ["numpy>=1.19", "pandas", "xarray", "netCDF4", "packaging"]
38-
# Configuration for setuptools-scm
39-
SETUP_REQUIRES = ["setuptools_scm"]
40-
USE_SCM_VERSION = {"local_scheme": "node-and-date", "fallback_version": "unknown"}
4138

4239
if __name__ == "__main__":
4340
setup(
4441
name=NAME,
4542
fullname=FULLNAME,
4643
description=DESCRIPTION,
4744
long_description=LONG_DESCRIPTION,
48-
use_scm_version=USE_SCM_VERSION,
4945
author=AUTHOR,
5046
author_email=AUTHOR_EMAIL,
5147
maintainer=MAINTAINER,
@@ -60,5 +56,4 @@
6056
keywords=KEYWORDS,
6157
python_requires=PYTHON_REQUIRES,
6258
install_requires=INSTALL_REQUIRES,
63-
setup_requires=SETUP_REQUIRES,
6459
)

0 commit comments

Comments
 (0)