Skip to content

Commit e50a704

Browse files
jayvdbindygreg
authored andcommitted
ci: install cffi extension zero-buffer
Import zero_buffer fails as cffi uses pycparser which needs __file__ so import _cffi_backend to verify the backend is operational, then import zero_buffer and catch the expected NameError.
1 parent 3b7d5c1 commit e50a704

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

ci/azure-pipelines-template.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ jobs:
4949

5050
- ${{ if ne(parameters.name, 'Windows') }}:
5151
- script: |
52-
cargo run --bin pyoxidizer -- init --python-code 'print("hello, world")' ~/pyapp
53-
cargo run --bin pyoxidizer -- run ~/pyapp
52+
cargo run --bin pyoxidizer -- init --pip-install appdirs==1.4.3 --pip-install zero-buffer==0.5.1 ~/pyapp
53+
cat ci/pyapp.py | cargo run --bin pyoxidizer -- run ~/pyapp
5454
displayName: Build Oxidized Application
5555
5656
- ${{ if eq(parameters.name, 'Windows') }}:
5757
- script: |
58-
cargo run --bin pyoxidizer -- init --python-code 'print("hello, world")' %USERPROFILE%/pyapp
59-
cargo run --bin pyoxidizer -- run %USERPROFILE%/pyapp
58+
cargo run --bin pyoxidizer -- init --pip-install appdirs==1.4.3 --pip-install zero-buffer==0.5.1 %USERPROFILE%/pyapp
59+
cat ci/pyapp.py | cargo run --bin pyoxidizer -- run %USERPROFILE%/pyapp
6060
displayName: Build Oxidized Application (Windows)

ci/pyapp.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import appdirs
2+
import _cffi_backend
3+
# Allow AttributeError rather than ImportError
4+
# as this indirectly triggers a missing __file__
5+
# https://github.com/dabeaz/ply/issues/216
6+
try:
7+
import zero_buffer
8+
except AttributeError:
9+
pass
10+
11+
print("hello, world")

0 commit comments

Comments
 (0)