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

CI Failures on Windows for Python 3.12.0a5 #1087

Closed
rmartin16 opened this issue Feb 8, 2023 · 3 comments · Fixed by #1088
Closed

CI Failures on Windows for Python 3.12.0a5 #1087

rmartin16 opened this issue Feb 8, 2023 · 3 comments · Fixed by #1088
Labels
android The issue relates to Android mobile support. bug A crash or error in behavior.

Comments

@rmartin16
Copy link
Member

rmartin16 commented Feb 8, 2023

Describe the bug

CI is failing on Windows for (recently released) Python 3.12.0a5.

==============================================================================
FAIL: tests/platforms/android/gradle/test_create.py::test_extract_packages[test_sources8-"leading"]
------------------------------------------------------------------------------
test_sources=['//leading']
app.test_sources=['//leading']
{'extract_packages': '""',
 'safe_formal_name': 'First App',
 'version_code': '100'}

Traceback (most recent call last):
  File "C:\Users\user\github\beeware\briefcase\tests\platforms\android\gradle\test_create.py", line 112, in test_extract_packages
    assert context["extract_packages"] == expected
AssertionError: assert '""' == '"leading"'
  - "leading"
  + ""

==============================================================================
FAIL: tests/platforms/android/gradle/test_create.py::test_extract_packages[test_sources21-"leading"]
------------------------------------------------------------------------------
test_sources=['\\\\leading']
app.test_sources=['\\\\leading']
{'extract_packages': '""',
 'safe_formal_name': 'First App',
 'version_code': '100'}

Traceback (most recent call last):
  File "C:\Users\user\github\beeware\briefcase\tests\platforms\android\gradle\test_create.py", line 112, in test_extract_packages
    assert context["extract_packages"] == expected
AssertionError: assert '""' == '"leading"'
  - "leading"
  + ""

------------------------------------------------------------------------------

(output augmented to include additional information)

Steps to reproduce

Run CI.

Expected behavior

CI should succeed.

I believe this CPython change is causing this new behavior.

I am not entirely sure what is necessary to resolve this, though. Based on the CPython fix, these are not really valid paths for Windows.

Notably, this CPython fix was backported to 3.11.

Screenshots

No response

Environment

  • Operating System: Windows 10
  • Python version: 3.12.0a5
  • Software versions:
    • Briefcase: 0.3.13.dev33+g8d503064.d20230208

Logs

No response

Additional context

No response

@rmartin16 rmartin16 added bug A crash or error in behavior. android The issue relates to Android mobile support. labels Feb 8, 2023
@freakboy3742
Copy link
Member

I'd like @mhsmith's take on this to be certain, but I think your analysis is correct - absolute paths are invalid tests in this case.

I could even see an argument that paths are invalid - it's a list of packages that should be extracted, not a list of paths, to my understanding. I think the paths will always be "android local" paths, and relative to the bundled Android app, so referring to them as if they were OS-local paths (and using Pathlib, which will use platform-appropriate separators) seems misleading at best.

@mhsmith
Copy link
Member

mhsmith commented Feb 9, 2023

These paths are actually from the project's test_sources setting, so they are on the build machine, and may be relative or absolute. Unfortunately it looks like there's been a change in the way Python deals with Windows network shares (also called "UNC" paths), which begin with two slashes. I'll look into this today.

@mhsmith
Copy link
Member

mhsmith commented Feb 9, 2023

Notably, this CPython fix was backported to 3.11.

The backport should have been released in 3.11.2, so in #1088 I've set that as the minimum version where we expect the new behavior. It was only released yesterday, so GitHub Actions hasn't picked it up yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android The issue relates to Android mobile support. bug A crash or error in behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants