Skip to content

Replace setup.py with pyproject.toml #928

Closed

Description

@janfb

According to PEP 517 and PEP 621, package meta data should be specified in a pyproject.toml file. It should declare the build backend and the metadata (see https://drivendata.co/blog/python-packaging-2023 for a great explanation).

The pyproject.toml can replace the setup.py, environment.yml and setup.py. It is all we need to make the package locally installable via pip. We can also use it to specify additional linting and code formatting tools and their options.

I happy to add this soon, ideally before the hackathon.

Any thought @michaeldeistler , @manuelgloeckler ?

Activity

  1. added
    docs
    enhancement
    on Feb 6, 2024
  2. self-assigned this
    on Feb 6, 2024
  3. michaeldeistler commented on Feb 6, 2024

    @michaeldeistler
    Contributor

    yup i'd be for that

  4. alvorithm commented on Feb 6, 2024

    @alvorithm
    Collaborator

    Good idea. Also, check out rye.

  5. psteinb commented on Feb 7, 2024

    @psteinb
    Collaborator

    good idea! In my experience, pyproject.toml works quite well with more recent python versions. The documentation is not as comprehensible as I'd love it to be, but it is enough for most applications.

  6. janfb commented on Feb 13, 2024

    @janfb
    ContributorAuthor

    Thanks for the pointer to rye, @alvorithm looks like a great project!
    I think it's kind off orthogonal to / more general than the packaging with pyproject.toml itself. I understand it as a tool for the user to set up their environment locally. I will definitively check it out myself and maybe we can recommend it as an alternative to using conda one day.

  7. janfb commented on Feb 13, 2024

    @janfb
    ContributorAuthor

    Thanks for sharing @psteinb
    I think pyproject.toml is independent from the build backend itself -- it lets you specify the backend, which could be setuptools or something else, e.g., poetry-core, hatchling etc.

  8. janfb commented on Feb 16, 2024

    @janfb
    ContributorAuthor

    closed with #941

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

docsenhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions