Skip to content

Commit

Permalink
Bundled all meta-information in pyproject.toml (#154)
Browse files Browse the repository at this point in the history
* Bundled all meta-information in pyproject.toml

* Removed python 3.11 claim
  • Loading branch information
pnkraemer authored Oct 11, 2023
1 parent bb06f2e commit 9ad2d96
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 63 deletions.
4 changes: 2 additions & 2 deletions docs/benchmarks/jacobian_squared.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def matvec(num, key):
@func.partial(benchmark_util.error_and_time, error_fun=error_fun)
@func.partial(func.jit, static_argnums=0)
def slq_low(num, key):
"""SLQ(1)""" # noqa: D400,D415
"""SLQ(1)""" # noqa: D400
return slq.trace_of_matfun_spd(
matfun,
jvp,
Expand All @@ -86,7 +86,7 @@ def slq_low(num, key):
@func.partial(benchmark_util.error_and_time, error_fun=error_fun)
@func.partial(func.jit, static_argnums=0)
def slq_high(num, key):
"""SLQ(5)""" # noqa: D400,D415
"""SLQ(5)""" # noqa: D400
return slq.trace_of_matfun_spd(
matfun,
jvp,
Expand Down
3 changes: 1 addition & 2 deletions matfree/backend/typing.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"""Types."""
# fmt: off
from collections.abc import Callable # noqa: F401
from typing import (Any, Generic, Iterable, Sequence, # noqa: F401, UP035
Tuple, TypeVar)
from typing import Any, Generic, Iterable, Sequence, Tuple, TypeVar # noqa: F401

from jax import Array # noqa: F401

Expand Down
132 changes: 119 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,123 @@
[build-system]
requires = [
"setuptools>=42",
"wheel",
"setuptools_scm[toml]>=6.0",
"setuptools>=64",
"setuptools_scm>=8",
]
build-backend = "setuptools.build_meta"

[project]
name = "matfree"
authors = [
{name="Nicholas Krämer", email="[email protected]"}
]
description = "Matrix-free numerical linear algebra."
readme = "README.md"
requires-python=">=3.8"
classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
dynamic = ["version"]


[project.optional-dependencies]
cpu = [
"jax[cpu]",
]
test =[
"pytest",
"pytest-cases",
]
lint =[
"matfree[test]",
"pre-commit",
]
format =[
"isort",
"black",
]
doc = [
"mkdocs",
"mkdocs-material",
"mkdocstrings",
"mkdocstrings-python",
"matplotlib",
"tqdm",
]
full = [
"matfree[cpu]",
"matfree[test]",
"matfree[lint]",
"matfree[format]",
"matfree[doc]",
]



[tool.setuptools.packages.find]
where = ["."] # list of folders that contain the packages (["."] by default)
include = ["matfree*"] # package names should match these glob patterns (["*"] by default)


[tool.setuptools_scm]
local_scheme = "dirty-tag"
write_to = "matfree/_version.py"
write_to_template = """
# pylint: skip-file
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
version = \"{version}\"
"""
version_file = "matfree/_version.py"

[project.urls]
"Documentation" = "https://pnkraemer.github.io/matfree/"
"Issue tracker" = "https://github.com/pnkraemer/matfree/issues"


[tool.ruff]
include = ["*.py", "**/pyproject.toml", "*.ipynb"]
# See: https://beta.ruff.rs/docs/rules/
select = ["E", "F", "D", "UP", "B", "A", "ICN", "PT", "Q", "RET", "SIM", "ARG", "RUF"]
select = [
# pycodestyle (warning, error)
"W",
"E",
# Pyflakes:
"F",
# pydocstyle:
"D",
# pyupgrade:
"UP",
# flake8-bugbear:
"B",
# flake8-builtins:
"A",
# flake8-import-conventions:
"ICN",
# flake8-pytest-style:
"PT",
# flake8-quotes:
"Q",
# flake8-return:
"RET",
# flake8-simplify:
"SIM",
# flake8-unused-arguments:
"ARG",
# Ruff-specific rules:
"RUF",
# isort:
"I",
# flake8-errormsg:
"EM",
# tryceratops:
"TRY",
]
ignore = [
# warning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible.
"D203",
# warning: `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible.
"D213",
# zip(..., strict=True/False) is not supported on Python < 3.10
"B905",
# Magic methods don't need a docstring:
"D105",
]

[tool.ruff.per-file-ignores]
Expand All @@ -39,3 +131,17 @@ ignore = [
"matfree/backend/progressbar.py" = ["D103"]
"matfree/backend/testing.py" = ["D103"]
"matfree/backend/time.py" = ["D103"]

[tool.ruff.pydocstyle]
convention = "numpy"


[tool.isort]
multi_line_output = "3"
include_trailing_comma = "true"
force_grid_wrap = "0"
use_parentheses = "true"
line_length = "88"

[tool.black]
line-length = "88"
41 changes: 0 additions & 41 deletions setup.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions setup.py

This file was deleted.

0 comments on commit 9ad2d96

Please sign in to comment.