Skip to content

Commit

Permalink
Ensure the sandbox distdir exists when creating dists via PEP517 (Che…
Browse files Browse the repository at this point in the history
…rrypick of #16647) (#16660)

Also fixes a docsite text alignment issue that didn't merit its own change.
  • Loading branch information
benjyw committed Aug 26, 2022
1 parent 0a0e964 commit ed3d8d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/markdown/Python/python/python-distributions.md
Expand Up @@ -180,8 +180,8 @@ For each `python_source` target S, the distribution in which S's code is publish
1. A `python_distribution` that depends, directly or indirectly, on S.
2. Is S's closest filesystem ancestor among those satisfying 1.
If there are multiple such exported source files at the same degree of ancestry, the ownership
is ambiguous and an error is raised. If there is no `python_distribution` that depends on S
If there are multiple such exported source files at the same degree of ancestry, the ownership
is ambiguous and an error is raised. If there is no `python_distribution` that depends on S
and is its ancestor, then there is no owner and an error is raised.
This algorithm implies that all source files published by a distribution must be below it in the filesystem. It also guarantees that a source file is only published by a single distribution.
Expand Down
2 changes: 2 additions & 0 deletions src/python/pants/backend/python/util_rules/dists.py
Expand Up @@ -144,6 +144,7 @@ class DistBuildResult:
_BACKEND_SHIM_BOILERPLATE = """
# DO NOT EDIT THIS FILE -- AUTOGENERATED BY PANTS
import os
import {build_backend_module}
backend = {build_backend_object}
Expand All @@ -154,6 +155,7 @@ class DistBuildResult:
wheel_config_settings = {wheel_config_settings_str}
sdist_config_settings = {sdist_config_settings_str}
os.makedirs(dist_dir, exist_ok=True)
wheel_path = backend.build_wheel(dist_dir, wheel_config_settings) if build_wheel else None
sdist_path = backend.build_sdist(dist_dir, sdist_config_settings) if build_sdist else None
Expand Down

0 comments on commit ed3d8d6

Please sign in to comment.