Skip to content
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

Add pyproject.toml #154

Merged
merged 28 commits into from
Apr 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
107b554
Setup: update test req
MuellerSeb Apr 6, 2021
22324f6
Setup: remove cfg redundant setup.cfg
MuellerSeb Apr 6, 2021
d550b22
Setup: add pyproject.toml: move setup req there, config black there, …
MuellerSeb Apr 6, 2021
c6e744f
Setup: update manifest
MuellerSeb Apr 6, 2021
1829d49
Setup: MANIFEST.in from scikit-hep.org
MuellerSeb Apr 6, 2021
65a539d
Setup: specify rtd config and use pip there to install gstools
MuellerSeb Apr 6, 2021
cac8c4e
Setup: reformat pyproject.toml
MuellerSeb Apr 6, 2021
04fda38
Setup: rework usage of req. files
MuellerSeb Apr 6, 2021
6170735
Setup: remove the openmp arg hack and use an env-var
MuellerSeb Apr 6, 2021
dd88046
Setup: reuse req file for sdist creation for now
MuellerSeb Apr 6, 2021
3792326
Setup: RTD config typo
MuellerSeb Apr 6, 2021
09f66be
Setup: editable build in CI to use local files for pytest
MuellerSeb Apr 6, 2021
8afe474
Setup: pip in CI should be less verbose (dep-tree is spamming)
MuellerSeb Apr 6, 2021
6d4bcbc
Setup: RTD build added line-breaks (fix attempt)
MuellerSeb Apr 6, 2021
b9b8e71
Doc: add doc about new way to build parallel version
MuellerSeb Apr 6, 2021
d9320e8
Setup: only include py and pyx files from gstools in sdist
MuellerSeb Apr 6, 2021
912efde
Setup: RTD with system packages as before
MuellerSeb Apr 6, 2021
90c80e8
Setup: RTD pin req versions
MuellerSeb Apr 6, 2021
1a20c1a
Setup: be more specific about req versions
MuellerSeb Apr 6, 2021
dd541de
Setup: explicitly install req for RTD
MuellerSeb Apr 6, 2021
165ec53
Setup: use build req from pyproject.toml in CI with CIBW
MuellerSeb Apr 6, 2021
c9baff5
CI: test 'build' pypa package to build sdist
MuellerSeb Apr 6, 2021
f8b5b4a
Setup: yepp, use build for pep517 conform sdist builds
MuellerSeb Apr 6, 2021
f22695d
CI: add black format check stage
MuellerSeb Apr 6, 2021
cfaa547
CI: use [test] options defined in setup.py for CIBW
MuellerSeb Apr 6, 2021
6a132ad
Setup: remove setup req file again, since sdist ist build pep517 conf…
MuellerSeb Apr 6, 2021
392fd4e
Setup: remove req files and use setup.cfg for all configs beside cyth…
MuellerSeb Apr 7, 2021
46b085d
Setup: minor fix for sdist check (attempt 1)
MuellerSeb Apr 7, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .coveragerc

This file was deleted.

44 changes: 33 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,29 @@ on:
workflow_dispatch:

jobs:
format_check:
name: format check
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v2

- name: Set up Python 3.8
uses: actions\setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black

- name: black check
run: |
python -m black --check .

build_wheels:
name: wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand All @@ -31,8 +54,7 @@ jobs:
uses: joerick/[email protected]
env:
CIBW_BUILD: cp36-* cp37-* cp38-* cp39-*
CIBW_BEFORE_BUILD: pip install numpy==1.19.* cython==0.29.* setuptools
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_EXTRAS: test
CIBW_TEST_COMMAND: pytest -v {project}/tests
with:
output-dir: dist
Expand Down Expand Up @@ -61,17 +83,12 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
env:
GSTOOLS_BUILD_PARALLEL: 1
run: |
python -m pip install --upgrade pip
pip install -r requirements_setup.txt
pip install -r requirements.txt
pip install -r requirements_test.txt
pip install coveralls>=3.0.0

- name: Build sdist
run: |
python setup.py sdist -d dist
python setup.py --openmp build_ext --inplace
pip install build coveralls>=3.0.0
pip install --editable .[test]

- name: Run tests
env:
Expand All @@ -80,6 +97,11 @@ jobs:
python -m pytest --cov gstools --cov-report term-missing -v tests/
python -m coveralls --service=github

- name: Build sdist
run: |
# PEP 517 package builder from pypa
python -m build --sdist --outdir dist .

- uses: actions/upload-artifact@v2
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'
with:
Expand Down
14 changes: 14 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 8 additions & 9 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
include README.md
include MANIFEST.in
include setup.py
include setup.cfg
recursive-include gstools *.py *.pyx *.c
recursive-include tests *.py
recursive-include docs/source *
include docs/Makefile docs/requirements.txt
include LICENSE
prune *
graft tests
graft docs
recursive-include gstools *.py *.pyx
recursive-exclude gstools *.c *.cpp
include LICENSE pyproject.toml setup.py setup.cfg
include *.md
global-exclude __pycache__ *.py[cod] .*
3 changes: 0 additions & 3 deletions docs/requirements.txt

This file was deleted.

7 changes: 0 additions & 7 deletions docs/requirements_doc.txt

This file was deleted.

20 changes: 10 additions & 10 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,24 @@ To get the latest development version you can install it directly from GitHub:

If something went wrong during installation, try the :code:`-I` `flag from pip <https://pip-python3.readthedocs.io/en/latest/reference/pip_install.html?highlight=i#cmdoption-i>`_.

To enable the OpenMP support, you have to provide a C compiler, Cython and OpenMP.
To get all other dependencies, it is recommended to first install gstools once
in the standard way just decribed.
Simply use the following commands:
To enable the OpenMP support, you have to provide a C compiler and OpenMP.
Parallel support is controlled by an environment variable ``GSTOOLS_BUILD_PARALLEL``,
that can be ``0`` or ``1`` (interpreted as ``0`` if not present).
GSTools then needs to be installed from source:

.. code-block:: none

pip install gstools
pip install -I --no-deps --global-option="--openmp" gstools
export GSTOOLS_BUILD_PARALLEL=1
pip install --no-binary=gstools gstools

Note, that the ``--no-binary=gstools`` option forces pip to not use a wheel for GSTools.

Or for the development version:
For the development version, you can do almost the same:

.. code-block:: none

export GSTOOLS_BUILD_PARALLEL=1
pip install git+git://github.com/GeoStat-Framework/GSTools.git@develop
pip install -I --no-deps --global-option="--openmp" git+git://github.com/GeoStat-Framework/GSTools.git@develop

The flags :code:`-I --no-deps` force pip to reinstall gstools but not the dependencies.


Citation
Expand Down
4 changes: 2 additions & 2 deletions examples/08_geo_coordinates/01_dwd_krige.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ def get_dwd_temperature(date="2020-06-09 12:00:00"):
sites = obs.DWDObservationStations(
parameter_set=obs.DWDObservationParameterSet.TEMPERATURE_AIR,
period=obs.DWDObservationPeriod.RECENT,
**settings
**settings,
)
ids, lat, lon = sites.all().loc[:, ["STATION_ID", "LAT", "LON"]].values.T
observations = obs.DWDObservationData(
station_ids=ids,
parameters=obs.DWDObservationParameter.HOURLY.TEMPERATURE_AIR_200,
periods=obs.DWDObservationPeriod.RECENT,
**settings
**settings,
)
temp = observations.all().VALUE.values
sel = np.isfinite(temp)
Expand Down
40 changes: 40 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[build-system]
requires = [
"setuptools>=42",
"wheel",
"setuptools_scm[toml]>=3.5",
"numpy>=1.14.5,<2.0",
"Cython>=0.28.3,<3.0",
]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "gstools/_version.py"
write_to_template = "__version__ = '{version}'"
local_scheme = "no-local-version"
fallback_version = "0.0.0.dev0"

[tool.coverage.run]
source = ["gstools"]
omit = [
"*docs*",
"*examples*",
"*tests*",
"*/gstools/covmodel/plot.py",
"*/gstools/field/plot.py",
]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"def __str__",
]

[tool.black]
line-length = 79
target-version = [
"py36",
"py37",
"py38",
]
6 changes: 0 additions & 6 deletions requirements.txt

This file was deleted.

4 changes: 0 additions & 4 deletions requirements_setup.txt

This file was deleted.

2 changes: 0 additions & 2 deletions requirements_test.txt

This file was deleted.

71 changes: 70 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,72 @@
[metadata]
description-file = README.md
name = gstools
description = GSTools: A geostatistical toolbox.
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/GeoStat-Framework/GSTools
author = Sebastian Müller, Lennart Schüler
author_email = [email protected]
maintainer = Sebastian Müller, Lennart Schüler
maintainer_email = [email protected]
license = LGPL-3.0
license_file = LICENSE
platforms = any
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
Intended Audience :: End Users/Desktop
Intended Audience :: Science/Research
License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Natural Language :: English
Operating System :: Unix
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
Topic :: Scientific/Engineering
Topic :: Utilities
project_urls =
Documentation = https://gstools.readthedocs.io
Source = https://github.com/GeoStat-Framework/GSTools
Tracker = https://github.com/GeoStat-Framework/GSTools/issues
Changelog = https://github.com/GeoStat-Framework/GSTools/blob/develop/CHANGELOG.md
Conda-Forge = https://anaconda.org/conda-forge/gstools

[options]
packages = find:
install_requires =
emcee>=3.0.0,<4
hankel>=1.0.2,<2
meshio>=4.0.3,<5.0
numpy>=1.14.5,<2
pyevtk>=1.1.1,<2
scipy>=1.1.0,<2
python_requires = >=3.6
zip_safe = False

[options.packages.find]
exclude =
tests*
docs*

[options.extras_require]
doc =
m2r2
matplotlib>=3
meshzoo
numpydoc>=1.1
pykrige>=1.5
pyvista
sphinx>=3
sphinx-gallery>=0.8
sphinx-rtd-theme>=0.5
plotting =
matplotlib
pyvista
test =
coverage[toml]>=5.2.1
pytest>=6.0
pytest-cov>=2.11.0
Loading