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
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ repos:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.12.0
rev: 26.1.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.10
rev: v0.15.4
hooks:
- id: ruff
args: ["--fix"]
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.7.4
rev: v3.8.1
hooks:
- id: prettier
args: ["--cache-location=.prettier_cache"]
Expand All @@ -26,11 +26,11 @@ repos:
- id: taplo-lint
args: ["--no-schema"]
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.24.1
rev: v0.25
hooks:
- id: validate-pyproject
- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: v1.19.0
rev: v1.22.0
hooks:
- id: zizmor

Expand Down
48 changes: 16 additions & 32 deletions minimum_versions/tests/test_environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,14 @@ def test_parse_spec(self, spec_text, expected_spec, expected_warnings):
assert actual_warnings == expected_warnings

def test_parse_environment(self, monkeypatch):
data = textwrap.dedent(
"""\
data = textwrap.dedent("""\
channels:
- conda-forge
dependencies:
- a=1.1
- b>=3.2
- c=1.6.5
""".rstrip()
)
""".rstrip())
monkeypatch.setattr(pathlib.Path, "read_text", lambda _: data)

expected_specs = [
Expand Down Expand Up @@ -245,8 +243,7 @@ def test_parse_spec_error(self, version_text):
["data", "path", "expected_specs", "expected_warnings"],
(
pytest.param(
textwrap.dedent(
"""\
textwrap.dedent("""\
[dependencies]
a = "1.0.*"
b = "2.2.*"
Expand All @@ -256,8 +253,7 @@ def test_parse_spec_error(self, version_text):

[environments]
env1 = { features = ["feature1"] }
""".rstrip()
),
""".rstrip()),
"pixi.toml",
[
Spec("a", Version("1.0")),
Expand All @@ -268,8 +264,7 @@ def test_parse_spec_error(self, version_text):
id="default-feature",
),
pytest.param(
textwrap.dedent(
"""\
textwrap.dedent("""\
[dependencies]
a = "1.0.*"
b = "2.2.*"
Expand All @@ -279,31 +274,27 @@ def test_parse_spec_error(self, version_text):

[environments]
env1 = { features = ["feature1"], no-default-feature = true }
""".rstrip()
),
""".rstrip()),
"pixi.toml",
[Spec("c", Version("3.1"))],
[("c", [])],
id="no-default-feature",
),
pytest.param(
textwrap.dedent(
"""\
textwrap.dedent("""\
[dependencies]
a = "1.0.*"

[environments]
env1 = { features = [] }
""".rstrip()
),
""".rstrip()),
"pixi.toml",
[Spec("a", Version("1.0"))],
[("a", [])],
id="missing-features",
),
pytest.param(
textwrap.dedent(
"""\
textwrap.dedent("""\
[dependencies]
a = "1.0.*"

Expand All @@ -312,16 +303,14 @@ def test_parse_spec_error(self, version_text):

[environments]
env1 = { features = [] }
""".rstrip()
),
""".rstrip()),
"pixi.toml",
[Spec("a", Version("1.0"))],
[("feature:default", ["Ignored PyPI dependencies."]), ("a", [])],
id="pypi_dependencies-default",
),
pytest.param(
textwrap.dedent(
"""\
textwrap.dedent("""\
[dependencies]
a = "1.0.*"

Expand All @@ -330,31 +319,27 @@ def test_parse_spec_error(self, version_text):

[environments]
env1 = { features = ["feat1"] }
""".rstrip()
),
""".rstrip()),
"pixi.toml",
[Spec("a", Version("1.0"))],
[("feature:feat1", ["Ignored PyPI dependencies."]), ("a", [])],
id="pypi_dependencies-feat1",
),
pytest.param(
textwrap.dedent(
"""\
textwrap.dedent("""\
[tool.pixi.feature.feature1.dependencies]
c = "3.1.*"

[tool.pixi.environments]
env1 = { features = ["feature1"], no-default-feature = true }
""".rstrip()
),
""".rstrip()),
"pyproject.toml",
[Spec("c", Version("3.1"))],
[("c", [])],
id="pyproject",
),
pytest.param(
textwrap.dedent(
"""\
textwrap.dedent("""\
[package]
name = "a"

Expand All @@ -366,8 +351,7 @@ def test_parse_spec_error(self, version_text):

[environments]
env1 = { features = ["feature1"] }
""".rstrip()
),
""".rstrip()),
"pixi.toml",
[Spec("c", Version("3.1"))],
[("c", [])],
Expand Down