Skip to content

Commit

Permalink
Add tests of multi-pass requirements install and support package hand…
Browse files Browse the repository at this point in the history
…ling.
  • Loading branch information
freakboy3742 committed Oct 5, 2023
1 parent 3873598 commit d270c24
Show file tree
Hide file tree
Showing 6 changed files with 454 additions and 34 deletions.
3 changes: 3 additions & 0 deletions src/briefcase/platforms/macOS/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def _install_app_requirements(
[
sys.executable,
"-u",
"-X",
"utf8",
"-m",
"pip",
"install",
Expand All @@ -100,6 +102,7 @@ def _install_app_requirements(
for package, version in binary_packages
],
check=True,
encoding="UTF-8",
env={
"PYTHONPATH": str(
self.support_path(app)
Expand Down
29 changes: 24 additions & 5 deletions tests/platforms/macOS/app/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


@pytest.fixture
def first_app_with_binaries(first_app_config, tmp_path):
def first_app_templated(first_app_config, tmp_path):
app_path = (
tmp_path
/ "base_path"
Expand Down Expand Up @@ -59,8 +59,30 @@ def first_app_with_binaries(first_app_config, tmp_path):
},
)

# Create some folders that need to exist.
(app_path / "Contents" / "Resources" / "app_packages").mkdir(parents=True)
(app_path / "Contents" / "Frameworks").mkdir(parents=True)

# Select dmg packaging by default
first_app_config.packaging_format = "dmg"

return first_app_config


@pytest.fixture
def first_app_with_binaries(first_app_templated, first_app_config, tmp_path):
app_path = (
tmp_path
/ "base_path"
/ "build"
/ "first-app"
/ "macos"
/ "app"
/ "First App.app"
)

# Create some libraries that need to be signed.
lib_path = app_path / "Contents" / "Resources"
lib_path = app_path / "Contents" / "Resources" / "app_packages"
frameworks_path = app_path / "Contents" / "Frameworks"

for lib in [
Expand Down Expand Up @@ -103,7 +125,4 @@ def first_app_with_binaries(first_app_config, tmp_path):
with (lib_path / "unknown.binary").open("wb") as f:
f.write(b"\xCA\xFE\xBA\xBEother")

# Select dmg packaging by default
first_app_config.packaging_format = "dmg"

return first_app_config
Loading

0 comments on commit d270c24

Please sign in to comment.