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

Port Dogtag to Python 3 #2039

Closed
pki-bot opened this issue Oct 3, 2020 · 12 comments
Closed

Port Dogtag to Python 3 #2039

pki-bot opened this issue Oct 3, 2020 · 12 comments
Milestone

Comments

@pki-bot
Copy link

pki-bot commented Oct 3, 2020

This issue was migrated from Pagure Issue #1480. Originally filed by cheimes (@tiran) on 2015-07-10 16:47:53:


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
@pki-bot pki-bot added this to the 10.6.0 milestone Oct 3, 2020
@pki-bot pki-bot closed this as completed Oct 3, 2020
@pki-bot
Copy link
Author

pki-bot commented Oct 3, 2020

@pki-bot
Copy link
Author

pki-bot commented Oct 3, 2020

Comment from mharmsen (@mharmsen) at 2015-07-14 00:06:16

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

@pki-bot
Copy link
Author

pki-bot commented Oct 3, 2020

Comment from cheimes (@tiran) at 2015-08-17 09:07:35

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.

@pki-bot
Copy link
Author

pki-bot commented Oct 3, 2020

Comment from cheimes (@tiran) at 2017-02-27 14:00:45

Metadata Update from @tiran:

  • Issue set to the milestone: UNTRIAGED

@pki-bot
Copy link
Author

pki-bot commented Oct 3, 2020

Comment from rcritten (@rcritten) at 2018-02-01 09:10:25

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

@pki-bot
Copy link
Author

pki-bot commented Oct 3, 2020

Comment from edewata (@edewata) at 2018-02-19 20:21:48

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)

@pki-bot
Copy link
Author

pki-bot commented Oct 3, 2020

Comment from cheimes (@tiran) at 2018-02-21 15:33:02

Dogtag now supports Python 3 and can be build with Python 3 as default for all commands. I have tracked the changes and progress at http://pki.fedoraproject.org/wiki/PKI_10.6_Python_Support

Relevant commits are:

@pki-bot
Copy link
Author

pki-bot commented Oct 3, 2020

Comment from cheimes (@tiran) at 2018-02-21 15:33:03

Metadata Update from @tiran:

  • Issue assigned to tiran
  • Issue close_status updated to: fixed
  • Issue status updated to: Closed (was: Open)

@pki-bot
Copy link
Author

pki-bot commented Oct 3, 2020

Comment from mharmsen (@mharmsen) at 2018-02-21 16:50:07

Metadata Update from @mharmsen:

  • Issue set to the milestone: 10.6.0 (was: 10.6)

@pki-bot
Copy link
Author

pki-bot commented Oct 3, 2020

Comment from mharmsen (@mharmsen) at 2018-06-29 20:30:55

Metadata Update from @mharmsen:

@pki-bot
Copy link
Author

pki-bot commented Oct 3, 2020

Comment from mharmsen (@mharmsen) at 2018-06-30 01:36:24

Metadata Update from @mharmsen:

@pki-bot
Copy link
Author

pki-bot commented Oct 3, 2020

Comment from mharmsen (@mharmsen) at 2018-06-30 01:37:35

Metadata Update from @mharmsen:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant