Skip to content

Commit 995eae7

Browse files
pre-commit-ci[bot]mtsokol
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 6412ddc commit 995eae7

File tree

5 files changed

+142
-108
lines changed

5 files changed

+142
-108
lines changed

.github/workflows/ci.yml

+33-24
Original file line numberDiff line numberDiff line change
@@ -24,43 +24,52 @@ jobs:
2424
steps:
2525
- name: Checkout Repo
2626
uses: actions/checkout@v4
27-
- name: Cache conda
28-
uses: actions/cache@v4
29-
env:
30-
# Increase this value to reset cache if ci/environment.yml has not changed
31-
CACHE_NUMBER: 0
32-
with:
33-
path: ~/conda_pkgs_dir
34-
key:
35-
test-${{ matrix.os }}-conda-py${{ matrix.python }}-${{ env.CACHE_NUMBER }}-${{
36-
hashFiles('ci/environment.yml') }}
37-
- uses: conda-incubator/setup-miniconda@v3
38-
with:
39-
activate-environment: sparse-dev
40-
allow-softlinks: true
41-
environment-file: ci/environment.yml
42-
python-version: ${{ matrix.python }}
43-
miniforge-version: latest
27+
# - name: Cache conda
28+
# uses: actions/cache@v4
29+
# env:
30+
# # Increase this value to reset cache if ci/environment.yml has not changed
31+
# CACHE_NUMBER: 0
32+
# with:
33+
# path: ~/conda_pkgs_dir
34+
# key:
35+
# test-${{ matrix.os }}-conda-py${{ matrix.python }}-${{ env.CACHE_NUMBER }}-${{
36+
# hashFiles('ci/environment.yml') }}
37+
# - uses: conda-incubator/setup-miniconda@v3
38+
# with:
39+
# activate-environment: sparse-dev
40+
# allow-softlinks: true
41+
# environment-file: ci/environment.yml
42+
# python-version: ${{ matrix.python }}
43+
# miniforge-version: latest
4444
# - name: Install julia and numba
4545
# run: |
4646
# conda install conda-forge::numba
4747
# conda install conda-forge::julia
4848
# - uses: julia-actions/[email protected]
4949
# with:
5050
# version: '1.10'
51+
- uses: actions/setup-python@v5
52+
with:
53+
python-version: ${{ matrix.python }}
54+
- name: Install Poetry
55+
uses: snok/install-poetry@v1
5156
- name: Install package
5257
run: |
53-
pip install -e .[tests,finch]
58+
poetry install --with tests,finch
59+
# - name: Install package
60+
# run: |
61+
# pip install -e .[tests,finch]
5462
- name: Run tests
5563
run: |
56-
pytest --pyargs sparse/tests/test_backends.py
64+
poetry run pytest tests/test_backends.py
65+
# pytest --pyargs sparse/tests/test_backends.py
5766
- uses: codecov/codecov-action@v4
5867
if: always()
59-
- name: Publish Test Results
60-
uses: EnricoMi/publish-unit-test-result-action/composite@v2
61-
if: always()
62-
with:
63-
files: "**/test-*.xml"
68+
# - name: Publish Test Results
69+
# uses: EnricoMi/publish-unit-test-result-action/composite@v2
70+
# if: always()
71+
# with:
72+
# files: "**/test-*.xml"
6473
docs:
6574
defaults:
6675
run:

pyproject.toml

+108-79
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,110 @@
1-
[build-system]
2-
requires = ["setuptools>=64", "setuptools_scm>=8"]
3-
build-backend = "setuptools.build_meta"
1+
# [build-system]
2+
# requires = ["setuptools>=64", "setuptools_scm>=8"]
3+
# build-backend = "setuptools.build_meta"
4+
5+
# [project]
6+
# name = "sparse"
7+
# dynamic = ["version"]
8+
# description = "Sparse n-dimensional arrays for the PyData ecosystem"
9+
# readme = "README.rst"
10+
# dependencies = ["numpy>=1.17"]
11+
# maintainers = [{ name = "Hameer Abbasi", email = "[email protected]" }]
12+
# requires-python = ">=3.9"
13+
# license = { file = "LICENSE" }
14+
# keywords = ["sparse", "numpy", "scipy", "dask"]
15+
# classifiers = [
16+
# "Development Status :: 2 - Pre-Alpha",
17+
# "Operating System :: OS Independent",
18+
# "License :: OSI Approved :: BSD License",
19+
# "Programming Language :: Python",
20+
# "Programming Language :: Python :: 3",
21+
# "Programming Language :: Python :: 3.9",
22+
# "Programming Language :: Python :: 3.10",
23+
# "Programming Language :: Python :: 3.11",
24+
# "Programming Language :: Python :: 3 :: Only",
25+
# "Intended Audience :: Developers",
26+
# "Intended Audience :: Science/Research",
27+
# ]
28+
29+
# [project.optional-dependencies]
30+
# docs = ["sphinx", "sphinx_rtd_theme", "scipy"]
31+
# tests = [
32+
# "dask[array]",
33+
# "pytest>=3.5",
34+
# "pytest-cov",
35+
# "pre-commit",
36+
# "scipy",
37+
# ]
38+
# tox = ["sparse[tests]", "tox"]
39+
# all = ["sparse[docs,tox]", "matrepr"]
40+
# finch = ["finch-tensor==0.1.6"]
41+
42+
# [project.urls]
43+
# Documentation = "https://sparse.pydata.org/"
44+
# Source = "https://github.com/pydata/sparse/"
45+
# Repository = "https://github.com/pydata/sparse.git"
46+
# "Issue Tracker" = "https://github.com/pydata/sparse/issues"
47+
# Discussions = "https://github.com/pydata/sparse/discussions"
48+
49+
# # [project.entry-points.numba_extensions]
50+
# # init = "sparse.pydata_backend._numba_extension:_init_extension"
51+
52+
# [tool.setuptools.packages.find]
53+
# where = ["."]
54+
# include = ["sparse", "sparse.*"]
55+
56+
# [tool.setuptools_scm]
57+
# version_file = "sparse/_version.py"
58+
59+
# [tool.ruff]
60+
# exclude = ["sparse/_version.py"]
61+
# line-length = 120
62+
63+
# [tool.ruff.lint]
64+
# select = ["F", "E", "W", "I", "B", "UP", "YTT", "BLE", "C4", "T10", "ISC", "ICN", "PIE", "PYI", "RSE", "RET", "SIM", "PGH", "FLY", "NPY", "PERF"]
465

5-
[project]
6-
name = "sparse"
7-
dynamic = ["version"]
8-
description = "Sparse n-dimensional arrays for the PyData ecosystem"
66+
# [tool.ruff.lint.isort.sections]
67+
# numpy = ["numpy", "numpy.*", "scipy", "scipy.*"]
68+
69+
# [tool.ruff.format]
70+
# quote-style = "double"
71+
# docstring-code-format = true
72+
73+
# [tool.ruff.lint.isort]
74+
# section-order = [
75+
# "future",
76+
# "standard-library",
77+
# "first-party",
78+
# "third-party",
79+
# "numpy",
80+
# "local-folder",
81+
# ]
82+
83+
[tool.poetry]
84+
name = "sparse-copy"
85+
version = "1.1.1"
86+
description = ""
87+
authors = ["Hameer Abbasi"]
988
readme = "README.rst"
10-
dependencies = ["numpy>=1.17"]
11-
maintainers = [{ name = "Hameer Abbasi", email = "[email protected]" }]
12-
requires-python = ">=3.9"
13-
license = { file = "LICENSE" }
14-
keywords = ["sparse", "numpy", "scipy", "dask"]
15-
classifiers = [
16-
"Development Status :: 2 - Pre-Alpha",
17-
"Operating System :: OS Independent",
18-
"License :: OSI Approved :: BSD License",
19-
"Programming Language :: Python",
20-
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.9",
22-
"Programming Language :: Python :: 3.10",
23-
"Programming Language :: Python :: 3.11",
24-
"Programming Language :: Python :: 3 :: Only",
25-
"Intended Audience :: Developers",
26-
"Intended Audience :: Science/Research",
27-
]
28-
29-
[project.optional-dependencies]
30-
docs = ["sphinx", "sphinx_rtd_theme", "scipy"]
31-
tests = [
32-
"dask[array]",
33-
"pytest>=3.5",
34-
"pytest-cov",
35-
"pre-commit",
36-
"scipy",
37-
]
38-
tox = ["sparse[tests]", "tox"]
39-
all = ["sparse[docs,tox]", "matrepr"]
40-
finch = ["finch-tensor==0.1.6"]
41-
42-
[project.urls]
43-
Documentation = "https://sparse.pydata.org/"
44-
Source = "https://github.com/pydata/sparse/"
45-
Repository = "https://github.com/pydata/sparse.git"
46-
"Issue Tracker" = "https://github.com/pydata/sparse/issues"
47-
Discussions = "https://github.com/pydata/sparse/discussions"
48-
49-
# [project.entry-points.numba_extensions]
50-
# init = "sparse.pydata_backend._numba_extension:_init_extension"
51-
52-
[tool.setuptools.packages.find]
53-
where = ["."]
54-
include = ["sparse", "sparse.*"]
55-
56-
[tool.setuptools_scm]
57-
version_file = "sparse/_version.py"
58-
59-
[tool.ruff]
60-
exclude = ["sparse/_version.py"]
61-
line-length = 120
62-
63-
[tool.ruff.lint]
64-
select = ["F", "E", "W", "I", "B", "UP", "YTT", "BLE", "C4", "T10", "ISC", "ICN", "PIE", "PYI", "RSE", "RET", "SIM", "PGH", "FLY", "NPY", "PERF"]
65-
66-
[tool.ruff.lint.isort.sections]
67-
numpy = ["numpy", "numpy.*", "scipy", "scipy.*"]
68-
69-
[tool.ruff.format]
70-
quote-style = "double"
71-
docstring-code-format = true
72-
73-
[tool.ruff.lint.isort]
74-
section-order = [
75-
"future",
76-
"standard-library",
77-
"first-party",
78-
"third-party",
79-
"numpy",
80-
"local-folder",
81-
]
89+
packages = [{include = "sparse"}]
90+
91+
[tool.poetry.dependencies]
92+
python = "^3.9"
93+
juliapkg = "^0.1.10"
94+
juliacall = "^0.9.15"
95+
numpy = "^1.19"
96+
llvmlite = "0.42.0"
97+
numba = "^0.59"
98+
99+
[tool.poetry.group.tests.dependencies]
100+
pytest = "^7.4.4"
101+
pre-commit = "^3.6.0"
102+
pytest-cov = "^4.1.0"
103+
scipy = "^1.7"
104+
105+
[tool.poetry.group.finch.dependencies]
106+
finch-tensor = "0.1.6"
107+
108+
[build-system]
109+
requires = ["poetry-core"]
110+
build-backend = "poetry.core.masonry.api"

sparse/__init__.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
from contextvars import ContextVar
33
from enum import Enum
44

5-
from ._version import __version__, __version_tuple__ # noqa: F401
6-
75
__array_api_version__ = "2022.12"
86

97

@@ -36,9 +34,7 @@ def __exit__(self, exc_type, exc_value, traceback):
3634
@staticmethod
3735
def get_backend_module():
3836
backend = backend_var.get()
39-
if backend == BackendType.PyData:
40-
import sparse.finch_backend as backend_module
41-
elif backend == BackendType.Finch:
37+
if backend == BackendType.PyData or backend == BackendType.Finch:
4238
import sparse.finch_backend as backend_module
4339
else:
4440
raise ValueError(f"Invalid backend identifier: {backend}")
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)