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

ci: backport python compatibility patches to 1.16 #880

Closed
wants to merge 20 commits into from

Conversation

pbrezina
Copy link
Member

@pbrezina pbrezina commented Sep 9, 2019

No description provided.

@pbrezina
Copy link
Member Author

pbrezina commented Sep 9, 2019

I did not include Lukas' patche for test_pam_responder.py since the affected tests are not present in 1.16. There was small conflict in BUILD: Change value of variable HAVE_PYTHON2/3_BINDINGS but it was easy to solve. Beside this, there were no conflicts and the patches has been just cherry-picked.

@pbrezina
Copy link
Member Author

retest this please

@pbrezina
Copy link
Member Author

I must have added also one more patch: 5f2bb96

This code is no longer available in master (it is about local domain), but caused troubles with Python 3.8.

@pbrezina
Copy link
Member Author

retest this please

1 similar comment
@pbrezina
Copy link
Member Author

retest this please

@pbrezina
Copy link
Member Author

Debain fails because PR #888

Copy link
Contributor

@thalman thalman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@pbrezina pbrezina added Ready to push Ready to push Conflict Conflicts with target branch and removed Ready to push Ready to push Conflict Conflicts with target branch labels Sep 23, 2019
pbrezina and others added 12 commits September 23, 2019 09:43
Fedora 31 changed symlink of /usr/bin/py.test from pytest2 to pytest3.
We need to run the python2 version in order to run our tests with python2.

Reviewed-by: Sumit Bose <sbose@redhat.com>
Reviewed-by: Sumit Bose <sbose@redhat.com>
If previous run of a PR failed to rebase, the code was left in rebase
in progress and was not correctly overwritten by new changes in the
patches.

Reviewed-by: Tomas Halman <thalman@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com>\
Reviewed-by: Pavel Březina <pbrezina@redhat.com>\
Reviewed-by: Pavel Březina <pbrezina@redhat.com>\
Reviewed-by: Pavel Březina <pbrezina@redhat.com>\
It will simplify detection in following patches

Reviewed-by: Pavel Březina <pbrezina@redhat.com>\
Reviewed-by: Pavel Březina <pbrezina@redhat.com>\
Reviewed-by: Pavel Březina <pbrezina@redhat.com>\
Samba 4.11.0 dropped support for python2 and thus it was also
dropped from samba related libraries (ldb ...)
which is required by integration tests

Merges: https://pagure.io/SSSD/sssd/pull-request/4075

Resolves:
https://pagure.io/SSSD/sssd/issue/4074

Reviewed-by: Pavel Březina <pbrezina@redhat.com>\
Samba 4.11.0 dropped support for python3 and thus it was also
dropped from samba related libraries (ldb ...)
which is required by integration tests

Merges: https://pagure.io/SSSD/sssd/pull-request/4075

Resolves:
https://pagure.io/SSSD/sssd/issue/4074

Reviewed-by: Pavel Březina <pbrezina@redhat.com>\
Lukas Slebodnik and others added 8 commits September 23, 2019 09:43
The macro PyDoc_STRVAR changed in python 3.8
and it defined variable with const modifier

src/python/pyhbac.c: In function ‘PyInit_pyhbac’:
src/python/pyhbac.c:1948:25: warning: passing argument 2 of
   ‘sss_exception_with_doc’ discards ‘const’ qualifier from pointer
   target type [-Wdiscarded-qualifiers]
 1948 |                         HbacError__doc__,
      |                         ^~~~~~~~~~~~~~~~
In file included from src/python/pyhbac.c:27:
./src/util/sss_python.h:33:1: note: expected ‘char *’ but argument
    is of type ‘const char *’
 33 | sss_exception_with_doc(char *name, char *doc, PyObject *base, PyObject *dict);
    | ^~~~~~~~~~~~~~~~~~~~~~

Reviewed-by: Pavel Březina <pbrezina@redhat.com>\
Reviewed-by: Pavel Březina <pbrezina@redhat.com>\
There is a warning with python 3.8

/usr/lib/python3.8/site-packages/SSSDConfig/ipachangeconf.py:399:
 SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if len(sectopts) is not 0:

Reviewed-by: Pavel Březina <pbrezina@redhat.com>\
Reviewed-by: Pavel Březina <pbrezina@redhat.com>\
src/tests/pysss-test.py:73: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  val1 = obfuscator.encrypt("123", obfuscator.AES_256)

These were introduced by https://bugs.python.org/issue36381 to warn about
an upcoming Python C API change. The meaning of PY_SSIZE_T_CLEAN is described
in https://python.readthedocs.io/en/stable/c-api/arg.html#strings-and-buffers.

Reviewed-by: Pavel Březina <pbrezina@redhat.com>\
src/tests/pysss_murmur-test.py:93: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  hash_val = pysss_murmur.murmurhash3(sid_str, 0, seed)
src/tests/pysss_murmur-test.py:96: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  hash_val = pysss_murmur.murmurhash3(sid_str, len(sid_str), seed)

These were introduced by https://bugs.python.org/issue36381 to warn about
an upcoming Python C API change. The meaning of PY_SSIZE_T_CLEAN is described
in https://python.readthedocs.io/en/stable/c-api/arg.html#strings-and-buffers.

Reviewed-by: Pavel Březina <pbrezina@redhat.com>\
Reviewed-by: Pavel Březina <pbrezina@redhat.com>\
To fix this error that happened during mockbuild on rawhide.

FAIL: src/tests/pysss-test.py3
==============================
ERROR: test_import (__main__.PysssImport)
Import the module and assert it comes from tree
----------------------------------------------------------------------
Traceback (most recent call last):
 File "/builddir/build/BUILD/sssd-1.16.5/src/tests/pysss-test.py", line 56, in test_import
   import pysss
 SystemError: bad call flags

In Python 3.7, import didn't check descriptor flags (METH_KEYWORDS):
these flags were only checked when the methods were called.

In Python 3.8, the flags are checked as soon as the module is imported,
which prevents the module to be imported.

Inspired by:
rpm-software-management/libcomps#50

Python doc:
https://docs.python.org/3/c-api/structures.html#METH_VARARGS
@pbrezina
Copy link
Member Author

Rebased on top of current sssd-1-16. There was a conflict solved by 3way merge. I'll wait till the CI finish then push.

@pbrezina pbrezina added the Ready to push Ready to push label Sep 23, 2019
@pbrezina
Copy link
Member Author

  • sssd-1-16
    • 50dffac - pysss: use METH_VARARGS | METH_KEYWORDS instead of just METH_KEYWORDS
    • c962c70 - testlib: Fix SyntaxWarning "is" with a literal
    • 0ba6af6 - pysss_murmur: Fix DeprecationWarning PY_SSIZE_T_CLEAN
    • 8bc81b3 - pysss: Fix DeprecationWarning PY_SSIZE_T_CLEAN
    • 8557cd9 - TESTS: Add minimal test for pysss encrypt
    • 4f577e2 - SSSDConfig: Fix SyntaxWarning "is not" with a literal
    • ed26a1e - SSSDConfig: Add minimal test for parse method
    • 4c2df3a - pyhbac: Fix warning Wdiscarded-qualifiers
    • 3a8ae6d - intg: Install python3 dependencies for intgcheck on new distros
    • ec78515 - BUILD: Prefer python3 for intgcheck
    • 958f02d - INTG: Do hot hardcode version of python/pytest in intgcheck
    • cd0d38c - BUILD: Move python checks for intgcheck to macro
    • 03ba5e7 - BUILD: Change value of variable HAVE_PYTHON2/3_BINDINGS
    • f9a4f72 - BUILD: Add macro for checking pytest for intgcheck
    • cf2b5ec - BUILD: Move checking of python2 modules for intgcheck
    • 44735f8 - BUILD: Fix typo of detecting python module for intgcheck
    • 7b95242 - BUILD: Add macro for checking python3 modules
    • 28668d2 - ci: remove left overs from previous rebase
    • d7fe861 - ci: pep8 was renamed to pycodestyle in Fedora 31
    • 900ebdb - ci: use python2 version of pytest

@pbrezina pbrezina added Pushed and removed Accepted Ready to push Ready to push labels Sep 23, 2019
@pbrezina pbrezina closed this Sep 23, 2019
@pbrezina pbrezina deleted the ci-1-16 branch November 14, 2019 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants