fastws-cli 0.0.30__tar.gz → 0.0.32__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 (23) hide show
  1. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/PKG-INFO +4 -2
  2. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/README.md +3 -1
  3. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/fastws/__init__.py +3 -1
  4. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/fastws/cargo.py +9 -3
  5. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/fastws_cli.egg-info/PKG-INFO +4 -2
  6. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/LICENSE +0 -0
  7. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/fastws/build_backend.py +0 -0
  8. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/fastws/core.py +0 -0
  9. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/fastws/news.py +0 -0
  10. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/fastws/releases.py +0 -0
  11. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/fastws_cli.egg-info/SOURCES.txt +0 -0
  12. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/fastws_cli.egg-info/dependency_links.txt +0 -0
  13. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/fastws_cli.egg-info/entry_points.txt +0 -0
  14. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/fastws_cli.egg-info/requires.txt +0 -0
  15. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/fastws_cli.egg-info/top_level.txt +0 -0
  16. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/pyproject.toml +0 -0
  17. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/setup.cfg +0 -0
  18. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/tests/test_build.py +0 -0
  19. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/tests/test_build_backend.py +0 -0
  20. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/tests/test_news.py +0 -0
  21. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/tests/test_releases.py +0 -0
  22. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/tests/test_setup.py +0 -0
  23. {fastws_cli-0.0.30 → fastws_cli-0.0.32}/tests/test_sync.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastws-cli
3
- Version: 0.0.30
3
+ Version: 0.0.32
4
4
  Summary: Fast workspace tools for multi-repo management
5
5
  Author: Jeremy Howard
6
6
  License-Expression: Apache-2.0
@@ -219,7 +219,9 @@ Set `native-binaries = true` under `[tool.fastws]` to build and install the bina
219
219
 
220
220
  `cargo develop` also copies the `data/` subdirectory of `[tool.maturin].data` into the active venv, as a wheel install does. For example, `data/share/jupyter/kernels/<name>/kernel.json` is installed as `share/jupyter/kernels/<name>/kernel.json`, where Jupyter finds the kernel. `cargo develop` installs the binaries it builds, not the staged copies in `scripts/`.
221
221
 
222
- Each Cargo build that fastws runs holds a shared `flock` on `/tmp/aai-ws-timing.lock`. A speed test that takes that lock exclusively then never times code while a build runs. A build waits up to 5 minutes for such a timing to finish, then goes ahead without the lock. Python code takes the same lock with `fastws.cargo.timing_lock`: `with timing_lock(exclusive=True):` around a timing, and `with timing_lock():` around a test run. An exclusive hold that has waited 30 seconds prints the processes that have the lock's file open. It raises `TimeoutError` after 5 minutes.
222
+ Set `post-develop-module = "package.generator"` under `[tool.fastws]` to run a generator after installing the native extension and binaries, before copying wheel data. It runs with the current Python in a fresh process from the project root, including when Cargo reuses its build. A failure stops `cargo develop` or `ws-sync`. Use it for generated files that need the rebuilt extension's metadata.
223
+
224
+ On Unix, each Cargo build that fastws runs holds a shared `flock` on `/tmp/aai-ws-timing.lock`. A speed test that takes that lock exclusively then never times code while a build runs. A build waits up to 5 minutes for such a timing to finish, then goes ahead without the lock. Python code takes the same lock with `fastws.cargo.timing_lock`: `with timing_lock(exclusive=True):` around a timing, and `with timing_lock():` around a test run. An exclusive hold that has waited 30 seconds prints the processes that have the lock's file open. It raises `TimeoutError` after 5 minutes. Windows builds and tests run without this timing coordination.
223
225
 
224
226
  Use `fastws.build_backend` as the build backend of a mixed project, and include `fastws-cli>=0.0.29` alongside `maturin>=1.13,<2.0` in `[build-system].requires`. Its editable builds install only Python metadata and the source path, and compile no Rust. `ws-sync` then runs `cargo develop` to build and install the extension, the binaries and the wheel data files. After standalone `uv sync`, run `cargo develop` yourself.
225
227
 
@@ -191,7 +191,9 @@ Set `native-binaries = true` under `[tool.fastws]` to build and install the bina
191
191
 
192
192
  `cargo develop` also copies the `data/` subdirectory of `[tool.maturin].data` into the active venv, as a wheel install does. For example, `data/share/jupyter/kernels/<name>/kernel.json` is installed as `share/jupyter/kernels/<name>/kernel.json`, where Jupyter finds the kernel. `cargo develop` installs the binaries it builds, not the staged copies in `scripts/`.
193
193
 
194
- Each Cargo build that fastws runs holds a shared `flock` on `/tmp/aai-ws-timing.lock`. A speed test that takes that lock exclusively then never times code while a build runs. A build waits up to 5 minutes for such a timing to finish, then goes ahead without the lock. Python code takes the same lock with `fastws.cargo.timing_lock`: `with timing_lock(exclusive=True):` around a timing, and `with timing_lock():` around a test run. An exclusive hold that has waited 30 seconds prints the processes that have the lock's file open. It raises `TimeoutError` after 5 minutes.
194
+ Set `post-develop-module = "package.generator"` under `[tool.fastws]` to run a generator after installing the native extension and binaries, before copying wheel data. It runs with the current Python in a fresh process from the project root, including when Cargo reuses its build. A failure stops `cargo develop` or `ws-sync`. Use it for generated files that need the rebuilt extension's metadata.
195
+
196
+ On Unix, each Cargo build that fastws runs holds a shared `flock` on `/tmp/aai-ws-timing.lock`. A speed test that takes that lock exclusively then never times code while a build runs. A build waits up to 5 minutes for such a timing to finish, then goes ahead without the lock. Python code takes the same lock with `fastws.cargo.timing_lock`: `with timing_lock(exclusive=True):` around a timing, and `with timing_lock():` around a test run. An exclusive hold that has waited 30 seconds prints the processes that have the lock's file open. It raises `TimeoutError` after 5 minutes. Windows builds and tests run without this timing coordination.
195
197
 
196
198
  Use `fastws.build_backend` as the build backend of a mixed project, and include `fastws-cli>=0.0.29` alongside `maturin>=1.13,<2.0` in `[build-system].requires`. Its editable builds install only Python metadata and the source path, and compile no Rust. `ws-sync` then runs `cargo develop` to build and install the extension, the binaries and the wheel data files. After standalone `uv sync`, run `cargo develop` yourself.
197
199
 
@@ -1,4 +1,6 @@
1
- __version__ = "0.0.30"
1
+ __version__ = "0.0.32"
2
+
3
+
2
4
 
3
5
 
4
6
 
@@ -1,5 +1,5 @@
1
1
  r"Build, test and install Cargo artifacts for mixed Rust/Python projects."
2
- import fcntl, json, os, re, shutil, subprocess, sys, sysconfig, time
2
+ import json, os, re, shutil, subprocess, sys, sysconfig, time
3
3
  from collections import Counter
4
4
  from contextlib import contextmanager
5
5
  from dataclasses import dataclass
@@ -45,7 +45,11 @@ def _lock_users():
45
45
  def timing_lock(
46
46
  exclusive=False, # Take the lock exclusively, as a timing does; False: take it shared, as a build or a test run does
47
47
  ):
48
- "Hold the lock that keeps this machine's timings apart from its builds and test runs. A hold waits up to 5 minutes for the lock. After that, a shared hold goes ahead without it. An exclusive hold raises `TimeoutError`. An exclusive hold that has waited 30 seconds prints, once, the other processes that have the lock's file open."
48
+ "Hold the Unix lock that keeps this machine's timings apart from its builds and test runs; a no-op on Windows. A hold waits up to 5 minutes for the lock. After that, a shared hold goes ahead without it. An exclusive hold raises `TimeoutError`. An exclusive hold that has waited 30 seconds prints, once, the other processes that have the lock's file open."
49
+ if os.name == 'nt':
50
+ yield
51
+ return
52
+ import fcntl
49
53
  with open(_TIMING_LOCK, 'a') as f:
50
54
  start, waiting, reported = time.monotonic(), False, False
51
55
  while True:
@@ -253,7 +257,7 @@ def replace(source, destination):
253
257
 
254
258
 
255
259
  def develop(root):
256
- "Install a Python extension, opted-in binaries and wheel data files from one Cargo build."
260
+ "Install a Python extension, opted-in binaries and wheel data, running the project's post-develop module before wheel data."
257
261
  root = Path(root).expanduser()
258
262
  tool = settings(root)
259
263
  cfg = tool['maturin']
@@ -270,6 +274,8 @@ def develop(root):
270
274
  scripts = env/('Scripts' if os.name == 'nt' else 'bin')
271
275
  for m in artifacts:
272
276
  if m.get('executable'): replace(m['executable'], scripts/Path(m['executable']).name)
277
+ if generator := tool.get('fastws', {}).get('post-develop-module'):
278
+ subprocess.run([sys.executable, '-m', generator], cwd=root, check=True)
273
279
  # Editable builds through `build_backend` don't install the wheel's data files, which a wheel install puts under the prefix.
274
280
  if 'data' in cfg:
275
281
  data = root/cfg['data']/'data'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastws-cli
3
- Version: 0.0.30
3
+ Version: 0.0.32
4
4
  Summary: Fast workspace tools for multi-repo management
5
5
  Author: Jeremy Howard
6
6
  License-Expression: Apache-2.0
@@ -219,7 +219,9 @@ Set `native-binaries = true` under `[tool.fastws]` to build and install the bina
219
219
 
220
220
  `cargo develop` also copies the `data/` subdirectory of `[tool.maturin].data` into the active venv, as a wheel install does. For example, `data/share/jupyter/kernels/<name>/kernel.json` is installed as `share/jupyter/kernels/<name>/kernel.json`, where Jupyter finds the kernel. `cargo develop` installs the binaries it builds, not the staged copies in `scripts/`.
221
221
 
222
- Each Cargo build that fastws runs holds a shared `flock` on `/tmp/aai-ws-timing.lock`. A speed test that takes that lock exclusively then never times code while a build runs. A build waits up to 5 minutes for such a timing to finish, then goes ahead without the lock. Python code takes the same lock with `fastws.cargo.timing_lock`: `with timing_lock(exclusive=True):` around a timing, and `with timing_lock():` around a test run. An exclusive hold that has waited 30 seconds prints the processes that have the lock's file open. It raises `TimeoutError` after 5 minutes.
222
+ Set `post-develop-module = "package.generator"` under `[tool.fastws]` to run a generator after installing the native extension and binaries, before copying wheel data. It runs with the current Python in a fresh process from the project root, including when Cargo reuses its build. A failure stops `cargo develop` or `ws-sync`. Use it for generated files that need the rebuilt extension's metadata.
223
+
224
+ On Unix, each Cargo build that fastws runs holds a shared `flock` on `/tmp/aai-ws-timing.lock`. A speed test that takes that lock exclusively then never times code while a build runs. A build waits up to 5 minutes for such a timing to finish, then goes ahead without the lock. Python code takes the same lock with `fastws.cargo.timing_lock`: `with timing_lock(exclusive=True):` around a timing, and `with timing_lock():` around a test run. An exclusive hold that has waited 30 seconds prints the processes that have the lock's file open. It raises `TimeoutError` after 5 minutes. Windows builds and tests run without this timing coordination.
223
225
 
224
226
  Use `fastws.build_backend` as the build backend of a mixed project, and include `fastws-cli>=0.0.29` alongside `maturin>=1.13,<2.0` in `[build-system].requires`. Its editable builds install only Python metadata and the source path, and compile no Rust. `ws-sync` then runs `cargo develop` to build and install the extension, the binaries and the wheel data files. After standalone `uv sync`, run `cargo develop` yourself.
225
227
 
File without changes
File without changes
File without changes
File without changes
File without changes