Skip to content

Commit 7513ff6

Browse files
committed
Port the README changes and test suite from the dev branch.
1 parent 5a748a5 commit 7513ff6

31 files changed

+460
-18
lines changed

.github/workflows/release.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ jobs:
3939
4040
Includes:
4141
* Python ${{ env.PY_VERSION }}.?
42-
* ...
42+
* OpenSSL 1.1.1?
43+
* BZip2 1.0.8
44+
* XZ 5.2.5
4345
outputs:
4446
upload_url: ${{ steps.create_release.outputs.upload_url }}
4547

README.rst

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Python Apple Support
22
====================
33

4-
**This repository branch builds a packaged version of Python 3.7.11**.
4+
**This repository branch builds a packaged version of Python 3.7.13**.
55
Other Python versions are available by cloning other branches of the main
66
repository.
77

@@ -12,21 +12,39 @@ It works by downloading, patching, and building a fat binary of Python and
1212
selected pre-requisites, and packaging them as static libraries that can be
1313
incorporated into an XCode project.
1414

15-
The binaries support x86_64 for macOS; arm64 for iOS and appleTV devices;
16-
and armv7k for watchOS. This should enable the code to run on:
17-
18-
* MacBook (MacBooks using Apple Silicon will run under Rosetta x86 emulation)
19-
* iMac (iMacs using Apple Silicon will run under Rosetta x86 emulation)
20-
* Mac Mini (iMacs using Apple Silicon will run under Rosetta x86 emulation)
21-
* Mac Pro
22-
* iPhone (5s or later)
23-
* iPad (5th gen or later)
24-
* iPad Air (all models)
25-
* iPad Mini (2 or later)
26-
* iPad Pro (all models)
27-
* iPod Touch (6th gen or later)
28-
* Apple TV (4th gen or later)
29-
* Apple Watch
15+
It exposed *almost* all the modules in the Python standard library except for:
16+
* dbm.gnu
17+
* tkinter
18+
* readline
19+
* nis (Deprecated by PEP594)
20+
* ossaudiodev (Deprecated by PEP594)
21+
* spwd (Deprecated by PEP594)
22+
23+
The following standard library modules are available on macOS, but not the other
24+
Apple platforms:
25+
* curses
26+
* posixshmem
27+
* posixsubprocess
28+
29+
The binaries support x86_64 for macOS; arm64 for iOS and appleTV devices; and
30+
armv7k for watchOS. It also supports device simulators on both x86_64 and M1
31+
hardware. This should enable the code to run on:
32+
33+
* macOS 10.8 (Catalina) or later, on:
34+
* MacBook (MacBooks using Apple Silicon will run under Rosetta emulation)
35+
* iMac (iMacs using Apple Silicon will run under Rosetta emulation)
36+
* Mac Mini (Mac Minis using Apple Silicon will run under Rosetta emulation)
37+
* Mac Studio (using Rosetta emulation)
38+
* Mac Pro (all models)
39+
* iOS 8.0 or later, on:
40+
* iPhone (6s or later)
41+
* iPad (5th gen or later)
42+
* iPad Air (all models)
43+
* iPad Mini (2 or later)
44+
* iPad Pro (all models)
45+
* iPod Touch (7th gen or later)
46+
* tvOS 9.0 or later, on Apple TV (4th gen or later)
47+
* watchOS 4.0 or later, on Apple Watch (1st-3rd gen)
3048

3149
Quickstart
3250
----------
@@ -47,7 +65,7 @@ This should:
4765

4866
1. Download the original source packages
4967
2. Patch them as required for compatibility with the selected OS
50-
3. Build the packages as XCode-compatible frameworks.
68+
3. Build the packages in an XCode-compatible form.
5169

5270
The build products will be in the `build` directory; the compiled frameworks
5371
will be in the `dist` directory.

tests/testbed/README.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Python Apple Support Testbed
2+
============================
3+
4+
This is a testbed application that can be used to do basic verification checks
5+
of the Python Apple Support builds.
6+
7+
The app can be deployed with Briefcase. When executed, (using `briefcase run
8+
macOS Xcode` or `briefcase run iOS`) the app will generate output on the console
9+
log that is similar to a unit test suite. If it returns 0 test failures, you can
10+
have some confidence that the support build is functioning as expected.
11+
12+
The default configuration assumes that you have already run `make` in the root
13+
directory of this repository.

tests/testbed/pyproject.toml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[tool.briefcase]
2+
project_name = "Testbed"
3+
bundle = "org.beeware"
4+
version = "0.0.1"
5+
url = "https://beeware.org"
6+
license = "BSD license"
7+
author = 'Russell Keith-Magee'
8+
author_email = "[email protected]"
9+
10+
[tool.briefcase.app.testbed]
11+
formal_name = "Testbed"
12+
description = "A testbed for the Apple Support packages."
13+
icon = "src/testbed/resources/testbed"
14+
sources = ['src/testbed']
15+
requires = [
16+
]
17+
18+
[tool.briefcase.app.testbed.macOS]
19+
requires = [
20+
"rubicon-objc",
21+
"std-nslog",
22+
]
23+
support_package = "../../dist/Python-3.7-macOS-support.custom.tar.gz"
24+
25+
[tool.briefcase.app.testbed.linux]
26+
supported = false
27+
28+
[tool.briefcase.app.testbed.windows]
29+
supported = false
30+
31+
# Mobile deployments
32+
[tool.briefcase.app.testbed.iOS]
33+
requires = [
34+
"rubicon-objc",
35+
"std-nslog",
36+
]
37+
support_package = "../../dist/Python-3.7-iOS-support.custom.tar.gz"
38+
39+
[tool.briefcase.app.testbed.android]
40+
supported = false

tests/testbed/src/testbed/__init__.py

Whitespace-only changes.

tests/testbed/src/testbed/__main__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from testbed.app import main
2+
3+
if __name__ == "__main__":
4+
main()

tests/testbed/src/testbed/app.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
"""
2+
A testbed for the Apple Support packages.
3+
"""
4+
import importlib
5+
import platform
6+
import sys
7+
import traceback
8+
9+
from . import common
10+
11+
12+
def discover_tests(module):
13+
"Discover all the test methods in the given module"
14+
return [
15+
(getattr(module, "__name__").split(".")[-1], getattr(module, name))
16+
for name in dir(module)
17+
if name.startswith("test_")
18+
]
19+
20+
21+
def main():
22+
# This should start and launch your app!
23+
print("=" * 80)
24+
print(f"Python {platform.python_version()} Apple Support verification suite")
25+
print(f"Running on {platform.platform()}")
26+
print("=" * 80)
27+
# Discover the common test suite
28+
suite = discover_tests(common)
29+
30+
# Discover the platform-specific tests
31+
try:
32+
module = importlib.import_module(f".{sys.platform}", "testbed")
33+
suite.extend(discover_tests(module))
34+
except ModuleNotFoundError:
35+
print(f"No platform-specific tests for {sys.platform}")
36+
37+
# Run the suite
38+
failures = 0
39+
tests = 0
40+
for sys_platform, test in suite:
41+
try:
42+
tests += 1
43+
# If the test has a docstring, use that text;
44+
# otherwise, use the test name
45+
if test.__doc__:
46+
print(f"{sys_platform}: {test.__doc__}", end="...")
47+
else:
48+
print(f"{sys_platform}: {test.__name__}", end="...")
49+
test()
50+
print(" ok")
51+
except Exception:
52+
failures += 1
53+
print(" FAILED!")
54+
print("-" * 80)
55+
traceback.print_exc()
56+
print("-" * 80)
57+
58+
print("=" * 80)
59+
print(f"Tests complete; {tests} tests, {failures} failures.")
60+
sys.exit(failures)

0 commit comments

Comments
 (0)