#6525 makeapi & makeaci under Python 2/3 generate different files
Closed: fixed 6 years ago Opened 8 years ago by pspacek.

Here is example of a diff:

$ python3 makeapi
$ git diff
 command: aci_add/1
 args: 1,15,3
 arg: Str('aciname', cli_name='name')
-option: StrEnum('aciprefix', cli_name='prefix', values=[u'permission', u'delegation', u'selfservice', u'none'])
+option: StrEnum('aciprefix', cli_name='prefix', values=['permission', 'delegation', 'selfservice', 'none'])

mass moving python3 tickets to FreeIPA 4.6 which should be smaller release targeted mainly on python3 porting.

Metadata Update from @pspacek:
- Issue assigned to someone
- Issue set to the milestone: FreeIPA 4.6

8 years ago

Metadata Update from @tkrizek:
- Issue set to the milestone: FreeIPA 4.6.1 (was: FreeIPA 4.6)

7 years ago

Metadata Update from @tkrizek:
- Issue set to the milestone: FreeIPA 4.6.2 (was: FreeIPA 4.6.1)

7 years ago

I'm not sure we can, or want to bother, maintaining a single API.txt for both python2 and python3.

The issues seem to be with:

  • StrEnum: str vs unicode types (may be easy to make repr display unicode as str)
  • bool, None, unicode moving from classes to types (and unicode to str)
  • Probably others that I missed

I don't see this as a critical issue. We need to pick one python interpreter and use that to generate the file. This check is used as a double-check to ensure API compatibility between versions. I think trying to handle the type differences between versions of python would be wasted effort.

This all boils down to when the command itself switches from hardcoded python2 to python3. At that time a fresh API.txt can be added to git and from then on be only python3.

It isn't like the API is going to be effectively different depending on the interpreter. Trying to squash all the repr to spit out something that is similar for both might be nice but doesn't seem to me to be urgent at all.

Metadata Update from @rcritten:
- Issue close_status updated to: None

7 years ago

Metadata Update from @tdudlak:
- Issue set to the milestone: FreeIPA 4.6.3 (was: FreeIPA 4.6.2)

7 years ago

Metadata Update from @rcritten:
- Issue set to the milestone: FreeIPA 4.6.4 (was: FreeIPA 4.6.3)

7 years ago

FreeIPA 4.6.3 has been released, moving to FreeIPA 4.6.4 milestone

The issue has been fixed in commit https://pagure.io/freeipa/c/8ffa33c24ecae7be41421669ff6114ae56e9a6e7 . makeapi and makeaci create the same output on Python 2 and 3.

Metadata Update from @cheimes:
- Issue close_status updated to: fixed
- Issue tagged with: py3

6 years ago

Log in to comment on this ticket.

Metadata