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

Add ignore_git_ignore flag to build options #1253

Closed
wants to merge 1 commit into from

Conversation

mbrobbel
Copy link
Contributor

@mbrobbel mbrobbel commented Nov 7, 2022

This can be set to include files that are ignored by .gitignore files. This was added in #695.

This may be helpful when Python modules are generated as part of a build. The module should be included in the wheel, but not in the git repo which is why it's in the .gitignore file.

@netlify
Copy link

netlify bot commented Nov 7, 2022

Deploy Preview for maturin-guide ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 4b8fc72
🔍 Latest deploy log https://app.netlify.com/sites/maturin-guide/deploys/63692db61e35a800083cfa7f
😎 Deploy Preview https://deploy-preview-1253--maturin-guide.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@messense
Copy link
Member

messense commented Nov 8, 2022

I don't believe this is the way to go. Excluding files via gitignore is a sensible default, simply disable it may cause more issues.

For sdist we already have sdist-include configuration, but there isn't one for wheel yet. Something like the include and exclude configuration of Poetry would be better IMO.

@mbrobbel
Copy link
Contributor Author

mbrobbel commented Nov 8, 2022

I totally agree with the current default behavior to excludes files listed in ignore files, and the added flag defaults to false which makes this a non-breaking change. Maybe the name is a bit confusing (double negative), but setting ignore_git_ignore to true disables excluding files via gitignore.

For sdist we already have sdist-include configuration, but there isn't one for wheel yet. Something like the include and exclude configuration of Poetry would be better IMO.

Are you suggesting to add that to maturin?

[tool.maturin]
include = []
exclude = []

I could try to implement that. Should we keep the sdist-include or (breaking change) copy the format key behavior from Poetry and deprecate the sdist-include configuration?

@messense
Copy link
Member

messense commented Nov 8, 2022

Are you suggesting to add that to maturin?

Yes

Should we keep the sdist-include or (breaking change) copy the format key behavior from Poetry and deprecate the sdist-include configuration?

We should first deprecate it and print a warning when it appears in configuration, we can then remove sdist-include in the next breaking change release to give users time to migrate to the new format.

bors bot added a commit that referenced this pull request Nov 9, 2022
1255: Add `[tool.maturin.include]` and `[tool.maturin.exclude]` r=messense a=mbrobbel

Based on the discussion in #1253, this is another attempt to allow users to override ignore files in Python modules by adding `[tool.maturin.include]` and `[tool.maturin.exclude]` similar to [Poetry](https://python-poetry.org/docs/pyproject/#include-and-exclude). This deprecates `[tool.maturin.sdist-include]`.

After some feedback on this approach, I'll add:
- [x] Documentation updates
- [x] Integration tests

Closes #1253


Co-authored-by: Matthijs Brobbel <[email protected]>
bors bot added a commit that referenced this pull request Nov 9, 2022
1255: Add `[tool.maturin.include]` and `[tool.maturin.exclude]` r=messense a=mbrobbel

Based on the discussion in #1253, this is another attempt to allow users to override ignore files in Python modules by adding `[tool.maturin.include]` and `[tool.maturin.exclude]` similar to [Poetry](https://python-poetry.org/docs/pyproject/#include-and-exclude). This deprecates `[tool.maturin.sdist-include]`.

After some feedback on this approach, I'll add:
- [x] Documentation updates
- [x] Integration tests

Closes #1253


Co-authored-by: Matthijs Brobbel <[email protected]>
@bors bors bot closed this in ee86fd8 Nov 9, 2022
@mbrobbel mbrobbel deleted the ignore-gitignore branch November 9, 2022 18:18
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

Successfully merging this pull request may close these issues.

2 participants