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

just translate pyproject.toml PEP 612 #1183

Closed
majidaldo opened this issue Jun 12, 2023 · 3 comments
Closed

just translate pyproject.toml PEP 612 #1183

majidaldo opened this issue Jun 12, 2023 · 3 comments

Comments

@majidaldo
Copy link

pyproject.toml

Poetry was a good step towards making declarative python project specs. Lessons learned from poetry have made it into PEPs. However, a few other projects have popped up that are more standards compliant, like PDM.

Therefore, there should just be a nix package that translates pyproject.toml directly. Most of the code here can just be reused. Nix's place is as a "virtual env" where any programming language's setup scheme can be accommodated.

@adisbladis
Copy link
Member

I've started a separate project over at https://github.com/adisbladis/pyproject.nix to tackle this.
There are a few reasons to tackle it as a separate project:

  • Poetry2nix contains a fair bit of legacy code at this point that is very hard to reason about. If we're going to target another format it's best to start with a clean slate.
  • The lib code in poetry2nix (like pep508.nix) isn't very good and lacks proper unit testing. Pyproject.nix is developed in a TDD fashion, so I'm hoping to avoid this.
  • There are a few design mistakes in Poetry2nix I'd like to learn from.

I think there is value in keeping poetry2nix as-is, and then when Poetry hopefully one day adopts PEP-621 this repo could either be archived or reimplemented on top of more generic building blocks.

@adisbladis
Copy link
Member

https://nix-community.github.io/pyproject.nix/ works like this now:
It has a project abstraction that understands many different metadata formats.
It can load pyproject.toml, either in PEP-621 compliant mode or using Poetry.
It can also load a requirements.txt, though this is of course not as rich of a format and can't render as nicely.

Lock file management is orthogonal to project metadata, and dealt with separately with overlay generators such as pdm2nix.

There still isn't a good story around overrides using these new tools.
I would like to avoid the same level of manual management we currently have to do in poetry2nix.

@majidaldo
Copy link
Author

https://nix-community.github.io/pyproject.nix/ works like this now: It has a project abstraction that understands many different metadata formats. It can load pyproject.toml, either in PEP-621 compliant mode or using Poetry. It can also load a requirements.txt, though this is of course not as rich of a format and can't render as nicely.

Lock file management is orthogonal to project metadata, and dealt with separately with overlay generators such as pdm2nix.

There still isn't a good story around overrides using these new tools. I would like to avoid the same level of manual management we currently have to do in poetry2nix.

fyi, i've gone Rye

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