nox-uv 0.5.0__tar.gz → 0.6.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nox-uv
3
- Version: 0.5.0
3
+ Version: 0.6.0
4
4
  Summary: Facilitate nox integration with uv for Python projects
5
5
  Project-URL: Homepage, https://github.com/dantebben/nox-uv
6
6
  Project-URL: Repository, https://github.com/dantebben/nox-uv
@@ -44,8 +44,8 @@ Description-Content-Type: text/markdown
44
44
  [ruff-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
45
45
  [mypy-badge]: https://www.mypy-lang.org/static/mypy_badge.svg
46
46
 
47
- `nox-uv` is a simple drop-in replacement for [nox](https://nox.thea.codes/)'s `@nox.session` that installs
48
- dependencies constrained by [uv](https://docs.astral.sh/uv/)'s lockfile.
47
+ `nox-uv` is a simple drop-in replacement for [nox](https://nox.thea.codes/)'s `@nox.session` that
48
+ installs dependencies constrained by [uv](https://docs.astral.sh/uv/)'s lockfile.
49
49
 
50
50
  ## Usage
51
51
 
@@ -107,7 +107,7 @@ def type_check(s: Session) -> None:
107
107
 
108
108
 
109
109
  @session(uv_only_groups=["lint"])
110
- def type_check(s: Session) -> None:
110
+ def lint(s: Session) -> None:
111
111
  s.run("ruff", "check", ".")
112
112
  s.run("ruff", "format", "--check", ".")
113
113
  ```
@@ -124,10 +124,11 @@ def type_check(s: Session) -> None:
124
124
  - `uv_groups`: list of `uv` _dependency-groups_
125
125
  - `uv_extras`: list of `uv` _optional-dependencies_
126
126
  - `uv_only_groups`: list of `uv` _only-groups_ to include. Prevents installation of project
127
- _dependencies_.
127
+ _dependencies_
128
128
  - `uv_all_extras`: boolean to install all _optional-dependencies_ from `pyproject.toml`
129
129
  - `uv_all_groups`: boolean to install all _dependency-groups_
130
- - `uv_sync_locked`: boolean to validate that `uv.lock` is up-to-date
130
+ - `uv_no_install_project`: boolean to not install the current project
131
+ - `uv_sync_locked`: boolean to validate that `uv.lock` is up to date
131
132
 
132
133
 
133
134
  ## Inspiration
@@ -16,8 +16,8 @@
16
16
  [ruff-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
17
17
  [mypy-badge]: https://www.mypy-lang.org/static/mypy_badge.svg
18
18
 
19
- `nox-uv` is a simple drop-in replacement for [nox](https://nox.thea.codes/)'s `@nox.session` that installs
20
- dependencies constrained by [uv](https://docs.astral.sh/uv/)'s lockfile.
19
+ `nox-uv` is a simple drop-in replacement for [nox](https://nox.thea.codes/)'s `@nox.session` that
20
+ installs dependencies constrained by [uv](https://docs.astral.sh/uv/)'s lockfile.
21
21
 
22
22
  ## Usage
23
23
 
@@ -79,7 +79,7 @@ def type_check(s: Session) -> None:
79
79
 
80
80
 
81
81
  @session(uv_only_groups=["lint"])
82
- def type_check(s: Session) -> None:
82
+ def lint(s: Session) -> None:
83
83
  s.run("ruff", "check", ".")
84
84
  s.run("ruff", "format", "--check", ".")
85
85
  ```
@@ -96,10 +96,11 @@ def type_check(s: Session) -> None:
96
96
  - `uv_groups`: list of `uv` _dependency-groups_
97
97
  - `uv_extras`: list of `uv` _optional-dependencies_
98
98
  - `uv_only_groups`: list of `uv` _only-groups_ to include. Prevents installation of project
99
- _dependencies_.
99
+ _dependencies_
100
100
  - `uv_all_extras`: boolean to install all _optional-dependencies_ from `pyproject.toml`
101
101
  - `uv_all_groups`: boolean to install all _dependency-groups_
102
- - `uv_sync_locked`: boolean to validate that `uv.lock` is up-to-date
102
+ - `uv_no_install_project`: boolean to not install the current project
103
+ - `uv_sync_locked`: boolean to validate that `uv.lock` is up to date
103
104
 
104
105
 
105
106
  ## Inspiration
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "nox-uv"
3
- version = "0.5.0"
3
+ version = "0.6.0"
4
4
  description = "Facilitate nox integration with uv for Python projects"
5
5
  keywords = ["nox", "uv"]
6
6
  readme = "README.md"
@@ -26,6 +26,7 @@ def session(
26
26
  uv_only_groups: Sequence[str] = (),
27
27
  uv_all_extras: bool = False,
28
28
  uv_all_groups: bool = False,
29
+ uv_no_install_project: bool = False,
29
30
  uv_sync_locked: bool = True,
30
31
  **kwargs: dict[str, Any],
31
32
  ) -> Callable[..., Callable[..., R]]:
@@ -34,7 +35,7 @@ def session(
34
35
  Args:
35
36
  args: Positional arguments are forwarded to ``nox.session``.
36
37
  kwargs: Keyword arguments are forwarded to ``nox.session``. Used to catch any future
37
- arguments of nox.session that aren't explicitely captured in nox_uv.session.
38
+ arguments of nox.session that aren't explicitly captured in nox_uv.session.
38
39
 
39
40
  Returns:
40
41
  The decorated session function.
@@ -55,6 +56,7 @@ def session(
55
56
  uv_all_extras=uv_all_extras,
56
57
  uv_all_groups=uv_all_groups,
57
58
  uv_only_groups=uv_only_groups,
59
+ uv_no_install_project=uv_no_install_project,
58
60
  uv_sync_locked=uv_sync_locked,
59
61
  **kwargs,
60
62
  ) # type: ignore
@@ -84,6 +86,9 @@ def session(
84
86
  if uv_all_extras:
85
87
  extended_cmd.append("--all-extras")
86
88
 
89
+ if uv_no_install_project:
90
+ extended_cmd.append("--no-install-project")
91
+
87
92
  sync_cmd += extended_cmd
88
93
 
89
94
  @functools.wraps(function)
@@ -104,7 +109,7 @@ def session(
104
109
  else:
105
110
  if len(extended_cmd) > 0:
106
111
  raise s.error(
107
- 'Using "uv" specific paramaters is not allowed outside of a "uv" '
112
+ 'Using "uv" specific parameters is not allowed outside of a "uv" '
108
113
  "venv_backend.\n"
109
114
  f"Check the venv_backend, or the {extended_cmd} parameters."
110
115
  )
@@ -12,6 +12,8 @@ options.sessions = [
12
12
  "one_extra",
13
13
  "correct_python",
14
14
  "only_groups",
15
+ "no_install_project",
16
+ "do_install_project",
15
17
  ]
16
18
 
17
19
 
@@ -87,6 +89,22 @@ def only_groups(s: Session) -> None:
87
89
  assert "nox-uv" not in r
88
90
 
89
91
 
92
+ @session(uv_no_install_project=True, uv_groups=["lint"])
93
+ def no_install_project(s: Session) -> None:
94
+ r = s.run("uv", "pip", "list", silent=True)
95
+ assert isinstance(r, str)
96
+ assert "ruff" in r
97
+ assert "subproject" not in r
98
+
99
+
100
+ @session(uv_groups=["lint"])
101
+ def do_install_project(s: Session) -> None:
102
+ r = s.run("uv", "pip", "list", silent=True)
103
+ assert isinstance(r, str)
104
+ assert "ruff" in r
105
+ assert "subproject" in r
106
+
107
+
90
108
  @session(uv_groups=["type_check"], venv_backend="virtualenv")
91
109
  def failed_virtualenv(s: Session) -> None:
92
110
  pass
@@ -5,7 +5,7 @@ description = "Project for testing nox-uv"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.9"
7
7
  classifiers = [
8
- "Private: Do Not Upload",
8
+ "Private :: Do Not Upload",
9
9
  ]
10
10
  dependencies = [
11
11
  "nox-uv",
@@ -14,6 +14,11 @@ dependencies = [
14
14
  [tool.uv.sources]
15
15
  nox-uv = { path = "../../", editable = true }
16
16
 
17
+ [build-system]
18
+ requires = ["hatchling"]
19
+ build-backend = "hatchling.build"
20
+
21
+
17
22
  [project.optional-dependencies]
18
23
  pyyaml = ["pyyaml"]
19
24
  scapy = ["scapy"]
@@ -266,7 +266,7 @@ wheels = [
266
266
 
267
267
  [[package]]
268
268
  name = "nox-uv"
269
- version = "0.5.0"
269
+ version = "0.6.0"
270
270
  source = { editable = "../../" }
271
271
  dependencies = [
272
272
  { name = "nox" },
@@ -430,7 +430,7 @@ wheels = [
430
430
  [[package]]
431
431
  name = "subproject"
432
432
  version = "0.1.0"
433
- source = { virtual = "." }
433
+ source = { editable = "." }
434
434
  dependencies = [
435
435
  { name = "nox-uv" },
436
436
  ]
@@ -246,7 +246,7 @@ wheels = [
246
246
 
247
247
  [[package]]
248
248
  name = "nox-uv"
249
- version = "0.5.0"
249
+ version = "0.6.0"
250
250
  source = { editable = "." }
251
251
  dependencies = [
252
252
  { name = "nox" },
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