-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix Code Generation with GYB #205
Conversation
@arthurpalves Can we update GYB to latest so we use python3 instead of python2? Since Mac doesn't include python2 by default anymore users need to manually install in the end, so it's better if we install the later version already. |
this is a very valid point. Using python2 require extra configuration and probably will cause issues for CI. can we move on with this PR @arthurpalves ? |
@GMinucci @obackbase can one of you try using gyb with python3 support? Traceback (most recent call last):
File "/usr/local/lib/variants/utils/gyb", line 3, in <module>
gyb.main()
File "/usr/local/lib/variants/utils/gyb.py", line 1254, in main
f.write(execute_template(ast, args.line_directive, **bindings))
File "/usr/local/lib/variants/utils/gyb.py", line 1124, in execute_template
ast.execute(execution_context)
File "/usr/local/lib/variants/utils/gyb.py", line 626, in execute
x.execute(context)
File "/usr/local/lib/variants/utils/gyb.py", line 712, in execute
result = eval(self.code, context.local_bindings)
File "/Users/arthura/Projects/PERSONAL/variants/samples/ios/Proj/Proj/Variants/Variants.swift.gyb", line 38, in <module>
%{ salt = [ord(byte) for byte in os.urandom(64)] }%
File "/Users/arthura/Projects/PERSONAL/variants/samples/ios/Proj/Proj/Variants/Variants.swift.gyb", line 38, in <listcomp>
%{ salt = [ord(byte) for byte in os.urandom(64)] }%
TypeError: ord() expected string of length 1, but int found |
@GMinucci had the chance to check this? |
This PR also fixes #240 |
…python3 can't be found
…nd ensure 'testRender_noSecrets' is corrected
75600fd
to
82bd008
Compare
Log
|
What does this PR do
stdout
orstderr
to be captured.python2.7
to rungyb
and default to afatalError
if not available. This prints an appropriate message to the user.fatalError
when generatingVariants.Secrets
if environment variable used by a custom config doesn't exist.How can it be tested
variants switch
orvariants setup
withoutpython2.7
installed or in your executables path.variants switch
orvariants setup
with at least one custom config whoseenv: true
butvalue
points to a non-existing environment variable.Task
Resolves #204
Resolves #240
Checklist:
make validation
locally with success