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

build: Add util.mkApplication #205

Merged
merged 1 commit into from
Dec 18, 2024
Merged

build: Add util.mkApplication #205

merged 1 commit into from
Dec 18, 2024

Conversation

adisbladis
Copy link
Member

@adisbladis adisbladis commented Dec 5, 2024

This helper takes a virtual environment and a derivation to use as a structure template & outputs a derivation without venv cruft.

See pyproject-nix/uv2nix#80
cc @jfly

@adisbladis adisbladis marked this pull request as draft December 5, 2024 03:24
Copy link

@jfly jfly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking this up!

I'm not sure I'm totally grok-ing the from argument to mkApplication. Is the idea that the derivation we pass to from will have just the stuff we want (namely the [project.scripts]) we need, and so that's a convinient way to figure out what to include in the final application, rather than re-parsing a pyproject.toml file to deduce the scripts? If so, that's clever, but it does include other stuff we don't need (as you call out your post).

from might be a weird name for the parameter? project/package/application might be less weird?

build/util/mk-application.py Outdated Show resolved Hide resolved
@adisbladis
Copy link
Member Author

it does include other stuff we don't need (as you call out your post).

And this is by design. You might want to include things that have no standardised notion in pyproject.toml such as systemd units & man pages.

from might be a weird name for the parameter? project/package/application might be less weird?

Yeah I totally agree. package feels like the best of these options:

Copy link

@jfly jfly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this. Thanks again =)

@adisbladis adisbladis force-pushed the venv-cruft-begone branch 2 times, most recently from db9cf44 to fc5b811 Compare December 18, 2024 03:24
@adisbladis adisbladis marked this pull request as ready for review December 18, 2024 03:30
This helper takes a virtual environment and a derivation to use as a structure template & outputs a derivation without venv cruft.
@adisbladis adisbladis merged commit cc489ac into master Dec 18, 2024
81 checks passed
@adisbladis adisbladis deleted the venv-cruft-begone branch December 18, 2024 03:44
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

Successfully merging this pull request may close these issues.

2 participants