spin 0.15__tar.gz → 0.16__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.
Files changed (32) hide show
  1. {spin-0.15/spin.egg-info → spin-0.16}/PKG-INFO +8 -4
  2. {spin-0.15 → spin-0.16}/README.md +4 -0
  3. {spin-0.15 → spin-0.16}/pyproject.toml +3 -3
  4. {spin-0.15 → spin-0.16}/spin/__init__.py +1 -1
  5. {spin-0.15 → spin-0.16}/spin/__main__.py +1 -2
  6. {spin-0.15 → spin-0.16}/spin/cmds/build.py +12 -0
  7. {spin-0.15 → spin-0.16}/spin/cmds/meson.py +4 -5
  8. {spin-0.15 → spin-0.16}/spin/cmds/util.py +8 -1
  9. {spin-0.15 → spin-0.16}/spin/tests/test_build_cmds.py +14 -4
  10. {spin-0.15 → spin-0.16}/spin/tests/testutil.py +11 -2
  11. {spin-0.15 → spin-0.16/spin.egg-info}/PKG-INFO +8 -4
  12. {spin-0.15 → spin-0.16}/spin.egg-info/requires.txt +4 -1
  13. {spin-0.15 → spin-0.16}/LICENSE +0 -0
  14. {spin-0.15 → spin-0.16}/setup.cfg +0 -0
  15. {spin-0.15 → spin-0.16}/spin/cmds/__init__.py +0 -0
  16. {spin-0.15 → spin-0.16}/spin/cmds/meta.py +0 -0
  17. {spin-0.15 → spin-0.16}/spin/cmds/pip.py +0 -0
  18. {spin-0.15 → spin-0.16}/spin/color_format.py +0 -0
  19. {spin-0.15 → spin-0.16}/spin/containers.py +0 -0
  20. {spin-0.15 → spin-0.16}/spin/sectioned_help.py +0 -0
  21. {spin-0.15 → spin-0.16}/spin/tests/__init__.py +0 -0
  22. {spin-0.15 → spin-0.16}/spin/tests/conftest.py +0 -0
  23. {spin-0.15 → spin-0.16}/spin/tests/test_cli.py +0 -0
  24. {spin-0.15 → spin-0.16}/spin/tests/test_editable.py +0 -0
  25. {spin-0.15 → spin-0.16}/spin/tests/test_extend_command.py +0 -0
  26. {spin-0.15 → spin-0.16}/spin/tests/test_meson.py +0 -0
  27. {spin-0.15 → spin-0.16}/spin/tests/test_test.py +0 -0
  28. {spin-0.15 → spin-0.16}/spin/tests/test_util.py +0 -0
  29. {spin-0.15 → spin-0.16}/spin.egg-info/SOURCES.txt +0 -0
  30. {spin-0.15 → spin-0.16}/spin.egg-info/dependency_links.txt +0 -0
  31. {spin-0.15 → spin-0.16}/spin.egg-info/entry_points.txt +0 -0
  32. {spin-0.15 → spin-0.16}/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.15
3
+ Version: 0.16
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,17 @@ 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.9
50
+ Requires-Python: >=3.10
52
51
  Description-Content-Type: text/markdown
53
52
  License-File: LICENSE
54
- Requires-Dist: click<8.3,>=8
53
+ Requires-Dist: click<=8.2,>=8; python_version == "3.10"
54
+ Requires-Dist: click!=8.3.0,<8.4,>=8
55
55
  Requires-Dist: tomli; python_version < "3.11"
56
56
  Requires-Dist: colorama; platform_system == "Windows"
57
57
  Requires-Dist: importlib_metadata>=7
@@ -189,6 +189,7 @@ Available as `spin.cmds.build.*`:
189
189
 
190
190
  ```
191
191
  sdist 📦 Build a source distribution in `dist/`
192
+ wheel 📦 Build a wheel distribution in `dist/`
192
193
  ```
193
194
 
194
195
  ### [pip](https://pip.pypa.io) (Package Installer for Python)
@@ -359,6 +360,9 @@ nox -s test -- -v
359
360
  nox -s test -- -v spin/tests/test_meson.py
360
361
  ```
361
362
 
363
+ `spin` takes a slightly more conservative approach than [SPEC 0](https://scientific-python.org/specs/spec-0000/), and
364
+ supports all non-EOL versions of Python.
365
+
362
366
  ## History
363
367
 
364
368
  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.9"
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,8 @@ classifiers = [
24
23
  "Programming Language :: Python :: 3 :: Only",
25
24
  ]
26
25
  dependencies = [
27
- "click>=8,<8.3",
26
+ "click>=8,<=8.2; python_version == '3.10'", # cannot deepcopy cmd params (specifically, Sentinel.UNSET) on 3.10
27
+ "click>=8,!=8.3.0,<8.4",
28
28
  "tomli; python_version < '3.11'",
29
29
  "colorama; platform_system == 'Windows'",
30
30
  "importlib_metadata >= 7"
@@ -6,7 +6,7 @@ For usage information see `python -m spin`.
6
6
  Read more at https://github.com/scientific-python/spin
7
7
  """
8
8
 
9
- __version__ = "0.15"
9
+ __version__ = "0.16"
10
10
 
11
11
  from .cmds import util
12
12
 
@@ -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) -> Union[pathlib.Path, None]:
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) -> Union[str, None]:
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() -> Union[str, None]:
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) -> Union[str, None]:
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(
@@ -127,7 +127,14 @@ def extend_command(
127
127
  Command to extend.
128
128
  doc : str
129
129
  Replacement docstring.
130
- The wrapped function's docstring is also appended.
130
+ The decorated function's docstring is also appended.
131
+ This is done so that two modes of documenting are enabled:
132
+
133
+ 1. Extend original command documentation.
134
+ Do this by providing a docstring on the decorated function.
135
+ 2. Replace the original command's documentation.
136
+ Do this either by setting ``doc`` to a docstring, or by
137
+ setting ``doc=''`` and adding a docstring to the decorated function.
131
138
  remove_args : tuple of str
132
139
  List of arguments to remove from the parent command.
133
140
  These arguments can still be set explicitly by calling
@@ -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=/foobar/")
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": True,
31
+ "sys_exit": False,
31
32
  }
32
- return run(["spin"] + list(args), **{**default_kwargs, **user_kwargs})
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.15
3
+ Version: 0.16
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,17 @@ 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.9
50
+ Requires-Python: >=3.10
52
51
  Description-Content-Type: text/markdown
53
52
  License-File: LICENSE
54
- Requires-Dist: click<8.3,>=8
53
+ Requires-Dist: click<=8.2,>=8; python_version == "3.10"
54
+ Requires-Dist: click!=8.3.0,<8.4,>=8
55
55
  Requires-Dist: tomli; python_version < "3.11"
56
56
  Requires-Dist: colorama; platform_system == "Windows"
57
57
  Requires-Dist: importlib_metadata>=7
@@ -189,6 +189,7 @@ Available as `spin.cmds.build.*`:
189
189
 
190
190
  ```
191
191
  sdist 📦 Build a source distribution in `dist/`
192
+ wheel 📦 Build a wheel distribution in `dist/`
192
193
  ```
193
194
 
194
195
  ### [pip](https://pip.pypa.io) (Package Installer for Python)
@@ -359,6 +360,9 @@ nox -s test -- -v
359
360
  nox -s test -- -v spin/tests/test_meson.py
360
361
  ```
361
362
 
363
+ `spin` takes a slightly more conservative approach than [SPEC 0](https://scientific-python.org/specs/spec-0000/), and
364
+ supports all non-EOL versions of Python.
365
+
362
366
  ## History
363
367
 
364
368
  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,4 +1,4 @@
1
- click<8.3,>=8
1
+ click!=8.3.0,<8.4,>=8
2
2
  importlib_metadata>=7
3
3
 
4
4
  [:platform_system == "Windows"]
@@ -7,6 +7,9 @@ colorama
7
7
  [:python_version < "3.11"]
8
8
  tomli
9
9
 
10
+ [:python_version == "3.10"]
11
+ click<=8.2,>=8
12
+
10
13
  [dev]
11
14
  changelist==0.5
12
15
 
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