Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
# Excluding files from an sdist generated by meson-python
#########################################################

# Note: when adding to this list, be aware that you need to commit your changes
# before they take effect (can be confusing during testing)

.github/* export-ignore
.git* export-ignore
codecov.yml export-ignore
pixi.lock export-ignore
RELEASING.md export-ignore
renovate.json export-ignore

# GitHub syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
4 changes: 2 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
1. Update the version in `src/array_api_extra/__init__.py`
1. Update the version in `pyproject.toml`, `meson.build`, and `src/array_api_extra/__init__.py`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

up to 3 sources now, I don't think pixi-build is smart enough to handle dynamic versioning yet. But I think it's okay.

2. Update the lockfile with `pixi update; pixi install`
3. Push your changes
4. Cut a release via the GitHub GUI
5. Update the version to `{next micro version}.dev0`
5. Update the version to `{next micro version}.dev0` in `pyproject.toml`, `meson.build`, and `src/array_api_extra/__init__.py`
6. `pixi clean cache --pypi; pixi update; pixi install`
7. Push your changes
8. Merge the automated PR to conda-forge/array-api-extra-feedstock
39 changes: 39 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
project(
'array-api-extra',
version: '0.10.0.dev0'
)

py = import('python').find_installation(pure: false)

# NOTE: downstream projects may rely on this variable name when vendoring,
# do not change it without consulting with downstream projects
sources = {
'array_api_extra': files(
'src/array_api_extra/__init__.py',
'src/array_api_extra/_delegation.py',
'src/array_api_extra/testing.py',
),
'array_api_extra/_lib': files(
'src/array_api_extra/_lib/__init__.py',
'src/array_api_extra/_lib/_at.py',
'src/array_api_extra/_lib/_backends.py',
'src/array_api_extra/_lib/_funcs.py',
'src/array_api_extra/_lib/_lazy.py',
'src/array_api_extra/_lib/_testing.py',
),
'array_api_extra/_lib/_utils': files(
'src/array_api_extra/_lib/_utils/__init__.py',
'src/array_api_extra/_lib/_utils/_compat.py',
'src/array_api_extra/_lib/_utils/_compat.pyi',
'src/array_api_extra/_lib/_utils/_helpers.py',
'src/array_api_extra/_lib/_utils/_typing.py',
'src/array_api_extra/_lib/_utils/_typing.pyi',
),
}

foreach subdir, files : sources
py.install_sources(files, subdir: subdir)
endforeach

subdir('tests')
subdir('vendor_tests')
584 changes: 495 additions & 89 deletions pixi.lock

Large diffs are not rendered by default.

90 changes: 52 additions & 38 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
requires = ["meson-python"]
build-backend = "mesonpy"

[project]
name = "array-api-extra"
version = "0.10.0.dev0"
authors = [
{ name = "Lucas Colley", email = "lucas.colley8@gmail.com" },
# { name = "Open Source Contributors" }, # https://github.com/pypi/warehouse/issues/14813
]
description = "Extra array functions built on top of the array API standard."
readme = "README.md"
license.file = "LICENSE"
license = "MIT"
license-files = ["LICENSE"]
requires-python = ">=3.11"
classifiers = [
"Intended Audience :: Developers",
Expand All @@ -24,33 +26,67 @@ classifiers = [
"Programming Language :: Python :: Free Threading :: 3 - Stable",
"Typing :: Typed",
]
dynamic = ["version"]
dependencies = ["array-api-compat>=1.12.0,<2"]

[project.urls]
Homepage = "https://github.com/data-apis/array-api-extra"
"Bug Tracker" = "https://github.com/data-apis/array-api-extra/issues"
Changelog = "https://github.com/data-apis/array-api-extra/releases"

# Hatch

[tool.hatch]
version.path = "src/array_api_extra/__init__.py"

[tool.hatch.build.targets.sdist]
exclude = ["codecov.yml", "pixi.lock", "RELEASING.md", "renovate.json"]

#  Pixi
# Pixi

[tool.pixi.workspace]
channels = ["https://prefix.dev/conda-forge"]
platforms = ["linux-64", "osx-64", "osx-arm64", "win-64"]
preview = ["pixi-build"]

### array-api-extra package definition ###

[tool.pixi.package.build.backend]
name = "pixi-build-python"
version = "*"

[tool.pixi.package.host-dependencies]
meson-python = "*"
uv = "*" # interfaces with meson-python instead of pip

[tool.pixi.package.run-dependencies]
array-api-compat = "*"

### workspace environments ###

[tool.pixi.environments]
default = { features = ["py313"], solve-group = "py313" }
lint = { features = ["py313", "lint"], solve-group = "py313" }
docs = { features = ["py313", "docs"], solve-group = "py313" }
tests = { features = ["py313", "tests"], solve-group = "py313" }
tests-py313 = { features = ["py313", "tests"], solve-group = "py313" } # alias of tests
Comment on lines +56 to +63
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just moved up from below, it is clearer to keep environment definitions at the top IMO


# Some backends may pin numpy; use separate solve-group
dev = { features = ["py313", "lint", "tests", "docs", "dev", "backends"], solve-group = "backends" }
tests-backends = { features = ["py313", "tests", "backends"], solve-group = "backends" }
tests-backends-py311 = { features = ["py311", "tests", "backends"] }

# CUDA not available on free github actions and on some developers' PCs
dev-cuda = { features = ["py313", "lint", "tests", "docs", "dev", "backends", "cuda-backends"], solve-group = "cuda" }
tests-cuda = { features = ["py313", "tests", "backends", "cuda-backends"], solve-group = "cuda" }
tests-cuda-py311 = { features = ["py311", "tests", "backends", "cuda-backends"] }

# Ungrouped environments
tests-numpy1 = ["py311", "tests", "numpy1"]
tests-py311 = ["py311", "tests"]
tests-nogil = ["nogil", "tests"]

### default feature definition ###

[tool.pixi.dev]
# this pulls in array-api-extra's host and run dependencies
array-api-extra.path = "."

[tool.pixi.dependencies]
array-api-compat = ">=1.12.0,<2"
array-api-extra.path = "."
Comment on lines +82 to +87
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ideally we wouldn't need both of these, I have asked offline


[tool.pixi.pypi-dependencies]
array-api-extra = { path = ".", editable = true }
### non-default feature definitions ###

[tool.pixi.feature.lint.dependencies]
typing-extensions = ">=4.15.0"
Expand Down Expand Up @@ -197,28 +233,6 @@ dask-core = ">=2025.12.0" # No distributed, tornado, etc.
# sparse = "*" # numba not available on Python 3.13t yet
# jax = "*" # ml_dtypes not available on Python 3.13t yet

[tool.pixi.environments]
default = { features = ["py313"], solve-group = "py313" }
lint = { features = ["py313", "lint"], solve-group = "py313" }
docs = { features = ["py313", "docs"], solve-group = "py313" }
tests = { features = ["py313", "tests"], solve-group = "py313" }
tests-py313 = { features = ["py313", "tests"], solve-group = "py313" } # alias of tests

# Some backends may pin numpy; use separate solve-group
dev = { features = ["py313", "lint", "tests", "docs", "dev", "backends"], solve-group = "backends" }
tests-backends = { features = ["py313", "tests", "backends"], solve-group = "backends" }
tests-backends-py311 = { features = ["py311", "tests", "backends"] }

# CUDA not available on free github actions and on some developers' PCs
dev-cuda = { features = ["py313", "lint", "tests", "docs", "dev", "backends", "cuda-backends"], solve-group = "cuda" }
tests-cuda = { features = ["py313", "tests", "backends", "cuda-backends"], solve-group = "cuda" }
tests-cuda-py311 = { features = ["py311", "tests", "backends", "cuda-backends"] }

# Ungrouped environments
tests-numpy1 = ["py311", "tests", "numpy1"]
tests-py311 = ["py311", "tests"]
tests-nogil = ["nogil", "tests"]

# pytest

[tool.pytest.ini_options]
Expand Down
12 changes: 12 additions & 0 deletions tests/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
py.install_sources([
'__init__.py',
'conftest.py',
'test_at.py',
'test_funcs.py',
'test_helpers.py',
'test_lazy.py',
'test_testing.py',
'test_version.py',
],
subdir: 'array_api_extra/tests'
)
7 changes: 7 additions & 0 deletions vendor_tests/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
py.install_sources([
'__init__.py',
'_array_api_compat_vendor.py',
'test_vendor.py',
],
subdir: 'array_api_extra/vendor_tests'
)