Skip to content

Commit d772e0c

Browse files
committed
Add spin configuration
1 parent 44c7010 commit d772e0c

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

.spin/cmds.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import sys
2+
3+
import click
4+
from spin.cmds.util import run
5+
6+
7+
@click.command()
8+
@click.argument("pytest_args", nargs=-1)
9+
@click.option(
10+
"-c",
11+
"--coverage",
12+
is_flag=True,
13+
help="Generate a coverage report of executed tests.",
14+
)
15+
def test(pytest_args, coverage=False):
16+
"""🔧 Run tests"""
17+
if coverage:
18+
pytest_args = ("--cov=lazy_loader", *pytest_args)
19+
run([sys.executable, "-m", "pytest", *list(pytest_args)])

pyproject.toml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ requires = ["setuptools>=61.2"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
name = "lazy_loader"
6+
name = "lazy-loader"
77
requires-python = ">=3.9"
88
authors = [{name = "Scientific Python Developers"}]
99
readme = "README.md"
10-
license = {file = "LICENSE.md"}
10+
license = "BSD-3-Clause"
1111
dynamic = ['version']
1212
classifiers = [
1313
"Development Status :: 4 - Beta",
14-
"License :: OSI Approved :: BSD License",
1514
"Programming Language :: Python :: 3",
1615
"Programming Language :: Python :: 3.9",
1716
"Programming Language :: Python :: 3.10",
@@ -102,3 +101,13 @@ source = [
102101
"src/lazy_loader",
103102
"*/site-packages/lazy_loader",
104103
]
104+
105+
[tool.spin]
106+
package = 'lazy_loader'
107+
108+
[tool.spin.commands]
109+
Build = [
110+
'spin.cmds.pip.install',
111+
'.spin/cmds.py:test',
112+
'spin.cmds.build.sdist',
113+
]

0 commit comments

Comments
 (0)