Skip to content

Conversation

@lrandersson
Copy link
Contributor

@lrandersson lrandersson commented Dec 9, 2025

Description

Opened this one separately, this branch and PR depends on #1084. No need to review this for now since the diff will look strange and is more for book-keeping since these changes were pulled out of PR 1084.

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@github-project-automation github-project-automation bot moved this to 🆕 New in 🔎 Review Dec 9, 2025
@lrandersson lrandersson changed the base branch from main to briefcase-integration December 9, 2025 20:40
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Dec 9, 2025
@lrandersson lrandersson marked this pull request as ready for review December 17, 2025 14:10
@lrandersson lrandersson requested a review from a team as a code owner December 17, 2025 14:10
@lrandersson lrandersson mentioned this pull request Dec 17, 2025
3 tasks

- name: Install Briefcase (editable)
run: |
pip install -e briefcase
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this still needed? Either way, this should only be installed for Windows.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, I removed that

input_path = _example_path("register_envs")
for installer, install_dir in create_installer(input_path, tmp_path):
if installer.suffix == ".msi":
raise Exception("Test for 'register_envs' not yet implemented for MSI")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should these exceptions be NotImplementedError?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, changed to NotImplementedError

if "license_file" in info:
return {"file": info["license_file"]}
# We cannot return an empty string because that results in an exception on the briefcase side.
return {"text": "TODO"}
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, updated!

Comment on lines 353 to 356
if is_admin():
root_dir = Path(os.environ.get("PROGRAMFILES") or r"C:\Program Files")
else:
local_dir = os.environ.get("LOCALAPPDATA") or str(Path.home() / r"AppData\Local")
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you using or instead of default values to account for empty strings?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, updated to follow the convention we use with .get("FOO", <default>)

process = _execute(cmd, installer_input=installer_input, timeout=timeout, check=check)
except subprocess.CalledProcessError as e:
if log_path.exists():
# When running on the CI system, it gets misdecodes a UTF-16 log file as UTF-8,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# When running on the CI system, it gets misdecodes a UTF-16 log file as UTF-8,
# When running on the CI system, it tries to decode a UTF-16 log file as UTF-8,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Comment on lines 492 to 494
if request: # and ON_CI
# We always need to do this currently since uninstall doesnt work fully
request.addfinalizer(lambda: shutil.rmtree(str(install_dir), ignore_errors=True))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not add rmtree to _run_uninstaller_msi then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Initially I didn't want to the interface to *_uninstaller_msi and *_uninstaller_exe to differ, but since this is temporary I've updated it now, I agree it looks more concise this way.

Comment on lines 646 to 649
if request:
request.addfinalizer(
lambda: shutil.rmtree(str(install_dir), ignore_errors=True)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here - consider adding to _run_uninstaller_msi, especially since this is used in other tests later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

install_dir: Path,
timeout: int = 420,
check: bool = True,
request: bool = False,
Copy link
Contributor

Choose a reason for hiding this comment

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

request is not a boolean, but a FixtureRequest object: https://docs.pytest.org/en/stable/reference/reference.html#request

However, I would say that it's generally not needed as a finalizer. We can just add rmtree as a clean-up step until the uninstallation works well.

Copy link
Contributor Author

@lrandersson lrandersson Jan 15, 2026

Choose a reason for hiding this comment

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

Ahh good that you caught that, I should not make assumptions based on an expression like if request:, I've updated it 496bf86, let me know if this is what you were thinking. I think this should be OK now, we always invoke rmtree, hopefully no test depended on rmtree not being called.

@lrandersson
Copy link
Contributor Author

@marcoesters is it possible to restart the CLA/check that failed intermittently?

@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Approved in 🔎 Review Jan 15, 2026
@marcoesters marcoesters merged commit 36a1479 into conda:briefcase-integration Jan 15, 2026
20 of 21 checks passed
@github-project-automation github-project-automation bot moved this from ✅ Approved to 🏁 Done in 🔎 Review Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed [bot] added once the contributor has signed the CLA

Projects

Status: 🏁 Done

Development

Successfully merging this pull request may close these issues.

3 participants