Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump to ruff 0.9 and mypy 1.14 #909

Merged
merged 7 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ repos:
- id: pyproject-fmt

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.0
rev: v0.9.0
henryiii marked this conversation as resolved.
Show resolved Hide resolved
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
rev: v1.14.1
hooks:
- id: mypy
files: ^(nox/|tests/)
Expand Down
17 changes: 10 additions & 7 deletions nox/tox_to_nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,15 @@ def main() -> None:
wrapjoin(c.split()) for c in section["commands"].strip().splitlines()
]

config[name]["deps"] = wrapjoin([
part for dep
in section["deps"].strip().splitlines()
for part in
(dep.split() if dep.startswith("-r") else [dep])
])
config[name]["deps"] = wrapjoin(
[
part
for dep in section["deps"].strip().splitlines()
for part in (
[dep[:2] + dep[3:]] if dep.startswith("-r ") else [dep]
)
]
)

for option in "skip_install", "use_develop":
if section.get(option):
Expand All @@ -138,7 +141,7 @@ def main() -> None:
)
config[name]["base_python"] = impl + section["py_dot_ver"]

change_dir = Path(section.get("change_dir"))
change_dir = Path(section.get("change_dir", ""))
rel_to_cwd = change_dir.relative_to(Path.cwd())
if str(rel_to_cwd) == ".":
config[name]["change_dir"] = None
Expand Down
7 changes: 3 additions & 4 deletions tests/test_tox_to_nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,12 @@ def test_commands_with_requirements(makeconfig: Callable[[str], str]) -> None:
envlist = aiohttp

[testenv]
use_develop = true
usedevelop = true
henryiii marked this conversation as resolved.
Show resolved Hide resolved
deps =
pytest
pytest-cov
aiohttp: -r requirements/aiohttp.txt
"""
)
""")
)

assert (
Expand All @@ -383,7 +382,7 @@ def test_commands_with_requirements(makeconfig: Callable[[str], str]) -> None:

@nox.session(python='python3.13')
def aiohttp(session):
session.install('pytest', 'pytest-cov', '-r', 'requirements/aiohttp.txt')
session.install('pytest', 'pytest-cov', '-rrequirements/aiohttp.txt')
henryiii marked this conversation as resolved.
Show resolved Hide resolved
session.install('-e', '.')
""").lstrip()
)
Loading