Skip to content

Commit 8a757bd

Browse files
MacOS, Windows and Linux support (#27)
1 parent 9b35e51 commit 8a757bd

File tree

331 files changed

+14641
-365
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

331 files changed

+14641
-365
lines changed

.appveyor.yml

Lines changed: 209 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ skip_branch_with_pr: true
44

55
environment:
66
PYTHON_STACK: python 3.10
7-
FLUTTER_MACOS_URL: https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_3.10.5-stable.zip
7+
FLUTTER_MACOS_URL: https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_3.13.7-stable.zip
88
GITHUB_TOKEN:
99
secure: doX0dwjWhBmT56aJqR9NCbtMFJpDpdYxPCIB4vQoHfSR+nTa+pLCo6Yv5qWpD/90
1010

@@ -17,9 +17,36 @@ environment:
1717
job_group: build_python
1818
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
1919

20+
- job_name: Test on macOS
21+
job_group: test_serious_python
22+
job_depends_on: build_python
23+
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
24+
25+
- job_name: Test on iOS
26+
job_group: test_serious_python
27+
job_depends_on: build_python
28+
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
29+
30+
- job_name: Test on Android
31+
job_group: test_serious_python
32+
job_depends_on: build_python
33+
APPVEYOR_BUILD_WORKER_IMAGE: ubuntu-gce-c
34+
35+
- job_name: Test on Windows
36+
job_group: test_serious_python
37+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
38+
39+
- job_name: Test on Linux
40+
job_group: test_serious_python
41+
APPVEYOR_BUILD_WORKER_IMAGE: ubuntu2004
42+
43+
- job_name: Test on Linux ARM64
44+
job_group: test_serious_python
45+
APPVEYOR_BUILD_WORKER_IMAGE: ubuntu2004-arm
46+
2047
- job_name: Publish serious_python package to pub.dev
2148
job_group: publish_package
22-
job_depends_on: build_python
49+
job_depends_on: build_python, test_serious_python
2350
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
2451

2552
stack:
@@ -46,6 +73,7 @@ for:
4673
Update-AppveyorBuild -Version $v
4774
4875
# install Kivy toolchain
76+
- pip3 list
4977
- pip3 install kivy-ios
5078
- HOMEBREW_NO_AUTO_UPDATE=1 brew install autoconf automake libtool pkg-config
5179
- brew link libtool
@@ -138,6 +166,164 @@ for:
138166
on:
139167
APPVEYOR_REPO_TAG: true
140168

169+
# ======================================
170+
# Test on macOS
171+
# ======================================
172+
173+
- matrix:
174+
only:
175+
- job_name: Test on macOS
176+
177+
install:
178+
- HOMEBREW_NO_AUTO_UPDATE=1 brew install cocoapods
179+
- curl $FLUTTER_MACOS_URL -o "$HOME/flutter_macos_stable.zip"
180+
- unzip -qq "$HOME/flutter_macos_stable.zip" -d $HOME
181+
- export PATH="$PATH:$HOME/flutter/bin"
182+
- flutter channel stable
183+
- flutter upgrade
184+
- flutter config --enable-macos-desktop
185+
- flutter doctor
186+
187+
build: off
188+
189+
test_script:
190+
- cd src/serious_python/example/flet_example
191+
- dart run serious_python:main package app/src --pre
192+
- flutter test integration_test -d macos
193+
194+
# ======================================
195+
# Test on iOS
196+
# ======================================
197+
198+
- matrix:
199+
only:
200+
- job_name: Test on iOS
201+
202+
install:
203+
- HOMEBREW_NO_AUTO_UPDATE=1 brew install cocoapods
204+
- curl $FLUTTER_MACOS_URL -o "$HOME/flutter_macos_stable.zip"
205+
- unzip -qq "$HOME/flutter_macos_stable.zip" -d $HOME
206+
- export PATH="$PATH:$HOME/flutter/bin"
207+
- flutter channel stable
208+
- flutter upgrade
209+
- flutter config --enable-macos-desktop
210+
- xcrun simctl list runtimes
211+
- xcrun simctl create "e2e test" "iPhone 12" "com.apple.CoreSimulator.SimRuntime.iOS-16-1"
212+
- xcrun xctrace list devices
213+
- |
214+
UDID=$(xcrun xctrace list devices | grep "^e2e test Simulator (16.1)" | awk '{gsub(/[()]/,""); print $NF}')
215+
echo $UDID
216+
xcrun simctl boot "${UDID:?No Simulator with this name found}"
217+
- flutter doctor -v
218+
219+
build: off
220+
221+
test_script:
222+
- cd src/serious_python/example/flet_example
223+
- dart run serious_python:main package app/src --pre
224+
- flutter drive --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart
225+
226+
# ======================================
227+
# Test on Android
228+
# ======================================
229+
230+
- matrix:
231+
only:
232+
- job_name: Test on Android
233+
234+
install:
235+
- API_LEVEL="33"
236+
- TARGET="google_atd"
237+
- ARCH="x86_64"
238+
- DEVICE_NAME="android_emulator"
239+
- DEVICE_TYPE="pixel_5"
240+
- 'export PATH=$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/emulator:$PATH'
241+
- sdkmanager "platform-tools" "platforms;android-${API_LEVEL}"
242+
- sdkmanager --install "system-images;android-${API_LEVEL};${TARGET};${ARCH}"
243+
- sdkmanager --update
244+
- echo "y" | sdkmanager --licenses
245+
- echo "no" | avdmanager -v create avd --force --name "${DEVICE_NAME}" --package "system-images;android-${API_LEVEL};${TARGET};${ARCH}" --tag "${TARGET}" --sdcard 128M --device "${DEVICE_TYPE}"
246+
- ls -al ~/.android/avd
247+
- sudo adduser $USER kvm
248+
- sudo chown $USER /dev/kvm
249+
- emulator -avd "${DEVICE_NAME}" -memory 2048 -wipe-data -no-boot-anim -cache-size 1000 -noaudio -no-window -partition-size 8192 &
250+
- adb wait-for-device shell 'while [[ -z $(getprop dev.bootcomplete) ]]; do sleep 1; done;'
251+
- flutter upgrade --force
252+
- flutter doctor -v
253+
254+
build: off
255+
256+
test_script:
257+
- cd src/serious_python/example/flet_example
258+
- dart run serious_python:main package app/src --pre
259+
- flutter test integration_test -d emulator-5554
260+
261+
262+
# ======================================
263+
# Test on Windows
264+
# ======================================
265+
266+
- matrix:
267+
only:
268+
- job_name: Test on Windows
269+
270+
#environment:
271+
# VC_REDIST_DIR: 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.29.30133\x64\Microsoft.VC142.CRT'
272+
273+
install:
274+
- flutter upgrade --force
275+
276+
build: off
277+
278+
test_script:
279+
- cd src/serious_python/example/flet_example
280+
- dart run serious_python:main package app/src --pre
281+
- flutter test integration_test -d windows
282+
283+
# ======================================
284+
# Test on Linux
285+
# ======================================
286+
287+
- matrix:
288+
only:
289+
- job_name: Test on Linux
290+
291+
install:
292+
- sudo apt update --allow-releaseinfo-change
293+
- sudo apt install -y xvfb libgtk-3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
294+
- flutter upgrade --force
295+
296+
build: off
297+
298+
test_script:
299+
- cd src/serious_python/example/flet_example
300+
- dart run serious_python:main package app/src --pre
301+
- xvfb-run flutter test integration_test -d linux
302+
303+
# ======================================
304+
# Test on Linux ARM64
305+
# ======================================
306+
307+
- matrix:
308+
only:
309+
- job_name: Test on Linux ARM64
310+
311+
install:
312+
# Flutter SDK
313+
- sudo apt update --allow-releaseinfo-change
314+
- sudo apt install -y clang xvfb libgtk-3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
315+
- git clone https://github.com/flutter/flutter.git -b stable "$HOME/flutter"
316+
- export PATH="$PATH:$HOME/flutter/bin"
317+
- flutter upgrade
318+
- flutter doctor
319+
320+
build: off
321+
322+
test_script:
323+
- cd src/serious_python/example/flet_example
324+
- dart run serious_python:main package app/src --pre
325+
- xvfb-run flutter test integration_test -d linux
326+
141327
# =========================================
142328
# Publish serious_python package to pub.dev
143329
# =========================================
@@ -171,10 +357,9 @@ for:
171357
python3 ci/patch_pubspec.py src/serious_python_platform_interface/pubspec.yaml $PKG_VER
172358
python3 ci/patch_pubspec.py src/serious_python/pubspec.yaml $PKG_VER
173359
python3 ci/patch_pubspec.py src/serious_python_android/pubspec.yaml $PKG_VER
174-
python3 ci/patch_pubspec.py src/serious_python_ios/pubspec.yaml $PKG_VER
175-
#python3 ci/patch_pubspec.py src/serious_python_windows/pubspec.yaml $PKG_VER
176-
#python3 ci/patch_pubspec.py src/serious_python_linux/pubspec.yaml $PKG_VER
177-
#python3 ci/patch_pubspec.py src/serious_python_macos/pubspec.yaml $PKG_VER
360+
python3 ci/patch_pubspec.py src/serious_python_darwin/pubspec.yaml $PKG_VER
361+
python3 ci/patch_pubspec.py src/serious_python_windows/pubspec.yaml $PKG_VER
362+
python3 ci/patch_pubspec.py src/serious_python_linux/pubspec.yaml $PKG_VER
178363
179364
pushd src/serious_python_platform_interface
180365
dart pub publish --force || exit 1
@@ -184,7 +369,15 @@ for:
184369
dart pub publish --force || exit 1
185370
popd
186371
187-
pushd src/serious_python_ios
372+
pushd src/serious_python_darwin
373+
dart pub publish --force || exit 1
374+
popd
375+
376+
pushd src/serious_python_windows
377+
dart pub publish --force || exit 1
378+
popd
379+
380+
pushd src/serious_python_linux
188381
dart pub publish --force || exit 1
189382
popd
190383
@@ -202,7 +395,15 @@ for:
202395
dart pub publish --dry-run
203396
popd
204397
205-
pushd src/serious_python_ios
398+
pushd src/serious_python_darwin
399+
dart pub publish --dry-run
400+
popd
401+
402+
pushd src/serious_python_windows
403+
dart pub publish --dry-run
404+
popd
405+
406+
pushd src/serious_python_linux
206407
dart pub publish --dry-run
207408
popd
208409

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ migrate_working_dir/
1919
# The .vscode folder contains launch configuration and tasks you configure in
2020
# VS Code which you may wish to be included in version control, so this line
2121
# is commented out by default.
22-
#.vscode/
22+
.vscode/
2323

2424
# Flutter/Dart/Pub related
2525
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
@@ -33,5 +33,4 @@ dist/
3333

3434
# Python
3535
.venv/
36-
__pypackages__/
37-
*.zip
36+
__pypackages__/

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ Bump version in:
66

77
* `pubspec.yaml`
88
* `src/serious_python_android/android/build.gradle`
9-
* `src/serious_python_ios/ios/serious_python_ios.podspec`
9+
* `src/serious_python_darwin/ios/serious_python_darwin.podspec`
1010

1111
Bump `serious_python` dependency version with `flutter pub get` in example lock files:
1212

1313
* `src/serious_python/example/flet_example/pubspec.lock`
1414
* `src/serious_python/example/flask_example/pubspec.lock`
15+
* `src/serious_python/example/run_example/pubspec.lock`
1516

1617
Update `CHANGELOG.md`.
1718

0 commit comments

Comments
 (0)