-
-
Notifications
You must be signed in to change notification settings - Fork 236
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
Use reusable venvs #199
base: main
Are you sure you want to change the base?
Use reusable venvs #199
Changes from all commits
873e9c7
aef5416
03b4eeb
65f29b8
1c9e24e
56774fd
0968207
bc54fba
4b600a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,14 +47,37 @@ jobs: | |
displayName: Clippy | ||
condition: ne( variables['rustup_toolchain'], 'nightly' ) | ||
|
||
- ${{ if ne(parameters.name, 'Windows') }}: | ||
- ${{ if eq(parameters.name, 'Linux') }}: | ||
- script: | | ||
cargo run --bin pyoxidizer -- init --pip-install appdirs==1.4.3 --pip-install cryptography ~/pyapp | ||
cat ci/pyapp.py | cargo run --bin pyoxidizer -- run ~/pyapp | ||
displayName: Build Oxidized Application | ||
|
||
- ${{ if eq(parameters.name, 'macOS') }}: | ||
- script: brew install [email protected] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is unnecessary, as it is pre-installed, but it is only a few seconds. Happy to remove it though. |
||
displayName: 'Install OpenSSL' | ||
|
||
- ${{ if eq(parameters.name, 'macOS') }}: | ||
- script: | | ||
cargo run --bin pyoxidizer -- init --pip-install appdirs==1.4.3 --pip-install zero-buffer==0.5.1 ~/pyapp | ||
export CPPFLAGS="-I$(brew --prefix [email protected])/include" | ||
export LDFLAGS="-L$(brew --prefix [email protected])/lib" | ||
cargo run --bin pyoxidizer -- init --pip-install appdirs==1.4.3 --pip-install cryptography==2.8 ~/pyapp | ||
cat ci/pyapp.py | cargo run --bin pyoxidizer -- run ~/pyapp | ||
displayName: Build Oxidized Application | ||
|
||
- ${{ if eq(parameters.name, 'Windows') }}: | ||
- script: choco install openssl | ||
displayName: 'Install OpenSSL' | ||
|
||
- ${{ if eq(parameters.name, 'Windows') }}: | ||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: '3.7' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is necessary because the windows job needs a functional Python, mostly due to indygreg/python-build-standalone#22 indygreg/python-build-standalone#19 is also problematic, but it can be worked around by using |
||
|
||
- ${{ if eq(parameters.name, 'Windows') }}: | ||
- script: | | ||
cargo run --bin pyoxidizer -- init --pip-install appdirs==1.4.3 --pip-install zero-buffer==0.5.1 %USERPROFILE%/pyapp | ||
set INCLUDE=%ProgramFiles%\OpenSSL-Win64\include;%INCLUDE% | ||
set LIB=%ProgramFiles%\OpenSSL-Win64\lib\;%LIB% | ||
cargo run --bin pyoxidizer -- init --pip-install appdirs==1.4.3 --pip-install cryptography==2.8 %USERPROFILE%/pyapp | ||
cat ci/pyapp.py | cargo run --bin pyoxidizer -- run %USERPROFILE%/pyapp | ||
displayName: Build Oxidized Application (Windows) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
import appdirs | ||
import _cffi_backend | ||
# Allow AttributeError rather than ImportError | ||
# as this indirectly triggers a missing __file__ | ||
# https://github.com/dabeaz/ply/issues/216 | ||
try: | ||
import zero_buffer | ||
except AttributeError: | ||
pass | ||
|
||
print("hello, world") | ||
|
||
import cryptography.fernet | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is copied from jamesabel/spafit#2 It is a good smoketest for basic cryptography. |
||
|
||
m = b'does this work?' | ||
s = 'original message:\n' + str(m) + '\n\n' | ||
|
||
k = cryptography.fernet.Fernet.generate_key() | ||
fernet = cryptography.fernet.Fernet(k) | ||
t = fernet.encrypt(m) | ||
d = fernet.decrypt(t) | ||
|
||
s += 'key:\n' + str(k) + '\n\n' | ||
s += 'token:\n' + str(t) + '\n\n' | ||
s += 'decoded message:\n' + str(d) | ||
print(s) | ||
assert d == m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#208 is needed for all of these enhancements to the sample app CI. This approach is taken because otherwise the lines are very long, and also to avoid horrid Windows CMD quoting problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix included in #200