-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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-378] integrate setuptools in Maven build #537
Conversation
Regarding CI, ASF Jenkins would need some extra configuration; but I guess Travis build wouldn't work until they implement travis-ci/travis-ci#4090. |
Thanks Sergio! @silviulica, @aaltay, what do you think? |
Thanks Sergio! Any help on doing Maven stuff is more than welcome. We need to keep the tests passing though:
I suggest as a way to make progress to evolve this CL into setting up the Maven infrastructure w/o doing changes to the version.py machinery: add the pom.xml file, add setup.py code to install it with the package so get_version() works at runtime, corrections on names. |
Hi Sergio,
Travis should work currently and it is already running Python tests. We do not need the above bug to be fixed. Because python is already installed in every Travis worker image already (https://docs.travis-ci.com/user/ci-environment/#Runtimes) And we also run an apt-get install to install 2.7 version explicitly. |
@@ -32,6 +32,8 @@ addons: | |||
apt: | |||
packages: | |||
- python2.7 | |||
- python-setuptools | |||
- python-dill |
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.
This change should not require of adding additional packages here. setuptools is already part of the Python distribution for Python 2 >=2.7.9 and setup.py requires (will install) dill.
…etup, and updated to be statically used as apache_beam.__version__ later on
@silviulica, I've tried to address the version issue in the last commits. The new approach consists on reading the version from Thanks @aaltay, I think CI should be fine now with respect to this PR, but still fails because setup issue of the overall python tool suite. We may need to take a look to it with more time. |
return global_names['__version__'] | ||
# Reads the actual version from pom.xml file, and synchronizes | ||
# apache_beam.__version__ field for later usage. | ||
def sync_version(): |
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.
I do not think you need this if the get_version_from_distribution() really works. you can use get_version_from_pom in setup.py and use get_version_from_distribution() in all the other places. This way you avoid the somewhat fragile rewriting the _init.py file.
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.
The problem is I didn't get get_version_from_distribution()
really working out of pip
-controlled environments. So, since it's not a pure setuptools
feature, I'm more think about removing such function.
Hi Sergio! We are getting close here. Thanks very much for your effort. Besides the comments in line can you please explain what is the purpose of the pom.xml? Perhaps as a comment in the pom.xml itself. It is needed to integrate with Apache build/test processes but this is where my knowledge ends. It would be nice to have this comment for people to understand why it is needed especially since it is unusual for a Python package. |
@aaltay, after merging
I've tried to get rid of the |
I got both python-sdk and flink examples running locally. See this commit: aaltay@a1df1f5 It is based on yours. Except that I used to disable execution. I noticed the flink was using this too. And adding an id there broke their disable mechanism. With this both places can use the same way of disabling. (In this commit I changed 1 place related to maven version to run locally with my old maven installation. That part should not be submitted.) Could you try this please? |
I commented on the RAT issue as well. Hopefully applying both will pass all the tests. Fingers crossed. @wikier Thank you again. |
Cool, @aaltay! That trick works better, actually avoiding inheritance in Also reverted So now the CI system should be, finally, happy 😄 Thanks so much for your time with these last details. I hope the overall idea of this PR would be useful for the podling. |
@aaltay I've patch the RAT configuration, but Jenkins reports unknown licenses I'm not able to reproduce locally... |
The error is because I cloned your branch and make this single line change: 232590e It fixes the problem. I also made a temporary PR (#814) to test this with the actual thing Jenkins is running, and the tests passed. I believe if you apply this change, all tests will pass. |
LGTM. R: @dhalperi for a final review. Thank you @wikier. It is great that your change gives us integration with maven. That said there are a few issues with the version management part. These should NOT block the merging of this PR. I will work on a follow up PR right after this is merged to address those. As a note the issues are |
Perfect. Let me know if you need anything else, @dhalperi. Back to the version issue @aaltay, if you read the thread above, I initially proposed to align versions. Then the feedback I got from @silviulica was that you didn't want to do that for now. So I kept the helper functions I implemented for whenever such issue would be revisited. Anyway I'd handle that in a separate PR, I've created BEAM-547 for that. |
@wikier Sounds good. I remember it was discussed earlier in the thread. Let's get this PR merged and let's move the version discussion to the https://issues.apache.org/jira/browse/BEAM-547. Thank you for opening that issue. |
Ah ok, merged in 76de610. You are welcome ;-) |
This PR provide an initial integration of the Python SDK in the Maven build, relying on the
exec-maven-plugin
to callsetuptools
(BEAM-378).Notice I keep out
install
on purpose, because I guess it may need discussion.Be sure to do all of the following to help us incorporate your contribution
quickly and easily:
[BEAM-<Jira issue #>] Description of pull request
mvn clean verify
. (Even better, enableTravis-CI on your fork and ensure the whole test matrix passes).
<Jira issue #>
in the title with the actual Jira issuenumber, if there is one.
Individual Contributor License Agreement.