Skip to content

[Bug]: flit publish fails with incompatible flit_core 4.x dependency #402

Closed

Description

@harryswift01

Bug Report

flit publish fails during the GitHub Actions release workflow with:

TypeError: SdistBuilder.build() got an unexpected keyword argument 'gen_setup_py'

To Reproduce

- name: Install flit
  run: |
    python -m pip install --upgrade pip
    python -m pip install flit~=3.9

- name: Publish
  run: flit publish

Build configuration:

[build-system]
requires = ["flit_core >=3.4,<4"]
build-backend = "flit_core.buildapi"

Actual Output

Run flit publish
Fetching list of valid trove classifiers
Using repository at https://upload.pypi.org/legacy/

...
File ".../flit/build.py", line 46, in main
    sdist_file = sb.build(dist_dir, gen_setup_py=gen_setup_py)

TypeError: SdistBuilder.build() got an unexpected keyword argument 'gen_setup_py'

Error: Process completed with exit code 1.

Expected Behaviour

The package should build and publish successfully to PyPI.

Environment

  • GitHub Actions
  • Python 3.14.6
  • Flit installed with flit~=3.9

Activity

  1. self-assigned this
    on Aug 18, 2026
  2. added theissue type on Aug 18, 2026
  3. added
    bug
    on Aug 18, 2026
  4. linked a pull request that will close this issueUpdate Flit release tooling to v4 #403on Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions