diff --git a/.dockerignore b/.dockerignore index e8bfaf4..e578f38 100644 --- a/.dockerignore +++ b/.dockerignore @@ -137,6 +137,9 @@ # Cython debug symbols **/cython_debug/ +# uv +**/uv.lock + # macOS **/.DS_Store diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d4c5c7..52e8d5d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,16 +27,15 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v3 - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.x' - - name: Install linting dependencies - run: | - pip install .[typing] + python-version-file: pyproject.toml - name: Check types with mypy run: | - mypy + uv run --extra typing mypy test: runs-on: ubuntu-22.04 @@ -70,11 +69,12 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - allow-prereleases: true - name: Set up OpenFOAM uses: gerlero/setup-openfoam@v1 with: @@ -84,10 +84,10 @@ jobs: uses: koesterlab/setup-slurm-action@v1 - name: Install test dependencies run: | - python -m pip install .[test] + uv sync --extra test --dev - name: Test with pytest run: | - pytest --cov=foamlib + uv run pytest --cov=foamlib env: OMPI_MCA_rmaps_base_oversubscribe: 1 OMPI_ALLOW_RUN_AS_ROOT: 1 @@ -96,3 +96,14 @@ jobs: uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} + + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v3 + - name: Check package build + run: | + uv build diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index e06811c..a8c2cc2 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -16,24 +16,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - name: Install needed packages - run: | - pip install --upgrade setuptools build - - name: Check version number - run: | - TAG="${GITHUB_REF#refs/tags/}" - VERSION_FROM_TAG="${TAG#v}" - PACKAGE_VERSION=$(python -c 'import setuptools; setuptools.setup()' --version) - if [ "$PACKAGE_VERSION" != "$VERSION_FROM_TAG" ]; then - echo "::error title=Version mismatch::$PACKAGE_VERSION (package version) != $VERSION_FROM_TAG (version from tag)" - exit - fi + - name: Install uv + uses: astral-sh/setup-uv@v3 - name: Build - run: | - python -m build + run: uv build - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + run: uv publish diff --git a/.gitignore b/.gitignore index c400eb5..b934eee 100644 --- a/.gitignore +++ b/.gitignore @@ -137,6 +137,9 @@ dmypy.json # Cython debug symbols cython_debug/ +# uv +uv.lock + # macOS .DS_Store diff --git a/README.md b/README.md index 9416822..6f5af63 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [![Codecov](https://codecov.io/gh/gerlero/foamlib/branch/main/graph/badge.svg)](https://codecov.io/gh/gerlero/foamlib) [![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) +[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv) [![PyPI](https://img.shields.io/pypi/v/foamlib)](https://pypi.org/project/foamlib/) [![Conda Version](https://img.shields.io/conda/vn/conda-forge/foamlib)](https://anaconda.org/conda-forge/foamlib) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/foamlib)](https://pypi.org/project/foamlib/) diff --git a/pyproject.toml b/pyproject.toml index 6b9ba50..0c5a233 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ typing = [ ] docs = [ "foamlib[numpy]", - "sphinx>=7,<9", + "sphinx>=5,<9", "sphinx_rtd_theme", ] dev = [