Skip to content

Add script to generate sdist included/exclude patterns from git#782

Merged
takluyver merged 3 commits into
mainfrom
gen-sdist-patterns
Apr 25, 2026
Merged

Add script to generate sdist included/exclude patterns from git#782
takluyver merged 3 commits into
mainfrom
gen-sdist-patterns

Conversation

@takluyver

@takluyver takluyver commented Oct 25, 2025

Copy link
Copy Markdown
Member

This is meant to ease making --no-use-vcs the default for flit build and flit publish, by generating sdist include & exclude patterns to produce sdists with the same contents as before. See #673.

To use it:

  • Generate any files that should be excluded from the sdist, e.g. virtualenvs, built docs, test coverage results, so the script can see them.
    • But only files/folders within included folders actually need to be excluded - extra things in the project root are left out by default
  • cd to the project root (where pyproject.toml is)
  • Run python -m flit.sdist_rules
  • Copy the output into pyproject.toml, make any changes you want

At present, this only looks at the files in the folder, aiming to include anything tracked in git, and exclude anything that isn't. This is why it's necessary to generate the unwanted files first. I'm still thinking about whether it can be smarter using .gitignore.

@takluyver takluyver added this to the 4.0 milestone Oct 25, 2025
@takluyver takluyver mentioned this pull request Oct 25, 2025
4 tasks
@takluyver

Copy link
Copy Markdown
Member Author

This probably isn't perfect, but I think it's good enough.

@takluyver takluyver merged commit 2581e66 into main Apr 25, 2026
16 of 18 checks passed
@takluyver takluyver deleted the gen-sdist-patterns branch April 25, 2026 13:58
potiuk added a commit to potiuk/airflow that referenced this pull request Apr 26, 2026
…files

Prepares for flit 4 making --no-use-vcs the default
(pypa/flit#782, pypa/flit#673). With explicit
sdist include lists, sdist contents no longer depend on git, which also
fixes the worktree fail-fast case from apache#65771.

The provider template emits namespace __init__.py lines based on
provider-id depth (e.g. microsoft.azure also includes
airflow/providers/microsoft/__init__.py). The 97 flit-based provider
pyproject.toml files were regenerated from the updated template.
dev/breeze, devel-common, and performance got their own include lists.

The flit_core==3.12.0 pin is unchanged - bumping to allow flit 4 is
left to dependabot once flit 4 ships.
potiuk added a commit to potiuk/airflow that referenced this pull request Apr 26, 2026
…files

Prepares for flit 4 making --no-use-vcs the default
(pypa/flit#782, pypa/flit#673). With explicit
sdist include lists, sdist contents no longer depend on git, which also
fixes the worktree fail-fast case from apache#65771.

The provider template emits namespace __init__.py lines based on
provider-id depth (e.g. microsoft.azure also includes
airflow/providers/microsoft/__init__.py). The 97 flit-based provider
pyproject.toml files were regenerated from the updated template.
dev/breeze, devel-common, and performance got their own include lists.

The flit_core==3.12.0 pin is unchanged - bumping to allow flit 4 is
left to dependabot once flit 4 ships.
potiuk added a commit to potiuk/airflow that referenced this pull request Apr 27, 2026
…files

Prepares for flit 4 making --no-use-vcs the default
(pypa/flit#782, pypa/flit#673). With explicit
sdist include lists, sdist contents no longer depend on git, which also
fixes the worktree fail-fast case from apache#65771.

The provider template emits namespace __init__.py lines based on
provider-id depth (e.g. microsoft.azure also includes
airflow/providers/microsoft/__init__.py). The 97 flit-based provider
pyproject.toml files were regenerated from the updated template.
dev/breeze, devel-common, and performance got their own include lists.

The flit_core==3.12.0 pin is unchanged - bumping to allow flit 4 is
left to dependabot once flit 4 ships.
potiuk added a commit to apache/airflow that referenced this pull request Apr 27, 2026
…#65861)

* Add explicit [tool.flit.sdist] sections to flit-based pyproject.toml files

Prepares for flit 4 making --no-use-vcs the default
(pypa/flit#782, pypa/flit#673). With explicit
sdist include lists, sdist contents no longer depend on git, which also
fixes the worktree fail-fast case from #65771.

The provider template emits namespace __init__.py lines based on
provider-id depth (e.g. microsoft.azure also includes
airflow/providers/microsoft/__init__.py). The 97 flit-based provider
pyproject.toml files were regenerated from the updated template.
dev/breeze, devel-common, and performance got their own include lists.

The flit_core==3.12.0 pin is unchanged - bumping to allow flit 4 is
left to dependabot once flit 4 ships.

* Add [tool.flit.sdist] section to akeyless provider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant