fastws-cli 0.0.28__tar.gz → 0.0.30__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.28/fastws_cli.egg-info → fastws_cli-0.0.30}/PKG-INFO +7 -5
  2. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/README.md +4 -2
  3. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/fastws/__init__.py +3 -1
  4. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/fastws/build_backend.py +5 -2
  5. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/fastws/cargo.py +38 -10
  6. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/fastws/core.py +5 -1
  7. {fastws_cli-0.0.28 → fastws_cli-0.0.30/fastws_cli.egg-info}/PKG-INFO +7 -5
  8. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/fastws_cli.egg-info/requires.txt +2 -2
  9. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/pyproject.toml +2 -2
  10. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/tests/test_build.py +1 -3
  11. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/LICENSE +0 -0
  12. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/fastws/news.py +0 -0
  13. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/fastws/releases.py +0 -0
  14. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/fastws_cli.egg-info/SOURCES.txt +0 -0
  15. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/fastws_cli.egg-info/dependency_links.txt +0 -0
  16. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/fastws_cli.egg-info/entry_points.txt +0 -0
  17. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/fastws_cli.egg-info/top_level.txt +0 -0
  18. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/setup.cfg +0 -0
  19. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/tests/test_build_backend.py +0 -0
  20. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/tests/test_news.py +0 -0
  21. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/tests/test_releases.py +0 -0
  22. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/tests/test_setup.py +0 -0
  23. {fastws_cli-0.0.28 → fastws_cli-0.0.30}/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.28
3
+ Version: 0.0.30
4
4
  Summary: Fast workspace tools for multi-repo management
5
5
  Author: Jeremy Howard
6
6
  License-Expression: Apache-2.0
@@ -14,12 +14,12 @@ Requires-Dist: fastcore>=2.2.33
14
14
  Requires-Dist: fastgit>=0.1.2
15
15
  Requires-Dist: ghapi>=2.0.6
16
16
  Requires-Dist: packaging
17
- Requires-Dist: python-fastllm
18
17
  Requires-Dist: rich
19
- Requires-Dist: maturin<2.0,>=1.9.4
18
+ Requires-Dist: maturin<2.0,>=1.13
20
19
  Requires-Dist: tomli; python_version < "3.11"
21
20
  Provides-Extra: dev
22
21
  Requires-Dist: fastship; extra == "dev"
22
+ Requires-Dist: python-fastllm; extra == "dev"
23
23
  Requires-Dist: build; extra == "dev"
24
24
  Requires-Dist: twine; extra == "dev"
25
25
  Requires-Dist: pytest; extra == "dev"
@@ -221,9 +221,9 @@ Set `native-binaries = true` under `[tool.fastws]` to build and install the bina
221
221
 
222
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.
223
223
 
224
- Use `fastws.build_backend` as the build backend of a mixed project, and include `fastws-cli>=0.0.25` alongside maturin 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.
224
+ 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
225
 
226
- For distribution wheels containing the binaries, also set `[tool.maturin].data` to a generated wheel-data directory. With `native-binaries = true`, wheel builds through the backend replace its `scripts/` subdirectory with the current Python-free binaries, then delegate packaging to maturin. Explicit profile and target arguments from maturin's build settings also apply to the binaries. Without `native-binaries`, wheel builds go straight to maturin, and `[tool.maturin].data` is optional.
226
+ For distribution wheels containing the binaries, also set `[tool.maturin].data` to a generated wheel-data directory. With `native-binaries = true`, wheel builds through the backend replace its `scripts/` subdirectory with the current Python-free binaries, then delegate packaging to maturin. Explicit profile, target and feature arguments from maturin's build settings also apply to the binaries. Without `native-binaries`, wheel builds go straight to maturin, and `[tool.maturin].data` is optional.
227
227
 
228
228
  Direct maturin CLI builds bypass the Python build backend. Stage the binaries first with the shared command:
229
229
 
@@ -232,6 +232,8 @@ cargo stage --profile dist
232
232
  maturin build --profile dist
233
233
  ```
234
234
 
235
+ Pass the same target and feature flags to both commands, including `--no-default-features` when needed. Staging builds binaries only. On macOS it matches Maturin's linker flags through `build.rustflags` or existing `RUSTFLAGS`/`CARGO_ENCODED_RUSTFLAGS`. A macOS target with its own `rustflags` must include `-C link-arg=-undefined -C link-arg=dynamic_lookup` there. Shared crates are reused when the two builds resolve the same dependency features. Adding `--lib` to staging can select a different compilation profile under LTO.
236
+
235
237
  ### `cargo wait`
236
238
 
237
239
  Wait until a Cargo workspace compiles:
@@ -193,9 +193,9 @@ Set `native-binaries = true` under `[tool.fastws]` to build and install the bina
193
193
 
194
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.
195
195
 
196
- Use `fastws.build_backend` as the build backend of a mixed project, and include `fastws-cli>=0.0.25` alongside maturin 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.
196
+ 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
197
 
198
- For distribution wheels containing the binaries, also set `[tool.maturin].data` to a generated wheel-data directory. With `native-binaries = true`, wheel builds through the backend replace its `scripts/` subdirectory with the current Python-free binaries, then delegate packaging to maturin. Explicit profile and target arguments from maturin's build settings also apply to the binaries. Without `native-binaries`, wheel builds go straight to maturin, and `[tool.maturin].data` is optional.
198
+ For distribution wheels containing the binaries, also set `[tool.maturin].data` to a generated wheel-data directory. With `native-binaries = true`, wheel builds through the backend replace its `scripts/` subdirectory with the current Python-free binaries, then delegate packaging to maturin. Explicit profile, target and feature arguments from maturin's build settings also apply to the binaries. Without `native-binaries`, wheel builds go straight to maturin, and `[tool.maturin].data` is optional.
199
199
 
200
200
  Direct maturin CLI builds bypass the Python build backend. Stage the binaries first with the shared command:
201
201
 
@@ -204,6 +204,8 @@ cargo stage --profile dist
204
204
  maturin build --profile dist
205
205
  ```
206
206
 
207
+ Pass the same target and feature flags to both commands, including `--no-default-features` when needed. Staging builds binaries only. On macOS it matches Maturin's linker flags through `build.rustflags` or existing `RUSTFLAGS`/`CARGO_ENCODED_RUSTFLAGS`. A macOS target with its own `rustflags` must include `-C link-arg=-undefined -C link-arg=dynamic_lookup` there. Shared crates are reused when the two builds resolve the same dependency features. Adding `--lib` to staging can select a different compilation profile under LTO.
208
+
207
209
  ### `cargo wait`
208
210
 
209
211
  Wait until a Cargo workspace compiles:
@@ -1,4 +1,6 @@
1
- __version__ = "0.0.28"
1
+ __version__ = "0.0.30"
2
+
3
+
2
4
 
3
5
 
4
6
 
@@ -13,11 +13,14 @@ def _stage(config_settings):
13
13
  if not tool.get('fastws', {}).get('native-binaries'): return
14
14
  parser = argparse.ArgumentParser(add_help=False)
15
15
  parser.add_argument('--profile')
16
- parser.add_argument('--release', action='store_true')
16
+ parser.add_argument('--release', '-r', action='store_true')
17
17
  parser.add_argument('--target')
18
+ parser.add_argument('--features', '-F', action='append')
19
+ parser.add_argument('--all-features', action='store_true')
20
+ parser.add_argument('--no-default-features', action='store_true')
18
21
  args, _ = parser.parse_known_args(maturin.get_maturin_pep517_args(config_settings))
19
22
  profile = args.profile or ('release' if args.release else tool['maturin'].get('profile', 'release'))
20
- stage_binaries(root, profile, args.target)
23
+ stage_binaries(root, profile, args.target, args.features, args.all_features, args.no_default_features)
21
24
 
22
25
 
23
26
  def build_wheel(wheel_directory, config_settings=None, metadata_directory=None):
@@ -191,7 +191,34 @@ def sources(root):
191
191
  return res
192
192
 
193
193
 
194
- def build(root, *, library=True, binaries=False, profile=None, target=None, no_default_features=False):
194
+ def _maturin_flags(target, env):
195
+ "Maturin's macOS linker flags without replacing existing compiler flags."
196
+ target = target or env.get('CARGO_BUILD_TARGET')
197
+ if not (target.endswith('-apple-darwin') if target else sys.platform == 'darwin'): return [], None
198
+ link_args = ['link-arg=-undefined', 'link-arg=dynamic_lookup']
199
+ if 'CARGO_ENCODED_RUSTFLAGS' in env:
200
+ flags = env['CARGO_ENCODED_RUSTFLAGS'].split('\x1f') if env['CARGO_ENCODED_RUSTFLAGS'] else []
201
+ elif 'RUSTFLAGS' in env: flags = env['RUSTFLAGS'].split()
202
+ else:
203
+ flags = [arg for flag in link_args for arg in ('-C', flag)]
204
+ return ['--config', 'build.rustflags=' + json.dumps(flags)], None
205
+ for flag in link_args:
206
+ if flag not in flags and '-C'+flag not in flags: flags += ['-C', flag]
207
+ return [], dict(env, CARGO_ENCODED_RUSTFLAGS='\x1f'.join(flags))
208
+
209
+
210
+ def build(
211
+ root, # The project directory, whose `tool.maturin` gives the defaults (expands `~`)
212
+ *,
213
+ library=True, # Build the library target?
214
+ binaries=False, # Build the binary targets?
215
+ profile=None, # Cargo profile; None: `tool.maturin.profile`, or Cargo's default
216
+ target=None, # Target triple; None: the host
217
+ features=None, # Features to enable, as a list or a string; None: `tool.maturin.features`
218
+ all_features=False, # Enable every feature? `tool.maturin`'s `all-features` also turns this on
219
+ no_default_features=False, # Leave out the default features? `tool.maturin`'s `no-default-features` also turns this on
220
+ for_maturin=False, # Use the macOS linker flags that maturin's own wheel build uses?
221
+ ):
195
222
  "Build with Cargo and return the compiler artifacts of the workspace's packages."
196
223
  root = Path(root).expanduser()
197
224
  cfg = settings(root)['maturin']
@@ -200,12 +227,12 @@ def build(root, *, library=True, binaries=False, profile=None, target=None, no_d
200
227
  if binaries: cmd.append('--bins')
201
228
  if profile := profile or cfg.get('profile'): cmd += ['--profile', profile]
202
229
  if target: cmd += ['--target', target]
203
- if no_default_features: cmd.append('--no-default-features')
204
- else:
205
- if features := cfg.get('features'): cmd += ['--features', ','.join(features)]
206
- for flag in ('all-features', 'no-default-features'):
207
- if cfg.get(flag): cmd.append('--' + flag)
208
- with timing_lock(): result = subprocess.run(['cargo', *cmd], cwd=root, stdout=subprocess.PIPE, text=True)
230
+ if features := features or cfg.get('features'):
231
+ cmd += ['--features', features if isinstance(features, str) else ','.join(features)]
232
+ for flag, active in [('all-features', all_features), ('no-default-features', no_default_features)]:
233
+ if active or cfg.get(flag): cmd.append('--' + flag)
234
+ extra, env = _maturin_flags(target, os.environ) if for_maturin else ([], None)
235
+ with timing_lock(): result = subprocess.run(['cargo', *cmd, *extra], cwd=root, stdout=subprocess.PIPE, text=True, env=env)
209
236
  messages = [json.loads(line) for line in result.stdout.splitlines()]
210
237
  for m in messages:
211
238
  if m.get('reason') != 'compiler-message': continue
@@ -250,12 +277,13 @@ def develop(root):
250
277
  if f.is_file(): replace(f, env/f.relative_to(data))
251
278
 
252
279
 
253
- def stage_binaries(root, profile=None, target=None):
254
- "Stage Python-free Cargo binaries in maturin's wheel-data directory."
280
+ def stage_binaries(root, profile=None, target=None, features=None, all_features=False, no_default_features=False):
281
+ "Stage Python-free Cargo binaries for a maturin wheel build."
255
282
  root = Path(root).expanduser()
256
283
  cfg = settings(root)['maturin']
257
284
  if 'data' not in cfg: raise ConfigError(r'staging native binaries requires tool.maturin.data')
258
285
  dest = root/cfg['data']/'scripts'
259
- artifacts = build(root, library=False, binaries=True, profile=profile, target=target, no_default_features=True)
286
+ artifacts = build(root, library=False, binaries=True, profile=profile, target=target, features=features,
287
+ all_features=all_features, no_default_features=no_default_features, for_maturin=True)
260
288
  if dest.exists(): shutil.rmtree(dest)
261
289
  return [replace(m['executable'], dest/Path(m['executable']).name) for m in artifacts if m.get('executable')]
@@ -582,11 +582,15 @@ def cargo_stage(
582
582
  path: str = '.', # Rust/Python project directory
583
583
  profile: str = '', # Cargo profile; defaults to the maturin profile or dev
584
584
  target: str = '', # Cargo target triple
585
+ features: str = '', # Space or comma separated Cargo features
586
+ all_features: bool = False, # Enable all Cargo features
587
+ no_default_features: bool = False, # Disable default Cargo features
585
588
  ):
586
589
  r"Stage Python-free native binaries for maturin wheel builds."
587
590
  from .cargo import stage_binaries
588
591
  with _cli_errors():
589
- for dest in stage_binaries(Path(path).resolve(), profile or None, target or None): print(f'Staged {dest}')
592
+ for dest in stage_binaries(Path(path).resolve(), profile or None, target or None, features,
593
+ all_features, no_default_features): print(f'Staged {dest}')
590
594
 
591
595
  def _newest(paths):
592
596
  "Newest file mtime among `paths`, walking each directory as `_src_mtime` does"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastws-cli
3
- Version: 0.0.28
3
+ Version: 0.0.30
4
4
  Summary: Fast workspace tools for multi-repo management
5
5
  Author: Jeremy Howard
6
6
  License-Expression: Apache-2.0
@@ -14,12 +14,12 @@ Requires-Dist: fastcore>=2.2.33
14
14
  Requires-Dist: fastgit>=0.1.2
15
15
  Requires-Dist: ghapi>=2.0.6
16
16
  Requires-Dist: packaging
17
- Requires-Dist: python-fastllm
18
17
  Requires-Dist: rich
19
- Requires-Dist: maturin<2.0,>=1.9.4
18
+ Requires-Dist: maturin<2.0,>=1.13
20
19
  Requires-Dist: tomli; python_version < "3.11"
21
20
  Provides-Extra: dev
22
21
  Requires-Dist: fastship; extra == "dev"
22
+ Requires-Dist: python-fastllm; extra == "dev"
23
23
  Requires-Dist: build; extra == "dev"
24
24
  Requires-Dist: twine; extra == "dev"
25
25
  Requires-Dist: pytest; extra == "dev"
@@ -221,9 +221,9 @@ Set `native-binaries = true` under `[tool.fastws]` to build and install the bina
221
221
 
222
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.
223
223
 
224
- Use `fastws.build_backend` as the build backend of a mixed project, and include `fastws-cli>=0.0.25` alongside maturin 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.
224
+ 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
225
 
226
- For distribution wheels containing the binaries, also set `[tool.maturin].data` to a generated wheel-data directory. With `native-binaries = true`, wheel builds through the backend replace its `scripts/` subdirectory with the current Python-free binaries, then delegate packaging to maturin. Explicit profile and target arguments from maturin's build settings also apply to the binaries. Without `native-binaries`, wheel builds go straight to maturin, and `[tool.maturin].data` is optional.
226
+ For distribution wheels containing the binaries, also set `[tool.maturin].data` to a generated wheel-data directory. With `native-binaries = true`, wheel builds through the backend replace its `scripts/` subdirectory with the current Python-free binaries, then delegate packaging to maturin. Explicit profile, target and feature arguments from maturin's build settings also apply to the binaries. Without `native-binaries`, wheel builds go straight to maturin, and `[tool.maturin].data` is optional.
227
227
 
228
228
  Direct maturin CLI builds bypass the Python build backend. Stage the binaries first with the shared command:
229
229
 
@@ -232,6 +232,8 @@ cargo stage --profile dist
232
232
  maturin build --profile dist
233
233
  ```
234
234
 
235
+ Pass the same target and feature flags to both commands, including `--no-default-features` when needed. Staging builds binaries only. On macOS it matches Maturin's linker flags through `build.rustflags` or existing `RUSTFLAGS`/`CARGO_ENCODED_RUSTFLAGS`. A macOS target with its own `rustflags` must include `-C link-arg=-undefined -C link-arg=dynamic_lookup` there. Shared crates are reused when the two builds resolve the same dependency features. Adding `--lib` to staging can select a different compilation profile under LTO.
236
+
235
237
  ### `cargo wait`
236
238
 
237
239
  Wait until a Cargo workspace compiles:
@@ -2,15 +2,15 @@ fastcore>=2.2.33
2
2
  fastgit>=0.1.2
3
3
  ghapi>=2.0.6
4
4
  packaging
5
- python-fastllm
6
5
  rich
7
- maturin<2.0,>=1.9.4
6
+ maturin<2.0,>=1.13
8
7
 
9
8
  [:python_version < "3.11"]
10
9
  tomli
11
10
 
12
11
  [dev]
13
12
  fastship
13
+ python-fastllm
14
14
  build
15
15
  twine
16
16
  pytest
@@ -20,15 +20,15 @@ dependencies = [
20
20
  "fastgit>=0.1.2",
21
21
  "ghapi>=2.0.6",
22
22
  "packaging",
23
- "python-fastllm",
24
23
  "rich",
25
- "maturin>=1.9.4,<2.0",
24
+ "maturin>=1.13,<2.0",
26
25
  "tomli; python_version < '3.11'",
27
26
  ]
28
27
 
29
28
  [project.optional-dependencies]
30
29
  dev = [
31
30
  "fastship",
31
+ "python-fastllm",
32
32
  "build",
33
33
  "twine",
34
34
  "pytest",
@@ -1,6 +1,4 @@
1
- import subprocess
2
- import pytest
3
- import fastws.core as core
1
+ import subprocess, pytest, fastws.core as core
4
2
  from fastws.cargo import build, run_tests, diagnostics
5
3
 
6
4
 
File without changes
File without changes
File without changes