Skip to content

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

Merged
abn merged 3 commits into
python-poetry:masterfrom
finswimmer:issue-2910-exlude-in-wheel
Sep 23, 2020
Merged

Fix: Exclude file from wheel when listed in gitignore and src layout is used#81
abn merged 3 commits into
python-poetry:masterfrom
finswimmer:issue-2910-exlude-in-wheel

Conversation

@finswimmer
Copy link
Copy Markdown
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
Comment thread poetry/core/masonry/builders/wheel.py Outdated
Comment thread poetry/core/masonry/builders/builder.py
…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
Comment thread poetry/core/masonry/builders/wheel.py
Comment thread poetry/core/masonry/builders/builder.py
Comment thread poetry/core/masonry/builders/builder.py Outdated
Comment thread poetry/core/masonry/builders/builder.py
…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