nox-uv 0.5.0__tar.gz → 0.6.1__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,14 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nox-uv
3
- Version: 0.5.0
3
+ Version: 0.6.1
4
4
  Summary: Facilitate nox integration with uv for Python projects
5
- Project-URL: Homepage, https://github.com/dantebben/nox-uv
6
- Project-URL: Repository, https://github.com/dantebben/nox-uv
7
- Project-URL: Issues, https://github.com/dantebben/nox-uv/issues
5
+ Keywords: nox,uv
6
+ Author: Dan Tebben
8
7
  Author-email: Dan Tebben <dantebben@gmail.com>
9
8
  License-Expression: MIT
10
9
  License-File: LICENSE.txt
11
- Keywords: nox,uv
12
10
  Classifier: Development Status :: 4 - Beta
13
11
  Classifier: Intended Audience :: Developers
14
12
  Classifier: License :: OSI Approved :: MIT License
@@ -22,8 +20,11 @@ Classifier: Programming Language :: Python :: 3.12
22
20
  Classifier: Programming Language :: Python :: 3.13
23
21
  Classifier: Topic :: Software Development :: Testing
24
22
  Classifier: Typing :: Typed
23
+ Requires-Dist: nox>=2025.5.1
25
24
  Requires-Python: >=3.9
26
- Requires-Dist: nox>=2025.05.01
25
+ Project-URL: Homepage, https://github.com/dantebben/nox-uv
26
+ Project-URL: Issues, https://github.com/dantebben/nox-uv/issues
27
+ Project-URL: Repository, https://github.com/dantebben/nox-uv
27
28
  Description-Content-Type: text/markdown
28
29
 
29
30
  ## Intro
@@ -44,8 +45,8 @@ Description-Content-Type: text/markdown
44
45
  [ruff-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
45
46
  [mypy-badge]: https://www.mypy-lang.org/static/mypy_badge.svg
46
47
 
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.
48
+ `nox-uv` is a simple drop-in replacement for [nox](https://nox.thea.codes/)'s `@nox.session` that
49
+ installs dependencies constrained by [uv](https://docs.astral.sh/uv/)'s lockfile.
49
50
 
50
51
  ## Usage
51
52
 
@@ -85,6 +86,8 @@ Within, your `noxfile.py`:
85
86
  dependencies.
86
87
  - `uv sync` is used to install dependencies so that their versions are constrained by
87
88
  `uv.lock`.
89
+ - By default (configurable with the `uv_sync_locked` parameter), `uv.lock` is also
90
+ validated to be up to date.
88
91
 
89
92
  ```py
90
93
  from nox import Session, options
@@ -107,7 +110,7 @@ def type_check(s: Session) -> None:
107
110
 
108
111
 
109
112
  @session(uv_only_groups=["lint"])
110
- def type_check(s: Session) -> None:
113
+ def lint(s: Session) -> None:
111
114
  s.run("ruff", "check", ".")
112
115
  s.run("ruff", "format", "--check", ".")
113
116
  ```
@@ -124,10 +127,11 @@ def type_check(s: Session) -> None:
124
127
  - `uv_groups`: list of `uv` _dependency-groups_
125
128
  - `uv_extras`: list of `uv` _optional-dependencies_
126
129
  - `uv_only_groups`: list of `uv` _only-groups_ to include. Prevents installation of project
127
- _dependencies_.
130
+ _dependencies_
128
131
  - `uv_all_extras`: boolean to install all _optional-dependencies_ from `pyproject.toml`
129
132
  - `uv_all_groups`: boolean to install all _dependency-groups_
130
- - `uv_sync_locked`: boolean to validate that `uv.lock` is up-to-date
133
+ - `uv_no_install_project`: boolean to not install the current project
134
+ - `uv_sync_locked`: boolean to validate that `uv.lock` is up to date
131
135
 
132
136
 
133
137
  ## 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
 
@@ -57,6 +57,8 @@ Within, your `noxfile.py`:
57
57
  dependencies.
58
58
  - `uv sync` is used to install dependencies so that their versions are constrained by
59
59
  `uv.lock`.
60
+ - By default (configurable with the `uv_sync_locked` parameter), `uv.lock` is also
61
+ validated to be up to date.
60
62
 
61
63
  ```py
62
64
  from nox import Session, options
@@ -79,7 +81,7 @@ def type_check(s: Session) -> None:
79
81
 
80
82
 
81
83
  @session(uv_only_groups=["lint"])
82
- def type_check(s: Session) -> None:
84
+ def lint(s: Session) -> None:
83
85
  s.run("ruff", "check", ".")
84
86
  s.run("ruff", "format", "--check", ".")
85
87
  ```
@@ -96,10 +98,11 @@ def type_check(s: Session) -> None:
96
98
  - `uv_groups`: list of `uv` _dependency-groups_
97
99
  - `uv_extras`: list of `uv` _optional-dependencies_
98
100
  - `uv_only_groups`: list of `uv` _only-groups_ to include. Prevents installation of project
99
- _dependencies_.
101
+ _dependencies_
100
102
  - `uv_all_extras`: boolean to install all _optional-dependencies_ from `pyproject.toml`
101
103
  - `uv_all_groups`: boolean to install all _dependency-groups_
102
- - `uv_sync_locked`: boolean to validate that `uv.lock` is up-to-date
104
+ - `uv_no_install_project`: boolean to not install the current project
105
+ - `uv_sync_locked`: boolean to validate that `uv.lock` is up to date
103
106
 
104
107
 
105
108
  ## Inspiration
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "nox-uv"
3
- version = "0.5.0"
3
+ version = "0.6.1"
4
4
  description = "Facilitate nox integration with uv for Python projects"
5
5
  keywords = ["nox", "uv"]
6
6
  readme = "README.md"
@@ -36,17 +36,15 @@ Repository = "https://github.com/dantebben/nox-uv"
36
36
  Issues = "https://github.com/dantebben/nox-uv/issues"
37
37
 
38
38
  [build-system]
39
- requires = ["hatchling"]
40
- build-backend = "hatchling.build"
39
+ requires = ["uv_build>=0.7.19,<0.8.0"]
40
+ build-backend = "uv_build"
41
41
 
42
42
  [dependency-groups]
43
43
  lint = [
44
44
  "ruff>=0.9.7",
45
45
  ]
46
46
  test = [
47
- # TODO: Remove this upper bound with pytest-cov fixes issues with filterwarnings = ["error"]
48
- # https://github.com/pytest-dev/pytest-cov/issues/693
49
- "pytest<8.4.0",
47
+ "pytest>=8.4.0",
50
48
  "pytest-cov>=6.0.0",
51
49
  ]
52
50
  type_check = [
@@ -59,9 +57,7 @@ default-groups = "all"
59
57
  [tool.mypy]
60
58
  ignore_missing_imports = true
61
59
  strict = true
62
- # TODO: Remove this when explicit-override is enabled by default in strict mode
63
- # https://github.com/python/mypy/issues/17511
64
- enable_error_code = ["explicit-override"]
60
+ enable_error_code = ["deprecated", "explicit-override"]
65
61
 
66
62
 
67
63
  [tool.ruff]
@@ -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
  )
@@ -1,7 +0,0 @@
1
- # For information about this file, see: https://editorconfig.org/
2
- root = true
3
-
4
- # For ease of fitting multiple editor panes side by side consistently, set all files types to use
5
- # the same relaxed max line length permitted in PEP 8.
6
- [*]
7
- max_line_length = 99
@@ -1,48 +0,0 @@
1
- name: CI
2
-
3
- on: [push, pull_request]
4
-
5
- env:
6
- UV_VERSION: "0.7.12"
7
-
8
- jobs:
9
- test:
10
- runs-on: ubuntu-24.04
11
- strategy:
12
- matrix:
13
- python-version: ["3.9", "3.10", "3.11", "3.12", "3.13" ]
14
- steps:
15
- - uses: actions/checkout@v4
16
- - name: Install uv
17
- uses: astral-sh/setup-uv@v5
18
- with:
19
- version: ${{ env.UV_VERSION }}
20
- - name: Set up Python ${{ matrix.python-version }}
21
- uses: actions/setup-python@v5
22
- with:
23
- python-version: ${{ matrix.python-version }}
24
- - name: Install Package
25
- run: uv sync --locked --no-default-groups
26
- - name: Test with Nox
27
- run: uv run nox -s test-${{ matrix.python-version }}
28
- quality:
29
- runs-on: ubuntu-24.04
30
- strategy:
31
- matrix:
32
- nox-session: ["lint", "type_check"]
33
- steps:
34
- - uses: actions/checkout@v4
35
- - name: Install uv
36
- uses: astral-sh/setup-uv@v5
37
- with:
38
- version: ${{ env.UV_VERSION }}
39
- - name: Set up Python
40
- uses: actions/setup-python@v5
41
- with:
42
- python-version-file: ".python-version"
43
- - name: Install dependencies
44
- run: uv sync --locked --no-default-groups
45
- - name: Test with Nox
46
- run: uv run nox -s ${{ matrix.nox-session }}
47
-
48
-
nox_uv-0.5.0/.gitignore DELETED
@@ -1,12 +0,0 @@
1
- .vscode
2
- .idea
3
- .mypy_cache
4
- .nox
5
- .pytest_cache
6
- dist
7
- htmlcov
8
- __pycache__
9
- *.pyc
10
- *.egg-info
11
- .coverage
12
- .coverage.*
@@ -1 +0,0 @@
1
- 3.12
nox_uv-0.5.0/noxfile.py DELETED
@@ -1,72 +0,0 @@
1
- from nox import Session, options, parametrize
2
-
3
- from nox_uv import session
4
-
5
- options.error_on_external_run = True
6
- options.default_venv_backend = "uv"
7
- options.sessions = ["lint", "type_check", "test"]
8
-
9
-
10
- @session(
11
- python=["3.9", "3.10", "3.11", "3.12", "3.13"],
12
- uv_groups=["test"],
13
- )
14
- def test(s: Session) -> None:
15
- s.run(
16
- "python",
17
- "-m",
18
- "pytest",
19
- "--cov=nox_uv",
20
- "--cov-branch",
21
- "--cov-report=html",
22
- "--cov-report=term",
23
- "--cov-fail-under=100",
24
- "tests",
25
- *s.posargs,
26
- )
27
-
28
-
29
- @session(uv_only_groups=["lint"])
30
- @parametrize(
31
- "command",
32
- [
33
- # During formatting, additionally sort imports and remove unused imports.
34
- [
35
- "ruff",
36
- "check",
37
- ".",
38
- "--select",
39
- "I",
40
- "--select",
41
- "F401",
42
- "--extend-fixable",
43
- "F401",
44
- "--fix",
45
- ],
46
- ["ruff", "format", "."],
47
- ],
48
- )
49
- def fmt(s: Session, command: list[str]) -> None:
50
- s.run(*command)
51
-
52
-
53
- @session(uv_only_groups=["lint"])
54
- @parametrize(
55
- "command",
56
- [
57
- ["ruff", "check", "."],
58
- ["ruff", "format", "--check", "."],
59
- ],
60
- )
61
- def lint(s: Session, command: list[str]) -> None:
62
- s.run(*command)
63
-
64
-
65
- @session(uv_only_groups=["lint"])
66
- def lint_fix(s: Session) -> None:
67
- s.run("ruff", "check", ".", "--extend-fixable", "F401", "--fix")
68
-
69
-
70
- @session(uv_groups=["test", "type_check"])
71
- def type_check(s: Session) -> None:
72
- s.run("mypy", "src", "tests", "noxfile.py")
File without changes
@@ -1 +0,0 @@
1
- 3.12
File without changes
@@ -1,6 +0,0 @@
1
- def main() -> None:
2
- print("Hello from subproject!")
3
-
4
-
5
- if __name__ == "__main__":
6
- main()
@@ -1,97 +0,0 @@
1
- from nox import Session, options
2
-
3
- from nox_uv import session
4
-
5
- options.default_venv_backend = "uv"
6
- options.sessions = [
7
- "check_python_version",
8
- "install_nothing",
9
- "test_group",
10
- "all_groups",
11
- "all_extras",
12
- "one_extra",
13
- "correct_python",
14
- "only_groups",
15
- ]
16
-
17
-
18
- @session(venv_backend="none")
19
- def check_python_version(s: Session) -> None:
20
- s.run("python", "--version")
21
-
22
-
23
- @session
24
- def install_nothing(s: Session) -> None:
25
- r = s.run("uv", "pip", "list", silent=True)
26
- assert isinstance(r, str)
27
- assert "nox-uv" in r
28
- assert "scapy" not in r
29
- assert "pyyaml" not in r
30
- assert "networkx" not in r
31
- assert "ruff" not in r
32
- assert "pytest-cov" not in r
33
- assert "mypy" not in r
34
-
35
-
36
- @session(uv_groups=["test"])
37
- def test_group(s: Session) -> None:
38
- r = s.run("uv", "pip", "list", silent=True)
39
- assert isinstance(r, str)
40
- assert "pytest-cov" in r
41
- assert "networkx" not in r
42
- assert "ruff" not in r
43
-
44
-
45
- @session(uv_all_groups=True)
46
- def all_groups(s: Session) -> None:
47
- r = s.run("uv", "pip", "list", silent=True)
48
- assert isinstance(r, str)
49
- assert "networkx" in r
50
- assert "ruff" in r
51
- assert "pytest-cov" in r
52
- assert "mypy" in r
53
-
54
-
55
- @session(uv_all_extras=True)
56
- def all_extras(s: Session) -> None:
57
- r = s.run("uv", "pip", "list", silent=True)
58
- assert isinstance(r, str)
59
- assert "networkx" not in r
60
- assert "scapy" in r
61
- assert "pyyaml" in r
62
-
63
-
64
- @session(uv_extras=["pyyaml"], uv_sync_locked=False) # Test without the --locked flag
65
- def one_extra(s: Session) -> None:
66
- r = s.run("uv", "pip", "list", silent=True)
67
- assert isinstance(r, str)
68
- assert "networkx" not in r
69
- assert "pyyaml" in r
70
-
71
-
72
- @session(python=["3.10"])
73
- def correct_python(s: Session) -> None:
74
- assert s.python == "3.10"
75
- v = s.run("python", "--version", silent=True)
76
- if isinstance(v, str):
77
- assert "Python 3.10" in v
78
- else:
79
- raise RuntimeError("Python version was not returned.")
80
-
81
-
82
- @session(uv_only_groups=["lint"])
83
- def only_groups(s: Session) -> None:
84
- r = s.run("uv", "pip", "list", silent=True)
85
- assert isinstance(r, str)
86
- assert "ruff" in r
87
- assert "nox-uv" not in r
88
-
89
-
90
- @session(uv_groups=["type_check"], venv_backend="virtualenv")
91
- def failed_virtualenv(s: Session) -> None:
92
- pass
93
-
94
-
95
- @session(uv_groups=["type_check"], venv_backend="none")
96
- def failed_venv_none(s: Session) -> None:
97
- pass
@@ -1,41 +0,0 @@
1
- [project]
2
- name = "subproject"
3
- version = "0.1.0"
4
- description = "Project for testing nox-uv"
5
- readme = "README.md"
6
- requires-python = ">=3.9"
7
- classifiers = [
8
- "Private: Do Not Upload",
9
- ]
10
- dependencies = [
11
- "nox-uv",
12
- ]
13
-
14
- [tool.uv.sources]
15
- nox-uv = { path = "../../", editable = true }
16
-
17
- [project.optional-dependencies]
18
- pyyaml = ["pyyaml"]
19
- scapy = ["scapy"]
20
-
21
- [dependency-groups]
22
- never-used = [
23
- "networkx"
24
- ]
25
-
26
- lint = [
27
- "ruff>=0.9.7",
28
- ]
29
- test = [
30
- "pytest-cov>=6.0.0",
31
- ]
32
- type_check = [
33
- "mypy>=1.15.0",
34
- ]
35
-
36
- [tool.uv]
37
- default-groups = [
38
- "lint",
39
- "test",
40
- "type_check",
41
- ]