From 9999498ecc25c183240ceffcb122af61780ddd96 Mon Sep 17 00:00:00 2001 From: Timo Rothenpieler Date: Wed, 21 Aug 2024 18:08:50 +0200 Subject: [PATCH] Workflow updates and artifact uploads (#253) * Upload pytest-mpl failures as artifacts * Update actions * Unpin coveralls version * Fully migrate from setup.cfg to pyproject.toml * Mark two missing tests as requires_static_key --- .github/workflows/run-tests.yml | 15 +++++--- pyproject.toml | 62 ++++++++++++++++++++++++++++++--- salem/tests/test_datasets.py | 5 ++- setup.cfg | 47 ------------------------- 4 files changed, 72 insertions(+), 57 deletions(-) delete mode 100644 setup.cfg diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 7b5d13d..7d52a70 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -19,7 +19,7 @@ jobs: - py311-all - py312-all use-mpl: - - "--mpl" + - "--mpl --mpl-results-path=/tmp/salem-mpl-results" include: - test-env: py311-min use-mpl: "" @@ -31,9 +31,9 @@ jobs: shell: bash -leo pipefail {0} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Conda - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: environment-file: ci/requirements-${{ matrix.test-env }}.yml activate-environment: test_env @@ -58,6 +58,13 @@ jobs: COVERALLS_SERVICE_NAME: github COVERALLS_PARALLEL: true run: coveralls + - name: Upload pytest-mpl artifacts + if: "${{ failure() && matrix.use-mpl != '' }}" + uses: actions/upload-artifact@v4 + with: + name: "pytest-mpl-results-${{ matrix.test-env }}" + path: /tmp/salem-mpl-results/ + if-no-files-found: ignore finish-coveralls: name: Coveralls Finished needs: test @@ -69,5 +76,5 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_SERVICE_NAME: github run: | - pip3 install --upgrade coveralls==3.2.0 && + pip3 install --upgrade coveralls && coveralls --finish diff --git a/pyproject.toml b/pyproject.toml index 7cb0f76..db9de26 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,62 @@ +[project] +name = "salem" +description = "Geoscientific data I/O and map projections" +authors = [{name = "Fabien Maussion", email = "fabien.maussion@uibk.ac.at"}] +license = {text = "BSD 3-clause"} +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Topic :: Scientific/Engineering :: Atmospheric Science", + "Topic :: Scientific/Engineering :: GIS", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] +requires-python = ">=3.8" +dependencies = [ + "numpy", + "scipy", + "pyproj", + "joblib", + "netCDF4", + "pandas", + "xarray", +] +dynamic = ["version"] + +[tool.setuptools_scm] +fallback_version = "0.3.11" +version_file = "salem/_version.py" + +[project.urls] +Homepage = "https://salem.readthedocs.io" +Documentation = "https://salem.readthedocs.io" +Source = "https://github.com/fmaussion/salem" +Tracker = "https://github.com/fmaussion/salem/issues" + +[project.readme] +file = "README.rst" +content-type = "text/x-rst; charset=UTF-8" + [build-system] -build-backend = 'setuptools.build_meta' requires = [ - "setuptools>=61", - "setuptools_scm[toml]>=7.0", + "setuptools>=64", + "setuptools_scm>=8", "wheel", ] +build-backend = "setuptools.build_meta" -[tool.setuptools_scm] -fallback_version = "0.3.8" +[tool.setuptools] +platforms = ["any"] +include-package-data = true +license-files = ["LICENSE.rst"] + +[tool.setuptools.packages.find] +exclude = ["docs"] +namespaces = false + +[tool.distutils.bdist_wheel] +universal = 1 diff --git a/salem/tests/test_datasets.py b/salem/tests/test_datasets.py index 04bfcc7..0436a77 100644 --- a/salem/tests/test_datasets.py +++ b/salem/tests/test_datasets.py @@ -21,7 +21,8 @@ GoogleCenterMap, GoogleVisibleMap, EsriITMIX) from salem.tests import (requires_rasterio, requires_motionless, requires_geopandas, requires_internet, - requires_matplotlib, requires_shapely) + requires_matplotlib, requires_shapely, + requires_static_key) class TestDataset(unittest.TestCase): @@ -432,6 +433,7 @@ class TestGoogleStaticMap(unittest.TestCase): @requires_internet @requires_motionless @requires_matplotlib + @requires_static_key def test_center(self): import matplotlib as mpl gm = GoogleCenterMap(center_ll=(10.762660, 46.794221), zoom=13, @@ -468,6 +470,7 @@ def test_center(self): @requires_internet @requires_motionless @requires_matplotlib + @requires_static_key def test_visible(self): import matplotlib as mpl diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 875ccd0..0000000 --- a/setup.cfg +++ /dev/null @@ -1,47 +0,0 @@ -[metadata] -name = salem -description = Geoscientific data I/O and map projections -long_description = file: README.rst -long_description_content_type = text/x-rst; charset=UTF-8 -url = https://salem.readthedocs.io -author = Fabien Maussion -author_email = fabien.maussion@uibk.ac.at -license = BSD 3-clause -license_file = LICENSE.rst -classifiers = - Development Status :: 3 - Alpha - Intended Audience :: Science/Research - License :: OSI Approved :: BSD License - Topic :: Scientific/Engineering :: Atmospheric Science - Topic :: Scientific/Engineering :: GIS - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 -project_urls = - Documentation = https://salem.readthedocs.io - Source = https://github.com/fmaussion/salem - Tracker = https://github.com/fmaussion/salem/issues - -[options] -platforms = any -python_requires = >=3.6 -packages = find: -include_package_data = True -setup_requires = - setuptools_scm -install_requires = - numpy - scipy - pyproj - joblib - netCDF4 - pandas - xarray - -[options.packages.find] -exclude = docs - -[bdist_wheel] -universal = 1