-
Notifications
You must be signed in to change notification settings - Fork 17
BLD/DEV: switch to meson-python and pixi-build #583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| 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` | ||
| 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 | ||
| 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 = { | ||
lucascolley marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| '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') | ||
Large diffs are not rendered by default.
| 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", | ||
|
|
@@ -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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" | ||
|
|
@@ -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] | ||
|
|
||
| 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' | ||
| ) |
| 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' | ||
| ) |
There was a problem hiding this comment.
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.