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

Leave out development package out of lock file #2512

Open
ernimd opened this issue Nov 19, 2024 · 6 comments
Open

Leave out development package out of lock file #2512

ernimd opened this issue Nov 19, 2024 · 6 comments

Comments

@ernimd
Copy link

ernimd commented Nov 19, 2024

Problem description

I'm using pixi as primary package manager for development of Python packages. It's nice to get an editable installation out of the box, once the environment is set up, thus I add this in a pyproject.toml:

[tool.pixi.pypi-dependencies]
awesome_pkg = { path = ".", editable = true }

One thing that's annoying about this, that lock file gets updated with every single commit (at least in my versioning setup, where each commit is marked with post: w.y.z.postx). Would be nice to have an option to leave this package out of lock file, so pixi.lock doesn't have to be committed to a repo every single commit. Something along the lines:

[tool.pixi.pypi-dependencies]
awesome_pkg = { path = ".", editable = true, lock = false }

Or there is another way to achieve this ?

Thanks !

@ruben-arts
Copy link
Contributor

Hey @ernimd,

There currently is no way to skip a package from being included in the lock-file.

To understand the issue better, you change the version in the pyproject.toml on every commit?

@ernimd
Copy link
Author

ernimd commented Nov 19, 2024

No, it's automatic versioning system with hatch. So whenever I build a package and activate a shell, or recreate an environment with pixi it creates this two line diff on a package that I am actively developing. See the screenshot below.

Image

The patch version and post commit versions are changing frequently. Would like to leave out development package out of the lock file completely, it's not a dependency, but rather the project itself.

Ofc I could just do pip install -e . instead of having it in pyproject.toml but it's a nice feature to set up a development environment with a single pixi command.

@olivier-lacroix
Copy link
Contributor

Maybe keeping it in the lockfile, but without version or sha256 info would be better?

@ruben-arts
Copy link
Contributor

We currently add this to run avoid running a rebuild. We could maybe only rebuild on pixi install if not already existing?

@ernimd
Copy link
Author

ernimd commented Nov 20, 2024

Not sure if got fully what you're saying. Even on pixi install I would rather not have the version change be recorded on the development package.

@ruben-arts
Copy link
Contributor

I'm sorry, let me elaborate. To get rid of the versions we would need to change the environment validation logic. Because we currently use these on every pixi command to validate the proper existence of the lock-file and environment. When we don't have these versions we would need to reinstall on every command if we can't figure the version information out from the lock-file. So to avoid that we would need to do something like, only revalidate the environment on pixi install and not on pixi run or pixi shell to avoid reinstallations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants