diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 28b7802..99e1a2d 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -12,12 +12,12 @@ jobs: uses: actions/setup-python@v3 with: python-version: '3.11' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install wheel - - name: Build bdist_wheel - run: python setup.py bdist_wheel + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + - name: Build wheel + run: uv build --wheel - uses: actions/upload-artifact@v3 with: path: dist/*.whl \ No newline at end of file diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 8ad41ce..fadd32a 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -17,7 +17,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: "3.8" + python-version: "3.11" - uses: pre-commit/action@v3.0.0 with: @@ -27,21 +27,21 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.8", "3.9", "3.10" ] + python-version: [ "3.11", "3.12" ] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true - name: Install dependencies run: | - # Keep pip below 23.0.1 (vam.whittaker install fails with higher versions, #84) - python -m pip install --upgrade 'pip<23.0.1' - pip install flake8 pytest - # Workaround for vam.whittaker installation issue https://github.com/WFP-VAM/vam.whittaker/issues/4 - pip install numpy==1.23.5 cython - pip install .[dev] + uv pip install --system flake8 pytest cython + uv pip install --system .[dev] --index-strategy unsafe-best-match --extra-index-url https://artifactory.vgt.vito.be/artifactory/api/pypi/python-packages-public/simple - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names @@ -50,4 +50,4 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pytest \ No newline at end of file + pytest diff --git a/Jenkinsfile b/Jenkinsfile index 625d1e4..1be6ff9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,4 +13,6 @@ pythonPipeline { wheel_repo = 'python-openeo' wheel_repo_dev = 'python-openeo' pep440 = true + enable_caching = true + enable_uv = true } diff --git a/pyproject.toml b/pyproject.toml index d650f55..34bcffc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=42", "wheel", "numpy==1.23.5"] +requires = ["setuptools>=42", "wheel", "numpy>=2.0"] build-backend = "setuptools.build_meta" [tool.black] @@ -7,7 +7,7 @@ line-length = 120 [tool.ruff] line-length = 120 -target-version = "py38" +target-version = "py311" select = ["F401", "I"] fix = true diff --git a/setup.cfg b/setup.cfg index 3c8eb80..c4c216f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,8 +21,10 @@ package_dir = packages = find: python_requires = >= 3.8 install_requires = - numpy==1.23.5 - vam.whittaker==2.0.6 + numpy>=2.0 + vam_whittaker @ https://artifactory.vgt.vito.be/artifactory/python-packages-public/vam_whittaker/2.0.6/vam_whittaker-2.0.6-cp311-cp311-linux_x86_64.whl ; python_version == "3.11" and sys_platform == "linux" + vam_whittaker @ https://artifactory.vgt.vito.be/artifactory/python-packages-public/vam_whittaker/2.0.6/vam_whittaker-2.0.6-cp312-cp312-linux_x86_64.whl ; python_version == "3.12" and sys_platform == "linux" + vam_whittaker ; sys_platform=="windows" xarray>=0.20.2 lcmap-pyccd==2021.7.19 openeo @@ -38,7 +40,7 @@ dev = pre-commit sphinx>=4.5.0 myst-parser>=0.17.0 - h5netcdf + h5netcdf[h5py] sphinx-autodoc-annotation sphinx-autodoc-typehints sphinxcontrib-svg2pdfconverter==1.2.0 diff --git a/src/fusets/whittaker.py b/src/fusets/whittaker.py index e027324..9aee581 100644 --- a/src/fusets/whittaker.py +++ b/src/fusets/whittaker.py @@ -103,7 +103,7 @@ def whittaker( def callback(timeseries): _, _, Zd, XXd = whittaker_f(dates, timeseries, smoothing_lambda, 1) - dates_mask = np.in1d(XXd, output_dates) + dates_mask = np.isin(XXd, output_dates) return Zd[dates_mask] result = xarray.apply_ufunc(