Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-24.04
strategy:
matrix:
nox-session: ["lint", "type_check"]
nox-session: ["lint", "type_check", "pyproject_fmt_check"]
steps:
- uses: actions/checkout@v5
- name: Install uv
Expand Down
26 changes: 25 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

options.error_on_external_run = True
options.default_venv_backend = "uv"
options.sessions = ["lint", "type_check", "test"]
options.sessions = ["lint", "type_check", "test", "pyproject_fmt_check"]


@session(
Expand Down Expand Up @@ -67,6 +67,30 @@ def lint_fix(s: Session) -> None:
s.run("ruff", "check", ".", "--extend-fixable", "F401", "--fix")


@session(uv_only_groups=["lint"])
@parametrize(
"command",
[
["pyproject-fmt", "pyproject.toml"],
["pyproject-fmt", "tests/subproject/pyproject.toml"],
],
)
def pyproject_fmt_fix(s: Session, command: list[str]) -> None:
s.run(*command)


@session(uv_only_groups=["lint"])
@parametrize(
"command",
[
["pyproject-fmt", "--check", "pyproject.toml"],
["pyproject-fmt", "--check", "tests/subproject/pyproject.toml"],
],
)
def pyproject_fmt_check(s: Session, command: list[str]) -> None:
s.run(*command)


@session(uv_groups=["test", "type_check"])
def type_check(s: Session) -> None:
s.run("mypy", "src", "tests", "noxfile.py")
145 changes: 67 additions & 78 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,103 +1,92 @@
[build-system]
build-backend = "uv_build"
requires = [ "uv-build>=0.9,<0.10" ]

[project]
name = "nox-uv"
version = "0.7.2-dev0"
description = "Facilitate nox integration with uv for Python projects"
keywords = ["nox", "uv"]
readme = "README.md"
authors = [{ name = "Dan Tebben", email = "dantebben@gmail.com" }]
keywords = [ "nox", "uv" ]
license = "MIT"
license-files = ["LICENSE.txt"]
license-files = [ "LICENSE.txt" ]
authors = [ { name = "Dan Tebben", email = "dantebben@gmail.com" } ]
requires-python = ">=3.9"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Testing",
"Typing :: Typed",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Testing",
"Typing :: Typed",
]

requires-python = ">=3.9"
dependencies = ["nox>=2026.2.9"]

[project.urls]
Homepage = "https://github.com/dantebben/nox-uv"
Repository = "https://github.com/dantebben/nox-uv"
Issues = "https://github.com/dantebben/nox-uv/issues"

[build-system]
requires = ["uv_build>=0.9.0,<0.10.0"]
build-backend = "uv_build"
dependencies = [ "nox>=2026.2.9" ]
urls.Homepage = "https://github.com/dantebben/nox-uv"
urls.Issues = "https://github.com/dantebben/nox-uv/issues"
urls.Repository = "https://github.com/dantebben/nox-uv"

[dependency-groups]
lint = ["ruff>=0.9.7"]
test = [
"pytest>=8.4.0",
# TODO: Remove this upper bound when CoverageWarnings are fixed.
"pytest-cov<7",
"pytest>=8.4",
# TODO: Remove this upper bound when CoverageWarnings are fixed.
"pytest-cov<7",
]
type_check = ["mypy>=1.15.0"]
lint = [ "pyproject-fmt>=2.8", "ruff>=0.9.7" ]
type_check = [ "mypy>=1.15" ]

[tool.uv]
default-groups = "all"

[tool.mypy]
ignore_missing_imports = true
strict = true
enable_error_code = ["deprecated", "exhaustive-match", "explicit-override"]


[tool.ruff]
line-length = 99
src = ["src"]


[tool.ruff.lint]
select = [
"F", # pyflakes
"E", # pycodestyle
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"RUF", # ruff
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"ISC", # flake8-implicit-str-concat
"PIE", # flake8-pie
"PT", # flake-pytest-style
"PTH", # flake8-use-pathlib
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
src = [ "src" ]
lint.select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"E", # pycodestyle
"F", # pyflakes
"I", # isort
"ISC", # flake8-implicit-str-concat
"N", # pep8-naming
"PIE", # flake8-pie
"PT", # flake-pytest-style
"PTH", # flake8-use-pathlib
"RUF", # ruff
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"UP", # pyupgrade
]
extend-ignore = ["RUF005", "RUF012"]
unfixable = [
# Disable removing unused imports by default and only enable within nox so editors don't delete
# unused imports while the user is in the middle of editing a file on save.
"F401",
lint.extend-ignore = [ "RUF005", "RUF012" ]
lint.unfixable = [
# Disable removing unused imports by default and only enable within nox so editors don't delete
# unused imports while the user is in the middle of editing a file on save.
"F401",
]
lint.flake8-tidy-imports.ban-relative-imports = "all"
lint.isort.force-sort-within-sections = true
lint.isort.split-on-trailing-comma = false

[tool.ruff.lint.isort]
force-sort-within-sections = true
split-on-trailing-comma = false

[tool.pytest]
ini_options.addopts = [ "--strict-config", "--strict-markers" ]
ini_options.xfail_strict = true
ini_options.filterwarnings = [ "error" ]

[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.coverage]
# The nox session that calls coverage does not find "src/nox_uv", but it is found in the

[tool.pytest.ini_options]
addopts = ["--strict-config", "--strict-markers"]
xfail_strict = true
filterwarnings = ["error"]

[tool.coverage.run]
parallel = true
# The nox session that calls coverage does not find "src/nox_uv", but it is found in the
# subprocess. Coverage generates a warning that the module was not found, but coverage is actually

# run and determined in the "parallel" subprocess.

[tool.mypy]
ignore_missing_imports = true
strict = true
enable_error_code = [ "deprecated", "exhaustive-match", "explicit-override" ]
43 changes: 23 additions & 20 deletions tests/subproject/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
[build-system]
build-backend = "uv_build"
requires = [ "uv-build>=0.9,<0.10" ]

[project]
name = "subproject"
version = "0.1.0"
description = "Project for testing nox-uv"
readme = "README.md"
requires-python = ">=3.9"
classifiers = ["Private :: Do Not Upload"]
dependencies = ["nox-uv"]

[tool.uv.sources]
nox-uv = { path = "../../", editable = true }

[build-system]
requires = ["uv_build>=0.9.0,<0.10.0"]
build-backend = "uv_build"


[project.optional-dependencies]
pyyaml = ["pyyaml"]
scapy = ["scapy"]
classifiers = [
"Private :: Do Not Upload",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [ "nox-uv" ]
optional-dependencies.pyyaml = [ "pyyaml" ]
optional-dependencies.scapy = [ "scapy" ]

[dependency-groups]
never-used = ["networkx"]

lint = ["ruff>=0.9.7"]
test = ["nose>=1.3.7"]
type_check = ["mypy>=1.15.0"]
test = [ "nose>=1.3.7" ]
lint = [ "ruff>=0.9.7" ]
never-used = [ "networkx" ]
type_check = [ "mypy>=1.15" ]

[tool.uv]
default-groups = ["lint", "test", "type_check"]
default-groups = [ "lint", "test", "type_check" ]
sources.nox-uv = { path = "../../", editable = true }
19 changes: 11 additions & 8 deletions tests/subproject/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading