Skip to content
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

Syntax Error: 'async' is a reserved word in Python >= 3.7 #252

Open
cclauss opened this issue Dec 4, 2018 · 1 comment
Open

Syntax Error: 'async' is a reserved word in Python >= 3.7 #252

cclauss opened this issue Dec 4, 2018 · 1 comment

Comments

@cclauss
Copy link

cclauss commented Dec 4, 2018

flake8 testing of https://github.com/bazelbuild/bazel-toolchains on Python 3.7.1

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./container/build.py:407:61: E999 SyntaxError: invalid syntax
                          arguments.bucket or arguments.async):
                                                            ^
1     E999 SyntaxError: invalid syntax
1
@nlopezgi nlopezgi closed this as completed Dec 4, 2018
@nlopezgi nlopezgi reopened this Dec 4, 2018
@nlopezgi
Copy link
Contributor

nlopezgi commented Dec 4, 2018

Apologies, just noticed your error is not related to containerregistry (which was my initial thought as its the source of most of my issues related to python).
We will soon be deprecating build.py as a means to drive building our containers, so we're not actively making improvements to this script.

To get around this issue in the meantime you can try to run directly the specific targets to build a container (instead of using the build.py script). For instance, this target (https://github.com/nlopezgi/bazel-toolchains/blob/master/container/ubuntu16_04/builders/rbe-ubuntu16_04/BUILD#L49) can be used to build rbe-ubuntu16_04, and this target (https://github.com/nlopezgi/bazel-toolchains/blob/master/container/ubuntu16_04/builders/bazel/BUILD) can be used to build the bazel container.

Note that build.py just calls those targets and does a couple of additional things (uploading the container to gcr and uploading a tar file to gcs), so for most use cases, building the container directly using the Bazel targets should suffice. Note, however, that when running these targets you might run into other issues related to py2/py3 compatibility with the container_image targets that are executed by the toolchain rules, due to containerregistry not being compatible with py3.

If you are really set on using build.py, it should be feasible to get it to be compatible with py3. I'll be happy to review any PRs you send for that purpose.

Could you also please elaborate a bit more about your use case (i.e., why do you want to build these containers?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants