Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
43 changes: 0 additions & 43 deletions .github/actions/setup-poetry-env/action.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/actions/setup-uv-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "setup-uv-env"
description: "Composite action to setup the Python and uv environment."

inputs:
python-version:
required: false
description: "The python version to use"
default: "3.11"

runs:
using: "composite"
steps:
- name: Set up python
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version }}

- name: Install UV
run: curl -LsSf https://astral.sh/uv/install.sh | sh
shell: bash

- name: Load cached venv
id: cached-uv-dependencies
uses: actions/cache@v4
if: github.run_attempt == 1
with:
path: .venv
key: venv-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('uv.lock') }}

- name: Install dependencies
if: github.run_attempt > 1 || steps.cached-uv-dependencies.outputs.cache-hit != 'true'
run: uv sync --all-groups
shell: bash
17 changes: 10 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Set up the environment
uses: ./.github/actions/setup-poetry-env
uses: ./.github/actions/setup-uv-env

- name: Run checks
run: make check
Expand All @@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: false
defaults:
run:
Expand All @@ -39,18 +39,21 @@ jobs:
uses: actions/checkout@v4

- name: Set up the environment
uses: ./.github/actions/setup-poetry-env
uses: ./.github/actions/setup-uv-env
with:
python-version: ${{ matrix.python-version }}

- name: Install xvfb
run: sudo apt-get update && sudo apt-get install -y xvfb

- name: Sync uv project
run: uv sync --all-groups

- name: Run tests
run: xvfb-run poetry run pytest tests --cov --cov-config=pyproject.toml --cov-report=xml
run: xvfb-run uv run pytest tests --cov --cov-config=pyproject.toml --cov-report=xml

- name: Check typing
run: poetry run mypy
run: uv run mypy

- name: Upload coverage reports to Codecov with GitHub Action on Python 3.11
uses: codecov/codecov-action@v4
Expand All @@ -63,7 +66,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up the environment
uses: ./.github/actions/setup-poetry-env
uses: ./.github/actions/setup-uv-env

- name: Check if documentation can be built
run: poetry run mkdocs build -s
run: uv run mkdocs build -s
8 changes: 4 additions & 4 deletions .github/workflows/on-release-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up the environment
uses: ./.github/actions/setup-poetry-env
uses: ./.github/actions/setup-uv-env

- name: Export tag
id: vars
Expand All @@ -22,7 +22,7 @@ jobs:
- name: Build and publish
run: |
source .venv/bin/activate
poetry version $RELEASE_VERSION
uv version $RELEASE_VERSION
make build-and-publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
Expand All @@ -36,7 +36,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up the environment
uses: ./.github/actions/setup-poetry-env
uses: ./.github/actions/setup-uv-env

- name: Deploy documentation
run: poetry run mkdocs gh-deploy --force
run: uv run mkdocs gh-deploy --force
36 changes: 17 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
.PHONY: install
install: ## Install the poetry environment and install the pre-commit hooks
@echo "🚀 Creating virtual environment using pyenv and poetry"
@poetry install
@ poetry run pre-commit install
@poetry shell
install: ## Install the uv environment and install the pre-commit hooks
@echo "🚀 Creating virtual environment using uv"
@uv sync
@uv run pre-commit install

.PHONY: check
check: ## Run code quality tools.
@echo "🚀 Checking Poetry lock file consistency with 'pyproject.toml': Running poetry check --lock"
@poetry check --lock
@echo "🚀 Checking UV lock file consistency with 'pyproject.toml': Running uv lock --check"
@uv lock --check
@echo "🚀 Linting code: Running pre-commit"
@poetry run pre-commit run -a
@uv run pre-commit run -a
@echo "🚀 Static type checking: Running mypy"
@poetry run mypy
@uv run mypy
@echo "🚀 Checking for obsolete dependencies: Running deptry"
@poetry run deptry --exclude=.venv --exclude=.venv_jupyter --exclude=examples --exclude=tests .
@uv run deptry --exclude=.venv --exclude=.venv_jupyter --exclude=examples --exclude=tests .

.PHONY: test
test: ## Test the code with pytest
@echo "🚀 Testing code: Running pytest"
@poetry run pytest --cov --cov-config=pyproject.toml --cov-report=xml
@uv run pytest --cov --cov-config=pyproject.toml --cov-report=xml

.PHONY: build
build: clean-build ## Build wheel file using poetry
build: clean-build ## Build wheel file using uv
@echo "🚀 Creating wheel file"
@poetry build
@uv build

.PHONY: clean-build
clean-build: ## clean build artifacts
Expand All @@ -33,26 +32,25 @@ clean-build: ## clean build artifacts
.PHONY: publish
publish: ## publish a release to pypi.
@echo "🚀 Publishing: Dry run."
@poetry config pypi-token.pypi $(PYPI_TOKEN)
@poetry publish --dry-run
@uv publish --dry-run --token $(PYPI_TOKEN)
@echo "🚀 Publishing."
@poetry publish
@uv publish --token $(PYPI_TOKEN)

.PHONY: build-and-publish
build-and-publish: build publish ## Build and publish.

.PHONY: docs-execute-notebooks
docs-execute-notebooks: ## Execute guide notebooks and save outputs
@echo "🚀 Executing guide notebooks"
@poetry run jupyter nbconvert --to notebook --execute --inplace $(filter-out docs/guides/notebooks/remote-simulations.ipynb,$(wildcard docs/guides/notebooks/*.ipynb))
@uv run jupyter nbconvert --to notebook --execute --inplace $(filter-out docs/guides/notebooks/remote-simulations.ipynb,$(wildcard docs/guides/notebooks/*.ipynb))

.PHONY: docs-test
docs-test: ## Test if documentation can be built without warnings or errors
@poetry run mkdocs build -s
@uv run mkdocs build -s

.PHONY: docs
docs: ## Build and serve the documentation
@poetry run mkdocs serve
@uv run mkdocs serve

.PHONY: help
help:
Expand Down
Binary file modified docs/guides/images/building-concentrations.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 docs/guides/images/building-geometry.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 docs/guides/images/building-slice3d-A.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 docs/guides/images/complex-analytic-geometry.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 docs/guides/images/complex-concentrations.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 docs/guides/images/complex-geometry.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 docs/guides/images/complex-slice3d-A.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 docs/guides/images/viz-concentrations.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 docs/guides/images/viz-slice2d.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 docs/guides/images/viz-slice3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion examples/scripts/fielddata_from_image_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def create_sinusoid(
return sinusoid.astype(dtype=np.float64)


with tempfile.TemporaryDirectory() as temp_dir_name, Path(temp_dir_name) as temp_dir:
with tempfile.TemporaryDirectory() as temp_dir_name:
temp_dir = Path(temp_dir_name)
print(f"temp_dir: {temp_dir}, exists={temp_dir.exists()}")
# ----- make a workspace
workspace_dir = temp_dir / "workspace"
Expand Down
3 changes: 2 additions & 1 deletion examples/scripts/fielddata_from_sim_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

import pyvcell.vcml as vc

with tempfile.TemporaryDirectory() as temp_dir_name, Path(temp_dir_name) as temp_dir:
with tempfile.TemporaryDirectory() as temp_dir_name:
temp_dir: Path = Path(temp_dir_name)
# ----- make a workspace
workspace_dir = temp_dir / "workspace"
sim1_dir = workspace_dir / "sim1_dir"
Expand Down
Loading
Loading