nox-uv 0.4.0__py3-none-any.whl → 0.6.0__py3-none-any.whl

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.
nox_uv/__init__.py CHANGED
@@ -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)
@@ -94,15 +99,17 @@ def session(
94
99
  # UV called from Nox does not respect the Python version set in the Nox session.
95
100
  # We need to pass the Python version to UV explicitly.
96
101
  if s.python is not None:
97
- # NOTE: casting to string explicitly because implicit casting isn't working
98
- # for the type checker.
99
- s.env["UV_PYTHON"] = str(s.python)
102
+ s.env["UV_PYTHON"] = s.virtualenv.location
100
103
 
104
+ s.debug(
105
+ f"UV_PYTHON={s.env['UV_PYTHON']} | "
106
+ f"UV_PROJECT_ENVIRONMENT={s.env['UV_PROJECT_ENVIRONMENT']}"
107
+ )
101
108
  s.run_install(*sync_cmd)
102
109
  else:
103
110
  if len(extended_cmd) > 0:
104
111
  raise s.error(
105
- 'Using "uv" specific paramaters is not allowed outside of a "uv" '
112
+ 'Using "uv" specific parameters is not allowed outside of a "uv" '
106
113
  "venv_backend.\n"
107
114
  f"Check the venv_backend, or the {extended_cmd} parameters."
108
115
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nox-uv
3
- Version: 0.4.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
@@ -0,0 +1,6 @@
1
+ nox_uv/__init__.py,sha256=mMZxMHQNKNTp4AblBvFa6nBrn28Nx7iME_TpO0XBV2E,3979
2
+ nox_uv/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ nox_uv-0.6.0.dist-info/METADATA,sha256=j-v9Xg2ymDAEoq2SGHjU2JZbv383S7Qu7PQc661LZN0,4662
4
+ nox_uv-0.6.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
5
+ nox_uv-0.6.0.dist-info/licenses/LICENSE.txt,sha256=iTZ5ALF1isnM6Ey9Tjom0XIGBBysArB0I2NHZ9a-b8I,1067
6
+ nox_uv-0.6.0.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- nox_uv/__init__.py,sha256=xtgjQYAGFFioVyrb9Iu4msEwnHm3C_wluRBn0VV_3T8,3759
2
- nox_uv/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- nox_uv-0.4.0.dist-info/METADATA,sha256=UYELp9h4KA9L0tz-4KUlULk8DrzGu5sU7eBOLl41CE4,4599
4
- nox_uv-0.4.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
5
- nox_uv-0.4.0.dist-info/licenses/LICENSE.txt,sha256=iTZ5ALF1isnM6Ey9Tjom0XIGBBysArB0I2NHZ9a-b8I,1067
6
- nox_uv-0.4.0.dist-info/RECORD,,
File without changes