#6468 Make ipaclient pip install-able
Closed: fixed Opened by cheimes.

FreeIPA git is now using setuptools for packaging. We have most pieces in place to make ipaclient, ipalib, ipaplatform and ipapython pip install-able. With just some small additions and changes we can turn FreeIPA's client packages into proper Python wheel packages. Wheels can be easily installed in virtual envs or containers. Binary wheels with dependencies to shared libraries can be build on one machine, then simply copied and installed on a compatible machine.

  • Make setup.py files PyPI compatible https://github.com/freeipa/freeipa/pull/197

  • Add Python package requirements to setup.py files https://github.com/tiran/freeipa/commits/python_requirements

  • Make ipaplatform's platform selection a runtime decision https://github.com/tiran/freeipa/commits/ipaplatform_detect

  • Document build time and runtime dependencies (header files, shared libraries, external commands)


The wheel packages won't support client enrolment. They have just enough features to run commands like and to use the FreeIPA's Python API like the RPC client.

part implemented:

master:

  • 2dd66c6366454f9edd9b89861530e97c75b2d869 Use correct classifiers to make setup.py files PyPI compatible

master:

  • 8346e1b067483d4d836627a267805bbe8d6e7efa Add install requirements to Python packages

This commit adds dependency on python-wheel package, which is missing on RHEL/CentOS, therefore IPA can't be built there. Would it be possible to make python-wheel package optional (it would be nice to use new build system and its configure options for disabling)? The traceback is attached:

 make[2]: Entering directory `/builddir/build/BUILD/freeipa-4.4/ipaclient'
cd .; /usr/bin/python setup.py \
    "--verbose" \
    build \
    --build-base "/builddir/build/BUILD/freeipa-4.4/ipaclient/build"
Download error on https://pypi.python.org/simple/wheel/: [Errno -2] Name or service not known -- Some packages may not be found!
Couldn't find index page for 'wheel' (maybe misspelled?)
Download error on https://pypi.python.org/simple/: [Errno -2] Name or service not known -- Some packages may not be found!
No local packages or download links found for wheel
Traceback (most recent call last):
  File "setup.py", line 58, in <module>
    "otptoken_yubikey": ["yubico", "usb"]
  File "/builddir/build/BUILD/freeipa-4.4/ipasetup.py", line 100, in ipasetup
    return setup(**setup_kwargs)
  File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup
    _setup_distribution = dist = klass(attrs)
  File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 265, in __init__
    self.fetch_build_eggs(attrs.pop('setup_requires'))
  File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 289, in fetch_build_eggs
    parse_requirements(requires), installer=self.fetch_build_egg
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 618, in resolve
    dist = best[req.key] = env.best_match(req, self, installer)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 862, in best_match
    return self.obtain(req, installer) # try and download/install
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 874, in obtain
    return installer(requirement)
  File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 339, in fetch_build_egg
    return cmd.easy_install(req)
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 617, in easy_install
    raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('wheel')
make[2]: Leaving directory `/builddir/build/BUILD/freeipa-4.4/ipaclient'
make[2]: *** [all-local] Error 1
make[1]: Leaving directory `/builddir/build/BUILD/freeipa-4.4'
RPM build errors:
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.JPDueS (%build)
    Bad exit status from /var/tmp/rpm-tmp.JPDueS (%build)
Child return code was: 1
EXCEPTION: [Error()]
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/mockbuild/trace_decorator.py", line 88, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.5/site-packages/mockbuild/util.py", line 562, in do
    raise exception.Error("Command failed. See logs for output.\n # %s" % (command,), child.returncode)
mockbuild.exception.Error: Command failed. See logs for output.

I agree with pvomacka. It should be handled as all other non-critical depedencies which are missing in RHEL: By --disable-switch which disables the optional feature.

I have addressed the wheel dependency in https://github.com/freeipa/freeipa/pull/255. The PR is in review.

master:

  • 573eee444e1746fd5949897294c96a1793e74511 Pylint: whitelist packages with extension modules

master:

  • 526bcea705d04895aa6b09bce996ac340783d1d0 Don't ship install subpackages with wheels

master:

  • ed9645b2ac58fd4664810f05970ea258c7948420 Adjustments for setup requirements

master:

  • 8559791e0d520f4a3503e35d1975ac31448b1390 Require python-gssapi >= 1.2.0

master:

  • 289982e02fa6bef700fe2c1900ddbed864876faa Require python-cryptography >= 1.3.1

master:

  • 027fc32fe0424659c5aecb4531299fe8d4a503d3 Backwards compatibility with setuptools 0.9.8

master:

  • 5dc5960e715b378b6090935ba133d6f332427de5 Require python-gssapi >= 1.2.0, take 2

master:

  • 7f301b00ce50814d098e7e42324ef741c71b6853 Adjustments for setup requirements v2

Is everything implemented? I.e., is this ticket fixed?

master:

  • 0663faf2585be4af3501965934703da0ede41610 fix: regression in API version comparison

master:

  • 987d24f784e05e911bf4e87bd1156abb1dd56210 Silence pylint import errors of ipaserver in ipalib and ipaclient

Metadata Update from @cheimes:
- Issue assigned to someone
- Issue set to the milestone: FreeIPA 4.5

Metadata Update from @cheimes:
- Custom field affects_doc reset
- Custom field component reset
- Custom field design reset
- Custom field rhbz reset
- Custom field type reset
- Issue close_status updated to: None
- Issue set to the milestone: None (was: FreeIPA 4.5)

Metadata Update from @cheimes:
- Custom field affects_doc reset
- Issue tagged with: integration

Metadata Update from @pvoborni:
- Custom field affects_doc reset
- Custom field tester adjusted to wanted
- Issue set to the milestone: FreeIPA 4.5

Metadata Update from @mbasti:
- Issue set to the milestone: FreeIPA 4.5.1 (was: FreeIPA 4.5)

master:

  • fe17d187f9f2cbac28fe369cbcdd697d85105481 Constrain wheel package versions

ipa-4-5:

  • 7c93a518c8b6fb0e3a85bc1ae0ee807c71168213 Constrain wheel package versions

Metadata Update from @mbasti:
- Issue set to the milestone: FreeIPA 4.5.2 (was: FreeIPA 4.5.1)

FreeIPA 4.5.1 has been released, moving to FreeIPA 4.5.2 milestone

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

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

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

With ipaclient, ipalib, ipapython, and ipaplatform packaged as wheels, the ticket is done.

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

master:

  • a5213140c3abf67a341b04d6edaeea6e0e1de62e Make netifaces optional

ipa-4-7:

  • 12bfb86f0dd260f8f0df1a596bddf781e8e72465 Make netifaces optional

master:

  • 2a459ce0f2c5e2af2dbe028afcf1d4e83875ce60 Make python-ldap optional for PyPI packages
  • d59f155e521c2e382f1745ebccc6abdbbbccc2e2 Make IPADiscovery work without ldap
  • bdce9164a1e822663cfce345976f66436068acd4 Make ipaclient.discovery usable from command line
Metadata