Closed Hofer-Julian closed 4 weeks ago
So I found out why this is. Note if you run with -v
, this gives you the reason why the dependencies are out of date, in this case because it did not expect ribasim to be editable, which at first glance seems strange, because it is defined as editable in the toml.
I think because this project is using a nested structure to include multiple projects this problem occurs.
pixi.toml
specifies ribasim
as editable.pyproject.toml
of ribasim_testmodels
specifies ribasim
as a regular pypi dependency.Editables and requirements are kind of disjunct in pypi world. So this may cause issues. I'll need to investigate as bit further.
I'm getting similar issue when trying to use my env:
[dependencies]
python = "~=3.11.0"
pandas = "*"
pyyaml = "*"
tqdm = "*"
ffmpeg = "*"
ruff = "*"
pre-commit = "*"
srt = "*"
[pypi-dependencies]
ffmpeg-python = {git= "https://github.com/charlienewey/ffmpeg-python.git", branch = "bugfix/782", rev="37dd98ca210fb8132575bedd719c6f8f9bfd1021"}
tensorflow ="~=2.15.0"
tensorflow-addons = "*"
tensorflow-io = "*"
tensorflow-datasets = "*"
keras-cv = "*"
pytest = "*"
pytest-cov = "*"
clearml = "*"
[feature.train.system-requirements]
cuda = "12.2"
[feature.train.tasks]
setup_precommit = "pre-commit install"
setup_jupyter = "python -m ipykernel install --user --name 'speaker-recognition-pixi'"
test_gpu = {cmd = ["python3", "-c", "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'));"], depends_on=["setup_precommit", "setup_jupyter"]}
[feature.train.dependencies]
ipykernel = "*"
matplotlib = "*"
pandas = "*"
umap-learn = "*"
bokeh = "*"
pre-commit = "*"
dask = ">=2024.4.1,<2024.5"
ffmpeg = "*"
[feature.train.pypi-dependencies]
tensorflow = {version="~=2.15.0", extras=["and-cuda"]}
ray = {version = "*", extras=["data","train","tune","serve"]}
audiomentations = "*"
joblib = "~=1.4.0"
This basically ends changing lockfile every time when I use it. It can also be a bit inconvenient when sharing .lock in git repository. I think that using --frozen
option would be a way to go, but still this is a bit concerning.
INFO pixi::lock_file::outdated: the pypi dependencies of environment 'train' for platform linux-64 are out of date because there are more pypi packages in the lock-file than are used by the environment: cachetools, flatbuffers, audioread, nvidia-cuda-cupti-cu12, nvidia-cuda-nvrtc-cu12, coverage, markdown, yarl, googleapis-common-protos, requests-oauthlib, astunparse, namex, clearml, opencensus-context, google-api-core
I guess tensorflow is not doing easy work for this env
@niemiaszek Thanks for you example. We've been looking for a smaller example this helps! If you find any smaller reproducible examples please let us know!
Sure, I will try to come with some examples. As I started to use Pixi daily, I will have more chance to experiment with "minimal not working examples". I will give it a chance over the weekend
@Hofer-Julian I can confirm that your issue is fixed by https://github.com/prefix-dev/pixi/pull/1251
@niemiaszek I am pretty sure your issue is solved by https://github.com/prefix-dev/pixi/pull/1253 (not entirely sure because your example doesnt include a lock).
I confirm that the lockfile is declared as up to date, but an issue still remains. Specifically, it seems to always get overwritten with no changes despite pixi declaring that it is up to date. This, for example, makes direnv trigger on every action.
Can you provide the pixi.toml?
My OS is Ubuntu 24.04 if that's important. I have the latest pixi (0.24.2). The toml is what I got after
pixi init
pixi add python
pixi add "black @ https://github.com/psf/black.git@24.4.2
[project]
name = "pixi_test"
version = "0.1.0"
description = "Add a short description here"
authors = ["Anton Akhmerov <anton.akhmerov@gmail.com>"]
channels = ["conda-forge"]
platforms = ["linux-64"]
[tasks]
[dependencies]
python = ">=3.12.4,<3.13"
[pypi-dependencies]
black = { git = "https://github.com/psf/black.git", rev = "24.4.2" }
I added .envrc
as recommended by the docs and enabled direnv in fish shell.
watch_file pixi.lock
eval "$(pixi shell-hook)"
I then observe that direnv runs pixi initialization on every action in the terminal.
You are using sdists instead of wheels. I experienced something similar in #1046
My OS is Ubuntu 24.04 if that's important. I have the latest pixi (0.24.2). The toml is what I got after
pixi init pixi add python pixi add "black @ https://github.com/psf/black.git@24.4.2
[project] name = "pixi_test" version = "0.1.0" description = "Add a short description here" authors = ["Anton Akhmerov <anton.akhmerov@gmail.com>"] channels = ["conda-forge"] platforms = ["linux-64"] [tasks] [dependencies] python = ">=3.12.4,<3.13" [pypi-dependencies] black = { git = "https://github.com/psf/black.git", rev = "24.4.2" }
I added
.envrc
as recommended by the docs and enabled direnv in fish shell.watch_file pixi.lock eval "$(pixi shell-hook)"
I then observe that direnv runs pixi initialization on every action in the terminal.
Actually, that does look like a 🐛!
INFO pixi::environment: verifying prefix location is unchanged, with prefix file: /private/tmp/black/.pixi/envs/default/conda-meta/pixi_env_prefix
INFO pixi::lock_file::outdated: the pypi dependencies of environment 'default' for platform osx-arm64 are out of date because the requirement 'black @ git+https://github.com/psf/black.git@24.4.2' could not be satisfied (required by '<environment>')
INFO pixi::lock_file::resolve::uv_resolution_context: uv keyring provider is disabled
INFO pixi::environment: Creating prefix file at: /private/tmp/black/.pixi/envs/default/conda-meta/pixi_env_prefix
INFO pixi::environment: No update needed for the prefix file.
INFO pixi::environment: Checking if history file exists: /private/tmp/black/.pixi/envs/default/conda-meta/history
INFO pixi::lock_file::update: updated conda packages in the 'default' prefix in 30ms 992us 792ns
INFO resolve_pypi{group=default platform=osx-arm64}: pixi::lock_file::resolve::pypi: there are no python packages installed by conda
INFO solve:solve_tracked: pubgrub::internal::partial_solution: add_decision: root @ 0a0.dev0
INFO solve:solve_tracked: pubgrub::internal::partial_solution: add_decision: black @ 24.4.2
INFO solve:solve_tracked: pubgrub::internal::partial_solution: add_decision: click @ 8.1.7
INFO solve:solve_tracked: pubgrub::internal::partial_solution: add_decision: mypy-extensions @ 1.0.0
INFO solve:solve_tracked: pubgrub::internal::partial_solution: add_decision: packaging @ 24.1
INFO solve:solve_tracked: pubgrub::internal::partial_solution: add_decision: pathspec @ 0.12.1
INFO solve:solve_tracked: pubgrub::internal::partial_solution: add_decision: platformdirs @ 4.2.2
INFO pixi::lock_file::update: resolved pypi packages for environment 'default' 'osx-arm64' in 741ms 828us 709ns
INFO pixi::install_pypi: Nothing to do - Audited 6 distributions in 34ms
✔ The default environment has been installed.
This environment is considered unsatified while it shouldnt be.
Ok @akhmerov I've just noticed, I think you are trying to use a tag as a revision, we don't support tags (yet). I'm thinking that's the problem.
Thank you for the explanation. I confirm that switching to a revision instead of a tag works.
It seems there is WIP PR #1245 . I was also confused when I used branch option and in fact it didn't use desired branch and caused similar issues. My issue #1206
I'm also seeing this one in https://github.com/sourmash-bio/sourmash
To reproduce on a specific commit with the issue (current latest
):
$ git clone https://github.com/sourmash-bio/sourmash && cd sourmash && git checkout d3ae5daffb66a794d859e59f774a54383bceb0ac
Edit .envrc
to add -v
in the last line:
eval "$(pixi -v shell-hook)"
And allow direnv to run:
What caught my attention was the line:
INFO pixi::lock_file::outdated: environment 'default' is out of date because the indexes used to previously solve to lock file are missing
what is the index missing?
pixi info:
$ pixi info
Pixi version: 0.26.1
Platform: linux-64
Virtual packages: __unix=0=0
: __linux=6.8.12=0
: __glibc=2.39=0
: __archspec=1=skylake
Cache dir: /home/luizirber/.cache/rattler/cache
Auth storage: /home/luizirber/.rattler/credentials.json
@luizirber You've got an interesting situation. You perfectly mimicked the [project.dependencies] with the [tool.pixi.dependencies]
so our logic is testing the pypi logic without having to install anything. This seems like a bug, will look into it some more.
@luizirber That will be fixed in: https://github.com/prefix-dev/pixi/pull/1862
Fixed with https://github.com/prefix-dev/pixi/pull/1862
Checks
[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of pixi, using
pixi --version
.Reproducible example
The last command will fail with
× lock-file not up-to-date with the project
I can reproduce this behavior on Linux and Windows machines.Issue description
Something seems to be fishy with our pixi setup after @Jingru923 moved to using
pypi-dependencies
: https://github.com/Deltares/Ribasim/pull/1400 Pixi always seem to consider the lock file out-of-date. I would love to make a smaller reproducer, but many other projects usepypi-dependencies
just fine, and I don't see what makes the Ribasim setup special.Expected behavior
Pixi should be able to update the lockfile in a way, that it afterwards is able to recognice that the lockfile is up-to-date.