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

Fix: Exclude file from wheel when listed in gitignore and src layout is used #81

Merged
merged 3 commits into from
Sep 23, 2020

Conversation

finswimmer
Copy link
Member

@finswimmer finswimmer commented Sep 15, 2020

In case a src-layout is used, excluding files via .gitignore currently fails for build wheels.

This is due to the fact that vcs.get_ignored_files() gives the relative path to the project folder, but the current file is given relative to the package folder.

This PR fixes this by make the comparison relative to the project folder.

Resolves: python-poetry/poetry#2910

  • Added tests for changed code.
  • Updated documentation for changed code.

…before setting source root to the package base

fix (masonry.builders.wheel): fix substitution in string formation
new (tests.masonry.builders.test_wheel): test to check if file is excluded in wheel, when listed in gitignore and src layout is used
@finswimmer finswimmer requested a review from a team September 15, 2020 04:59
poetry/core/masonry/builders/wheel.py Outdated Show resolved Hide resolved
poetry/core/masonry/builders/builder.py Outdated Show resolved Hide resolved
…dIncludeFile` to store the original path to the project's root folder

new (masonry.builders.builder): method to return relative path to project's root for `BuildIncludeFile`
change (masonry.builders.builder): use relative path to project's root when checking if BuildIncludeFile is excluded
fix (masonry.builders.wheel): fix substitution in string formation
@finswimmer finswimmer requested a review from abn September 17, 2020 04:36
poetry/core/masonry/builders/wheel.py Show resolved Hide resolved
poetry/core/masonry/builders/builder.py Show resolved Hide resolved
poetry/core/masonry/builders/builder.py Outdated Show resolved Hide resolved
poetry/core/masonry/builders/builder.py Show resolved Hide resolved
…ttribute of `Builder`

fix (masonry.builders.builder): fix some type hints
@finswimmer finswimmer requested a review from abn September 20, 2020 17:22
@abn abn merged commit a056c46 into python-poetry:master Sep 23, 2020
@abn abn mentioned this pull request Sep 25, 2020
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.

poetry build not respecting git's ignore patterns when -f is specified
2 participants