-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[BEAM-7060] Introduce Python3-only test modules #9223
Conversation
This is required for testing type annotations support (PEP 484). Also introduces pylinting of modified files, which reduces gradlew lint times by ~37% (or ~50s). before: https://scans.gradle.com/s/544uyirsdn6n4 after: https://scans.gradle.com/s/a3sys35gig3kc
It does not support already commited and possibly pushed but not merged commits, and even if I added commands to list those for my workflow there's no guarantee that it'd work for everone else's.
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.
LGTM. Thanks.
@@ -60,23 +60,34 @@ EXCLUDED_GENERATED_FILES=( | |||
apache_beam/portability/api/*pb2*.py | |||
) | |||
|
|||
PYTHON_MAJOR=$(python -c 'import sys; print(sys.version_info[0])') |
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.
Please add a JIRA to do lint checks for *py3.py files.
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.
FILES_TO_IGNORE="" | ||
for file in "${EXCLUDED_GENERATED_FILES[@]}"; do | ||
for file in "${EXCLUDED_GENERATED_FILES[@]}" ${EXCLUDED_PY3_FILES}; do |
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.
Does this loop work as intended when $EXCLUDED_PY3_FILES has more than one file?
Alternative solution: https://github.com/apache/beam/pull/8505/files#diff-d91ac373b8d2235683a85576912b5db5R66
which requires: https://github.com/apache/beam/pull/8505/files#diff-d91ac373b8d2235683a85576912b5db5R87
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.
Run Python 2 PostCommit |
@tvalentyn I believe pre-commits cover all the changes in this PR. |
A similar change was reverted because it broke postcommits: #8505 (comment) |
run python precommit |
run python 2 postcommit |
Run Python Dataflow ValidatesContainer |
Error in postcommit is a transient pip issue |
LGTM. Thanks. |
Hello! I am thinking if this PR causes Run
I am working on a macbook. |
Thanks, @amaliujia, I opened https://issues.apache.org/jira/browse/BEAM-7892 to track this. |
This is required for testing type annotations support (PEP 484).
Note that
*py3.py
files are only intended for tests where the syntax is incompatible with Py2. Not intended to replace checks for where certain versions of Python behave differently.Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username
).[BEAM-XXX] Fixes bug in ApproximateQuantiles
, where you replaceBEAM-XXX
with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.Post-Commit Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.