-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e62c9c
commit 601751b
Showing
10 changed files
with
910 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
uarray/_version.py export-subst | ||
# GitHub syntax highlighting | ||
pixi.lock linguist-language=YAML linguist-generated=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,6 @@ build/ | |
default.profraw | ||
uarray/_version.py | ||
*.pyd | ||
# pixi environments | ||
.pixi | ||
*.egg-info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
cmake_minimum_required(VERSION 3.15...3.30) | ||
project(${SKBUILD_PROJECT_NAME} LANGUAGES CXX) | ||
|
||
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED) | ||
|
||
Python_add_library(_uarray MODULE | ||
uarray/small_dynamic_array.h | ||
uarray/vectorcall.h | ||
uarray/vectorcall.cxx | ||
uarray/_uarray_dispatch.cxx | ||
) | ||
set_property(TARGET _uarray PROPERTY CXX_STANDARD 11) | ||
install(TARGETS _uarray DESTINATION ${SKBUILD_PROJECT_NAME}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,95 @@ | ||
[build-system] | ||
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"] | ||
requires = ["scikit-build-core", "setuptools", "setuptools_scm"] | ||
build-backend = "scikit_build_core.setuptools.build_meta" | ||
|
||
[tool.black] | ||
exclude = 'uarray/_version.py' | ||
[project] | ||
name = "uarray" | ||
dynamic = ["version"] | ||
description = "Array interface object for Python with pluggable backends and a multiple-dispatch mechanism for defining down-stream functions" | ||
readme = "README.md" | ||
dependencies = [] | ||
maintainers = [{ name = "Hameer Abbasi", email = "[email protected]" }] | ||
requires-python = ">=3.10" | ||
license = { file = "LICENSE" } | ||
keywords = ["uarray", "scipy", "multiple-dispatch"] | ||
classifiers = [ | ||
"Development Status :: 2 - Pre-Alpha", | ||
"Operating System :: OS Independent", | ||
"License :: OSI Approved :: BSD License", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: 3.13", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Science/Research", | ||
"Typing :: Typed", | ||
] | ||
|
||
[project.urls] | ||
Documentation = "https://uarray.org/" | ||
Source = "https://github.com/Quansight-Labs/uarray/" | ||
Repository = "https://github.com/Quansight-Labs/uarray.git" | ||
"Issue Tracker" = "https://github.com/Quansight-Labs/uarray/issues" | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["."] | ||
include = ["uarray", "uarray.*"] | ||
|
||
[tool.setuptools_scm] | ||
write_to = "uarray/_version.py" | ||
[project.optional-dependencies] | ||
docs = [ | ||
"sphinx", | ||
"sphinx_rtd_theme", | ||
"doc8", | ||
] | ||
tests = [ | ||
"pytest>=3.5", | ||
"pytest-flake8", | ||
"pytest-cov", | ||
"mypy>=0.930", | ||
] | ||
optional = [] | ||
all = [ | ||
"uarray[docs]", | ||
"uarray[tests]", | ||
"uarray[optional]", | ||
] | ||
|
||
[tool.mypy] | ||
show_error_codes = true | ||
no_implicit_reexport = true | ||
disallow_any_unimported = true | ||
|
||
[[tool.mypy.overrides]] | ||
module = [ | ||
"pytest_black.*", | ||
] | ||
ignore_missing_imports = true | ||
disallow_any_unimported = false | ||
|
||
[tool.cibuildwheel] | ||
build = "{cp3{8..10}-*,pp3{8..9}-*}" | ||
build = "{cp3{10..13}-*,pp310-*}" | ||
build-frontend = "build" | ||
free-threaded-support = true | ||
test-command = "pip install -r {project}/requirements/tests.txt && pytest --pyargs uarray" | ||
|
||
[tool.cibuildwheel.macos] | ||
archs = ["x86_64", "universal2"] | ||
|
||
[tool.cibuildwheel.config-settings] | ||
"cmake.verbose" = true | ||
"logging.level" = "INFO" | ||
[tool.pixi.project] | ||
channels = ["conda-forge"] | ||
platforms = ["osx-arm64"] | ||
|
||
[tool.pixi.pypi-dependencies] | ||
uarray = { path = ".", editable = true } | ||
|
||
[tool.pixi.environments] | ||
default = { solve-group = "default" } | ||
all = { features = ["all", "docs", "tests", "optional"], solve-group = "default" } | ||
docs = { features = ["docs"], solve-group = "default" } | ||
optional = { features = ["optional"], solve-group = "default" } | ||
tests = { features = ["tests"], solve-group = "default" } | ||
|
||
[tool.pixi.tasks] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
pytest>=3.5 | ||
pytest-flake8 | ||
pytest-cov | ||
pytest-black; platform_python_implementation == 'CPython' | ||
mypy>=0.930 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,103 +1,3 @@ | ||
#!/usr/bin/env python | ||
from setuptools import setup | ||
|
||
from setuptools import setup, find_packages, Extension | ||
from setuptools.command.build_ext import build_ext | ||
from pathlib import Path | ||
import sys | ||
import os | ||
from typing import List | ||
|
||
cwd = Path(os.path.dirname(os.path.abspath(__file__))) | ||
|
||
|
||
def open_reqs_file(file, reqs_path=Path(cwd)): | ||
with (reqs_path / file).open() as f: | ||
reqs = list(f.read().strip().split("\n")) | ||
|
||
i = 0 | ||
while i < len(reqs): | ||
if reqs[i].startswith("-r"): | ||
reqs[i : i + 1] = open_reqs_file(reqs[i][2:].strip(), reqs_path=reqs_path) | ||
else: | ||
i += 1 | ||
|
||
return reqs | ||
|
||
|
||
extras_require = {} | ||
reqs = [] # type: List[str] | ||
|
||
|
||
def parse_requires(): | ||
reqs_path = cwd / "requirements" | ||
reqs.extend(open_reqs_file("requirements.txt")) | ||
|
||
for f in reqs_path.iterdir(): | ||
extras_require[f.stem] = open_reqs_file(f.parts[-1], reqs_path=reqs_path) | ||
|
||
|
||
parse_requires() | ||
|
||
with open("README.md") as f: | ||
long_desc = f.read() | ||
|
||
|
||
class build_cpp11_ext(build_ext): | ||
def build_extension(self, ext): | ||
cc = self.compiler | ||
if cc.compiler_type == "unix": | ||
ext.extra_compile_args.append("--std=c++11") | ||
if self.plat_name.startswith("macosx"): | ||
ext.extra_compile_args.append("-mmacosx-version-min=10.9") | ||
ext.extra_link_args.append("-mmacosx-version-min=10.9") | ||
build_ext.build_extension(self, ext) | ||
|
||
|
||
extensions = [ | ||
Extension( | ||
"uarray._uarray", | ||
sources=["uarray/_uarray_dispatch.cxx", "uarray/vectorcall.cxx"], | ||
depends=["uarray/small_dynamic_array.h", "uarray/vectorcall.h"], | ||
language="c++", | ||
) | ||
] | ||
|
||
setup( | ||
name="uarray", | ||
cmdclass={"build_ext": build_cpp11_ext}, | ||
description="Array interface object for Python with pluggable backends and a multiple-dispatch" | ||
"mechanism for defining down-stream functions", | ||
url="https://github.com/Quansight-Labs/uarray/", | ||
maintainer="Hameer Abbasi", | ||
maintainer_email="[email protected]", | ||
license="BSD 3-Clause License (Revised)", | ||
keywords="uarray,numpy,scipy,pytorch,cupy,tensorflow", | ||
packages=find_packages(include=["uarray", "uarray.*"]), | ||
long_description=long_desc, | ||
long_description_content_type="text/markdown", | ||
install_requires=reqs, | ||
extras_require=extras_require, | ||
zip_safe=False, | ||
classifiers=[ | ||
"Development Status :: 2 - Pre-Alpha", | ||
"Operating System :: OS Independent", | ||
"License :: OSI Approved :: BSD License", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Science/Research", | ||
"Typing :: Typed", | ||
], | ||
package_data={"uarray": ["*.pyi", "py.typed"]}, | ||
project_urls={ | ||
"Documentation": "https://uarray.org/", | ||
"Source": "https://github.com/Quansight-Labs/uarray/", | ||
"Tracker": "https://github.com/Quansight-Labs/uarray/issues", | ||
}, | ||
python_requires=">=3.8, <4", | ||
ext_modules=extensions, | ||
) | ||
setup(cmake_source_dir=".") |
This file was deleted.
Oops, something went wrong.