Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
22a0c16
update python versions and dependencies
Jhsmit Jan 16, 2025
b501b60
separated workflows and extended python versions
cvanelteren Jan 16, 2025
a8798a2
added a main matrix to different python versions
cvanelteren Jan 16, 2025
b9f08d2
added py versions to docs and linter
cvanelteren Jan 16, 2025
1ecb15c
just run job on push without checkout all
cvanelteren Jan 16, 2025
34e1794
main workflow runs build and docs
cvanelteren Jan 16, 2025
303a3e7
fixed python versions
cvanelteren Jan 16, 2025
8b4c805
fixed python versions
cvanelteren Jan 16, 2025
b852254
fixed python versions
cvanelteren Jan 16, 2025
e56a803
dev env needs python version
cvanelteren Jan 16, 2025
d0751dd
fix np version
cvanelteren Jan 16, 2025
ba567af
typo -_-
cvanelteren Jan 16, 2025
e99712d
fixing at most 3.10 due to basemap
cvanelteren Jan 16, 2025
9072ad3
remove support py 3.8
cvanelteren Jan 17, 2025
c6031ee
pin upper limit to py3.13
cvanelteren Jan 17, 2025
e7f52cd
pin upper limit to py3.13
cvanelteren Jan 17, 2025
9021d17
pin upper limit to py3.13 in pyproject
cvanelteren Jan 17, 2025
9756ba9
update dev-env
cvanelteren Jan 17, 2025
de5f50c
moved theme under organization
cvanelteren Jan 17, 2025
4fe4b59
Merge branch 'main' into pyproject_toml
cvanelteren Jan 18, 2025
3f3833d
added mpl flag and baseline checks
cvanelteren Jan 22, 2025
cab11eb
Merge remote-tracking branch 'jhsmit/pyproject_toml' into HEAD
cvanelteren Jan 22, 2025
16f71d0
bump on artefact workflow
cvanelteren Jan 22, 2025
80ce94a
attempt fix getting proper branch
cvanelteren Jan 22, 2025
048b57e
activate env
cvanelteren Jan 22, 2025
f6da16c
typo
cvanelteren Jan 22, 2025
a1d6722
fix
cvanelteren Jan 22, 2025
72768af
added normal tests
cvanelteren Jan 22, 2025
c151026
separate tests
cvanelteren Jan 23, 2025
67b2d20
commenting mpl until fixed upstream
cvanelteren Jan 26, 2025
ecd38be
updated to build on devel
cvanelteren Jan 26, 2025
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
12 changes: 7 additions & 5 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: Build docs
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_call:
inputs:
python-version:
required: true
type: string

jobs:
build:
build-docs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
Expand All @@ -16,6 +17,7 @@ jobs:
environment-file: ./environment-dev.yml
init-shell: bash
create-args: --verbose
python=${{ inputs.python-version }}
cache-environment: true
cache-downloads: false

Expand Down
49 changes: 41 additions & 8 deletions .github/workflows/build-ultraplot.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: Build and Test
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_call:
inputs:
python-version:
required: true
type: string

jobs:
build:
build-ultraplot:
name: Test Python ${{ inputs.python-version }}
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
Expand All @@ -15,13 +17,44 @@ jobs:
with:
environment-file: ./environment-dev.yml
init-shell: bash
create-args: --verbose
create-args: >-
--verbose
python=${{ inputs.python-version }}
cache-environment: true
cache-downloads: false

- name: Test Ultraplot
- name: Build Ultraplot
shell: bash -el {0}
run: |
micromamba activate ultraplot-dev
pip install .
python -m pytest

- name: Generate baseline from main
shell: bash -el {0}
run: |
mkdir -p baseline
micromamba activate ultraplot-dev
git fetch origin ${{ github.event.pull_request.base.sha }}
git checkout ${{ github.event.pull_request.base.sha }}
pytest --mpl-generate-path=baseline_images
git checkout ${{ github.sha }} # Return to PR branch

- name: Test Ultraplot
shell: bash -el {0}
run: |
micromamba activate ultraplot-dev
pytest

# - name: Image Comparison Ultraplot
# shell: bash -el {0}
# run: |
# micromamba activate ultraplot-dev
# pytest --mpl --mpl-baseline-path=baseline_images

# # return the images that failed
# - name: Upload comparison failures
# if: failure()
# uses: actions/upload-artifact@v4
# with:
# name: failed-comparisons
# path: result_images
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches: [main]

jobs:
build:
linter:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Matrix Test
on:
push:
branches: [main, devel]
pull_request:
branches: [main, devel]

jobs:
get-python-versions:
runs-on: ubuntu-latest
outputs:
python-versions: ${{ steps.set-versions.outputs.python-versions }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install dependencies
run: pip install tomli

- id: set-versions
run: |
# Create a Python script to read and parse versions
cat > get_versions.py << 'EOF'
import tomli
import re
import json

# Read pyproject.toml
with open("pyproject.toml", "rb") as f:
data = tomli.load(f)

# Get Python version requirement
python_req = data["project"]["requires-python"]

# Parse min and max versions
min_version = re.search(r">=(\d+\.\d+)", python_req)
max_version = re.search(r"<(\d+\.\d+)", python_req)

versions = []
if min_version and max_version:
# Convert version strings to tuples
min_v = tuple(map(int, min_version.group(1).split(".")))
max_v = tuple(map(int, max_version.group(1).split(".")))

# Generate version list
current = min_v
while current < max_v:
versions.append(".".join(map(str, current)))
current = (current[0], current[1] + 1)

# Print as JSON array
print(json.dumps(versions))
EOF

# Run the script and capture output
VERSIONS=$(python3 get_versions.py)
echo "Detected versions: ${VERSIONS}" # Debug output
echo "python-versions=${VERSIONS}" >> $GITHUB_OUTPUT

build:
needs: get-python-versions
strategy:
matrix:
python-version: ${{ fromJson(needs.get-python-versions.outputs.python-versions) }}
locale: ["en_US.UTF-8", "C.UTF-8"]
fail-fast: false
uses: ./.github/workflows/build-ultraplot.yml
with:
python-version: ${{ matrix.python-version }}
8 changes: 4 additions & 4 deletions environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: ultraplot-dev
channels:
- conda-forge
dependencies:
- python==3.12
- numpy>=2.2
- matplotlib>=3.9.3
- python>=3.9, <3.13
- numpy>=1.20.0
- matplotlib>=3.9
- cartopy
- xarray
- seaborn
Expand All @@ -21,5 +21,5 @@ dependencies:
- nbsphinx
- sphinx-copybutton
- sphinx-autoapi
- git+https://github.com/cvanelteren/sphinx-rtd-light-dark.git@mplv3.9.1
- git+https://github.com/ultraplot/UltraTheme.git@mplv3.9.1
- sphinx-automodapi
6 changes: 3 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ channels:
- conda-forge
- nodefaults
dependencies:
- python >=3.9
- python >=3.9, <3.13
- pytest
- pytest-mpl
- numpy
- matplotlib>=3.9.2
- numpy>=1.20.0
- matplotlib>=3.9
- pip
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools>=64",
"setuptools_scm[toml]>=8",
"wheel",
"numpy>=1.26.0",
"matplotlib>=3.9.1",
"matplotlib>=3.9",
]
build-backend = "setuptools.build_meta"

Expand All @@ -19,22 +19,21 @@ maintainers = [
]
description = "A succinct matplotlib wrapper for making beautiful, publication-quality graphics."
readme = "README.rst"
requires-python = ">=3.6.0"
requires-python = ">=3.9,<3.13"
license = {text = "MIT"}
classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3 :: Only",
"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",
]
dependencies= [
'importlib-metadata; python_version>"3.8"',

"numpy>=1.26.0",
"matplotlib>=3.9"
]
dynamic = ["version"]

Expand Down
Binary file modified ultraplot/tests/baseline/test_align_labels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed ultraplot/tests/baseline/test_colormap_mode.png
Binary file not shown.
Binary file modified ultraplot/tests/baseline/test_column_iteration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ultraplot/tests/baseline/test_contour_labels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ultraplot/tests/baseline/test_contour_legend_with_label.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ultraplot/tests/baseline/test_contour_legend_without_label.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ultraplot/tests/baseline/test_contour_single.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ultraplot/tests/baseline/test_data_keyword.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed ultraplot/tests/baseline/test_discrete_ticks.png
Binary file not shown.
Binary file removed ultraplot/tests/baseline/test_discrete_vs_fixed.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified ultraplot/tests/baseline/test_flow_functions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ultraplot/tests/baseline/test_histogram_legend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed ultraplot/tests/baseline/test_ignore_message.png
Binary file not shown.
Binary file removed ultraplot/tests/baseline/test_inset_colorbars.png
Binary file not shown.
Binary file modified ultraplot/tests/baseline/test_invalid_dist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ultraplot/tests/baseline/test_keep_guide_labels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ultraplot/tests/baseline/test_label_settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed ultraplot/tests/baseline/test_locale_formatting.png
Binary file not shown.
Binary file modified ultraplot/tests/baseline/test_panel_dist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ultraplot/tests/baseline/test_panels_without_sharing_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ultraplot/tests/baseline/test_panels_without_sharing_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ultraplot/tests/baseline/test_parametric_colors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ultraplot/tests/baseline/test_pint_quantities.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ultraplot/tests/baseline/test_scatter_alpha.png
Binary file modified ultraplot/tests/baseline/test_scatter_args.png
Binary file modified ultraplot/tests/baseline/test_scatter_cycle.png
Binary file modified ultraplot/tests/baseline/test_scatter_sizes.png
Binary file modified ultraplot/tests/baseline/test_seaborn_hist.png
Binary file modified ultraplot/tests/baseline/test_seaborn_relational.png
Diff not rendered.
Binary file modified ultraplot/tests/baseline/test_share_all_basic.png
Binary file modified ultraplot/tests/baseline/test_span_labels.png
Binary file removed ultraplot/tests/baseline/test_standardized_input.png
Diff not rendered.
Binary file modified ultraplot/tests/baseline/test_title_deflection.png
Binary file modified ultraplot/tests/baseline/test_twin_axes_1.png
Binary file modified ultraplot/tests/baseline/test_twin_axes_3.png