From 884abdcc69903ac19fec9f10efb684874b98160b Mon Sep 17 00:00:00 2001 From: Simon Biquard <79218427+sbiquard@users.noreply.github.com> Date: Thu, 17 Sep 2026 16:09:51 +0100 Subject: [PATCH 1/3] deps: add dev group --- pyproject.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 59a151f..1628079 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,6 +28,13 @@ dependencies = [ "scikit-learn", ] +[dependency-groups] +dev = [ + "flake8", + "pytest", + "pytest-cov", +] + [project.scripts] soopercool-get-analysis-mask = "pipeline.get_analysis_mask:cli" soopercool-prepare-cov-inputs = "pipeline.prepare_cov_inputs:cli" From fe9eccda1e8e5d74cbda839fa39480de7afad692 Mon Sep 17 00:00:00 2001 From: Simon Biquard <79218427+sbiquard@users.noreply.github.com> Date: Thu, 17 Sep 2026 16:10:05 +0100 Subject: [PATCH 2/3] ci: modernize, install using uv --- .github/environment.yml | 3 --- .github/workflows/ci.yml | 55 ++++++++++------------------------------ 2 files changed, 13 insertions(+), 45 deletions(-) delete mode 100644 .github/environment.yml diff --git a/.github/environment.yml b/.github/environment.yml deleted file mode 100644 index 67df094..0000000 --- a/.github/environment.yml +++ /dev/null @@ -1,3 +0,0 @@ -name: test -dependencies: - python=3.8 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d91d834..dd37dfd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,59 +7,30 @@ on: - releases/* pull_request: null -env: - CACHE_NUMBER: 0 # increase to reset cache manually - CONDA_ENV: .github/environment.yml - jobs: lint: runs-on: ubuntu-latest steps: - name: Checkout SOOPERCOOL repository - uses: actions/checkout@v3 + uses: actions/checkout@v7 - - name: Install python - uses: actions/setup-python@v2 - with: - python-version: 3.8 + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y libgsl-dev libfftw3-dev libcfitsio-dev - - uses: awvwgk/setup-fortran@main - id: setup-fortran + - name: Install uv & python + uses: astral-sh/setup-uv@v10.1.0 with: - compiler: gcc - version: 11 - - - run: ${{ env.FC }} --version - env: - FC: ${{ steps.setup-fortran.outputs.fc }} + python-version: "3.13" - - name: Install dependencies + - name: Install soopercool run: | - sudo -H apt-get install libgsl-dev libfftw3-dev libcfitsio-dev - - - name: Install soopercool & dependencies - run: | - python -m pip install -U pip - pip install -U wheel - pip install -U setuptools - pip install -U numpy - pip install -U scipy - pip install -U healpy - pip install -U sacc - pip install -U camb - pip install -U pymaster - pip install -U flake8 - pip install -U pytest - pip install -U pytest-cov - pip install -U coveralls - pip install -U pixell - pip install . + uv venv + uv pip install --group dev . - name: Lint - uses: py-actions/flake8@v2 - with: - args: "--config .flake8" + run: uv run --no-sync flake8 --config .flake8 - name: Tests - run: pytest -vv --cov=soopercool - + run: uv run --no-sync pytest -vv --cov=soopercool From e1f45ea7caac830f98bc380330873513aee69b0b Mon Sep 17 00:00:00 2001 From: Simon Biquard <79218427+sbiquard@users.noreply.github.com> Date: Thu, 17 Sep 2026 16:29:27 +0100 Subject: [PATCH 3/3] fix(lint): exclude .venv from flake8, drop dead globals --- .flake8 | 3 ++- soopercool/mpi_utils.py | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.flake8 b/.flake8 index 1813745..8cb1a0f 100644 --- a/.flake8 +++ b/.flake8 @@ -1,4 +1,5 @@ [flake8] exclude = build/, - legacy/ + legacy/, + .venv/ diff --git a/soopercool/mpi_utils.py b/soopercool/mpi_utils.py index 571a629..299b549 100755 --- a/soopercool/mpi_utils.py +++ b/soopercool/mpi_utils.py @@ -55,20 +55,14 @@ def init(switch=False, logger=None): def is_initialized(): - global _initialized return _initialized def is_mpion(): - global _switch return _switch def taskrange(imax, imin=0, shift=0, logger=None): - """ - """ - global rank, size - if (not isinstance(imin, int) or not isinstance(imax, int) or not isinstance(shift, int)): raise TypeError("imin, imax and shift must be integers")