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
Build: makerpms.sh generates Python 2 & 3 packages at the same time #272
Conversation
|
AFAIK the build won't run pylint twice with the correct Python version. You could replace the configure option for pylint and the pylint command with: |
| Requires: %{name}-server-common = %{version}-%{release} | ||
| Requires: %{name}-common = %{version}-%{release} | ||
| Requires: python3-ipaclient = %{version}-%{release} | ||
| Requires: python-pyldap >= 2.4.15 |
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.
python3-pyldap
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.
Good catch, fixed.
7ab796b
to
bb1ac49
Compare
|
It does not automatically run pylint at all. Isn't |
|
Shouldn't be there python3 in BuildRequires as well? At least with python3-pylint we need python3 dependencies to be able do pylint3 validation |
bb1ac49
to
de0f80a
Compare
|
Fixed. Now |
|
@mbasti-rh @jcholast @tiran (Just keep in mind that build needs to be done under Python 2 till samba-python bindings are ported to Python 3.) |
|
+1 for my trick Since I disabled the import warnings for samba bindings in fef6f18, pylint is passing under Python 3, too. |
|
I would like rather explicit pylint version than autodetection |
|
It makes more sense to follow the principal test what you build, build what you test. |
|
But we build both 2/3 versions at once |
|
Or we can run both pylints as far as we wants py2/3 compatible versions |
|
I had discussion with Petr, and currently we cannot run both pylints in build system and it is not easy to add it there. So we have to manually override pylint versions in travis tests, so I would stay with the current version of commits |
|
It's easily possible with my proposal, just saying:
|
|
PS: I'd rather not run both linters in parallel. We use pylint in parallel mode, which runs as many workers as CPU cores. |
|
Ok if Petr agree we can go with your proposal |
|
I'm fine with |
de0f80a
to
6d08735
Compare
|
I've implemented tiran's proposal and rebased the patchset. |
| #BuildRequires: python3-samba | ||
| BuildRequires: python3-setuptools | ||
| # 0.6: serialization.load_pem_private_key, load_pem_public_key | ||
| BuildRequires: python3-cryptography >= 0.6 |
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.
>= 1.3.1
| BuildRequires: python3-setuptools | ||
| # 0.6: serialization.load_pem_private_key, load_pem_public_key | ||
| BuildRequires: python3-cryptography >= 0.6 | ||
| BuildRequires: python3-gssapi |
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.
>= 1.2.0
| Requires: python3-ipaclient = %{version}-%{release} | ||
| Requires: python3-pyldap >= 2.4.15 | ||
| Requires: python3-lxml | ||
| Requires: python3-gssapi >= 1.1.2 |
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.
>= 1.2.0
|
6d08735
to
37af778
Compare
|
I've synchronized |
|
ACK, but travis runs tests under PY3 and should not, I tried locally and tests works for me (ipa-run-tests is still py2 by default), so there is an issue with travis tests. I prefer to fix travis first before pushing this to not blocking tests for other PRs. |
|
@martbab Can I do something in the build system to make your CI implementation easier? |
|
Probably travis tests uses make install (haven't looked) |
|
Travis installs the built RPMs and then runs server install and outoftree test suite. It does not use BTW does this mean that Travis is actually running tests using Py3? Sorry but I am just trying to get up to speed. |
|
So, how are you caling the stuff? If you want to always run Python 2 tests, specify |
|
Relevant parts of SPEC file are here: |
|
@martbab Yes for this PR travis run tests under PY3, see tracebacks they are from python3.5 site-packages |
|
To be sure I re-built RPMs from this PR using
I have no idea why it should fail in Travis. |
|
Have you tried on F25? it might be related to it |
|
I have re-built RPMs in the F25 image and found out that the /usr/bin/ipa command has the following shebang: so this one is the culprit. |
|
Yep, running |
Petr Viktorin recommended me to copy the whole build directory and run configure twice, with different values for PYTHON variable. After thinking a bit about that, it seems as cleanest approach. Building for two versions of Python at the same time should be temporary state so I decided not to complicate Autotools build system with conditional spagetti for two versions of Python. For proper Python2/3 distiction in the two separate builds, I added find/grep/sed combo which replaces shebangs with system-wide Python interpreter as necessary. This is workaround for the fact that FreeIPA does not use setuptools properly. Honza told me that proper use of setuptools is not trivial so we decided to go with this for now. https://fedorahosted.org/freeipa/ticket/157
python3-samba is intentionally ommited because it is not in Fedora repos. Pylint somehow magically ignores this missing package. Keep in mind that server will not work until this this solved. https://fedorahosted.org/freeipa/ticket/157
configure option --with/without-pylint was replaced by --enable/disable-pylint. Pylint is always called as $(PYTHON) -m python. If you need to override Pylint version, use command "make pylint PYTHON=xxx". https://fedorahosted.org/freeipa/ticket/157
37af778
to
f09181e
Compare
|
I've found the root cause - incorrect order of operations in freeipa.spec.in. Now it should work. |
Petr Viktorin recommended me to copy the whole build directory and run
configure twice, with different values for PYTHON variable.
After thinking a bit about that, it seems as cleanest approach.
Building for two versions of Python at the same time should be
temporary state so I decided not to complicate Autotools build system
with conditional spagetti for two versions of Python.
For proper Python2/3 distiction in the two separate builds, I added
find/grep/sed combo which replaces shebangs with system-wide Python
interpreter as necessary. This is workaround for the fact that FreeIPA
does not use setuptools properly. Honza told me that proper use of
setuptools is not trivial so we decided to go with this for now.
https://fedorahosted.org/freeipa/ticket/157