-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modernize the build system using
pyproject.toml
Also, remove vendored `versioneer.py`
- Loading branch information
1 parent
955bd26
commit b002fc0
Showing
7 changed files
with
101 additions
and
1,950 deletions.
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 |
---|---|---|
|
@@ -26,3 +26,4 @@ sourcespec.egg-info/ | |
dist/ | ||
build/ | ||
RELEASE-VERSION | ||
README_pkg.md |
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
[build-system] | ||
requires = ["setuptools>=64", "versioneer[toml]"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "sourcespec" | ||
dynamic = ["version"] | ||
authors = [ | ||
{ name = "Claudio Satriano", email = "[email protected]" }, | ||
] | ||
description = "Earthquake source parameters from P- or S-wave displacement spectra" | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Console", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: CEA CNRS Inria Logiciel Libre License, version 2.1 (CeCILL-2.1)", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"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 :: Physics", | ||
] | ||
requires-python = ">=3.7" | ||
dependencies = [ | ||
"numpy>=1.10", | ||
"scipy>=0.17", | ||
"matplotlib>=3.2,<3.10", | ||
"pillow>=4.0.0", | ||
"obspy>=1.2.0", | ||
"pyproj", | ||
"tzlocal", | ||
"pyyaml>=5.1", | ||
"h5py", | ||
] | ||
|
||
[project.license] | ||
text = "CeCILL Free Software License Agreement, Version 2.1" | ||
|
||
[project.readme] | ||
file = "README_pkg.md" | ||
content-type = "text/markdown" | ||
|
||
[project.urls] | ||
Homepage = "https://sourcespec.seismicsource.org" | ||
Source = "https://github.com/SeismicSource/sourcespec" | ||
Documentation = "https://sourcespec.readthedocs.io" | ||
|
||
[project.scripts] | ||
source_spec = "sourcespec.source_spec:main" | ||
source_model = "sourcespec.source_model:main" | ||
source_residuals = "sourcespec.source_residuals:main" | ||
clipping_detection = "sourcespec.clipping_detection:main" | ||
plot_sourcepars = "sourcespec.plot_sourcepars:main" | ||
|
||
[tool.setuptools] | ||
include-package-data = true | ||
platforms = [ | ||
"OS", | ||
"Independent", | ||
] | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["sourcespec", "sourcespec.*"] | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "sourcespec.__version__"} | ||
|
||
[tool.versioneer] | ||
VCS = "git" | ||
style = "pep440" | ||
versionfile_source = "sourcespec/_version.py" | ||
versionfile_build = "sourcespec/_version.py" | ||
tag_prefix = "v" | ||
parentdir_prefix = "sourcespec-" | ||
|
||
[tool.pylama] | ||
skip = "build/*,versioneer.py,*/_version.py,*/configobj/*,*/adjustText/*" |
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,29 +1,24 @@ | ||
# -*- coding: utf-8 -*- | ||
# SPDX-License-Identifier: CECILL-2.1 | ||
""" | ||
Setup script for SourceSpec | ||
""" | ||
# pylint: disable=wrong-import-position, consider-using-f-string | ||
import sys | ||
A minimal setup script for SourceSpec. | ||
MIN_PYTHON_VERSION = (3, 7) | ||
MIN_PYTHON_VERSION_STR = '.'.join(str(n) for n in MIN_PYTHON_VERSION) | ||
PYTHON_VERSION_STR = '.'.join(str(n) for n in sys.version_info[:3]) | ||
if sys.version_info < MIN_PYTHON_VERSION: | ||
MSG = ( | ||
'SourceSpec requires Python version >= {}' | ||
' you are using Python version {}'.format( | ||
MIN_PYTHON_VERSION_STR, PYTHON_VERSION_STR) | ||
) | ||
sys.exit(MSG) | ||
This script ensures compatibility with versioneer | ||
and generates a README_pkg.md for correctly displaying images on PyPI. | ||
All the remaining configuration is in pyproject.toml. | ||
""" | ||
import os | ||
from setuptools import setup | ||
import versioneer | ||
|
||
from setuptools import setup # noqa | ||
import versioneer # noqa | ||
# Generate a README_pkg.md file with CDN links to images, to be used for | ||
# PKG-INFO on PyPI. This file is removed after the setup is complete. | ||
revision = versioneer.get_versions()['full-revisionid'] | ||
cdn_baseurl = 'https://cdn.jsdelivr.net/gh/SeismicSource/sourcespec@{}'\ | ||
.format(revision) | ||
with open('README.md', 'rb') as f: | ||
long_descr = f.read().decode('utf-8').replace( | ||
readme_pkg = f.read().decode('utf-8').replace( | ||
'imgs/SourceSpec_logo.svg', | ||
'{}/imgs/SourceSpec_logo.svg'.format(cdn_baseurl) | ||
).replace( | ||
|
@@ -36,65 +31,9 @@ | |
'(CHANGELOG.md)', | ||
'({}/CHANGELOG.md)'.format(cdn_baseurl) | ||
) | ||
with open('README_pkg.md', 'w', encoding='utf-8') as f: | ||
f.write(readme_pkg) | ||
|
||
project_urls = { | ||
'Homepage': 'https://sourcespec.seismicsource.org', | ||
'Source': 'https://github.com/SeismicSource/sourcespec', | ||
'Documentation': 'https://sourcespec.readthedocs.io' | ||
} | ||
setup(cmdclass=versioneer.get_cmdclass()) | ||
|
||
setup( | ||
name='sourcespec', | ||
packages=['sourcespec', 'sourcespec.configobj', 'sourcespec.adjustText'], | ||
include_package_data=True, | ||
entry_points={ | ||
'console_scripts': [ | ||
'source_spec = sourcespec.source_spec:main', | ||
'source_model = sourcespec.source_model:main', | ||
'source_residuals = sourcespec.source_residuals:main', | ||
'clipping_detection = sourcespec.clipping_detection:main', | ||
'plot_sourcepars = sourcespec.plot_sourcepars:main', | ||
] | ||
}, | ||
version=versioneer.get_version(), | ||
cmdclass=versioneer.get_cmdclass(), | ||
description='Earthquake source parameters from P- or S-wave ' | ||
'displacement spectra', | ||
long_description=long_descr, | ||
long_description_content_type='text/markdown', | ||
author='Claudio Satriano', | ||
author_email='[email protected]', | ||
url=project_urls['Homepage'], | ||
project_urls=project_urls, | ||
license='CeCILL Free Software License Agreement, Version 2.1', | ||
platforms='OS Independent', | ||
classifiers=[ | ||
'Development Status :: 5 - Production/Stable', | ||
'Environment :: Console', | ||
'Intended Audience :: Science/Research', | ||
'License :: OSI Approved :: CEA CNRS Inria Logiciel Libre ' | ||
'License, version 2.1 (CeCILL-2.1)', | ||
'Operating System :: OS Independent', | ||
'Programming Language :: Python', | ||
'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 :: Physics'], | ||
python_requires='>={}'.format(MIN_PYTHON_VERSION_STR), | ||
install_requires=[ | ||
'numpy>=1.10', | ||
'scipy>=0.17', | ||
'matplotlib>=3.2,<3.10', | ||
'pillow>=4.0.0', | ||
'obspy>=1.2.0', | ||
'pyproj', | ||
'tzlocal', | ||
'pyyaml>=5.1', | ||
'h5py' | ||
] | ||
) | ||
os.remove('README_pkg.md') |
Oops, something went wrong.