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

New structure for PythonProject #3497

Open
garysassano opened this issue Mar 29, 2024 · 3 comments
Open

New structure for PythonProject #3497

garysassano opened this issue Mar 29, 2024 · 3 comments

Comments

@garysassano
Copy link
Contributor

garysassano commented Mar 29, 2024

A few things I would like to change for PythonProject:

  • pyproject.toml is the new standard configuration file for all projects, completely replacing the old requirements.txt.

  • A new requiresPython prop that follows pyproject.toml PyPA spec is introduced, with the following default value:

    • >=3.9
  • A new packageManager prop is introduced, with the following valid values:

    • UV (default)
    • PIP
    • PDM
    • POETRY
    • CONDA
  • A new buildSystem prop that follows PEP 517 is introduced, with the following valid values:

    • SETUPTOOLS (default)
    • POETRY (default when packageManager is POETRY)
  • A new formatAndLinting array prop is introduced, with the following valid values:

    • RUFF (default)
    • BLACK
    • FLAKE8
    • YAPF
    • AUTOPEP8
    • PYLINT
    • PYCODESTYLE
@garysassano
Copy link
Contributor Author

Possible non-issues when moving pyproject.toml to PythonProject:

  • pyproject.toml currently doesn't support "non-package projects" (something that PEP 735 aims to address), so all Python projects would need to be created inside a package directory having the same name as the project (this isn't a big deal and it's actually what we already do for PoetryProject).

  • Conda doesn't currently support pyproject.toml, but it will eventually be supported (not a real issue since projen doesn't support it either at the moment).

@mrgrain
Copy link
Contributor

mrgrain commented Apr 1, 2024

This probably needs to be an RFC:

  • prefix the issue title with RFC
  • solicit feedback from the community

@automartin5000
Copy link

This is awesome. I've been thinking for a while that it would be great to provide the same developer experience to other tools that's provided for/with Poetry.

The Astral tools do look promising, and I might personally opt for them in our teams' projects. However, I worry about making them the default. That especially seems aggressive given that uv was just released. If we can abstract the same general developer experience with standard tooling pip, venv, flake8, etc, then I would vote for that to be the default.

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