Skip to content

Commit

Permalink
Workflow updates and artifact uploads (#253)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
TimoRoth authored Aug 21, 2024
1 parent e0f4e2e commit 9999498
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 57 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
62 changes: 57 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,62 @@
[project]
name = "salem"
description = "Geoscientific data I/O and map projections"
authors = [{name = "Fabien Maussion", email = "[email protected]"}]
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
5 changes: 4 additions & 1 deletion salem/tests/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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

Expand Down
47 changes: 0 additions & 47 deletions setup.cfg

This file was deleted.

0 comments on commit 9999498

Please sign in to comment.