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

BLD: Move build to setuptools #2

Merged
merged 2 commits into from
Jan 24, 2024
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
13 changes: 6 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,6 @@ ipython_config.py
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
Expand Down Expand Up @@ -158,3 +151,9 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# macOS
**/.DS_Store

# Version file
finch/_version.py
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
# Finch
# finch-tensor

This is the beginnings of a sparse tensor library for Python, backed by the
[Finch.jl](https://github.com/willow-ahrens/Finch.jl) tensor compiler.

## Installation

Finch is available on PyPi, and can be installed with pip:
`finch-tensor` is available on PyPi, and can be installed with pip:
```bash
pip install finch
pip install finch-tensor
```

## Contributing

### Packaging
### Local setup

Finch uses [poetry](https://python-poetry.org/) for packaging.
`conda` can be used for creating a local development setup:

```bash
git clone https://github.com/willow-ahrens/finch-tensor.git
cd finch-tensor/
conda create --name finch-tensor-dev python=3.9
conda activate finch-tensor-dev
pip install .
```

### Testing

Finch uses [pytest](https://docs.pytest.org/en/latest/) for testing. To run the
`finch-tensor` uses [pytest](https://docs.pytest.org/en/latest/) for testing. To run the
tests:

```bash
poetry run pytest
pytest tests
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_sparse.py → finch/tests/test_sparse.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
from src import finch
import finch

@pytest.fixture
def x():
Expand Down
144 changes: 0 additions & 144 deletions poetry.lock

This file was deleted.

53 changes: 39 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,46 @@
[tool.poetry]
[build-system]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "finch-tensor"
version = "0.1.3"
dynamic = ["version"]
description = ""
authors = ["Willow Ahrens <[email protected]>"]
maintainers = [{ name = "Willow Ahrens", email = "[email protected]" }]
readme = "README.md"
packages = [{include = "finch", from = "src"}]
license = { file = "LICENSE" }
requires-python = ">=3.8"
dependencies = ["juliapkg>=0.1.10", "juliacall>=0.9.15"]

[tool.poetry.dependencies]
python = "^3.8"
juliapkg = "^0.1.10"
juliacall = "^0.9.15"
[project.optional-dependencies]
tests = ["pytest>=3.5", "sparse>=0.15.1"]

[project.urls]
Source = "https://github.com/willow-ahrens/finch-tensor"
Repository = "https://github.com/willow-ahrens/finch-tensor.git"

[tool.poetry.group.test.dependencies]
pytest = "^7.4.4"
pre-commit = "^3.6.0"
[tool.setuptools.packages.find]
where = ["."]
include = ["finch", "finch.*"]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.setuptools_scm]
version_file = "finch/_version.py"

[tool.ruff]
select = ["F", "E", "W", "I", "B", "UP", "YTT", "BLE", "C4", "T10", "ISC", "ICN", "PIE", "PYI", "RSE", "RET", "SIM", "PGH", "FLY", "NPY", "PERF"]
exclude = ["finch/_version.py"]
line-length = 120

[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",
]
7 changes: 7 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[pytest]
addopts = --cov-report term-missing --cov-report html --cov-report=xml --cov-report=term --cov sparse --cov-config .coveragerc --junitxml=junit/test-results.xml
filterwarnings =
ignore::PendingDeprecationWarning
testpaths =
finch
junit_family=xunit2
9 changes: 0 additions & 9 deletions requirements.txt

This file was deleted.

Loading