Skip to content

Commit

Permalink
Merge pull request #270 from acsone/build-from-empty-directory
Browse files Browse the repository at this point in the history
Start wheel build from an empty directory
  • Loading branch information
sbidoul authored Dec 16, 2023
2 parents 734e5c5 + 122b23a commit aac1932
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
2 changes: 2 additions & 0 deletions newsfragments/270.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Start wheel build from an empty directory, to avoid accidentally importing
python files from the addon root directory during the build process.
28 changes: 16 additions & 12 deletions src/oca_github_bot/build_wheels.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,22 @@ def __init__(self):
)

def build_wheel(self, project_dir: Path, dist_dir: str) -> None:
check_call(
[
self.env_python,
"-m",
"build",
"--wheel",
"--outdir",
dist_dir,
"--no-isolation",
],
cwd=project_dir,
)
with tempfile.TemporaryDirectory() as empty_dir:
# Start build from an empty directory, to avoid accidentally importing
# python files from the addon root directory during the build process.
check_call(
[
self.env_python,
"-m",
"build",
"--wheel",
"--outdir",
dist_dir,
"--no-isolation",
project_dir,
],
cwd=empty_dir,
)
self._check_wheels(dist_dir)
return True

Expand Down

0 comments on commit aac1932

Please sign in to comment.