Skip to content

add extras for hatchling and setuptools#44

Merged
alexrashed merged 1 commit intomainfrom
add-extras
Mar 25, 2026
Merged

add extras for hatchling and setuptools#44
alexrashed merged 1 commit intomainfrom
add-extras

Conversation

@alexrashed
Copy link
Copy Markdown
Member

@alexrashed alexrashed commented Mar 16, 2026

Motivation

The hatchling build tool integration has just been merged with #35.
With build isolation, hatchling is not in the actual environment being used for the project but only in the temporary environment created by the build environment. (Actually, this is also the case for setuptools, but setuptools is often defined by transitive dependencies - f.e. packaging depends on setuptools.)
When using the entrypoints command, you would end up with the following error (if you are using hatchling as build backend in the pyproject.toml but do not have it in your dependencies):

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/ls/Repos/plux/plux/__main__.py", line 13, in <module>
    main()
    ~~~~^^
  File "/home/ls/Repos/plux/plux/__main__.py", line 9, in main
    cli.main(argv)
    ~~~~~~~~^^^^^^
  File "/home/ls/Repos/plux/plux/cli/cli.py", line 183, in main
    args.func(args)
    ~~~~~~~~~^^^^^^
  File "/home/ls/Repos/plux/plux/cli/cli.py", line 41, in entrypoints
    project = _load_project(args)
  File "/home/ls/Repos/plux/plux/cli/cli.py", line 31, in _load_project
    from plux.build.hatchling import HatchlingProject
  File "/home/ls/Repos/plux/plux/build/hatchling.py", line 15, in <module>
    from hatchling.builders.config import BuilderConfig
ModuleNotFoundError: No module named 'hatchling'

Changes

  • This PR adds two extras, such that you can define the build backend you want the transitive dependencyies of:
    • setuptools and
    • hatchling

@alexrashed alexrashed requested review from dfangl and thrau as code owners March 16, 2026 15:56
@alexrashed alexrashed added the enhancement New feature or request label Mar 16, 2026
Copy link
Copy Markdown
Member

@thrau thrau left a comment

Choose a reason for hiding this comment

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

Thanks Alex! Classic case of "it was working on my machine". Adding two extras is a good idea

Copy link
Copy Markdown
Member

@dfangl dfangl left a comment

Choose a reason for hiding this comment

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

Makes sense!

@alexrashed alexrashed merged commit 109eadf into main Mar 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants