Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional exclusion of files/folders depending on build distribution? #636

Closed
Zeitsperre opened this issue Apr 5, 2023 · 2 comments
Closed

Comments

@Zeitsperre
Copy link

Hi,

I'm wondering if there is a way to specify certain folders being selectively included/excluded depending on format (ie: source/wheel). My use case is that I would like to include my tests folder in the source distribution but exclude them when building the wheel. Is this currently possible? Essentially, something like the following:

For sdist:

[tool.flit.sdist]
include = ["docs/", "tests/"]
exclude = ["docs/*.html"]```

and for bdist_wheel:

[tool.flit.bdist_wheel]
include = ["docs/"]
exclude = ["doc/*.html", "tests/"]

I wasn't sure if this was a feature that was already implemented for flit, but I couldn't find anything in the documentation that suggested otherwise.

Thanks,

Reference: pyOpenSci/software-submission#73 (comment)

@takluyver
Copy link
Member

I would like to include my tests folder in the source distribution but exclude them when building the wheel.

The wheel contains whatever is in the package directory. So if your tests are outside the package directory (typically in a separate top-level tests folder), they'll automatically be excluded from the wheel. It's easy to include this folder in the sdist, and generally a good idea to do so.

On the other hand, if your tests are inside the package directory, as I see they are in xclim at present, that means (from Flit's perspective) that you want them to get installed with your package, for which they need to be in the wheel as well.

@Zeitsperre
Copy link
Author

Understood. It's reasonable to change our structure a bit by moving the tests explicitly out of the package structure. Thanks for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants