Skip to content

Commit

Permalink
BEHAVIOR: define only one default pixi environment
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Aug 12, 2024
1 parent ca3bd4f commit 8df6990
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ elif [ -e venv ]; then
source venv/bin/activate
elif [ -e .pixi ]; then
watch_file pixi.lock
eval "$(pixi shell-hook --environment compwa-policy)"
eval "$(pixi shell-hook)"
else
layout anaconda
fi
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ env = {PRETTIER_LEGACY_CLI = "1"}
python = "3.9.*"

[tool.pixi.environments]
compwa-policy = {features = [
default = {features = [
"dev",
"doc",
"sty",
"test",
"types",
], solve-group = "default"}
]}

[tool.pixi.feature.dev.tasks.ci]
depends_on = ["cov", "doc", "linkcheck", "sty"]
Expand Down
12 changes: 4 additions & 8 deletions src/compwa_policy/check_dev_files/pixi.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,16 +358,12 @@ def __contains_line(path: Path, expected_line: str) -> bool:
def _update_dev_environment(pyproject: ModifiablePyproject) -> None:
if not pyproject.has_table("project.optional-dependencies"):
return
optional_dependencies = sorted(pyproject.get_table("project.optional-dependencies"))
optional_dependencies = pyproject.get_table("project.optional-dependencies")
expected = inline_table()
expected.update({
"features": to_toml_array(optional_dependencies),
"solve-group": "default",
})
expected["features"] = to_toml_array(sorted(optional_dependencies))
environments = pyproject.get_table("tool.pixi.environments", create=True)
package_name = pyproject.get_package_name(raise_on_missing=True)
if environments.get(package_name) != expected:
environments[package_name] = expected
if environments.get("default") != expected:
environments["default"] = expected
msg = "Updated Pixi developer environment"
pyproject.append_to_changelog(msg)

Expand Down

0 comments on commit 8df6990

Please sign in to comment.