forked from jendrikseipp/rednotebook
-
Notifications
You must be signed in to change notification settings - Fork 1
/
appveyor.yml
119 lines (99 loc) · 4.6 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
clone_folder: C:\repo
matrix:
fast_finish: true
environment:
global:
DOWNLOAD_DIR: _download_cache
APPVEYOR_SAVE_CACHE_ON_ERROR: true
PATH: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Git\cmd;C:\Tools\curl\bin;C:\msys64\usr\bin;C:\Program Files\7-zip;C:\Program Files (x86)\Inno Setup 6
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
VS_VER: 14
PLATFORM: x64
PYTHON: C:\Python39-x64\python.exe
build_script:
# Show environment info.
- set APPVEYOR_BUILD_WORKER_IMAGE
- set PATH
- "%PYTHON% --version"
- '%PYTHON% -c "import platform; print(platform.architecture())"'
# Set RedNotebook VERSION variable.
- for /f %%i in ('%PYTHON% -c "from rednotebook import info; print(info.version)"') do set VERSION=%%i
- set VERSION
# Set up GTK stack compiled with gvsbuild.
- curl -Lo gtk-bundle.zip https://www.dropbox.com/s/lo0p8c96cljcc1c/gtk-bundle.zip?dl=1
- 7z x gtk-bundle.zip -oC:\gtk
- ls C:\gtk
- set PATH=%PATH%;C:\gtk\bin
# Somehow the msgfmt binary (used for building translations) is already available.
# If it ever disappears, use the following steps to install it (untested).
# - curl -Lo gettext.zip https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.21-v1.16/gettext0.21-iconv1.16-shared-64.zip
# - 7z x gettext.zip -oC:\gettext
# - set PATH=%PATH%;C:\gettext\bin
# Install other dependencies.
- "%PYTHON% -m pip install --no-warn-script-location -U pip setuptools tox==3.27.1 wheel"
# Install separately because --no-binary option disables using wheels (leading to problems for Cython).
- "%PYTHON% -m pip install --no-warn-script-location -U --no-binary :all: pyenchant==3.2.2"
- "%PYTHON% -m pip install --no-warn-script-location -r win/requirements.txt"
- "%PYTHON% -m pip freeze"
- "%PYTHON% -m pip list --outdated"
# Patch GtkSourceView hook by replacing "3.0" with "4".
- sed -i 's/3\.0/4/g' C:/Python39-x64/Lib/site-packages/pyinstaller/hooks/hook-gi.repository.GtkSource.py
# Pyenchant wheels bundle DLLs. The bundled DLLs are incompatible to the DLLs
# we use and lead to the error "ImportError: DLL load failed: The specified
# procedure could not be found." when calling "import gi". Therefore, we use
# the --no-binary option when installing the pyenchant package and use our own
# libenchant.dll file (see also
# https://pyenchant.github.io/pyenchant/install.html).
# Enable debug logging for Pyenchant.
- set PYENCHANT_VERBOSE_FIND=foobar
# Install dictionaries.
- curl -Lo dicts.tar.gz https://www.dropbox.com/s/f12k20aur6znpmo/myspell-dicts.tar.gz?dl=1
- tar -xzf dicts.tar.gz
- move enchant C:\gtk\share
# Run tests.
- "%PYTHON% -m tox -v -e py"
- cd win
# Sanity check with dummy app. PyInstaller misses Enchant DLLs, so we manually add them.
- "%PYTHON% sampleapp.py"
- "%PYTHON% -m PyInstaller --additional-hooks-dir=. --add-data C:/gtk/bin/libenchant.dll;. --add-data C:/gtk/lib/enchant/libenchant_myspell.dll;lib/enchant/ sampleapp.py"
- cp -r C:\gtk\share\enchant dist\sampleapp\share\enchant
- ls dist\sampleapp
- ls dist\sampleapp\lib\enchant