-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate project metadata from setup.py to pyproject.toml following PEP621 #1848
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
0c67c61
Migrate project metadata from setup.py to pyproject.toml following PE…
seisman 7cff590
Add docstrings to setup.py
seisman cc9d8e0
Use the new email address for pygmt team
seisman 033d369
Update the link for development mode
seisman f6bf6f6
Set include-package-data to include baseline and data files
seisman 796acf9
Merge branch 'main' into pep621
seisman f6a0514
Merge branch 'main' into pep621
seisman 1155adc
Merge branch 'main' into pep621
seisman f1015f5
Merge branch 'main' into pep621
seisman 6aa4888
Merge branch 'main' into pep621
seisman cfc20a7
Remove setup.py completely. Requires setuptools>=64.0.0
seisman f85015e
Fix the minimum required numpy version to 1.20
seisman f257a36
Add package data
seisman 7553f0b
Update the command to check README syntax
seisman 8fbf603
Merge branch 'main' into pep621
seisman 9d9ce07
Run tests in editable mode
seisman 2764315
Merge branch 'main' into pep621
seisman 5f54cc5
Multi-line dependencies
seisman 6ba0fe0
Merge branch 'main' into pep621
seisman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,44 @@ | ||
[build-system] | ||
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] | ||
requires = ["setuptools>=61", "setuptools_scm[toml]>=6.2"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "pygmt" | ||
description = "A Python interface for the Generic Mapping Tools" | ||
readme = "README.rst" | ||
requires-python = ">=3.8" | ||
license = {text = "BSD License"} | ||
authors = [{name = "The PyGMT Developers", email = "[email protected]"}] | ||
seisman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
maintainers = [{name = "The PyGMT Developers", email = "[email protected]"}] | ||
seisman marked this conversation as resolved.
Show resolved
Hide resolved
seisman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
keywords = [] | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Science/Research", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Education", | ||
"Topic :: Scientific/Engineering", | ||
"Topic :: Software Development :: Libraries", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"License :: OSI Approved :: BSD License", | ||
] | ||
dependencies = ["numpy>=1.19", "pandas", "xarray", "netCDF4", "packaging"] | ||
dynamic = ["version"] | ||
|
||
[project.urls] | ||
homepage = "https://www.pygmt.org" | ||
documentation = "https://www.pygmt.org" | ||
repository = "https://github.com/GenericMappingTools/pygmt" | ||
changelog = "https://www.pygmt.org/latest/changes.html" | ||
|
||
[tool.setuptools] | ||
platforms = ["Any"] | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["pygmt*"] | ||
exclude = ["doc"] | ||
|
||
[tool.setuptools_scm] | ||
local_scheme = "node-and-date" | ||
fallback_version = "unknown" | ||
seisman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,3 @@ | ||
""" | ||
Build and install the project. | ||
""" | ||
weiji14 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
from setuptools import find_packages, setup | ||
from setuptools import setup | ||
|
||
NAME = "pygmt" | ||
FULLNAME = "PyGMT" | ||
AUTHOR = "The PyGMT Developers" | ||
AUTHOR_EMAIL = "[email protected]" | ||
MAINTAINER = AUTHOR | ||
MAINTAINER_EMAIL = AUTHOR_EMAIL | ||
LICENSE = "BSD License" | ||
URL = "https://github.com/GenericMappingTools/pygmt" | ||
DESCRIPTION = "A Python interface for the Generic Mapping Tools" | ||
KEYWORDS = "" | ||
with open("README.rst", "r", encoding="utf8") as f: | ||
LONG_DESCRIPTION = "".join(f.readlines()) | ||
|
||
PACKAGES = find_packages(exclude=["doc"]) | ||
SCRIPTS = [] | ||
PACKAGE_DATA = {"pygmt.tests": ["data/*", "baseline/*"]} | ||
weiji14 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
CLASSIFIERS = [ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Science/Research", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Education", | ||
"Topic :: Scientific/Engineering", | ||
"Topic :: Software Development :: Libraries", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
f"License :: OSI Approved :: {LICENSE}", | ||
] | ||
PLATFORMS = "Any" | ||
PYTHON_REQUIRES = ">=3.8" | ||
INSTALL_REQUIRES = ["numpy>=1.19", "pandas", "xarray", "netCDF4", "packaging"] | ||
|
||
if __name__ == "__main__": | ||
setup( | ||
name=NAME, | ||
fullname=FULLNAME, | ||
description=DESCRIPTION, | ||
long_description=LONG_DESCRIPTION, | ||
author=AUTHOR, | ||
author_email=AUTHOR_EMAIL, | ||
maintainer=MAINTAINER, | ||
maintainer_email=MAINTAINER_EMAIL, | ||
license=LICENSE, | ||
url=URL, | ||
platforms=PLATFORMS, | ||
scripts=SCRIPTS, | ||
packages=PACKAGES, | ||
package_data=PACKAGE_DATA, | ||
classifiers=CLASSIFIERS, | ||
keywords=KEYWORDS, | ||
python_requires=PYTHON_REQUIRES, | ||
install_requires=INSTALL_REQUIRES, | ||
) | ||
setup() | ||
seisman marked this conversation as resolved.
Show resolved
Hide resolved
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that changes in this PR require setuptools>=61.
setuptools v61.0.0 was released on Mar. 24, 2022. This version starts to support storing project metadata in
pyproject.toml
following PEP621 but it's still experimental and may change in future versions. I think we should not merge this PR unless thepyproject.toml
support is stable.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, let's wait and see first. I've had to pin to setuptools=58.4.0 on one of my projects 3 weeks ago because one of the dependencies didn't like setuptools v60.9. There might be some other packages pinning to a lower setuptools version too.