Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and mtsokol committed Mar 13, 2024
1 parent 6412ddc commit a3e9a74
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 106 deletions.
57 changes: 33 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,43 +24,52 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Cache conda
uses: actions/cache@v4
env:
# Increase this value to reset cache if ci/environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
test-${{ matrix.os }}-conda-py${{ matrix.python }}-${{ env.CACHE_NUMBER }}-${{
hashFiles('ci/environment.yml') }}
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: sparse-dev
allow-softlinks: true
environment-file: ci/environment.yml
python-version: ${{ matrix.python }}
miniforge-version: latest
# - name: Cache conda
# uses: actions/cache@v4
# env:
# # Increase this value to reset cache if ci/environment.yml has not changed
# CACHE_NUMBER: 0
# with:
# path: ~/conda_pkgs_dir
# key:
# test-${{ matrix.os }}-conda-py${{ matrix.python }}-${{ env.CACHE_NUMBER }}-${{
# hashFiles('ci/environment.yml') }}
# - uses: conda-incubator/setup-miniconda@v3
# with:
# activate-environment: sparse-dev
# allow-softlinks: true
# environment-file: ci/environment.yml
# python-version: ${{ matrix.python }}
# miniforge-version: latest
# - name: Install julia and numba
# run: |
# conda install conda-forge::numba
# conda install conda-forge::julia
# - uses: julia-actions/setup-julia@v1.9
# with:
# version: '1.10'
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install package
run: |
pip install -e .[tests,finch]
poetry install --with tests,finch
# - name: Install package
# run: |
# pip install -e .[tests,finch]
- name: Run tests
run: |
pytest --pyargs sparse/tests/test_backends.py
poetry run pytest tests/test_backends.py
# pytest --pyargs sparse/tests/test_backends.py
- uses: codecov/codecov-action@v4
if: always()
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v2
if: always()
with:
files: "**/test-*.xml"
# - name: Publish Test Results
# uses: EnricoMi/publish-unit-test-result-action/composite@v2
# if: always()
# with:
# files: "**/test-*.xml"
docs:
defaults:
run:
Expand Down
187 changes: 108 additions & 79 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,81 +1,110 @@
[build-system]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"
# [build-system]
# requires = ["setuptools>=64", "setuptools_scm>=8"]
# build-backend = "setuptools.build_meta"

# [project]
# name = "sparse"
# dynamic = ["version"]
# description = "Sparse n-dimensional arrays for the PyData ecosystem"
# readme = "README.rst"
# dependencies = ["numpy>=1.17"]
# maintainers = [{ name = "Hameer Abbasi", email = "hameerabbasi@yahoo.com" }]
# requires-python = ">=3.9"
# license = { file = "LICENSE" }
# keywords = ["sparse", "numpy", "scipy", "dask"]
# 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.9",
# "Programming Language :: Python :: 3.10",
# "Programming Language :: Python :: 3.11",
# "Programming Language :: Python :: 3 :: Only",
# "Intended Audience :: Developers",
# "Intended Audience :: Science/Research",
# ]

# [project.optional-dependencies]
# docs = ["sphinx", "sphinx_rtd_theme", "scipy"]
# tests = [
# "dask[array]",
# "pytest>=3.5",
# "pytest-cov",
# "pre-commit",
# "scipy",
# ]
# tox = ["sparse[tests]", "tox"]
# all = ["sparse[docs,tox]", "matrepr"]
# finch = ["finch-tensor==0.1.6"]

# [project.urls]
# Documentation = "https://sparse.pydata.org/"
# Source = "https://github.com/pydata/sparse/"
# Repository = "https://github.com/pydata/sparse.git"
# "Issue Tracker" = "https://github.com/pydata/sparse/issues"
# Discussions = "https://github.com/pydata/sparse/discussions"

# # [project.entry-points.numba_extensions]
# # init = "sparse.pydata_backend._numba_extension:_init_extension"

# [tool.setuptools.packages.find]
# where = ["."]
# include = ["sparse", "sparse.*"]

# [tool.setuptools_scm]
# version_file = "sparse/_version.py"

# [tool.ruff]
# exclude = ["sparse/_version.py"]
# line-length = 120

# [tool.ruff.lint]
# select = ["F", "E", "W", "I", "B", "UP", "YTT", "BLE", "C4", "T10", "ISC", "ICN", "PIE", "PYI", "RSE", "RET", "SIM", "PGH", "FLY", "NPY", "PERF"]

[project]
name = "sparse"
dynamic = ["version"]
description = "Sparse n-dimensional arrays for the PyData ecosystem"
# [tool.ruff.lint.isort.sections]
# numpy = ["numpy", "numpy.*", "scipy", "scipy.*"]

# [tool.ruff.format]
# quote-style = "double"
# docstring-code-format = true

# [tool.ruff.lint.isort]
# section-order = [
# "future",
# "standard-library",
# "first-party",
# "third-party",
# "numpy",
# "local-folder",
# ]

[tool.poetry]
name = "sparse-copy"
version = "1.1.1"
description = ""
authors = ["Hameer Abbasi"]
readme = "README.rst"
dependencies = ["numpy>=1.17"]
maintainers = [{ name = "Hameer Abbasi", email = "hameerabbasi@yahoo.com" }]
requires-python = ">=3.9"
license = { file = "LICENSE" }
keywords = ["sparse", "numpy", "scipy", "dask"]
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.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
]

[project.optional-dependencies]
docs = ["sphinx", "sphinx_rtd_theme", "scipy"]
tests = [
"dask[array]",
"pytest>=3.5",
"pytest-cov",
"pre-commit",
"scipy",
]
tox = ["sparse[tests]", "tox"]
all = ["sparse[docs,tox]", "matrepr"]
finch = ["finch-tensor==0.1.6"]

[project.urls]
Documentation = "https://sparse.pydata.org/"
Source = "https://github.com/pydata/sparse/"
Repository = "https://github.com/pydata/sparse.git"
"Issue Tracker" = "https://github.com/pydata/sparse/issues"
Discussions = "https://github.com/pydata/sparse/discussions"

# [project.entry-points.numba_extensions]
# init = "sparse.pydata_backend._numba_extension:_init_extension"

[tool.setuptools.packages.find]
where = ["."]
include = ["sparse", "sparse.*"]

[tool.setuptools_scm]
version_file = "sparse/_version.py"

[tool.ruff]
exclude = ["sparse/_version.py"]
line-length = 120

[tool.ruff.lint]
select = ["F", "E", "W", "I", "B", "UP", "YTT", "BLE", "C4", "T10", "ISC", "ICN", "PIE", "PYI", "RSE", "RET", "SIM", "PGH", "FLY", "NPY", "PERF"]

[tool.ruff.lint.isort.sections]
numpy = ["numpy", "numpy.*", "scipy", "scipy.*"]

[tool.ruff.format]
quote-style = "double"
docstring-code-format = true

[tool.ruff.lint.isort]
section-order = [
"future",
"standard-library",
"first-party",
"third-party",
"numpy",
"local-folder",
]
packages = [{include = "sparse"}]

[tool.poetry.dependencies]
python = "^3.9"
juliapkg = "^0.1.10"
juliacall = "^0.9.15"
numpy = "^1.19"
llvmlite = "0.42.0"
numba = "^0.59"

[tool.poetry.group.tests.dependencies]
pytest = "^7.4.4"
pre-commit = "^3.6.0"
pytest-cov = "^4.1.0"
scipy = "^1.7"

[tool.poetry.group.finch.dependencies]
finch-tensor = "0.1.6"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
4 changes: 1 addition & 3 deletions sparse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ def __exit__(self, exc_type, exc_value, traceback):
@staticmethod
def get_backend_module():
backend = backend_var.get()
if backend == BackendType.PyData:
import sparse.finch_backend as backend_module
elif backend == BackendType.Finch:
if backend == BackendType.PyData or backend == BackendType.Finch:
import sparse.finch_backend as backend_module
else:
raise ValueError(f"Invalid backend identifier: {backend}")
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit a3e9a74

Please sign in to comment.