The documentation claims:
Changed in version 3.8: Include and exclude patterns can now use recursive glob patterns (**).
However, using flit-core 3.12, I try using this clause in pyproject.toml:
[tool.flit.sdist]
exclude = ["**/*.swp"]
and use build programmatically to invoke flit-core (via a wrapper script):
def build_from_sdist(src, dst):
builder = ProjectBuilder(src)
# delete = False for debugging
with TemporaryDirectory(delete=False) as sdist_build_dir:
print("THE DIRECTORY IS AT:", sdist_build_dir) # for debugging
ProjectBuilder(src).build('sdist', sdist_build_dir)
and discover that the resulting sdist still contains those .swp files (corresponding to source files I currently have open in Vim; they are named with a leading .). Although notably it does not include e.g. .pyproject.toml.swp.
Specifying an explicit, complete path to one of the "temporary" files (still leaving everything open in Vim while running the build script) does cause that file to be excluded from the sdist.
The documentation claims:
However, using flit-core 3.12, I try using this clause in
pyproject.toml:and use
buildprogrammatically to invoke flit-core (via a wrapper script):and discover that the resulting sdist still contains those
.swpfiles (corresponding to source files I currently have open in Vim; they are named with a leading.). Although notably it does not include e.g..pyproject.toml.swp.Specifying an explicit, complete path to one of the "temporary" files (still leaving everything open in Vim while running the build script) does cause that file to be excluded from the sdist.