From da6cf4429623b5af427a2d2a4d511109ac308af2 Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Mon, 11 Sep 2023 16:29:49 -0600 Subject: [PATCH 01/11] Add release notes for 1.4 --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 725594e5..233b04cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +# 1.4 (2023-09-11) + +## Major Changes + +- Releases are now made with GitHub Actions (thanks + [@matthewfeickert](https://github.com/matthewfeickert)). + +## Minor Changes + +- Fix `torch.result_type()` cross-kind promotion + ([@lucascolley](https://github.com/lucascolley)). + +- Fix the torch.take() wrapper to make axis optional for ndim = 1. + +- Add requires-python metadata to the package + ([@matthewfeickert](https://github.com/matthewfeickert)). + # 1.3 (2023-06-20) ## Major Changes From 3a150bd7b4bbf8d2bcf0677cdf324ae4f5829473 Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Mon, 11 Sep 2023 21:53:12 -0600 Subject: [PATCH 02/11] XFAIL test_linspace for numpy 1.21 --- numpy-1-21-xfails.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/numpy-1-21-xfails.txt b/numpy-1-21-xfails.txt index 80ac9f10..f122453f 100644 --- a/numpy-1-21-xfails.txt +++ b/numpy-1-21-xfails.txt @@ -1,6 +1,9 @@ # asarray(copy=False) is not yet implemented array_api_tests/test_creation_functions.py::test_asarray_arrays +# https://github.com/data-apis/array-api-tests/issues/195 +array_api_tests/test_creation_functions.py::test_linspace + # finfo(float32).eps returns float32 but should return float array_api_tests/test_data_type_functions.py::test_finfo[float32] From 49094b9e8ddd5738112dde9825d32d6d1aff675a Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Tue, 12 Sep 2023 12:25:11 -0600 Subject: [PATCH 03/11] Add numpy 1.21 xfail --- numpy-1-21-xfails.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/numpy-1-21-xfails.txt b/numpy-1-21-xfails.txt index f122453f..48484413 100644 --- a/numpy-1-21-xfails.txt +++ b/numpy-1-21-xfails.txt @@ -123,6 +123,7 @@ array_api_tests/test_operators_and_elementwise_functions.py::test_floor_divide[_ array_api_tests/test_operators_and_elementwise_functions.py::test_floor_divide[__floordiv__(x1, x2)] array_api_tests/test_operators_and_elementwise_functions.py::test_floor_divide[__ifloordiv__(x, s)] array_api_tests/test_operators_and_elementwise_functions.py::test_floor_divide[floor_divide(x1, x2)] +array_api_tests/test_operators_and_elementwise_functions.py::test_greater[__gt__(x1, x2)] array_api_tests/test_operators_and_elementwise_functions.py::test_greater[greater(x1, x2)] array_api_tests/test_operators_and_elementwise_functions.py::test_less[__lt__(x1, x2)] array_api_tests/test_operators_and_elementwise_functions.py::test_less_equal[less_equal(x1, x2)] From 160e0d8af4784b29f7599129494bd23eae54aa99 Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Wed, 13 Sep 2023 15:48:05 -0600 Subject: [PATCH 04/11] Automatically create a GitHub release from a tag --- .github/workflows/publish-package.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 35f087d2..dd21445c 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -87,6 +87,12 @@ jobs: - name: List all files run: ls -lh dist + - name: Create GitHub Release from a Tag + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: dist/* + - name: Publish distribution 📦 to Test PyPI # Publish to TestPyPI on tag events of if manually triggered # Compare to 'true' string as booleans get turned into strings in the console From 0d8b2c637250a2565f58eb47db64a8e681e667e5 Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Wed, 13 Sep 2023 15:49:53 -0600 Subject: [PATCH 05/11] Bump version to 1.4 --- array_api_compat/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/array_api_compat/__init__.py b/array_api_compat/__init__.py index 5a0d650d..b60dd0d5 100644 --- a/array_api_compat/__init__.py +++ b/array_api_compat/__init__.py @@ -17,6 +17,6 @@ this implementation for the default when working with NumPy arrays. """ -__version__ = '1.3' +__version__ = '1.4' from .common import * From f32ee93d1c91d0a142728a4bbe0407ccad101e9c Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Wed, 13 Sep 2023 16:16:02 -0600 Subject: [PATCH 06/11] Create the release after publishing to test pypi --- .github/workflows/publish-package.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index dd21445c..88296469 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -87,12 +87,6 @@ jobs: - name: List all files run: ls -lh dist - - name: Create GitHub Release from a Tag - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - files: dist/* - - name: Publish distribution 📦 to Test PyPI # Publish to TestPyPI on tag events of if manually triggered # Compare to 'true' string as booleans get turned into strings in the console @@ -104,6 +98,12 @@ jobs: repository-url: https://test.pypi.org/legacy/ print-hash: true + - name: Create GitHub Release from a Tag + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: dist/* + - name: Publish distribution 📦 to PyPI if: github.event_name == 'release' && github.event.action == 'published' uses: pypa/gh-action-pypi-publish@v1.8.10 From 078927993385cc024399ec08ad4a22d5a34ab47c Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Wed, 13 Sep 2023 16:53:01 -0600 Subject: [PATCH 07/11] Fix release date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 233b04cb..e107a63f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 1.4 (2023-09-11) +# 1.4 (2023-09-13) ## Major Changes From 693f5da5910837d0699dc09e23bb66e503329b94 Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Wed, 13 Sep 2023 21:24:09 -0600 Subject: [PATCH 08/11] Add contents: write permissions for the release action --- .github/workflows/publish-package.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 88296469..b56c3a82 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -73,6 +73,7 @@ jobs: # c.f. https://docs.pypi.org/trusted-publishers/using-a-publisher/ permissions: id-token: write + contents: write # Restrict to the environment set for the trusted publisher environment: name: publish-package From 84d8a8d50c25029d2f495622188bcacef3faa034 Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Thu, 14 Sep 2023 01:09:43 -0600 Subject: [PATCH 09/11] Disable test pypi for now --- .github/workflows/publish-package.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index b56c3a82..a3ae6793 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -88,16 +88,16 @@ jobs: - name: List all files run: ls -lh dist - - name: Publish distribution 📦 to Test PyPI - # Publish to TestPyPI on tag events of if manually triggered - # Compare to 'true' string as booleans get turned into strings in the console - 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.8.10 - with: - repository-url: https://test.pypi.org/legacy/ - print-hash: true + # - name: Publish distribution 📦 to Test PyPI + # # Publish to TestPyPI on tag events of if manually triggered + # # Compare to 'true' string as booleans get turned into strings in the console + # 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.8.10 + # with: + # repository-url: https://test.pypi.org/legacy/ + # print-hash: true - name: Create GitHub Release from a Tag uses: softprops/action-gh-release@v1 From e1523e2450c89ec4f7fd6a39ed10c67ebd303ad2 Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Thu, 14 Sep 2023 15:07:12 -0600 Subject: [PATCH 10/11] Fix publish to pypi action to actually run Apparently the release created by the action doesn't recursively cause the action to run. --- .github/workflows/publish-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index a3ae6793..cdfdc1ba 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -106,7 +106,7 @@ jobs: files: dist/* - name: Publish distribution 📦 to PyPI - if: github.event_name == 'release' && github.event.action == 'published' + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@v1.8.10 with: print-hash: true From 68486f3ab4cfa19edc1b15ff2eb9c33614f99660 Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Thu, 14 Sep 2023 15:36:46 -0600 Subject: [PATCH 11/11] Uncomment test pypi stuff --- .github/workflows/publish-package.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index cdfdc1ba..b60c2d23 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -88,16 +88,16 @@ jobs: - name: List all files run: ls -lh dist - # - name: Publish distribution 📦 to Test PyPI - # # Publish to TestPyPI on tag events of if manually triggered - # # Compare to 'true' string as booleans get turned into strings in the console - # 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.8.10 - # with: - # repository-url: https://test.pypi.org/legacy/ - # print-hash: true + - name: Publish distribution 📦 to Test PyPI + # Publish to TestPyPI on tag events of if manually triggered + # Compare to 'true' string as booleans get turned into strings in the console + 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.8.10 + with: + repository-url: https://test.pypi.org/legacy/ + print-hash: true - name: Create GitHub Release from a Tag uses: softprops/action-gh-release@v1