Skip to content

CircleCI: Add a build_image_python3 build step - #5606

Closed
cclauss wants to merge 2 commits into
envoyproxy:masterfrom
cclauss:CircleCI-add-Python3-build-step
Closed

cclauss wants to merge 2 commits into
envoyproxy:masterfrom
cclauss:CircleCI-add-Python3-build-step

Conversation

@cclauss

@cclauss cclauss commented Jan 15, 2019 •

Copy link
Copy Markdown
Contributor

Related to #4552
Should not be merged until after #5599 fixes ci/circleci: build_image_python3 failures.

Add a build_image_python3 build step which is based on circleci/python:3.7 and adds a flake8 test to ensure that there are no Python 3 syntax errors or undefined names.

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

E901,E999,F821,F822,F823 are the "showstopper" flake8 issues that can halt the runtime with a SyntaxError, NameError, etc. Most other flake8 issues are merely "style violations" -- useful for readability but they do not effect runtime safety.

  • F821: undefined name name
  • F822: undefined name name in __all__
  • F823: local variable name referenced before assignment
  • E901: SyntaxError or IndentationError
  • E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree

For an explanation of how to fill out the fields, please see the relevant section
in PULL_REQUESTS.md

Description: CircleCI: Add a build_image_python3 build step
Risk Level: Minmal
Testing: Adds a CircleCI build step with flake8 tests
Docs Changes:
Release Notes:
[Optional Fixes #Issue]
[Optional Deprecated:]

@cclauss
cclauss force-pushed the CircleCI-add-Python3-build-step branch 6 times, most recently from a496ae8 to 782e0d7 Compare January 15, 2019 10:49
@cclauss cclauss mentioned this pull request Jan 15, 2019
@lizan

lizan commented Jan 15, 2019

Copy link
Copy Markdown
Member

Can we have this check in format that already use pip to install several stuff?

@lizan lizan self-assigned this Jan 16, 2019
@cclauss
cclauss force-pushed the CircleCI-add-Python3-build-step branch from cc191e0 to e70cf6a Compare January 16, 2019 11:04
@cclauss

cclauss commented Jan 16, 2019 •

Copy link
Copy Markdown
Contributor Author

@lizan We need flake8 to run on Python 3 to catch these errors that were fixed in #5599. See the "very important note" near the top of http://flake8.pycqa.org

format currently is installing legacy Python and legacy pip which will force flake8 to build Python 2 Abstract Syntax Trees so none of the Python 3 issues that we are looking for will be raised. This PR currently installs Python 3 so that flake8 builds Python 3 ASTs which was our goal.

Also (as stated in the commit message) the issues specified in the flake8 --select statement are syntax errors and improperly named variables -- this is not about code formatting but about avoiding runtime failures. Please help me understand how we should modify the current PR?

Are you advocating that we migrate format to Python 3 and add flake8 testing to it?

@lizan

lizan commented Jan 16, 2019

Copy link
Copy Markdown
Member

Are you advocating that we migrate format to Python 3 and add flake8 testing to it?

Yes this is what I meant, I don't think you need do a full migration in one shot if it doesn't work. Python 2 and 3 can co-exists in ubuntu image.

@cclauss
cclauss force-pushed the CircleCI-add-Python3-build-step branch from e70cf6a to 2ddbde6 Compare January 17, 2019 11:44
@stale

stale Bot commented Jan 24, 2019

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale Bot added stale stalebot believes this issue/PR has not been touched recently and removed stale stalebot believes this issue/PR has not been touched recently labels Jan 24, 2019
@cclauss
cclauss force-pushed the CircleCI-add-Python3-build-step branch from 990f7f1 to fa1bec2 Compare January 24, 2019 18:53
@cclauss cclauss closed this Jan 24, 2019
@cclauss
cclauss deleted the CircleCI-add-Python3-build-step branch January 24, 2019 19:16
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

Successfully merging this pull request may close these issues.

2 participants