#1480 Port Dogtag to Python 3
Closed: fixed 6 years ago Opened 8 years ago by cheimes.

Python 2 is the past, Python 3 is the future. Python 2 is in maintenance mode. All new features and improvements are happening in Python 3. Fedora is moving away from Python 2, too. There are plans to switch the Fedora 23 Server Live DVD to Python 3, https://fedoraproject.org/wiki/Changes/Python_3_as_Default

For Fedora 23 Dogtag must support Python 3 soon. Since Dogtag has to run on RHEL with Python 2.7, the code base has to be compatible with Python 2 and 3 at the same time. It makes the migration more smooth, too. Polyglot code can be archived with tools like six and restriction to latest versions 2.7 and 3.4. Python 3.4 has regained the u* text prefix.

Simple and mechanical tasks like the conversion of print statements to print functions can be automated with e.g. python-modernize http://python-modernize.readthedocs.org/ and from __future__ import print_function. tox and pylint --py3k help to ensure that code is compatible with 2 and 3.

Risks

Dogtag has almost no unit tests for its Python code. The lack of automated tests is going to make it harder to find bugs. In my experience it will slow down the undertaking, too.

Dependencies

ldap::
python-ldap / no Python 3
lxml::
python-lxml / python3-lxml
nss::
python-nss / no Python 3
selinux::
libselinux-python / libselinux-python3
seobject::
policycoreutils-python / policycoreutils-python3
requests::
python-requests / python3-requests

Currently there is an ongoing discussion about the ldap and nss packages. Dogtag uses nss only for key wrapping and LDAP just with simple bind and limited searching. We might consider to replace nss with python-cryptography and ldap with a Python compatible LDAP adapter.

Patch

I have created a patch with python-modernize and some manual fixes. In order to test the patch, run:

$ sudo dnf install policycoreutils-python3 libselinux-python3 python3-lxml python3-requests python-six python-tox
$ tox
$ tox -e lint34

Per CS/DS meeting of 07/13/2015: 10.3

My patch sets 24-34 and 35-38 make pkispawn and pkidestroy compatible with Python 3.4. I still need to do much more testing before I can declare Dogtag fully compatible, though.

Metadata Update from @cheimes:
- Issue set to the milestone: UNTRIAGED

7 years ago

This task is very important to the IPA project which has nearly completed its transition to python 3.

Metadata Update from @edewata:
- Custom field feature adjusted to None
- Custom field proposedmilestone adjusted to None
- Custom field proposedpriority adjusted to None
- Custom field reviewer adjusted to None
- Custom field version adjusted to None
- Issue close_status updated to: None
- Issue priority set to: critical (was: major)
- Issue set to the milestone: 10.6 (was: UNTRIAGED)

6 years ago

Metadata Update from @cheimes:
- Issue assigned to cheimes
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

6 years ago

Metadata Update from @mharmsen:
- Issue set to the milestone: 10.6.0 (was: 10.6)

6 years ago

Metadata Update from @mharmsen:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1596897

5 years ago

Metadata Update from @mharmsen:
- Custom field rhbz reset (from https://bugzilla.redhat.com/show_bug.cgi?id=1596897)

5 years ago

Metadata Update from @mharmsen:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1596897

5 years ago

Dogtag PKI is moving from Pagure issues to GitHub issues. This means that existing or new
issues will be reported and tracked through Dogtag PKI's GitHub Issue tracker.

This issue has been cloned to GitHub and is available here:
https://github.com/dogtagpki/pki/issues/2039

If you want to receive further updates on the issue, please navigate to the
GitHub issue and click on Subscribe button.

Thank you for understanding, and we apologize for any inconvenience.

Login to comment on this ticket.

Metadata