railwayapp / nixpacks

App source + Nix packages + Docker = Image
https://nixpacks.com
MIT License
2.33k stars 222 forks source link

add asdf support to python + poetry #1042

Open iloveitaly opened 6 months ago

iloveitaly commented 6 months ago

Feature request

The idea here is to support asdf/.tool-versions for specifying python + poetry versions. This could then be extended to support node, go, etc in the future but my initial use case is scoped to python.

Motivation

No response

Contribution

https://github.com/railwayapp/nixpacks/pull/1026

github-actions[bot] commented 6 months ago

Hello, @iloveitaly! Thanks for your submission.

Our team will respond soon. If you need more immediate help, try our Forum or our Discord. Thanks!

zuchka commented 5 months ago

@iloveitaly sorry about the delays--I'm looking into this...

zuchka commented 5 months ago

folks seem to like this proposal. Are you interested in finishing your PR? It looks like it's not quite done...

zuchka commented 5 months ago

@iloveitaly also check this out: https://github.com/railwayapp/nixpacks/issues/1017#issuecomment-1839761192

maybe worth hopping on that thread? how would this PR interface with that solution?

coffee-cup commented 5 months ago

Hi @iloveitaly, I think having a full on asdf provider could be a good idea. Basically if .tool-versions file is found at the root, then we install asdf and all packages defined. Would you be interested in creating a PR for this?

The problem with https://github.com/railwayapp/nixpacks/pull/1026 is that Nix does not support specifying the exact version of packages. It only supports the latest major/minor version. So parsing a tool-version file and then passing the version to Nix does not make a lot of sense in that case.

iloveitaly commented 5 months ago

@coffee-cup That makes sense—What do you think about just extracting the major/minor version from asdf and passing that down to the Python builder?

coffee-cup commented 5 months ago

That works as a good first step!