diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 3627f05..0000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,39 +0,0 @@ -# SPDX-FileCopyrightText: © 2022 the SimWeights contributors -# -# SPDX-License-Identifier: BSD-2-Clause -name: Docs -on: - push: - branches: - - main - pull_request: - workflow_dispatch: -jobs: - Docs: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.12" - cache: pip - cache-dependency-path: pyproject.toml - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install .[docs] - - name: Run Sphinx - working-directory: ./docs - run: make html - - name: Upload docs to docs.icecube.aq - if: ${{ github.ref_name == 'main' && !github.event.act }} - working-directory: ./docs - run: | - tar -czvf simweights_docs.tar.gz -C_build/html . - curl -XPUT -i --data-binary @simweights_docs.tar.gz https://docs.icecube.aq/api/upload?path=simweights/${{ github.ref_name }} -u icecube:${{ secrets.ICECUBE_PASSWORD }} - # - name: Check Links - # working-directory: ./docs - # env: - # ICECUBE_PASSWORD: ${{ secrets.ICECUBE_PASSWORD }} - # run: make linkcheck SPHINXOPTS="-W --keep-going" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b06da7e..f6fd186 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,30 +12,33 @@ concurrency: cancel-in-progress: true jobs: Tests: + env: + UV_SYSTEM_PYTHON: 1 runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13"] os: [ubuntu-24.04] include: - python-version: "3.13" - os: macos-latest + os: macos-13 + - python-version: "3.13" + os: macos-14 + - python-version: "3.13" + os: macos-15 steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - cache: pip - cache-dependency-path: pyproject.toml + - name: Install uv and set the python version + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true - name: Install SimWeights - run: | - if [ "${{matrix.python-version}}" != "3.13" ]; then - python3 -m pip install nuflux - fi - python3 -m pip install flit - python3 -m flit install --symlink --deps=production --extras=test + run: uv pip install -e .[test] - name: Download Test Data run: | curl -u icecube:${{ secrets.ICECUBE_PASSWORD }} https://convey.icecube.wisc.edu/data/ana/Software/simweights/test-data/simweights_testdata.tar.gz -O @@ -60,14 +63,20 @@ jobs: fail_ci_if_error: false verbose: true TestsIceTray: + env: + UV_SYSTEM_PYTHON: 1 runs-on: ubuntu-latest container: icecube/icetray:icetray-devel-current-ubuntu22.04-X64 strategy: fail-fast: false steps: - uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true - name: Install SimWeights - run: python3 -m pip install 'pytest>7' .[test] + run: uv pip install -e .[test] - name: Download Test Data run: | curl -u icecube:${{ secrets.ICECUBE_PASSWORD }} https://convey.icecube.wisc.edu/data/ana/Software/simweights/test-data/simweights_testdata.tar.gz -O @@ -104,3 +113,29 @@ jobs: with: files: "*.xml" deduplicate_classes_by_file_name: true + Docs: + env: + UV_SYSTEM_PYTHON: 1 + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: "3.13" + - name: Install uv + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true + - name: Install dependencies + run: | + uv pip install .[docs] + - name: Run Sphinx + working-directory: ./docs + run: make html + - name: Upload docs to docs.icecube.aq + if: ${{ github.ref_name == 'main' && !github.event.act }} + working-directory: ./docs + run: | + tar -czvf simweights_docs.tar.gz -C_build/html . + curl -XPUT -i --data-binary @simweights_docs.tar.gz https://docs.icecube.aq/api/upload?path=simweights/${{ github.ref_name }} -u icecube:${{ secrets.ICECUBE_PASSWORD }} diff --git a/tests/test_weighter.py b/tests/test_weighter.py index 935ef14..2d13375 100755 --- a/tests/test_weighter.py +++ b/tests/test_weighter.py @@ -4,7 +4,6 @@ # # SPDX-License-Identifier: BSD-2-Clause -import contextlib import unittest from copy import deepcopy @@ -12,9 +11,6 @@ from simweights import TIG1996, IceTopSurface, NaturalRateCylinder, NuGenSurface, PowerLaw, Weighter -with contextlib.suppress(ImportError): - import nuflux - def fluxfun1(energy): return energy**2 @@ -315,7 +311,7 @@ def test_nuflux(self): weighter1.add_weight_column("energy", data1["I3Weight"]["energy"]) weighter1.add_weight_column("cos_zen", np.cos(data1["I3Weight"]["zenith"])) - honda = nuflux.makeFlux("honda2006") + honda = nuflux.makeFlux("honda2006") # noqa : F821 w = weighter1.get_weights(honda) fluxval = honda.getFlux(14, data1["I3Weight"]["energy"], np.cos(data1["I3Weight"]["zenith"])) oneweight = weighter1.get_weights(1)