diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5b5616f..289f91d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,6 +5,8 @@ updates: directory: "/" schedule: interval: "weekly" + cooldown: + default-days: 7 # optional groups: actions: patterns: diff --git a/.github/workflows/array-api-tests.yml b/.github/workflows/array-api-tests.yml index 79430c5..920210f 100644 --- a/.github/workflows/array-api-tests.yml +++ b/.github/workflows/array-api-tests.yml @@ -11,11 +11,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] - numpy-version: ['1.26', '2.3.5', 'dev'] + python-version: ['3.10', '3.13', '3.14'] + numpy-version: ['1.26', 'latest', 'dev'] exclude: - python-version: '3.10' - numpy-version: '2.3.5' + numpy-version: 'latest' - python-version: '3.10' numpy-version: 'dev' - python-version: '3.13' @@ -25,11 +25,11 @@ jobs: fail-fast: false steps: - name: Checkout array-api-strict - uses: actions/checkout@v6 + uses: actions/checkout@v6.0.3 with: path: array-api-strict - name: Checkout array-api-tests - uses: actions/checkout@v6 + uses: actions/checkout@v6.0.3 with: repository: data-apis/array-api-tests submodules: 'true' @@ -43,6 +43,8 @@ jobs: python -m pip install --upgrade pip if [[ "${{ matrix.numpy-version }}" == "dev" ]]; then python -m pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy; + elif [[ "${{ matrix.numpy-version }}" == "latest" ]]; then + python -m pip install numpy else python -m pip install 'numpy=='${{ matrix.numpy-version }}; fi diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index bd29e25..48dfc68 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v2 + uses: dependabot/fetch-metadata@v3 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - name: Enable auto-merge for Dependabot PRs diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index ffff634..4faf581 100644 --- a/.github/workflows/docs-build.yml +++ b/.github/workflows/docs-build.yml @@ -6,7 +6,7 @@ jobs: docs-build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v6.0.3 - uses: actions/setup-python@v6 - name: Install Dependencies run: | @@ -16,7 +16,7 @@ jobs: cd docs make html - name: Upload Artifact - uses: actions/upload-artifact@v6 + uses: actions/upload-artifact@v7 with: name: docs-build path: docs/_build/html diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml index 07d6f57..98eba23 100644 --- a/.github/workflows/docs-deploy.yml +++ b/.github/workflows/docs-deploy.yml @@ -11,9 +11,9 @@ jobs: environment: name: docs-deploy steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v6.0.3 - name: Download Artifact - uses: dawidd6/action-download-artifact@v14 + uses: dawidd6/action-download-artifact@v21 with: workflow: docs-build.yml name: docs-build diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index ef7e206..e5fd509 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v6.0.3 with: fetch-depth: 0 @@ -62,7 +62,7 @@ jobs: run: python -m zipfile --list dist/array_api_strict-*.whl - name: Upload distribution artifact - uses: actions/upload-artifact@v6 + uses: actions/upload-artifact@v7 with: name: dist-artifact path: dist @@ -83,7 +83,7 @@ jobs: steps: - name: Download distribution artifact - uses: actions/download-artifact@v7 + uses: actions/download-artifact@v8 with: name: dist-artifact path: dist @@ -97,19 +97,19 @@ jobs: # if: >- # (github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) # || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true') - # uses: pypa/gh-action-pypi-publish@v1.13.0 + # uses: pypa/gh-action-pypi-publish@v1.14.0 # with: # repository-url: https://test.pypi.org/legacy/ # print-hash: true - name: Publish distribution 📦 to PyPI if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@v1.13.0 + uses: pypa/gh-action-pypi-publish@v1.14.0 with: print-hash: true - name: Create GitHub Release from a Tag - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@v3 if: startsWith(github.ref, 'refs/tags/') with: files: dist/* diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index 6e83890..42cb749 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v6.0.3 - name: Install Python uses: actions/setup-python@v6 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 59f4252..7ceae51 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,11 +5,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] - numpy-version: ['1.26', '2.3.5', 'dev'] + python-version: ['3.10', '3.13', '3.14'] + numpy-version: ['1.26', 'latest', 'dev'] exclude: - python-version: '3.10' - numpy-version: '2.3.5' + numpy-version: 'latest' - python-version: '3.10' numpy-version: 'dev' - python-version: '3.13' @@ -18,7 +18,7 @@ jobs: numpy-version: '1.26' fail-fast: false steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v6.0.3 - uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} @@ -27,6 +27,8 @@ jobs: python -m pip install --upgrade pip if [[ "${{ matrix.numpy-version }}" == "dev" ]]; then python -m pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy; + elif [[ "${{ matrix.numpy-version }}" == "latest" ]]; then + python -m pip install numpy else python -m pip install 'numpy=='${{ matrix.numpy-version }} fi diff --git a/array-api-tests-xfails.txt b/array-api-tests-xfails.txt index 6cd7051..b7042ff 100644 --- a/array-api-tests-xfails.txt +++ b/array-api-tests-xfails.txt @@ -45,3 +45,10 @@ array_api_tests/test_special_cases.py::test_unary[tanh(real(x_i) is +infinity an array_api_tests/test_special_cases.py::test_unary[acosh(real(x_i) is +0 and imag(x_i) is NaN) -> NaN \xb1 \u03c0j/2] array_api_tests/test_special_cases.py::test_unary[sqrt(real(x_i) is +infinity and isfinite(imag(x_i)) and imag(x_i) > 0) -> +0 + infinity j] + +# remove this when array-api-strict 2.6 is released: this is only for array-api-tests, +# which runs self-tests against a released array-api-strict +array_api_tests/test_dlpack.py::test_from_dlpack + +# NumPy 1.26 : NotImplementedError: The copy argument to __dlpack__ is not yet implemented +array_api_tests/test_dlpack.py::test_dunder_dlpack diff --git a/array_api_strict/_creation_functions.py b/array_api_strict/_creation_functions.py index af4fa6e..8d3dc60 100644 --- a/array_api_strict/_creation_functions.py +++ b/array_api_strict/_creation_functions.py @@ -212,15 +212,15 @@ def from_dlpack( if copy is not _undef: raise ValueError("The copy argument to from_dlpack requires at least version 2023.12 of the array API") - # Going to wait for upstream numpy support if device is not _undef: _check_device(device) else: device = None - if copy not in [_undef, None]: - raise NotImplementedError("The copy argument to from_dlpack is not yet implemented") + if copy in [_undef, None]: + # numpy 1.26 does not have the copy= arg + return Array._new(np.from_dlpack(x), device=device) - return Array._new(np.from_dlpack(x), device=device) + return Array._new(np.from_dlpack(x, copy=copy), device=device) def full( diff --git a/pyproject.toml b/pyproject.toml index 22fb964..62ccf76 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools >= 61.0,<=75", "setuptools_scm>8"] +requires = ["setuptools >= 61.0,<=75", "setuptools_scm>8,<10"] build-backend = "setuptools.build_meta" [project]