spin 0.15__tar.gz → 0.17__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {spin-0.15/spin.egg-info → spin-0.17}/PKG-INFO +7 -4
- {spin-0.15 → spin-0.17}/README.md +4 -0
- {spin-0.15 → spin-0.17}/pyproject.toml +2 -3
- {spin-0.15 → spin-0.17}/spin/__init__.py +1 -1
- {spin-0.15 → spin-0.17}/spin/__main__.py +1 -2
- {spin-0.15 → spin-0.17}/spin/cmds/build.py +12 -0
- {spin-0.15 → spin-0.17}/spin/cmds/meson.py +4 -5
- {spin-0.15 → spin-0.17}/spin/cmds/util.py +17 -1
- {spin-0.15 → spin-0.17}/spin/tests/test_build_cmds.py +14 -4
- {spin-0.15 → spin-0.17}/spin/tests/testutil.py +11 -2
- {spin-0.15 → spin-0.17/spin.egg-info}/PKG-INFO +7 -4
- {spin-0.15 → spin-0.17}/spin.egg-info/requires.txt +1 -1
- {spin-0.15 → spin-0.17}/LICENSE +0 -0
- {spin-0.15 → spin-0.17}/setup.cfg +0 -0
- {spin-0.15 → spin-0.17}/spin/cmds/__init__.py +0 -0
- {spin-0.15 → spin-0.17}/spin/cmds/meta.py +0 -0
- {spin-0.15 → spin-0.17}/spin/cmds/pip.py +0 -0
- {spin-0.15 → spin-0.17}/spin/color_format.py +0 -0
- {spin-0.15 → spin-0.17}/spin/containers.py +0 -0
- {spin-0.15 → spin-0.17}/spin/sectioned_help.py +0 -0
- {spin-0.15 → spin-0.17}/spin/tests/__init__.py +0 -0
- {spin-0.15 → spin-0.17}/spin/tests/conftest.py +0 -0
- {spin-0.15 → spin-0.17}/spin/tests/test_cli.py +0 -0
- {spin-0.15 → spin-0.17}/spin/tests/test_editable.py +0 -0
- {spin-0.15 → spin-0.17}/spin/tests/test_extend_command.py +0 -0
- {spin-0.15 → spin-0.17}/spin/tests/test_meson.py +0 -0
- {spin-0.15 → spin-0.17}/spin/tests/test_test.py +0 -0
- {spin-0.15 → spin-0.17}/spin/tests/test_util.py +0 -0
- {spin-0.15 → spin-0.17}/spin.egg-info/SOURCES.txt +0 -0
- {spin-0.15 → spin-0.17}/spin.egg-info/dependency_links.txt +0 -0
- {spin-0.15 → spin-0.17}/spin.egg-info/entry_points.txt +0 -0
- {spin-0.15 → spin-0.17}/spin.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: spin
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.17
|
|
4
4
|
Summary: Developer tool for scientific Python libraries
|
|
5
5
|
Maintainer-email: Scientific Python <spin@discuss.scientific-python.org>
|
|
6
6
|
License: BSD 3-Clause License
|
|
@@ -41,17 +41,16 @@ Classifier: Intended Audience :: Science/Research
|
|
|
41
41
|
Classifier: License :: OSI Approved :: BSD License
|
|
42
42
|
Classifier: Operating System :: OS Independent
|
|
43
43
|
Classifier: Programming Language :: Python :: 3
|
|
44
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
45
44
|
Classifier: Programming Language :: Python :: 3.10
|
|
46
45
|
Classifier: Programming Language :: Python :: 3.11
|
|
47
46
|
Classifier: Programming Language :: Python :: 3.12
|
|
48
47
|
Classifier: Programming Language :: Python :: 3.13
|
|
49
48
|
Classifier: Programming Language :: Python :: 3.14
|
|
50
49
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
51
|
-
Requires-Python: >=3.
|
|
50
|
+
Requires-Python: >=3.10
|
|
52
51
|
Description-Content-Type: text/markdown
|
|
53
52
|
License-File: LICENSE
|
|
54
|
-
Requires-Dist: click
|
|
53
|
+
Requires-Dist: click!=8.3.0,<8.4,>=8
|
|
55
54
|
Requires-Dist: tomli; python_version < "3.11"
|
|
56
55
|
Requires-Dist: colorama; platform_system == "Windows"
|
|
57
56
|
Requires-Dist: importlib_metadata>=7
|
|
@@ -189,6 +188,7 @@ Available as `spin.cmds.build.*`:
|
|
|
189
188
|
|
|
190
189
|
```
|
|
191
190
|
sdist 📦 Build a source distribution in `dist/`
|
|
191
|
+
wheel 📦 Build a wheel distribution in `dist/`
|
|
192
192
|
```
|
|
193
193
|
|
|
194
194
|
### [pip](https://pip.pypa.io) (Package Installer for Python)
|
|
@@ -359,6 +359,9 @@ nox -s test -- -v
|
|
|
359
359
|
nox -s test -- -v spin/tests/test_meson.py
|
|
360
360
|
```
|
|
361
361
|
|
|
362
|
+
`spin` takes a slightly more conservative approach than [SPEC 0](https://scientific-python.org/specs/spec-0000/), and
|
|
363
|
+
supports all non-EOL versions of Python.
|
|
364
|
+
|
|
362
365
|
## History
|
|
363
366
|
|
|
364
367
|
The `dev.py` tool was [proposed for SciPy](https://github.com/scipy/scipy/issues/15489) by Ralf Gommers and [implemented](https://github.com/scipy/scipy/pull/15959) by Sayantika Banik, Eduardo Naufel Schettino, and Ralf Gommers (also see [Sayantika's blog post](https://labs.quansight.org/blog/the-evolution-of-the-scipy-developer-cli)).
|
|
@@ -126,6 +126,7 @@ Available as `spin.cmds.build.*`:
|
|
|
126
126
|
|
|
127
127
|
```
|
|
128
128
|
sdist 📦 Build a source distribution in `dist/`
|
|
129
|
+
wheel 📦 Build a wheel distribution in `dist/`
|
|
129
130
|
```
|
|
130
131
|
|
|
131
132
|
### [pip](https://pip.pypa.io) (Package Installer for Python)
|
|
@@ -296,6 +297,9 @@ nox -s test -- -v
|
|
|
296
297
|
nox -s test -- -v spin/tests/test_meson.py
|
|
297
298
|
```
|
|
298
299
|
|
|
300
|
+
`spin` takes a slightly more conservative approach than [SPEC 0](https://scientific-python.org/specs/spec-0000/), and
|
|
301
|
+
supports all non-EOL versions of Python.
|
|
302
|
+
|
|
299
303
|
## History
|
|
300
304
|
|
|
301
305
|
The `dev.py` tool was [proposed for SciPy](https://github.com/scipy/scipy/issues/15489) by Ralf Gommers and [implemented](https://github.com/scipy/scipy/pull/15959) by Sayantika Banik, Eduardo Naufel Schettino, and Ralf Gommers (also see [Sayantika's blog post](https://labs.quansight.org/blog/the-evolution-of-the-scipy-developer-cli)).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "spin"
|
|
3
|
-
requires-python = ">=3.
|
|
3
|
+
requires-python = ">=3.10" # Oldest non-EOL Python here
|
|
4
4
|
description = "Developer tool for scientific Python libraries"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = {file = "LICENSE"}
|
|
@@ -15,7 +15,6 @@ classifiers = [
|
|
|
15
15
|
"License :: OSI Approved :: BSD License",
|
|
16
16
|
"Operating System :: OS Independent",
|
|
17
17
|
"Programming Language :: Python :: 3",
|
|
18
|
-
"Programming Language :: Python :: 3.9",
|
|
19
18
|
"Programming Language :: Python :: 3.10",
|
|
20
19
|
"Programming Language :: Python :: 3.11",
|
|
21
20
|
"Programming Language :: Python :: 3.12",
|
|
@@ -24,7 +23,7 @@ classifiers = [
|
|
|
24
23
|
"Programming Language :: Python :: 3 :: Only",
|
|
25
24
|
]
|
|
26
25
|
dependencies = [
|
|
27
|
-
"click>=8,<8.
|
|
26
|
+
"click>=8,!=8.3.0,<8.4",
|
|
28
27
|
"tomli; python_version < '3.11'",
|
|
29
28
|
"colorama; platform_system == 'Windows'",
|
|
30
29
|
"importlib_metadata >= 7"
|
|
@@ -6,7 +6,6 @@ import pathlib
|
|
|
6
6
|
import sys
|
|
7
7
|
import textwrap
|
|
8
8
|
import traceback
|
|
9
|
-
from typing import Union
|
|
10
9
|
|
|
11
10
|
import click
|
|
12
11
|
|
|
@@ -31,7 +30,7 @@ config_filenames = (
|
|
|
31
30
|
)
|
|
32
31
|
|
|
33
32
|
|
|
34
|
-
def _detect_config_dir(path: pathlib.Path) ->
|
|
33
|
+
def _detect_config_dir(path: pathlib.Path) -> pathlib.Path | None:
|
|
35
34
|
path = path.resolve()
|
|
36
35
|
files = os.listdir(path)
|
|
37
36
|
if any(f in files for f in config_filenames):
|
|
@@ -13,3 +13,15 @@ def sdist(pyproject_build_args):
|
|
|
13
13
|
spin sdist -- -x -n
|
|
14
14
|
"""
|
|
15
15
|
run(["pyproject-build", ".", "--sdist"] + list(pyproject_build_args))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@click.command()
|
|
19
|
+
@click.argument("pyproject-build-args", metavar="", nargs=-1)
|
|
20
|
+
def wheel(pyproject_build_args):
|
|
21
|
+
"""📦 Build a wheel distribution in `dist/`
|
|
22
|
+
|
|
23
|
+
Extra arguments are passed to `pyproject-build`, e.g.
|
|
24
|
+
|
|
25
|
+
spin wheel -- -x -n
|
|
26
|
+
"""
|
|
27
|
+
run(["pyproject-build", ".", "--wheel"] + list(pyproject_build_args))
|
|
@@ -8,7 +8,6 @@ import signal
|
|
|
8
8
|
import sys
|
|
9
9
|
from enum import Enum
|
|
10
10
|
from pathlib import Path
|
|
11
|
-
from typing import Union
|
|
12
11
|
|
|
13
12
|
import click
|
|
14
13
|
|
|
@@ -36,7 +35,7 @@ def _meson_cli():
|
|
|
36
35
|
return [meson_cli]
|
|
37
36
|
|
|
38
37
|
|
|
39
|
-
def editable_install_path(distname: str) ->
|
|
38
|
+
def editable_install_path(distname: str) -> str | None:
|
|
40
39
|
"""Return path of the editable install for package `distname`.
|
|
41
40
|
|
|
42
41
|
If the package is not an editable install, return None.
|
|
@@ -191,7 +190,7 @@ def _get_site_packages(build_dir: str) -> str:
|
|
|
191
190
|
return site_packages
|
|
192
191
|
|
|
193
192
|
|
|
194
|
-
def _meson_version() ->
|
|
193
|
+
def _meson_version() -> str | None:
|
|
195
194
|
try:
|
|
196
195
|
p = _run(_meson_cli() + ["--version"], output=False, echo=False)
|
|
197
196
|
return p.stdout.decode("ascii").strip()
|
|
@@ -199,7 +198,7 @@ def _meson_version() -> Union[str, None]:
|
|
|
199
198
|
return None
|
|
200
199
|
|
|
201
200
|
|
|
202
|
-
def _meson_version_configured(build_dir: str) ->
|
|
201
|
+
def _meson_version_configured(build_dir: str) -> str | None:
|
|
203
202
|
try:
|
|
204
203
|
meson_info_fn = os.path.join(build_dir, "meson-info", "meson-info.json")
|
|
205
204
|
with open(meson_info_fn) as f:
|
|
@@ -445,7 +444,7 @@ def _get_configured_command(command_name):
|
|
|
445
444
|
metavar="N_JOBS",
|
|
446
445
|
default="1",
|
|
447
446
|
help=(
|
|
448
|
-
"Number of parallel jobs for testing. Can be set to `auto` to use all cores."
|
|
447
|
+
"Number of parallel jobs for testing with pytest-xdist. Can be set to `auto` to use all cores."
|
|
449
448
|
),
|
|
450
449
|
)
|
|
451
450
|
@click.option(
|
|
@@ -3,6 +3,7 @@ from __future__ import (
|
|
|
3
3
|
)
|
|
4
4
|
|
|
5
5
|
import copy
|
|
6
|
+
import enum
|
|
6
7
|
import os
|
|
7
8
|
import shlex
|
|
8
9
|
import shutil
|
|
@@ -127,7 +128,14 @@ def extend_command(
|
|
|
127
128
|
Command to extend.
|
|
128
129
|
doc : str
|
|
129
130
|
Replacement docstring.
|
|
130
|
-
The
|
|
131
|
+
The decorated function's docstring is also appended.
|
|
132
|
+
This is done so that two modes of documenting are enabled:
|
|
133
|
+
|
|
134
|
+
1. Extend original command documentation.
|
|
135
|
+
Do this by providing a docstring on the decorated function.
|
|
136
|
+
2. Replace the original command's documentation.
|
|
137
|
+
Do this either by setting ``doc`` to a docstring, or by
|
|
138
|
+
setting ``doc=''`` and adding a docstring to the decorated function.
|
|
131
139
|
remove_args : tuple of str
|
|
132
140
|
List of arguments to remove from the parent command.
|
|
133
141
|
These arguments can still be set explicitly by calling
|
|
@@ -152,6 +160,14 @@ def extend_command(
|
|
|
152
160
|
"""
|
|
153
161
|
my_cmd = copy.copy(cmd)
|
|
154
162
|
|
|
163
|
+
# This patch is to work around an enum deepcopy bug in Python 3.10.
|
|
164
|
+
if not hasattr(enum.Enum, "__deepcopy__"):
|
|
165
|
+
|
|
166
|
+
def __deepcopy__(self, memo):
|
|
167
|
+
return self
|
|
168
|
+
|
|
169
|
+
enum.Enum.__deepcopy__ = __deepcopy__ # type: ignore[method-assign]
|
|
170
|
+
|
|
155
171
|
# This is necessary to ensure that added options do not leak
|
|
156
172
|
# to the original command
|
|
157
173
|
my_cmd.params = copy.deepcopy(cmd.params)
|
|
@@ -2,7 +2,7 @@ import os
|
|
|
2
2
|
import subprocess
|
|
3
3
|
import sys
|
|
4
4
|
import tempfile
|
|
5
|
-
from pathlib import Path
|
|
5
|
+
from pathlib import Path, PureWindowsPath
|
|
6
6
|
|
|
7
7
|
import pytest
|
|
8
8
|
|
|
@@ -19,6 +19,10 @@ from .testutil import (
|
|
|
19
19
|
)
|
|
20
20
|
|
|
21
21
|
|
|
22
|
+
def unix_path(p: str) -> str:
|
|
23
|
+
return PureWindowsPath(p).as_posix()
|
|
24
|
+
|
|
25
|
+
|
|
22
26
|
def test_basic_build(example_pkg):
|
|
23
27
|
"""Does the package build?"""
|
|
24
28
|
spin("build")
|
|
@@ -39,7 +43,7 @@ def test_debug_builds(example_pkg):
|
|
|
39
43
|
|
|
40
44
|
def test_prefix_builds(example_pkg):
|
|
41
45
|
"""does spin build --prefix create a build-install directory with the correct structure?"""
|
|
42
|
-
spin("build", "--prefix
|
|
46
|
+
spin("build", f"--prefix={os.path.abspath('/foobar')}")
|
|
43
47
|
assert (Path("build-install") / Path("foobar")).exists()
|
|
44
48
|
|
|
45
49
|
|
|
@@ -116,6 +120,12 @@ def test_sdist(example_pkg):
|
|
|
116
120
|
spin("sdist")
|
|
117
121
|
|
|
118
122
|
|
|
123
|
+
def test_wheel(example_pkg):
|
|
124
|
+
spin("wheel")
|
|
125
|
+
wheel_file_list = list(Path("dist").glob("example_pkg-0.0.dev0-*.whl"))
|
|
126
|
+
assert len(wheel_file_list) == 1, "Wheel file not created in dist/"
|
|
127
|
+
|
|
128
|
+
|
|
119
129
|
def test_example(example_pkg):
|
|
120
130
|
spin("example")
|
|
121
131
|
|
|
@@ -178,7 +188,7 @@ def test_parallel_builds(example_pkg):
|
|
|
178
188
|
spin("build")
|
|
179
189
|
spin("build", "-C", "parallel/build")
|
|
180
190
|
p = spin("python", "--", "-c", "import example_pkg; print(example_pkg.__file__)")
|
|
181
|
-
example_pkg_path = stdout(p).split("\n")[-1]
|
|
191
|
+
example_pkg_path = unix_path(stdout(p).split("\n")[-1])
|
|
182
192
|
p = spin(
|
|
183
193
|
"python",
|
|
184
194
|
"-C",
|
|
@@ -187,7 +197,7 @@ def test_parallel_builds(example_pkg):
|
|
|
187
197
|
"-c",
|
|
188
198
|
"import example_pkg; print(example_pkg.__file__)",
|
|
189
199
|
)
|
|
190
|
-
example_pkg_parallel_path = stdout(p).split("\n")[-1]
|
|
200
|
+
example_pkg_parallel_path = unix_path(stdout(p).split("\n")[-1])
|
|
191
201
|
assert "build-install" in example_pkg_path
|
|
192
202
|
assert "parallel/build-install" in example_pkg_parallel_path
|
|
193
203
|
assert "parallel/build-install" not in example_pkg_path
|
|
@@ -24,12 +24,21 @@ skip_py_lt_311 = pytest.mark.skipif(
|
|
|
24
24
|
|
|
25
25
|
def spin(*args, **user_kwargs):
|
|
26
26
|
args = (str(el) for el in args)
|
|
27
|
+
# Capture stdout, stderr separately
|
|
27
28
|
default_kwargs = {
|
|
28
29
|
"stdout": subprocess.PIPE,
|
|
29
30
|
"stderr": subprocess.PIPE,
|
|
30
|
-
"sys_exit":
|
|
31
|
+
"sys_exit": False,
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
+
p = run(["spin"] + list(args), **{**default_kwargs, **user_kwargs})
|
|
34
|
+
if p.returncode != 0:
|
|
35
|
+
print(p.stdout.decode("utf-8"), end="")
|
|
36
|
+
print(p.stderr.decode("utf-8"), end="")
|
|
37
|
+
# Exit unless the spin call explicitly asks us not to
|
|
38
|
+
# by setting sys_exit=False
|
|
39
|
+
if user_kwargs.get("sys_exit", True):
|
|
40
|
+
sys.exit(p.returncode)
|
|
41
|
+
return p
|
|
33
42
|
|
|
34
43
|
|
|
35
44
|
def stdout(p):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: spin
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.17
|
|
4
4
|
Summary: Developer tool for scientific Python libraries
|
|
5
5
|
Maintainer-email: Scientific Python <spin@discuss.scientific-python.org>
|
|
6
6
|
License: BSD 3-Clause License
|
|
@@ -41,17 +41,16 @@ Classifier: Intended Audience :: Science/Research
|
|
|
41
41
|
Classifier: License :: OSI Approved :: BSD License
|
|
42
42
|
Classifier: Operating System :: OS Independent
|
|
43
43
|
Classifier: Programming Language :: Python :: 3
|
|
44
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
45
44
|
Classifier: Programming Language :: Python :: 3.10
|
|
46
45
|
Classifier: Programming Language :: Python :: 3.11
|
|
47
46
|
Classifier: Programming Language :: Python :: 3.12
|
|
48
47
|
Classifier: Programming Language :: Python :: 3.13
|
|
49
48
|
Classifier: Programming Language :: Python :: 3.14
|
|
50
49
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
51
|
-
Requires-Python: >=3.
|
|
50
|
+
Requires-Python: >=3.10
|
|
52
51
|
Description-Content-Type: text/markdown
|
|
53
52
|
License-File: LICENSE
|
|
54
|
-
Requires-Dist: click
|
|
53
|
+
Requires-Dist: click!=8.3.0,<8.4,>=8
|
|
55
54
|
Requires-Dist: tomli; python_version < "3.11"
|
|
56
55
|
Requires-Dist: colorama; platform_system == "Windows"
|
|
57
56
|
Requires-Dist: importlib_metadata>=7
|
|
@@ -189,6 +188,7 @@ Available as `spin.cmds.build.*`:
|
|
|
189
188
|
|
|
190
189
|
```
|
|
191
190
|
sdist 📦 Build a source distribution in `dist/`
|
|
191
|
+
wheel 📦 Build a wheel distribution in `dist/`
|
|
192
192
|
```
|
|
193
193
|
|
|
194
194
|
### [pip](https://pip.pypa.io) (Package Installer for Python)
|
|
@@ -359,6 +359,9 @@ nox -s test -- -v
|
|
|
359
359
|
nox -s test -- -v spin/tests/test_meson.py
|
|
360
360
|
```
|
|
361
361
|
|
|
362
|
+
`spin` takes a slightly more conservative approach than [SPEC 0](https://scientific-python.org/specs/spec-0000/), and
|
|
363
|
+
supports all non-EOL versions of Python.
|
|
364
|
+
|
|
362
365
|
## History
|
|
363
366
|
|
|
364
367
|
The `dev.py` tool was [proposed for SciPy](https://github.com/scipy/scipy/issues/15489) by Ralf Gommers and [implemented](https://github.com/scipy/scipy/pull/15959) by Sayantika Banik, Eduardo Naufel Schettino, and Ralf Gommers (also see [Sayantika's blog post](https://labs.quansight.org/blog/the-evolution-of-the-scipy-developer-cli)).
|
{spin-0.15 → spin-0.17}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|