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

When Building Wheels, Resolve Relative Path Dependencies Correctly #2114

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions poetry/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Factory:
"""

def create_poetry(
self, cwd=None, io=None
self, cwd=None, io=None, original_root=None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing type hint.

): # type: (Optional[Path], Optional[IO]) -> Poetry
if io is None:
io = NullIO()
Expand All @@ -57,7 +57,7 @@ def create_poetry(
name = local_config["name"]
version = local_config["version"]
package = ProjectPackage(name, version, version)
package.root_dir = poetry_file.parent
package.root_dir = original_root or poetry_file.parent
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will sort of defeat the purpose, since we really want the build to use the source in cwd. We might want to consider another approach to this one.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So after reading #2046 and especially the fact that these relative paths work fine if you build ONLY the wheel or ONLY the sdist... I have to ask, where is the need for this "isolated source copy" coming from? Building only the sdist doesn't seem to need it, building only the wheel doesn't seem to need it. So why is the CompleteBuilder trying to do something more than simply running both individual builders?


for author in local_config["authors"]:
package.authors.append(author)
Expand Down
8 changes: 6 additions & 2 deletions poetry/masonry/builders/complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ def build(self):

with self.unpacked_tarball(sdist_file) as tmpdir:
WheelBuilder.make_in(
Factory().create_poetry(tmpdir),
Factory().create_poetry(
tmpdir, original_root=self._poetry.file.path.parent
),
self._env,
self._io,
dist_dir,
Expand All @@ -52,7 +54,9 @@ def build(self):
else:
with self.unpacked_tarball(sdist_file) as tmpdir:
WheelBuilder.make_in(
Factory().create_poetry(tmpdir),
Factory().create_poetry(
tmpdir, original_root=self._poetry.file.path.parent
),
self._env,
self._io,
dist_dir,
Expand Down