Skip to content
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

Add pyproject.toml #255

Merged
merged 1 commit into from
Mar 25, 2025
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/setup-python@v5
- name: Install Dependencies
run: |
python -m pip install -r docs/requirements.txt
python -m pip install .[docs]
- name: Build Docs
run: |
cd docs
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ jobs:
PIP_EXTRA='numpy==1.26.*'
fi

if [ "${{ matrix.python-version }}" == "3.9" ]; then
sed -i '/^ndonnx/d' requirements-dev.txt
fi

python -m pip install -r requirements-dev.txt $PIP_EXTRA
python -m pip install .[dev] $PIP_EXTRA

- name: Run Tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ the array API standard. There are also array-api-compat specific tests in
These tests should be limited to things that are not tested by the test suite,
e.g., tests for [helper functions](../helper-functions.rst) or for behavior
that is not strictly required by the standard. To run these tests, install the
dependencies from `requirements-dev.txt` (array-api-compat has [no hard
dependencies from the `dev` optional group (array-api-compat has [no hard
runtime dependencies](no-dependencies)).

array-api-tests is run against all supported libraries are tested on CI
Expand Down
6 changes: 0 additions & 6 deletions docs/requirements.txt

This file was deleted.

96 changes: 96 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[project]
name = "array-api-compat"
dynamic = ["version"]
description = "A wrapper around NumPy and other array libraries to make them compatible with the Array API standard"
readme = "README.md"
requires-python = ">=3.9"
license = "MIT"
authors = [{name = "Consortium for Python Data API Standards"}]
classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]

[project.optional-dependencies]
cupy = ["cupy"]
dask = ["dask"]
jax = ["jax"]
numpy = ["numpy"]
pytorch = ["torch"]
sparse = ["sparse>=0.15.1"]
docs = [
"furo",
"linkify-it-py",
"myst-parser",
"sphinx",
"sphinx-copybutton",
"sphinx-autobuild",
]
dev = [
"array-api-strict",
"dask[array]",
"jax[cpu]",
"numpy",
"pytest",
"torch",
"sparse>=0.15.1",
"ndonnx; python_version>=\"3.10\""
]

[project.urls]
homepage = "https://data-apis.org/array-api-compat/"
repository = "https://github.com/data-apis/array-api-compat/"

[tool.setuptools.dynamic]
version = {attr = "array_api_compat.__version__"}
Copy link
Member

Choose a reason for hiding this comment

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

Note to self: need to make sure this keeps working from both a regular commit and a git tag for a release:

  • a "regular" way: python -m bulid generates a version with a dynamic tag
  • from a git tag / in a release workflow: the version is from __init__.py, as set manually


[tool.setuptools.packages.find]
include = ["array_api_compat*"]
namespaces = false

[toolint]
preview = true
select = [
# Defaults
"E4", "E7", "E9", "F",
# Undefined export
"F822",
# Useless import alias
"PLC0414"
]

ignore = [
# Module import not at top of file
"E402",
# Do not use bare `except`
"E722"
]

[tool.ruff.lint]
preview = true
select = [
# Defaults
"E4", "E7", "E9", "F",
# Undefined export
"F822",
# Useless import alias
"PLC0414"
]

ignore = [
# Module import not at top of file
"E402",
# Do not use bare `except`
"E722"
]
8 changes: 0 additions & 8 deletions requirements-dev.txt

This file was deleted.

17 changes: 0 additions & 17 deletions ruff.toml

This file was deleted.

40 changes: 0 additions & 40 deletions setup.py

This file was deleted.

Loading