From d5ea756629f3aaad6f4f8e197926f932677a6658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Sat, 14 May 2022 16:12:57 +0200 Subject: [PATCH] setup: use pyproject.toml --- .coveragerc | 20 ---------- .readthedocs.yml | 14 +++++++ MANIFEST.in | 13 +++---- docs/requirements.txt | 3 -- docs/requirements_doc.txt | 1 - docs/source/conf.py | 1 + pyproject.toml | 63 ++++++++++++++++++++++++++++++ requirements.txt | 6 --- requirements_setup.txt | 2 - requirements_test.txt | 2 - setup.cfg | 76 ++++++++++++++++++++++++++++++++++++- setup.py | 80 --------------------------------------- 12 files changed, 159 insertions(+), 122 deletions(-) delete mode 100644 .coveragerc create mode 100644 .readthedocs.yml delete mode 100644 docs/requirements.txt delete mode 100755 docs/requirements_doc.txt create mode 100644 pyproject.toml delete mode 100755 requirements.txt delete mode 100755 requirements_setup.txt delete mode 100755 requirements_test.txt delete mode 100644 setup.py diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 50d715d..0000000 --- a/.coveragerc +++ /dev/null @@ -1,20 +0,0 @@ -[run] -source = ogs5py -omit = - *docs* - *examples* - *tests* - ogs5py/reader/* - ogs5py/tools/vtk_viewer.py - ogs5py/fileclasses/msh/gmsh.py - ogs5py/fileclasses/msh/viewer.py - ogs5py/fileclasses/msh/checker.py - ogs5py/fileclasses/gli/checker.py - -[report] -exclude_lines = - pragma: no cover - if __name__ == '__main__': - if verbose: - def __repr__ - def __str__ diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000..f88c11a --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,14 @@ +version: 2 + +sphinx: + configuration: docs/source/conf.py + +formats: all + +python: + version: 3.7 + install: + - method: pip + path: . + extra_requirements: + - doc diff --git a/MANIFEST.in b/MANIFEST.in index c16750c..e35e283 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1,6 @@ -include MANIFEST.in -include setup.py -recursive-include ogs5py *.py -recursive-include tests *.py -recursive-include docs/source * -include docs/Makefile docs/requirements.txt -include LICENSE +prune * +graft ogs5py +graft tests + +include LICENSE README.md pyproject.toml setup.cfg +global-exclude __pycache__ *.py[cod] .* diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index c5a6a23..0000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ --r requirements_doc.txt --r ../requirements_setup.txt --r ../requirements.txt diff --git a/docs/requirements_doc.txt b/docs/requirements_doc.txt deleted file mode 100755 index a2954e3..0000000 --- a/docs/requirements_doc.txt +++ /dev/null @@ -1 +0,0 @@ -numpydoc diff --git a/docs/source/conf.py b/docs/source/conf.py index 1cc9f27..16fd7fe 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -21,6 +21,7 @@ # pip install sphinx_rtd_theme # is needed in order to build the documentation import datetime + from ogs5py import __version__ as ver diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..7d40e89 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,63 @@ +[build-system] +requires = [ + "setuptools>=42", + "wheel", + "setuptools_scm[toml]>=3.5", +] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +write_to = "ogs5py/_version.py" +write_to_template = "__version__ = '{version}'" +local_scheme = "no-local-version" +fallback_version = "0.0.0.dev0" + +[tool.black] +exclude = "_version.py" +line-length = 79 +target-version = [ + "py36", + "py37", + "py38", +] + +[tool.coverage] + [tool.coverage.run] + source = ["ogs5py"] + omit = [ + "*docs*", + "*examples*", + "*tests*", + ] + + [tool.coverage.report] + exclude_lines = [ + "pragma: no cover", + "if __name__ == '__main__':", + "def __repr__", + "def __str__", + ] + +[tool.pylint] + [tool.pylint.master] + extension-pkg-whitelist = [ + "numpy", + "scipy", + ] + ignore = "_version.py" + + [tool.pylint.message_control] + disable = [ + "R0801", + ] + + [tool.pylint.reports] + output-format = "colorized" + + [tool.pylint.design] + max-args = 20 + max-locals = 50 + max-branches = 30 + max-statements = 80 + max-attributes = 25 + max-public-methods = 75 diff --git a/requirements.txt b/requirements.txt deleted file mode 100755 index a313df1..0000000 --- a/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -numpy>=1.14.5 -pandas>=0.23.2 -meshio>=4.0.3, <5.0 -lxml~=4.0 -pexpect~=4.0 -vtk>=8.1 diff --git a/requirements_setup.txt b/requirements_setup.txt deleted file mode 100755 index 80e9200..0000000 --- a/requirements_setup.txt +++ /dev/null @@ -1,2 +0,0 @@ -setuptools>=41.0.1 -setuptools_scm>=3.5.0 diff --git a/requirements_test.txt b/requirements_test.txt deleted file mode 100755 index be10813..0000000 --- a/requirements_test.txt +++ /dev/null @@ -1,2 +0,0 @@ -pytest-cov>=2.8.0 -pytest>=5.3.0 diff --git a/setup.cfg b/setup.cfg index f48fdad..042bd98 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,77 @@ [metadata] -description-file = README.md +name = ogs5py +description = ogs5py: a python API for OpenGeoSys5 +long_description = file: README.md +long_description_content_type = text/markdown +url = https://github.com/GeoStat-Framework/ogs5py +author = Sebastian Müller, Falk Heße +author_email = info@geostat-framework.org +maintainer = Sebastian Müller +maintainer_email = info@geostat-framework.org +license = MIT license_file = LICENSE +platforms = any +classifiers = + Development Status :: 5 - Production/Stable + Intended Audience :: Developers + Intended Audience :: End Users/Desktop + Intended Audience :: Science/Research + Intended Audience :: Education + License :: OSI Approved :: MIT License + Natural Language :: English + Operating System :: Unix + Operating System :: Microsoft + Operating System :: MacOS + Programming Language :: Python + Programming Language :: Python :: 3 + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Topic :: Scientific/Engineering + Topic :: Scientific/Engineering :: GIS + Topic :: Scientific/Engineering :: Hydrology + Topic :: Scientific/Engineering :: Mathematics + Topic :: Scientific/Engineering :: Physics + Topic :: Utilities +project_urls = + Homepage = https://geostat-framework.org/#ogs5py + Documentation = https://ogs5py.readthedocs.io + Source = https://github.com/GeoStat-Framework/ogs5py + Tracker = https://github.com/GeoStat-Framework/ogs5py/issues + Changelog = https://github.com/GeoStat-Framework/ogs5py/blob/main/CHANGELOG.md + Conda-Forge = https://anaconda.org/conda-forge/ogs5py + +[options] +packages = find: +install_requires = + numpy>=1.14.5 + pandas>=0.23.2 + meshio>=4.0.3, <5.0 + lxml~=4.0 + pexpect~=4.0 + vtk>=8.1 +python_requires = >=3.6 +zip_safe = False + +[options.packages.find] +exclude = + tests* + docs* + +[options.extras_require] +doc = + m2r2>=0.2.8 + matplotlib>=3 + numpydoc>=1.1 + sphinx>=4 + sphinx-gallery>=0.8 + sphinx-rtd-theme>=1 +show = + mayavi +gmsh = + pygmsh +test = + pytest-cov>=3 diff --git a/setup.py b/setup.py deleted file mode 100644 index 1d34eaa..0000000 --- a/setup.py +++ /dev/null @@ -1,80 +0,0 @@ -# -*- coding: utf-8 -*- -"""ogs5py: a python API for OpenGeoSys5""" - -import os -from setuptools import setup, find_packages - - -HERE = os.path.abspath(os.path.dirname(__file__)) - -with open(os.path.join(HERE, "README.md"), encoding="utf-8") as f: - README = f.read() -with open(os.path.join(HERE, "requirements.txt"), encoding="utf-8") as f: - REQ = f.read().splitlines() -with open(os.path.join(HERE, "requirements_setup.txt"), encoding="utf-8") as f: - REQ_SETUP = f.read().splitlines() -with open(os.path.join(HERE, "requirements_test.txt"), encoding="utf-8") as f: - REQ_TEST = f.read().splitlines() -with open( - os.path.join(HERE, "docs", "requirements_doc.txt"), encoding="utf-8" -) as f: - REQ_DOC = f.read().splitlines() - -REQ_DEV = REQ_SETUP + REQ_TEST + REQ_DOC - -DOCLINE = __doc__.split("\n")[0] -CLASSIFIERS = [ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "Intended Audience :: End Users/Desktop", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "Operating System :: MacOS", - "Operating System :: MacOS :: MacOS X", - "Operating System :: Microsoft", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX", - "Operating System :: Unix", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "Topic :: Scientific/Engineering", - "Topic :: Software Development", - "Topic :: Utilities", -] - -setup( - name="ogs5py", - description=DOCLINE, - long_description=README, - long_description_content_type="text/markdown", - maintainer="Sebastian Mueller", - maintainer_email="sebastian.mueller@ufz.de", - author="Sebastian Mueller, Falk Hesse", - author_email="info@geostat-framework.org", - url="https://github.com/GeoStat-Framework/ogs5py", - license="MIT", - classifiers=CLASSIFIERS, - platforms=["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"], - include_package_data=True, - python_requires=">=3.5", - use_scm_version={ - "relative_to": __file__, - "write_to": "ogs5py/_version.py", - "write_to_template": "__version__ = '{version}'", - "local_scheme": "no-local-version", - "fallback_version": "0.0.0.dev0", - }, - install_requires=REQ, - setup_requires=REQ_SETUP, - extras_require={ - "gmsh": ["pygmsh"], # optional for creating gmesh based meshes - "show": ["mayavi"], # optional to view a mesh - "all": ["pygmsh", "mayavi"], # everything - "doc": REQ_DOC, - "test": REQ_TEST, - "dev": REQ_DEV, - }, - packages=find_packages(exclude=["tests*", "docs*"]), -)