nox-uv 0.3.0__tar.gz → 0.4.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.3.0 → nox_uv-0.4.0}/.github/workflows/ci.yml +1 -1
- nox_uv-0.4.0/PKG-INFO +136 -0
- nox_uv-0.4.0/README.md +108 -0
- {nox_uv-0.3.0 → nox_uv-0.4.0}/noxfile.py +2 -1
- {nox_uv-0.3.0 → nox_uv-0.4.0}/pyproject.toml +4 -5
- {nox_uv-0.3.0 → nox_uv-0.4.0}/src/nox_uv/__init__.py +27 -8
- {nox_uv-0.3.0 → nox_uv-0.4.0}/tests/subproject/noxfile.py +24 -5
- {nox_uv-0.3.0 → nox_uv-0.4.0}/tests/subproject/pyproject.toml +1 -1
- {nox_uv-0.3.0 → nox_uv-0.4.0}/tests/subproject/uv.lock +3 -3
- nox_uv-0.4.0/tests/test_lib.py +35 -0
- {nox_uv-0.3.0 → nox_uv-0.4.0}/uv.lock +35 -36
- nox_uv-0.3.0/PKG-INFO +0 -50
- nox_uv-0.3.0/README.md +0 -25
- nox_uv-0.3.0/tests/test_lib.py +0 -16
- {nox_uv-0.3.0 → nox_uv-0.4.0}/.editorconfig +0 -0
- {nox_uv-0.3.0 → nox_uv-0.4.0}/.gitignore +0 -0
- {nox_uv-0.3.0 → nox_uv-0.4.0}/.python-version +0 -0
- {nox_uv-0.3.0 → nox_uv-0.4.0}/LICENSE.txt +0 -0
- {nox_uv-0.3.0 → nox_uv-0.4.0}/src/nox_uv/py.typed +0 -0
- {nox_uv-0.3.0 → nox_uv-0.4.0}/tests/__init__.py +0 -0
- {nox_uv-0.3.0 → nox_uv-0.4.0}/tests/subproject/.python-version +0 -0
- {nox_uv-0.3.0 → nox_uv-0.4.0}/tests/subproject/README.md +0 -0
- {nox_uv-0.3.0 → nox_uv-0.4.0}/tests/subproject/main.py +0 -0
nox_uv-0.4.0/PKG-INFO
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nox-uv
|
|
3
|
+
Version: 0.4.0
|
|
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
|
|
8
|
+
Author-email: Dan Tebben <dantebben@gmail.com>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE.txt
|
|
11
|
+
Keywords: nox,uv
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Software Development :: Testing
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Python: >=3.9
|
|
26
|
+
Requires-Dist: nox>=2025.05.01
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
## Intro
|
|
30
|
+
|
|
31
|
+
[![GitHub Actions][github-actions-badge]](https://github.com/dantebben/nox-uv/actions)
|
|
32
|
+
[![PyPI version][pypi-version-badge]](https://pypi.python.org/pypi/nox-uv)
|
|
33
|
+
[![Python versions][python-versions-badge]](https://pypi.python.org/pypi/nox-uv)
|
|
34
|
+
[![uv][uv-badge]](https://github.com/astral-sh/uv)
|
|
35
|
+
[![Nox][nox-badge]](https://github.com/wntrblm/nox)
|
|
36
|
+
[![Ruff][ruff-badge]](https://github.com/astral-sh/ruff)
|
|
37
|
+
[![Type checked with mypy][mypy-badge]](https://mypy-lang.org/)
|
|
38
|
+
|
|
39
|
+
[github-actions-badge]: https://github.com/dantebben/nox-uv/workflows/CI/badge.svg
|
|
40
|
+
[pypi-version-badge]: https://img.shields.io/pypi/v/nox-uv.svg
|
|
41
|
+
[python-versions-badge]: https://img.shields.io/pypi/pyversions/nox-uv.svg
|
|
42
|
+
[uv-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json
|
|
43
|
+
[nox-badge]: https://img.shields.io/badge/%F0%9F%A6%8A-Nox-D85E00.svg
|
|
44
|
+
[ruff-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
|
|
45
|
+
[mypy-badge]: https://www.mypy-lang.org/static/mypy_badge.svg
|
|
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.
|
|
49
|
+
|
|
50
|
+
## Usage
|
|
51
|
+
|
|
52
|
+
Add `nox-uv` as a development dependency. The following example adds it into a `nox`
|
|
53
|
+
`dependency-group`.
|
|
54
|
+
|
|
55
|
+
```shell
|
|
56
|
+
uv add --group nox nox-uv
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Using the following configuration within `pyproject.toml` as an example:
|
|
60
|
+
|
|
61
|
+
```toml
|
|
62
|
+
[dependency-groups]
|
|
63
|
+
nox = [
|
|
64
|
+
"nox-uv",
|
|
65
|
+
]
|
|
66
|
+
test = [
|
|
67
|
+
"pytest",
|
|
68
|
+
"pytest-cov",
|
|
69
|
+
]
|
|
70
|
+
type_check = [
|
|
71
|
+
"mypy",
|
|
72
|
+
]
|
|
73
|
+
lint = [
|
|
74
|
+
"ruff",
|
|
75
|
+
]
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Within, your `noxfile.py`:
|
|
79
|
+
|
|
80
|
+
1. Import `session` from `nox_uv`.
|
|
81
|
+
2. Set `venv_backend` to `"uv"`. This can be done globally using
|
|
82
|
+
`options.default_venv_backend = "uv"`.
|
|
83
|
+
3. Use the new [`uv_*` parameters](#added-parameters) to `session` to control which dependencies
|
|
84
|
+
are synced into the session's virtual environment in addition to the project's main
|
|
85
|
+
dependencies.
|
|
86
|
+
- `uv sync` is used to install dependencies so that their versions are constrained by
|
|
87
|
+
`uv.lock`.
|
|
88
|
+
|
|
89
|
+
```py
|
|
90
|
+
from nox import Session, options
|
|
91
|
+
from nox_uv import session
|
|
92
|
+
|
|
93
|
+
options.default_venv_backend = "uv"
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
@session(
|
|
97
|
+
python=["3.10", "3.11", "3.12", "3.13"],
|
|
98
|
+
uv_groups=["test"],
|
|
99
|
+
)
|
|
100
|
+
def test(s: Session) -> None:
|
|
101
|
+
s.run("python", "-m", "pytest")
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
@session(uv_groups=["type_check"])
|
|
105
|
+
def type_check(s: Session) -> None:
|
|
106
|
+
s.run("mypy", "src")
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
@session(uv_only_groups=["lint"])
|
|
110
|
+
def type_check(s: Session) -> None:
|
|
111
|
+
s.run("ruff", "check", ".")
|
|
112
|
+
s.run("ruff", "format", "--check", ".")
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
> [!NOTE]
|
|
116
|
+
> All `@session(...)` parameters are keywords only, no positional parameters are allowed.
|
|
117
|
+
|
|
118
|
+
> [!NOTE]
|
|
119
|
+
> The `default_groups` defined in `pyproject.toml` are _not_ installed by default. The
|
|
120
|
+
> user must explicitly list the desired groups in the `uv_groups` parameter.
|
|
121
|
+
|
|
122
|
+
### Added parameters
|
|
123
|
+
|
|
124
|
+
- `uv_groups`: list of `uv` _dependency-groups_
|
|
125
|
+
- `uv_extras`: list of `uv` _optional-dependencies_
|
|
126
|
+
- `uv_only_groups`: list of `uv` _only-groups_ to include. Prevents installation of project
|
|
127
|
+
_dependencies_.
|
|
128
|
+
- `uv_all_extras`: boolean to install all _optional-dependencies_ from `pyproject.toml`
|
|
129
|
+
- `uv_all_groups`: boolean to install all _dependency-groups_
|
|
130
|
+
- `uv_sync_locked`: boolean to validate that `uv.lock` is up-to-date
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
## Inspiration
|
|
134
|
+
|
|
135
|
+
This is heavily influenced by, but much more limited than,
|
|
136
|
+
[nox-poetry](https://nox-poetry.readthedocs.io).
|
nox_uv-0.4.0/README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
## Intro
|
|
2
|
+
|
|
3
|
+
[![GitHub Actions][github-actions-badge]](https://github.com/dantebben/nox-uv/actions)
|
|
4
|
+
[![PyPI version][pypi-version-badge]](https://pypi.python.org/pypi/nox-uv)
|
|
5
|
+
[![Python versions][python-versions-badge]](https://pypi.python.org/pypi/nox-uv)
|
|
6
|
+
[![uv][uv-badge]](https://github.com/astral-sh/uv)
|
|
7
|
+
[![Nox][nox-badge]](https://github.com/wntrblm/nox)
|
|
8
|
+
[![Ruff][ruff-badge]](https://github.com/astral-sh/ruff)
|
|
9
|
+
[![Type checked with mypy][mypy-badge]](https://mypy-lang.org/)
|
|
10
|
+
|
|
11
|
+
[github-actions-badge]: https://github.com/dantebben/nox-uv/workflows/CI/badge.svg
|
|
12
|
+
[pypi-version-badge]: https://img.shields.io/pypi/v/nox-uv.svg
|
|
13
|
+
[python-versions-badge]: https://img.shields.io/pypi/pyversions/nox-uv.svg
|
|
14
|
+
[uv-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json
|
|
15
|
+
[nox-badge]: https://img.shields.io/badge/%F0%9F%A6%8A-Nox-D85E00.svg
|
|
16
|
+
[ruff-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
|
|
17
|
+
[mypy-badge]: https://www.mypy-lang.org/static/mypy_badge.svg
|
|
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.
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
Add `nox-uv` as a development dependency. The following example adds it into a `nox`
|
|
25
|
+
`dependency-group`.
|
|
26
|
+
|
|
27
|
+
```shell
|
|
28
|
+
uv add --group nox nox-uv
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Using the following configuration within `pyproject.toml` as an example:
|
|
32
|
+
|
|
33
|
+
```toml
|
|
34
|
+
[dependency-groups]
|
|
35
|
+
nox = [
|
|
36
|
+
"nox-uv",
|
|
37
|
+
]
|
|
38
|
+
test = [
|
|
39
|
+
"pytest",
|
|
40
|
+
"pytest-cov",
|
|
41
|
+
]
|
|
42
|
+
type_check = [
|
|
43
|
+
"mypy",
|
|
44
|
+
]
|
|
45
|
+
lint = [
|
|
46
|
+
"ruff",
|
|
47
|
+
]
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Within, your `noxfile.py`:
|
|
51
|
+
|
|
52
|
+
1. Import `session` from `nox_uv`.
|
|
53
|
+
2. Set `venv_backend` to `"uv"`. This can be done globally using
|
|
54
|
+
`options.default_venv_backend = "uv"`.
|
|
55
|
+
3. Use the new [`uv_*` parameters](#added-parameters) to `session` to control which dependencies
|
|
56
|
+
are synced into the session's virtual environment in addition to the project's main
|
|
57
|
+
dependencies.
|
|
58
|
+
- `uv sync` is used to install dependencies so that their versions are constrained by
|
|
59
|
+
`uv.lock`.
|
|
60
|
+
|
|
61
|
+
```py
|
|
62
|
+
from nox import Session, options
|
|
63
|
+
from nox_uv import session
|
|
64
|
+
|
|
65
|
+
options.default_venv_backend = "uv"
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
@session(
|
|
69
|
+
python=["3.10", "3.11", "3.12", "3.13"],
|
|
70
|
+
uv_groups=["test"],
|
|
71
|
+
)
|
|
72
|
+
def test(s: Session) -> None:
|
|
73
|
+
s.run("python", "-m", "pytest")
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
@session(uv_groups=["type_check"])
|
|
77
|
+
def type_check(s: Session) -> None:
|
|
78
|
+
s.run("mypy", "src")
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
@session(uv_only_groups=["lint"])
|
|
82
|
+
def type_check(s: Session) -> None:
|
|
83
|
+
s.run("ruff", "check", ".")
|
|
84
|
+
s.run("ruff", "format", "--check", ".")
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
> [!NOTE]
|
|
88
|
+
> All `@session(...)` parameters are keywords only, no positional parameters are allowed.
|
|
89
|
+
|
|
90
|
+
> [!NOTE]
|
|
91
|
+
> The `default_groups` defined in `pyproject.toml` are _not_ installed by default. The
|
|
92
|
+
> user must explicitly list the desired groups in the `uv_groups` parameter.
|
|
93
|
+
|
|
94
|
+
### Added parameters
|
|
95
|
+
|
|
96
|
+
- `uv_groups`: list of `uv` _dependency-groups_
|
|
97
|
+
- `uv_extras`: list of `uv` _optional-dependencies_
|
|
98
|
+
- `uv_only_groups`: list of `uv` _only-groups_ to include. Prevents installation of project
|
|
99
|
+
_dependencies_.
|
|
100
|
+
- `uv_all_extras`: boolean to install all _optional-dependencies_ from `pyproject.toml`
|
|
101
|
+
- `uv_all_groups`: boolean to install all _dependency-groups_
|
|
102
|
+
- `uv_sync_locked`: boolean to validate that `uv.lock` is up-to-date
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
## Inspiration
|
|
106
|
+
|
|
107
|
+
This is heavily influenced by, but much more limited than,
|
|
108
|
+
[nox-poetry](https://nox-poetry.readthedocs.io).
|
|
@@ -3,7 +3,6 @@ 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 = False
|
|
7
6
|
options.default_venv_backend = "uv"
|
|
8
7
|
options.sessions = ["uv_lock_check", "lint", "type_check", "test"]
|
|
9
8
|
|
|
@@ -23,8 +22,10 @@ def test(s: Session) -> None:
|
|
|
23
22
|
"-m",
|
|
24
23
|
"pytest",
|
|
25
24
|
"--cov=nox_uv",
|
|
25
|
+
"--cov-branch",
|
|
26
26
|
"--cov-report=html",
|
|
27
27
|
"--cov-report=term",
|
|
28
|
+
"--cov-fail-under=100",
|
|
28
29
|
"tests",
|
|
29
30
|
*s.posargs,
|
|
30
31
|
)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "nox-uv"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.4.0"
|
|
4
4
|
description = "Facilitate nox integration with uv for Python projects"
|
|
5
|
+
keywords = ["nox", "uv"]
|
|
5
6
|
readme = "README.md"
|
|
6
7
|
authors = [
|
|
7
8
|
{ name = "Dan Tebben", email = "dantebben@gmail.com" }
|
|
@@ -31,6 +32,8 @@ dependencies = [
|
|
|
31
32
|
|
|
32
33
|
[project.urls]
|
|
33
34
|
Homepage = "https://github.com/dantebben/nox-uv"
|
|
35
|
+
Repository = "https://github.com/dantebben/nox-uv"
|
|
36
|
+
Issues = "https://github.com/dantebben/nox-uv/issues"
|
|
34
37
|
|
|
35
38
|
[build-system]
|
|
36
39
|
requires = ["hatchling"]
|
|
@@ -98,9 +101,6 @@ split-on-trailing-comma = false
|
|
|
98
101
|
[tool.ruff.lint.flake8-tidy-imports]
|
|
99
102
|
ban-relative-imports = "all"
|
|
100
103
|
|
|
101
|
-
[tool.ruff.lint.flake8-bugbear]
|
|
102
|
-
extend-immutable-calls = ["typer.Argument"]
|
|
103
|
-
|
|
104
104
|
[tool.pytest.ini_options]
|
|
105
105
|
addopts = [
|
|
106
106
|
"--strict-config",
|
|
@@ -114,4 +114,3 @@ parallel = true
|
|
|
114
114
|
# The nox session that calls coverage does not find "src/nox_uv", but it is found in the
|
|
115
115
|
# subprocess. Coverage generates a warning that the module was not found, but coverage is actually
|
|
116
116
|
# run and determined in the "parallel" subprocess.
|
|
117
|
-
disable_warnings = ["module-not-imported", "no-data-collected"]
|
|
@@ -16,15 +16,17 @@ def session(
|
|
|
16
16
|
python: Python | None = None,
|
|
17
17
|
reuse_venv: bool | None = None,
|
|
18
18
|
name: str | None = None,
|
|
19
|
-
venv_backend:
|
|
19
|
+
venv_backend: str | None = None,
|
|
20
20
|
venv_params: Sequence[str] = (),
|
|
21
21
|
tags: Sequence[str] | None = None,
|
|
22
22
|
default: bool = True,
|
|
23
23
|
requires: Sequence[str] | None = None,
|
|
24
24
|
uv_groups: Sequence[str] = (),
|
|
25
25
|
uv_extras: Sequence[str] = (),
|
|
26
|
+
uv_only_groups: Sequence[str] = (),
|
|
26
27
|
uv_all_extras: bool = False,
|
|
27
28
|
uv_all_groups: bool = False,
|
|
29
|
+
uv_sync_locked: bool = True,
|
|
28
30
|
**kwargs: dict[str, Any],
|
|
29
31
|
) -> Callable[..., Callable[..., R]]:
|
|
30
32
|
"""Drop-in replacement for the :func:`nox.session` decorator to add support for `uv`.
|
|
@@ -52,27 +54,37 @@ def session(
|
|
|
52
54
|
uv_extras=uv_extras,
|
|
53
55
|
uv_all_extras=uv_all_extras,
|
|
54
56
|
uv_all_groups=uv_all_groups,
|
|
57
|
+
uv_only_groups=uv_only_groups,
|
|
58
|
+
uv_sync_locked=uv_sync_locked,
|
|
55
59
|
**kwargs,
|
|
56
60
|
) # type: ignore
|
|
57
61
|
|
|
58
62
|
[function] = args
|
|
59
63
|
|
|
60
64
|
# Create the `uv sync` command
|
|
61
|
-
sync_cmd = ["uv", "sync", "--no-default-groups"
|
|
65
|
+
sync_cmd = ["uv", "sync", "--no-default-groups"]
|
|
66
|
+
extended_cmd: list[str] = []
|
|
67
|
+
|
|
68
|
+
# Add the --locked flag
|
|
69
|
+
if uv_sync_locked:
|
|
70
|
+
sync_cmd.append("--locked")
|
|
62
71
|
|
|
63
72
|
# Add the groups
|
|
64
|
-
for g in uv_groups
|
|
65
|
-
sync_cmd.append(f"--group={g}")
|
|
73
|
+
extended_cmd.extend([f"--group={g}" for g in uv_groups])
|
|
66
74
|
|
|
67
75
|
# Add the extras
|
|
68
|
-
for e in uv_extras
|
|
69
|
-
|
|
76
|
+
extended_cmd.extend([f"--extra={e}" for e in uv_extras])
|
|
77
|
+
|
|
78
|
+
# Add the only-groups
|
|
79
|
+
extended_cmd.extend([f"--only-group={g}" for g in uv_only_groups])
|
|
70
80
|
|
|
71
81
|
if uv_all_groups:
|
|
72
|
-
|
|
82
|
+
extended_cmd.append("--all-groups")
|
|
73
83
|
|
|
74
84
|
if uv_all_extras:
|
|
75
|
-
|
|
85
|
+
extended_cmd.append("--all-extras")
|
|
86
|
+
|
|
87
|
+
sync_cmd += extended_cmd
|
|
76
88
|
|
|
77
89
|
@functools.wraps(function)
|
|
78
90
|
def wrapper(s: nox.Session, *_args: Any, **_kwargs: Any) -> None:
|
|
@@ -87,6 +99,13 @@ def session(
|
|
|
87
99
|
s.env["UV_PYTHON"] = str(s.python)
|
|
88
100
|
|
|
89
101
|
s.run_install(*sync_cmd)
|
|
102
|
+
else:
|
|
103
|
+
if len(extended_cmd) > 0:
|
|
104
|
+
raise s.error(
|
|
105
|
+
'Using "uv" specific paramaters is not allowed outside of a "uv" '
|
|
106
|
+
"venv_backend.\n"
|
|
107
|
+
f"Check the venv_backend, or the {extended_cmd} parameters."
|
|
108
|
+
)
|
|
90
109
|
|
|
91
110
|
function(nox.Session(s._runner), *_args, **_kwargs)
|
|
92
111
|
|
|
@@ -8,11 +8,12 @@ options.reuse_existing_virtualenvs = False
|
|
|
8
8
|
options.sessions = [
|
|
9
9
|
"check_python_version",
|
|
10
10
|
"install_nothing",
|
|
11
|
-
"
|
|
11
|
+
"test_group",
|
|
12
12
|
"all_groups",
|
|
13
13
|
"all_extras",
|
|
14
|
-
"
|
|
14
|
+
"one_extra",
|
|
15
15
|
"correct_python",
|
|
16
|
+
"only_groups",
|
|
16
17
|
]
|
|
17
18
|
|
|
18
19
|
|
|
@@ -35,7 +36,7 @@ def install_nothing(s: Session) -> None:
|
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
@session(uv_groups=["test"])
|
|
38
|
-
def
|
|
39
|
+
def test_group(s: Session) -> None:
|
|
39
40
|
r = s.run("uv", "pip", "list", silent=True)
|
|
40
41
|
assert isinstance(r, str)
|
|
41
42
|
assert "pytest-cov" in r
|
|
@@ -62,8 +63,8 @@ def all_extras(s: Session) -> None:
|
|
|
62
63
|
assert "pyyaml" in r
|
|
63
64
|
|
|
64
65
|
|
|
65
|
-
@session(uv_extras=["pyyaml"])
|
|
66
|
-
def
|
|
66
|
+
@session(uv_extras=["pyyaml"], uv_sync_locked=False) # Test without the --locked flag
|
|
67
|
+
def one_extra(s: Session) -> None:
|
|
67
68
|
r = s.run("uv", "pip", "list", silent=True)
|
|
68
69
|
assert isinstance(r, str)
|
|
69
70
|
assert "networkx" not in r
|
|
@@ -78,3 +79,21 @@ def correct_python(s: Session) -> None:
|
|
|
78
79
|
assert "Python 3.10" in v
|
|
79
80
|
else:
|
|
80
81
|
raise RuntimeError("Python version was not returned.")
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
@session(uv_only_groups=["lint"])
|
|
85
|
+
def only_groups(s: Session) -> None:
|
|
86
|
+
r = s.run("uv", "pip", "list", silent=True)
|
|
87
|
+
assert isinstance(r, str)
|
|
88
|
+
assert "ruff" in r
|
|
89
|
+
assert "nox-uv" not in r
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
@session(uv_groups=["type-check"], venv_backend="virtualenv")
|
|
93
|
+
def failed_virtualenv(s: Session) -> None:
|
|
94
|
+
pass
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
@session(uv_groups=["type-check"], venv_backend="none")
|
|
98
|
+
def failed_venv_none(s: Session) -> None:
|
|
99
|
+
pass
|
|
@@ -266,8 +266,8 @@ wheels = [
|
|
|
266
266
|
|
|
267
267
|
[[package]]
|
|
268
268
|
name = "nox-uv"
|
|
269
|
-
version = "0.
|
|
270
|
-
source = {
|
|
269
|
+
version = "0.4.0"
|
|
270
|
+
source = { editable = "../../" }
|
|
271
271
|
dependencies = [
|
|
272
272
|
{ name = "nox" },
|
|
273
273
|
]
|
|
@@ -457,7 +457,7 @@ type-check = [
|
|
|
457
457
|
|
|
458
458
|
[package.metadata]
|
|
459
459
|
requires-dist = [
|
|
460
|
-
{ name = "nox-uv",
|
|
460
|
+
{ name = "nox-uv", editable = "../../" },
|
|
461
461
|
{ name = "pyyaml", marker = "extra == 'pyyaml'" },
|
|
462
462
|
{ name = "scapy", marker = "extra == 'scapy'" },
|
|
463
463
|
]
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
import subprocess
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def test_1() -> None:
|
|
7
|
+
assert 5 == 5
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def test_run_uv_nox() -> None:
|
|
11
|
+
cur_folder = Path.cwd()
|
|
12
|
+
testing_folder = Path(__file__).parent / "subproject"
|
|
13
|
+
os.chdir(testing_folder)
|
|
14
|
+
a = subprocess.run(["uv", "run", "python", "-m", "nox"])
|
|
15
|
+
assert a.returncode == 0
|
|
16
|
+
os.chdir(cur_folder)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def test_run_failed_uv_venv() -> None:
|
|
20
|
+
cur_folder = Path.cwd()
|
|
21
|
+
testing_folder = Path(__file__).parent / "subproject"
|
|
22
|
+
os.chdir(testing_folder)
|
|
23
|
+
a = subprocess.run(
|
|
24
|
+
["uv", "run", "python", "-m", "nox", "-s", "failed_virtualenv"], capture_output=True
|
|
25
|
+
)
|
|
26
|
+
assert a.returncode == 1 # This test is expected to fail with a `Session.error` raised.
|
|
27
|
+
assert "is not allowed" in a.stderr.decode()
|
|
28
|
+
|
|
29
|
+
a = subprocess.run(
|
|
30
|
+
["uv", "run", "python", "-m", "nox", "-s", "failed_venv_none"], capture_output=True
|
|
31
|
+
)
|
|
32
|
+
assert a.returncode == 1 # This test is expected to fail with a `Session.error` raised.
|
|
33
|
+
assert "is not allowed" in a.stderr.decode()
|
|
34
|
+
|
|
35
|
+
os.chdir(cur_folder)
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
version = 1
|
|
2
2
|
revision = 1
|
|
3
3
|
requires-python = ">=3.9"
|
|
4
|
-
resolution-markers = [
|
|
5
|
-
"python_full_version >= '3.10'",
|
|
6
|
-
"python_full_version < '3.10'",
|
|
7
|
-
]
|
|
8
4
|
|
|
9
5
|
[[package]]
|
|
10
6
|
name = "argcomplete"
|
|
@@ -122,15 +118,15 @@ toml = [
|
|
|
122
118
|
|
|
123
119
|
[[package]]
|
|
124
120
|
name = "dependency-groups"
|
|
125
|
-
version = "1.3.
|
|
121
|
+
version = "1.3.1"
|
|
126
122
|
source = { registry = "https://pypi.org/simple" }
|
|
127
123
|
dependencies = [
|
|
128
124
|
{ name = "packaging" },
|
|
129
125
|
{ name = "tomli", marker = "python_full_version < '3.11'" },
|
|
130
126
|
]
|
|
131
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
127
|
+
sdist = { url = "https://files.pythonhosted.org/packages/62/55/f054de99871e7beb81935dea8a10b90cd5ce42122b1c3081d5282fdb3621/dependency_groups-1.3.1.tar.gz", hash = "sha256:78078301090517fd938c19f64a53ce98c32834dfe0dee6b88004a569a6adfefd", size = 10093 }
|
|
132
128
|
wheels = [
|
|
133
|
-
{ url = "https://files.pythonhosted.org/packages/99/
|
|
129
|
+
{ url = "https://files.pythonhosted.org/packages/99/c7/d1ec24fb280caa5a79b6b950db565dab30210a66259d17d5bb2b3a9f878d/dependency_groups-1.3.1-py3-none-any.whl", hash = "sha256:51aeaa0dfad72430fcfb7bcdbefbd75f3792e5919563077f30bc0d73f4493030", size = 8664 },
|
|
134
130
|
]
|
|
135
131
|
|
|
136
132
|
[[package]]
|
|
@@ -144,11 +140,14 @@ wheels = [
|
|
|
144
140
|
|
|
145
141
|
[[package]]
|
|
146
142
|
name = "exceptiongroup"
|
|
147
|
-
version = "1.
|
|
143
|
+
version = "1.3.0"
|
|
148
144
|
source = { registry = "https://pypi.org/simple" }
|
|
149
|
-
|
|
145
|
+
dependencies = [
|
|
146
|
+
{ name = "typing-extensions", marker = "python_full_version < '3.13'" },
|
|
147
|
+
]
|
|
148
|
+
sdist = { url = "https://files.pythonhosted.org/packages/0b/9f/a65090624ecf468cdca03533906e7c69ed7588582240cfe7cc9e770b50eb/exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88", size = 29749 }
|
|
150
149
|
wheels = [
|
|
151
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
150
|
+
{ url = "https://files.pythonhosted.org/packages/36/f4/c6e662dade71f56cd2f3735141b265c3c79293c109549c1e6933b0651ffc/exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10", size = 16674 },
|
|
152
151
|
]
|
|
153
152
|
|
|
154
153
|
[[package]]
|
|
@@ -242,7 +241,7 @@ wheels = [
|
|
|
242
241
|
|
|
243
242
|
[[package]]
|
|
244
243
|
name = "nox-uv"
|
|
245
|
-
version = "0.
|
|
244
|
+
version = "0.4.0"
|
|
246
245
|
source = { editable = "." }
|
|
247
246
|
dependencies = [
|
|
248
247
|
{ name = "nox" },
|
|
@@ -278,11 +277,11 @@ wheels = [
|
|
|
278
277
|
|
|
279
278
|
[[package]]
|
|
280
279
|
name = "platformdirs"
|
|
281
|
-
version = "4.3.
|
|
280
|
+
version = "4.3.8"
|
|
282
281
|
source = { registry = "https://pypi.org/simple" }
|
|
283
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
282
|
+
sdist = { url = "https://files.pythonhosted.org/packages/fe/8b/3c73abc9c759ecd3f1f7ceff6685840859e8070c4d947c93fae71f6a0bf2/platformdirs-4.3.8.tar.gz", hash = "sha256:3d512d96e16bcb959a814c9f348431070822a6496326a4be0911c40b5a74c2bc", size = 21362 }
|
|
284
283
|
wheels = [
|
|
285
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
284
|
+
{ url = "https://files.pythonhosted.org/packages/fe/39/979e8e21520d4e47a0bbe349e2713c0aac6f3d853d0e5b34d76206c439aa/platformdirs-4.3.8-py3-none-any.whl", hash = "sha256:ff7059bb7eb1179e2685604f4aaf157cfd9535242bd23742eadc3c13542139b4", size = 18567 },
|
|
286
285
|
]
|
|
287
286
|
|
|
288
287
|
[[package]]
|
|
@@ -326,27 +325,27 @@ wheels = [
|
|
|
326
325
|
|
|
327
326
|
[[package]]
|
|
328
327
|
name = "ruff"
|
|
329
|
-
version = "0.11.
|
|
328
|
+
version = "0.11.9"
|
|
330
329
|
source = { registry = "https://pypi.org/simple" }
|
|
331
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
330
|
+
sdist = { url = "https://files.pythonhosted.org/packages/f5/e7/e55dda1c92cdcf34b677ebef17486669800de01e887b7831a1b8fdf5cb08/ruff-0.11.9.tar.gz", hash = "sha256:ebd58d4f67a00afb3a30bf7d383e52d0e036e6195143c6db7019604a05335517", size = 4132134 }
|
|
332
331
|
wheels = [
|
|
333
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
334
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
335
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
336
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
337
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
338
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
339
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
340
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
341
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
342
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
343
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
344
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
345
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
346
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
347
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
348
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
349
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
332
|
+
{ url = "https://files.pythonhosted.org/packages/fb/71/75dfb7194fe6502708e547941d41162574d1f579c4676a8eb645bf1a6842/ruff-0.11.9-py3-none-linux_armv6l.whl", hash = "sha256:a31a1d143a5e6f499d1fb480f8e1e780b4dfdd580f86e05e87b835d22c5c6f8c", size = 10335453 },
|
|
333
|
+
{ url = "https://files.pythonhosted.org/packages/74/fc/ad80c869b1732f53c4232bbf341f33c5075b2c0fb3e488983eb55964076a/ruff-0.11.9-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:66bc18ca783b97186a1f3100e91e492615767ae0a3be584e1266aa9051990722", size = 11072566 },
|
|
334
|
+
{ url = "https://files.pythonhosted.org/packages/87/0d/0ccececef8a0671dae155cbf7a1f90ea2dd1dba61405da60228bbe731d35/ruff-0.11.9-py3-none-macosx_11_0_arm64.whl", hash = "sha256:bd576cd06962825de8aece49f28707662ada6a1ff2db848d1348e12c580acbf1", size = 10435020 },
|
|
335
|
+
{ url = "https://files.pythonhosted.org/packages/52/01/e249e1da6ad722278094e183cbf22379a9bbe5f21a3e46cef24ccab76e22/ruff-0.11.9-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5b1d18b4be8182cc6fddf859ce432cc9631556e9f371ada52f3eaefc10d878de", size = 10593935 },
|
|
336
|
+
{ url = "https://files.pythonhosted.org/packages/ed/9a/40cf91f61e3003fe7bd43f1761882740e954506c5a0f9097b1cff861f04c/ruff-0.11.9-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0f3f46f759ac623e94824b1e5a687a0df5cd7f5b00718ff9c24f0a894a683be7", size = 10172971 },
|
|
337
|
+
{ url = "https://files.pythonhosted.org/packages/61/12/d395203de1e8717d7a2071b5a340422726d4736f44daf2290aad1085075f/ruff-0.11.9-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f34847eea11932d97b521450cf3e1d17863cfa5a94f21a056b93fb86f3f3dba2", size = 11748631 },
|
|
338
|
+
{ url = "https://files.pythonhosted.org/packages/66/d6/ef4d5eba77677eab511644c37c55a3bb8dcac1cdeb331123fe342c9a16c9/ruff-0.11.9-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:f33b15e00435773df97cddcd263578aa83af996b913721d86f47f4e0ee0ff271", size = 12409236 },
|
|
339
|
+
{ url = "https://files.pythonhosted.org/packages/c5/8f/5a2c5fc6124dd925a5faf90e1089ee9036462118b619068e5b65f8ea03df/ruff-0.11.9-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7b27613a683b086f2aca8996f63cb3dd7bc49e6eccf590563221f7b43ded3f65", size = 11881436 },
|
|
340
|
+
{ url = "https://files.pythonhosted.org/packages/39/d1/9683f469ae0b99b95ef99a56cfe8c8373c14eba26bd5c622150959ce9f64/ruff-0.11.9-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9e0d88756e63e8302e630cee3ce2ffb77859797cc84a830a24473939e6da3ca6", size = 13982759 },
|
|
341
|
+
{ url = "https://files.pythonhosted.org/packages/4e/0b/c53a664f06e0faab596397867c6320c3816df479e888fe3af63bc3f89699/ruff-0.11.9-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:537c82c9829d7811e3aa680205f94c81a2958a122ac391c0eb60336ace741a70", size = 11541985 },
|
|
342
|
+
{ url = "https://files.pythonhosted.org/packages/23/a0/156c4d7e685f6526a636a60986ee4a3c09c8c4e2a49b9a08c9913f46c139/ruff-0.11.9-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:440ac6a7029f3dee7d46ab7de6f54b19e34c2b090bb4f2480d0a2d635228f381", size = 10465775 },
|
|
343
|
+
{ url = "https://files.pythonhosted.org/packages/43/d5/88b9a6534d9d4952c355e38eabc343df812f168a2c811dbce7d681aeb404/ruff-0.11.9-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:71c539bac63d0788a30227ed4d43b81353c89437d355fdc52e0cda4ce5651787", size = 10170957 },
|
|
344
|
+
{ url = "https://files.pythonhosted.org/packages/f0/b8/2bd533bdaf469dc84b45815ab806784d561fab104d993a54e1852596d581/ruff-0.11.9-py3-none-musllinux_1_2_i686.whl", hash = "sha256:c67117bc82457e4501473c5f5217d49d9222a360794bfb63968e09e70f340abd", size = 11143307 },
|
|
345
|
+
{ url = "https://files.pythonhosted.org/packages/2f/d9/43cfba291788459b9bfd4e09a0479aa94d05ab5021d381a502d61a807ec1/ruff-0.11.9-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:e4b78454f97aa454586e8a5557facb40d683e74246c97372af3c2d76901d697b", size = 11603026 },
|
|
346
|
+
{ url = "https://files.pythonhosted.org/packages/22/e6/7ed70048e89b01d728ccc950557a17ecf8df4127b08a56944b9d0bae61bc/ruff-0.11.9-py3-none-win32.whl", hash = "sha256:7fe1bc950e7d7b42caaee2a8a3bc27410547cc032c9558ee2e0f6d3b209e845a", size = 10548627 },
|
|
347
|
+
{ url = "https://files.pythonhosted.org/packages/90/36/1da5d566271682ed10f436f732e5f75f926c17255c9c75cefb77d4bf8f10/ruff-0.11.9-py3-none-win_amd64.whl", hash = "sha256:52edaa4a6d70f8180343a5b7f030c7edd36ad180c9f4d224959c2d689962d964", size = 11634340 },
|
|
348
|
+
{ url = "https://files.pythonhosted.org/packages/40/f7/70aad26e5877c8f7ee5b161c4c9fa0100e63fc4c944dc6d97b9c7e871417/ruff-0.11.9-py3-none-win_arm64.whl", hash = "sha256:bcf42689c22f2e240f496d0c183ef2c6f7b35e809f12c1db58f75d9aa8d630ca", size = 10741080 },
|
|
350
349
|
]
|
|
351
350
|
|
|
352
351
|
[[package]]
|
|
@@ -399,14 +398,14 @@ wheels = [
|
|
|
399
398
|
|
|
400
399
|
[[package]]
|
|
401
400
|
name = "virtualenv"
|
|
402
|
-
version = "20.
|
|
401
|
+
version = "20.31.2"
|
|
403
402
|
source = { registry = "https://pypi.org/simple" }
|
|
404
403
|
dependencies = [
|
|
405
404
|
{ name = "distlib" },
|
|
406
405
|
{ name = "filelock" },
|
|
407
406
|
{ name = "platformdirs" },
|
|
408
407
|
]
|
|
409
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
408
|
+
sdist = { url = "https://files.pythonhosted.org/packages/56/2c/444f465fb2c65f40c3a104fd0c495184c4f2336d65baf398e3c75d72ea94/virtualenv-20.31.2.tar.gz", hash = "sha256:e10c0a9d02835e592521be48b332b6caee6887f332c111aa79a09b9e79efc2af", size = 6076316 }
|
|
410
409
|
wheels = [
|
|
411
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
410
|
+
{ url = "https://files.pythonhosted.org/packages/f3/40/b1c265d4b2b62b58576588510fc4d1fe60a86319c8de99fd8e9fec617d2c/virtualenv-20.31.2-py3-none-any.whl", hash = "sha256:36efd0d9650ee985f0cad72065001e66d49a6f24eb44d98980f630686243cf11", size = 6057982 },
|
|
412
411
|
]
|
nox_uv-0.3.0/PKG-INFO
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
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).
|
nox_uv-0.3.0/README.md
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
## Intro
|
|
2
|
-
|
|
3
|
-
This is a basic drop-in replacement for `nox.session` of [nox](https://nox.thea.codes/) to be used
|
|
4
|
-
with the [uv](https://docs.astral.sh/uv/) package manager.
|
|
5
|
-
|
|
6
|
-
To use, import `session` from `nox_uv` in your `noxfile.py`.
|
|
7
|
-
|
|
8
|
-
> [!NOTE]
|
|
9
|
-
> All `@session(...)` parameters are keywords only, no positional parameters are allowed.
|
|
10
|
-
|
|
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.
|
|
14
|
-
|
|
15
|
-
## Added parameters
|
|
16
|
-
|
|
17
|
-
- `uv_groups`: list of `uv` dependency groups
|
|
18
|
-
- `uv_extras`: list of `uv` extras
|
|
19
|
-
- `uv_all_extras`: boolean to install all extras from `pyproject.toml`
|
|
20
|
-
- `uv_all_groups`: boolean to install all dependency groups
|
|
21
|
-
|
|
22
|
-
## Inspiration
|
|
23
|
-
|
|
24
|
-
This is heavily influenced by, but much more limited than,
|
|
25
|
-
[nox-poetry](https://nox-poetry.readthedocs.io).
|
nox_uv-0.3.0/tests/test_lib.py
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
from pathlib import Path
|
|
3
|
-
import subprocess
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def test_1() -> None:
|
|
7
|
-
assert 5 == 5
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def test_run_uv_nox() -> None:
|
|
11
|
-
cur_folder = Path.cwd()
|
|
12
|
-
testing_folder = Path(__file__).parent / "subproject"
|
|
13
|
-
os.chdir(testing_folder)
|
|
14
|
-
a = subprocess.run(["uv", "run", "python", "-m", "nox"])
|
|
15
|
-
assert a.returncode == 0
|
|
16
|
-
os.chdir(cur_folder)
|
|
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
|