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

Better support for dynamic version #2923

Open
akhmerov opened this issue Jan 16, 2025 · 7 comments
Open

Better support for dynamic version #2923

akhmerov opened this issue Jan 16, 2025 · 7 comments

Comments

@akhmerov
Copy link

akhmerov commented Jan 16, 2025

Problem description

pyproject.toml allows to specify a dynamic version, which I use with hatch-vcs build backend (see my pyproject.toml here). I have encountered two complications:

  • It seems that in order for this to work well in the docker image, all environments containing the package must also have git, otherwise getting the version fails.
  • I have git = "*" specified in build-dependencies, but that doesn't seem to avoid failures. I tried moving this to host-dependencies, and the problem went away, however it is not at all clear to me whether build-dependencies or host-dependencies are guaranteed to be present when installing pypi-dependencies with { path = ".", editable = true }
  • A cleaner way to integrate this with pixi would be by using pixi build, but as far as I can tell, it does not support dynamic version yet. (And no editable builds I assume?)

Altogether, at this point I am unsure what is the best way to use a package with a dynamic version with pixi, and I would appreciate a clarification or improvement of the available tools.

@tdejager
Copy link
Contributor

Hi @akhmerov, thanks for the issue.

Okay, as far as I can tell. It should just install git, it is also available in the lock file. As why uv cannot use it in one case or the other I'm uncertain. Its hard for me to reproduce even, as my mac has a global git installation it can always reach. I suppose we need to build a docker or something to reproduce. As it is currently unreproducable for me, without breaking my git install I suppose.

With regards to pixi build, we should be building in editable by default. However, maybe it would be good for us to give your case a try for before you try it out :)

In any case it shouldn't make a difference if you are not using the build preview feature where you put the dependency. The only thing I can think of is that there is a difference in activation, it uses the activated environment to pass to uv. Lets see if we can get a good local reproducer.

@akhmerov
Copy link
Author

With regards to pixi build, we should be building in editable by default.

That part is awesome! I wonder, however, about dealing with dynamic version.

@tdejager
Copy link
Contributor

We use PEP517 to build, so this should definitely be possible!

@akhmerov
Copy link
Author

How to specify this in the manifest though? The docs seem to suggest that package version must be present.

@tdejager
Copy link
Contributor

Ah you are right! We would need to rethink this, indeed! Thank you looking into this.

@akhmerov
Copy link
Author

About the other bug (whether uv pics up git from pixi installation): the most bizarre thing is that it seems nondeterministic.

As a side-note, #2588 is a related quality-of-life missing feature.

@tdejager
Copy link
Contributor

Very strange! We are going to make the version optional in the build protocol but this needs some further engineering to get right on our side with regards to pixi build. Sorry about that, but good that we caught this early.

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

2 participants