nox-uv 0.2.2__tar.gz → 0.3.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.
- {nox_uv-0.2.2 → nox_uv-0.3.0}/.github/workflows/ci.yml +1 -1
- nox_uv-0.3.0/PKG-INFO +50 -0
- {nox_uv-0.2.2 → nox_uv-0.3.0}/README.md +10 -7
- {nox_uv-0.2.2 → nox_uv-0.3.0}/noxfile.py +2 -3
- {nox_uv-0.2.2 → nox_uv-0.3.0}/pyproject.toml +20 -20
- {nox_uv-0.2.2 → nox_uv-0.3.0}/src/nox_uv/__init__.py +2 -2
- nox_uv-0.3.0/tests/subproject/.python-version +1 -0
- nox_uv-0.3.0/tests/subproject/README.md +0 -0
- nox_uv-0.3.0/tests/subproject/main.py +6 -0
- nox_uv-0.3.0/tests/subproject/noxfile.py +80 -0
- nox_uv-0.3.0/tests/subproject/pyproject.toml +41 -0
- nox_uv-0.3.0/tests/subproject/uv.lock +532 -0
- nox_uv-0.3.0/tests/test_lib.py +16 -0
- nox_uv-0.3.0/uv.lock +412 -0
- nox_uv-0.2.2/PKG-INFO +0 -38
- nox_uv-0.2.2/tests/subnoxfile.py +0 -55
- nox_uv-0.2.2/tests/test_lib.py +0 -13
- nox_uv-0.2.2/uv.lock +0 -708
- {nox_uv-0.2.2 → nox_uv-0.3.0}/.editorconfig +0 -0
- {nox_uv-0.2.2 → nox_uv-0.3.0}/.gitignore +0 -0
- {nox_uv-0.2.2 → nox_uv-0.3.0}/.python-version +0 -0
- {nox_uv-0.2.2 → nox_uv-0.3.0}/LICENSE.txt +0 -0
- {nox_uv-0.2.2 → nox_uv-0.3.0}/src/nox_uv/py.typed +0 -0
- {nox_uv-0.2.2 → nox_uv-0.3.0}/tests/__init__.py +0 -0
nox_uv-0.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nox-uv
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Facilitate nox integration with uv for Python projects
|
|
5
|
+
Project-URL: Homepage, https://github.com/dantebben/nox-uv
|
|
6
|
+
Author-email: Dan Tebben <dantebben@gmail.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE.txt
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Software Development :: Testing
|
|
21
|
+
Classifier: Typing :: Typed
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Requires-Dist: nox>=2025.05.01
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
## Intro
|
|
27
|
+
|
|
28
|
+
This is a basic drop-in replacement for `nox.session` of [nox](https://nox.thea.codes/) to be used
|
|
29
|
+
with the [uv](https://docs.astral.sh/uv/) package manager.
|
|
30
|
+
|
|
31
|
+
To use, import `session` from `nox_uv` in your `noxfile.py`.
|
|
32
|
+
|
|
33
|
+
> [!NOTE]
|
|
34
|
+
> All `@session(...)` parameters are keywords only, no positional parameters are allowed.
|
|
35
|
+
|
|
36
|
+
> [!NOTE]
|
|
37
|
+
> The `default_groups` defined in `pyproject.toml` are _not_ installed by default. The
|
|
38
|
+
> user must explicitly list the desired groups in the `uv_groups` parameter.
|
|
39
|
+
|
|
40
|
+
## Added parameters
|
|
41
|
+
|
|
42
|
+
- `uv_groups`: list of `uv` dependency groups
|
|
43
|
+
- `uv_extras`: list of `uv` extras
|
|
44
|
+
- `uv_all_extras`: boolean to install all extras from `pyproject.toml`
|
|
45
|
+
- `uv_all_groups`: boolean to install all dependency groups
|
|
46
|
+
|
|
47
|
+
## Inspiration
|
|
48
|
+
|
|
49
|
+
This is heavily influenced by, but much more limited than,
|
|
50
|
+
[nox-poetry](https://nox-poetry.readthedocs.io).
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
## Intro
|
|
2
2
|
|
|
3
|
-
This is heavliy influcenced by, but much more limited than,
|
|
4
|
-
[nox-poetry](https://nox-poetry.readthedocs.io).
|
|
5
|
-
|
|
6
3
|
This is a basic drop-in replacement for `nox.session` of [nox](https://nox.thea.codes/) to be used
|
|
7
4
|
with the [uv](https://docs.astral.sh/uv/) package manager.
|
|
8
5
|
|
|
9
|
-
To use, import `session` from `
|
|
6
|
+
To use, import `session` from `nox_uv` in your `noxfile.py`.
|
|
10
7
|
|
|
11
|
-
|
|
8
|
+
> [!NOTE]
|
|
9
|
+
> All `@session(...)` parameters are keywords only, no positional parameters are allowed.
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
> [!NOTE]
|
|
12
|
+
> The `default_groups` defined in `pyproject.toml` are _not_ installed by default. The
|
|
13
|
+
> user must explicitly list the desired groups in the `uv_groups` parameter.
|
|
15
14
|
|
|
16
15
|
## Added parameters
|
|
17
16
|
|
|
@@ -20,3 +19,7 @@ user must explicitly list the desired groups in the `uv_groups` parameter.
|
|
|
20
19
|
- `uv_all_extras`: boolean to install all extras from `pyproject.toml`
|
|
21
20
|
- `uv_all_groups`: boolean to install all dependency groups
|
|
22
21
|
|
|
22
|
+
## Inspiration
|
|
23
|
+
|
|
24
|
+
This is heavily influenced by, but much more limited than,
|
|
25
|
+
[nox-poetry](https://nox-poetry.readthedocs.io).
|
|
@@ -3,7 +3,7 @@ from nox import Session, options, parametrize
|
|
|
3
3
|
from nox_uv import session
|
|
4
4
|
|
|
5
5
|
options.error_on_external_run = True
|
|
6
|
-
options.reuse_existing_virtualenvs =
|
|
6
|
+
options.reuse_existing_virtualenvs = False
|
|
7
7
|
options.default_venv_backend = "uv"
|
|
8
8
|
options.sessions = ["uv_lock_check", "lint", "type_check", "test"]
|
|
9
9
|
|
|
@@ -14,8 +14,7 @@ def uv_lock_check(s: Session) -> None:
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
@session(
|
|
17
|
-
|
|
18
|
-
python=["3.10", "3.11", "3.12", "3.13"],
|
|
17
|
+
python=["3.9", "3.10", "3.11", "3.12", "3.13"],
|
|
19
18
|
uv_groups=["test"],
|
|
20
19
|
)
|
|
21
20
|
def test(s: Session) -> None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "nox-uv"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.3.0"
|
|
4
4
|
description = "Facilitate nox integration with uv for Python projects"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
@@ -8,16 +8,26 @@ authors = [
|
|
|
8
8
|
]
|
|
9
9
|
license = "MIT"
|
|
10
10
|
license-files = ["LICENSE.txt"]
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
11
|
+
classifiers = [
|
|
12
|
+
"Development Status :: 4 - Beta",
|
|
13
|
+
"Intended Audience :: Developers",
|
|
14
|
+
"License :: OSI Approved :: MIT License",
|
|
15
|
+
"Operating System :: OS Independent",
|
|
16
|
+
"Programming Language :: Python",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Programming Language :: Python :: 3.9",
|
|
19
|
+
"Programming Language :: Python :: 3.10",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python :: 3.12",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Topic :: Software Development :: Testing",
|
|
24
|
+
"Typing :: Typed",
|
|
14
25
|
]
|
|
15
26
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
27
|
+
requires-python = ">=3.9"
|
|
28
|
+
dependencies = [
|
|
29
|
+
"nox>=2025.05.01",
|
|
30
|
+
]
|
|
21
31
|
|
|
22
32
|
[project.urls]
|
|
23
33
|
Homepage = "https://github.com/dantebben/nox-uv"
|
|
@@ -37,18 +47,8 @@ type-check = [
|
|
|
37
47
|
"mypy>=1.15.0",
|
|
38
48
|
]
|
|
39
49
|
|
|
40
|
-
never-used = [
|
|
41
|
-
"networkx"
|
|
42
|
-
]
|
|
43
|
-
|
|
44
|
-
|
|
45
50
|
[tool.uv]
|
|
46
|
-
default-groups =
|
|
47
|
-
"lint",
|
|
48
|
-
"test",
|
|
49
|
-
"type-check",
|
|
50
|
-
]
|
|
51
|
-
|
|
51
|
+
default-groups = "all"
|
|
52
52
|
|
|
53
53
|
[tool.mypy]
|
|
54
54
|
ignore_missing_imports = true
|
|
@@ -2,13 +2,13 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from collections.abc import Callable, Sequence
|
|
4
4
|
import functools
|
|
5
|
-
from typing import Any, TypeVar
|
|
5
|
+
from typing import Any, TypeVar, Union
|
|
6
6
|
|
|
7
7
|
import nox
|
|
8
8
|
|
|
9
9
|
R = TypeVar("R")
|
|
10
10
|
|
|
11
|
-
Python = Sequence[str]
|
|
11
|
+
Python = Union[Sequence[str], str, bool]
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
def session(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
File without changes
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
from nox import Session, options
|
|
2
|
+
|
|
3
|
+
from nox_uv import session
|
|
4
|
+
|
|
5
|
+
options.default_venv_backend = "uv"
|
|
6
|
+
options.reuse_existing_virtualenvs = False
|
|
7
|
+
|
|
8
|
+
options.sessions = [
|
|
9
|
+
"check_python_version",
|
|
10
|
+
"install_nothing",
|
|
11
|
+
"only_test_group",
|
|
12
|
+
"all_groups",
|
|
13
|
+
"all_extras",
|
|
14
|
+
"only_one_extra",
|
|
15
|
+
"correct_python",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@session(venv_backend="none")
|
|
20
|
+
def check_python_version(s: Session) -> None:
|
|
21
|
+
s.run("python3", "--version")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@session
|
|
25
|
+
def install_nothing(s: Session) -> None:
|
|
26
|
+
r = s.run("uv", "pip", "list", silent=True)
|
|
27
|
+
assert isinstance(r, str)
|
|
28
|
+
assert "nox-uv" in r
|
|
29
|
+
assert "scapy" not in r
|
|
30
|
+
assert "pyyaml" not in r
|
|
31
|
+
assert "networkx" not in r
|
|
32
|
+
assert "ruff" not in r
|
|
33
|
+
assert "pytest-cov" not in r
|
|
34
|
+
assert "mypy" not in r
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@session(uv_groups=["test"])
|
|
38
|
+
def only_test_group(s: Session) -> None:
|
|
39
|
+
r = s.run("uv", "pip", "list", silent=True)
|
|
40
|
+
assert isinstance(r, str)
|
|
41
|
+
assert "pytest-cov" in r
|
|
42
|
+
assert "networkx" not in r
|
|
43
|
+
assert "ruff" not in r
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@session(uv_all_groups=True)
|
|
47
|
+
def all_groups(s: Session) -> None:
|
|
48
|
+
r = s.run("uv", "pip", "list", silent=True)
|
|
49
|
+
assert isinstance(r, str)
|
|
50
|
+
assert "networkx" in r
|
|
51
|
+
assert "ruff" in r
|
|
52
|
+
assert "pytest-cov" in r
|
|
53
|
+
assert "mypy" in r
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
@session(uv_all_extras=True)
|
|
57
|
+
def all_extras(s: Session) -> None:
|
|
58
|
+
r = s.run("uv", "pip", "list", silent=True)
|
|
59
|
+
assert isinstance(r, str)
|
|
60
|
+
assert "networkx" not in r
|
|
61
|
+
assert "scapy" in r
|
|
62
|
+
assert "pyyaml" in r
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
@session(uv_extras=["pyyaml"])
|
|
66
|
+
def only_one_extra(s: Session) -> None:
|
|
67
|
+
r = s.run("uv", "pip", "list", silent=True)
|
|
68
|
+
assert isinstance(r, str)
|
|
69
|
+
assert "networkx" not in r
|
|
70
|
+
assert "pyyaml" in r
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
@session(python=["3.10"])
|
|
74
|
+
def correct_python(s: Session) -> None:
|
|
75
|
+
assert s.python == "3.10"
|
|
76
|
+
v = s.run("python3", "--version", silent=True)
|
|
77
|
+
if isinstance(v, str):
|
|
78
|
+
assert "Python 3.10" in v
|
|
79
|
+
else:
|
|
80
|
+
raise RuntimeError("Python version was not returned.")
|
|
@@ -0,0 +1,41 @@
|
|
|
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 = "../../" }
|
|
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
|
+
]
|