Add pixi [pyconde sprints] - #2525
Conversation
isuruf
left a comment
There was a problem hiding this comment.
This requires keeping environment.yml and pyproject.toml to be in sync. Please add a test that checks that these two lists are identical so that we don't accidentally change one list and not the other.
|
@jaimergp - could you please do a second review? I did a follow-up commit to try and address your feedback. |
@isuruf - is the existing check OK? |
| - pip: | ||
| - -e . |
There was a problem hiding this comment.
I think this is added by pixi workspace export conda-environment because of the pypi-dependencies table, and I see no way to disable that. We may need to edit it out by hand with sed or something.
@cdeil, if you are into Rust, adding a --no-pip flag to the subcommand in Pixi would be straightforward. This the Rust module: https://github.com/prefix-dev/pixi/blob/802105d11f030187916ee812e66572a388c76c3d/crates/pixi_cli/src/workspace/export/conda_environment.rs#L166-L170
There was a problem hiding this comment.
Just out of curiosity, why do you want to remove this? Isnt it just as nice that you dont have to run pip install -e anymore?
There was a problem hiding this comment.
I don't like tools doing sneaky things. It's a hack anyway that -e . works at all.
There was a problem hiding this comment.
pixi-build might solve this here? #general > Add a pixi-build section to conda-smithy @ 💬
| pixi workspace export conda-environment --name conda-smithy | sed '/^$/d' > environment.yml | ||
| if ! git diff --exit-code environment.yml; then | ||
| echo "error: pyproject.toml [tool.pixi] and environment.yml are out of sync" | ||
| echo "Run: pixi workspace export conda-environment --name conda-smithy | sed '/^\$/d' > environment.yml" |
There was a problem hiding this comment.
Can you please post the diff here? There's no need for a developer to force pixi to figure out this change.
There was a problem hiding this comment.
The diff is currently empty because the two files are consistent.
This CI check guarantees they will remain in sync moving forward.
In the future if a dev adjusts a dependency they have to do it in pyproject.toml and environment.yml consistently, or they just do it in pyproject.toml and run the pixi workspace export command which applies the correct consistent change to environment.yml.
As far as I know there is no better way to do it. But seems OK, no?
@isuruf Does this answer your question?
(Apologies if I misunderstood/don't get what you are looking for)
There was a problem hiding this comment.
I mean report the failing diff in the CI test, so that a PR author can apply the diff without needing to have pixi.
There was a problem hiding this comment.
AFAIK the line if ! git diff --exit-code environment.yml is not redirecting output anywhere, so it'll be printed by default 🤔 See this example with a single line change in README.md:
❯ git status
On branch linter-revamp
Your branch is up to date with 'origin/linter-revamp'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: README.md
no changes added to commit (use "git add" and/or "git commit -a")
❯ if ! git diff --exit-code; then
∙ echo "There are changes"
∙ fi
diff --git i/README.md w/README.md
index f10ed6ba..08723d03 100644
--- i/README.md
+++ w/README.md
@@ -15,6 +15,8 @@ Overview
[](https://github.com/astral-sh/ruff)
[](https://github.com/ambv/black)
+A change
+
Installation
------------
There are changes
| pixi workspace export conda-environment --name conda-smithy | sed '/^$/d' > environment.yml | ||
| if ! git diff --exit-code environment.yml; then | ||
| echo "error: pyproject.toml [tool.pixi] and environment.yml are out of sync" | ||
| echo "Run: pixi workspace export conda-environment --name conda-smithy | sed '/^\$/d' > environment.yml" |
There was a problem hiding this comment.
| echo "Run: pixi workspace export conda-environment --name conda-smithy | sed '/^\$/d' > environment.yml" | |
| echo "Please apply the above diff or run: pixi workspace export conda-environment --name conda-smithy | sed '/^\$/d' > environment.yml" |
| * Add Pixi dev support in `pyproject.toml`, keeping `conda` support as-is. | ||
| This is for devs working on `conda-smithy`. |
There was a problem hiding this comment.
| * Add Pixi dev support in `pyproject.toml`, keeping `conda` support as-is. | |
| This is for devs working on `conda-smithy`. | |
| * Add Pixi-driven development support in `pyproject.toml`, keeping `conda` support as-is. (#2525) |
| - rattler-build-conda-compat >=1.4.5,<2.0.0a0 | ||
| - python >=3.9 |
There was a problem hiding this comment.
| - rattler-build-conda-compat >=1.4.5,<2.0.0a0 | |
| - python >=3.9 | |
| - rattler-build-conda-compat >=1.4.12,<2.0.0a0 | |
| - python >=3.11 |
As per recently merged PRs.
| exceptiongroup = "*" | ||
| # py-rattler's API subject to change, pin to minor | ||
| py-rattler = ">=0.22,<0.23" | ||
| rattler-build-conda-compat = ">=1.4.5,<2.0.0a0" |
There was a problem hiding this comment.
| rattler-build-conda-compat = ">=1.4.5,<2.0.0a0" | |
| rattler-build-conda-compat = ">=1.4.12,<2.0.0a0" |
As per recently merged PRs.
|
@cdeil Are you planning on continuing with this? |
No. Would be great if someone from the team could finish this up. |
|
@jaimergp Do you think instead of using a dynamic version, it would be ok to use rever to update the version in the pyproject.toml instead? |
Can you elaborate? 🤔 The dynamic version of what? |
|
The pyproject defines the version of the package as dynamic: Line 11 in ef21335 |
|
Ah, that's for the |
|
Ah sorry I completely missed adding the context 😅 Im asking because I was trying to turn conda-smithy into (optionally) a pixi build package. That makes it easy to (amongst others) use it directly as a git dependency. However, currently pixi doesnt support |
|
I see. I guess we can discuss it, but it'll have to be separate from this PR. |
At the PyConDE sprints most of us trying to work on
conda-smithywere running intocondaissues in regular terminals or VSCode terminals.This PR adds support for using
pixito work onconda-smithykeepingcondasupport unchanged.The large diff in
environment.ymlis a one-time format change due to order and formatting of the pixi export.The CI check to ensure consistency of dependencies in
environment.ymlandpyproject.tomlbetween conda and pixi users is following the example HERE suggested by @jaimergp