URL: https://github.com/freeipa/freeipa/pull/195 Author: tiran Title: #195: [WIP] Make ipaclient pip install-able Action: synchronized
To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/195/head:pr195 git checkout pr195
From ecbc43635405147a42ca39cea9aec554b1688a8d Mon Sep 17 00:00:00 2001 From: Christian Heimes <chei...@redhat.com> Date: Thu, 27 Oct 2016 14:04:58 +0200 Subject: [PATCH 1/2] Add install requirements to Python packages Signed-off-by: Christian Heimes <chei...@redhat.com> --- Makefile.am | 21 ++++++++++++++++++++- Makefile.python.am | 7 +++++++ ipaclient/setup.cfg | 4 ++++ ipaclient/setup.py | 11 +++++++++++ ipalib/setup.cfg | 4 ++++ ipalib/setup.py | 8 ++++++++ ipaplatform/setup.cfg | 4 ++++ ipaplatform/setup.py | 7 +++++++ ipapython/setup.cfg | 4 ++++ ipapython/setup.py | 17 +++++++++++++++++ ipaserver/setup.cfg | 4 ++++ ipaserver/setup.py | 23 +++++++++++++++++++++++ ipasetup.py.in | 24 ++++++++++++++++++++++++ ipatests/setup.cfg | 4 ++++ ipatests/setup.py | 23 ++++++++++++++++++++++- 15 files changed, 163 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index ffa5de2..09ce753 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,5 @@ -SUBDIRS = asn1 util client contrib daemons init install ipaclient ipalib ipaplatform ipapython ipaserver ipatests po +IPACLIENT_SUBDIRS = ipaclient ipalib ipaplatform ipapython +SUBDIRS = asn1 util client contrib daemons init install $(IPACLIENT_SUBDIRS) ipaserver ipatests po MOSTLYCLEANFILES = ipasetup.pyc ipasetup.pyo @@ -105,3 +106,21 @@ jslint-ui-test: jslint-html: cd $(top_srcdir)/install/html; \ jsl -nologo -nosummary -nofilelisting -conf jsl.conf + +.PHONY: bdist_wheel wheel_bundle +WHEELDISTDIR = $(top_builddir)/dist/wheels +WHEELBUNDLEDIR = $(top_builddir)/dist/bundle + +$(WHEELDISTDIR): + mkdir -p $(WHEELDISTDIR) + +$(WHEELBUNDLEDIR): + mkdir -p $(WHEELBUNDLEDIR) + +bdist_wheel: $(WHEELDISTDIR) + for dir in $(IPACLIENT_SUBDIRS); do \ + $(MAKE) $(AM_MAKEFLAGS) -C $${dir} $@ || exit 1; \ + done + +wheel_bundle: $(WHEELBUNDLEDIR) bdist_wheel + $(PYTHON) -m pip wheel --wheel-dir $(WHEELBUNDLEDIR) $(WHEELDISTDIR)/*.whl diff --git a/Makefile.python.am b/Makefile.python.am index 0ea3fcf..eb6fdc2 100644 --- a/Makefile.python.am +++ b/Makefile.python.am @@ -36,3 +36,10 @@ dist-hook: if test -x "$(srcdir)/$${FILEN}"; then MODE=755; else MODE=644; fi; \ $(INSTALL) -D -m $${MODE} "$(srcdir)/$${FILEN}" "$(distdir)/$${FILEN}" || exit $$?; \ done + + +WHEELDISTDIR = $(top_builddir)/dist/wheels +.PHONY: bdist_wheel +bdist_wheel: + rm -rf $(WHEELDISTDIR)/$(pkgname)*.whl + $(PYTHON) "$(srcdir)/setup.py" bdist_wheel --dist-dir=$(WHEELDISTDIR) diff --git a/ipaclient/setup.cfg b/ipaclient/setup.cfg index 34abb12..666b750 100644 --- a/ipaclient/setup.cfg +++ b/ipaclient/setup.cfg @@ -1,4 +1,8 @@ +[sdist] +dist-dir = ../dist + [bdist_wheel] +dist-dir = ../dist universal = 1 [metadata] diff --git a/ipaclient/setup.py b/ipaclient/setup.py index 32778b0..6d12171 100644 --- a/ipaclient/setup.py +++ b/ipaclient/setup.py @@ -42,4 +42,15 @@ "ipaclient.remote_plugins.2_156", "ipaclient.remote_plugins.2_164", ], + install_requires=[ + "cryptography", + "ipalib", + "ipapython", + "python-nss", + "qrcode", + "six", + ], + extra_requires = { + "otptoken_yubikey": ["yubico", "usb"] + } ) diff --git a/ipalib/setup.cfg b/ipalib/setup.cfg index 34abb12..666b750 100644 --- a/ipalib/setup.cfg +++ b/ipalib/setup.cfg @@ -1,4 +1,8 @@ +[sdist] +dist-dir = ../dist + [bdist_wheel] +dist-dir = ../dist universal = 1 [metadata] diff --git a/ipalib/setup.py b/ipalib/setup.py index 982a783..2a7754c 100644 --- a/ipalib/setup.py +++ b/ipalib/setup.py @@ -35,4 +35,12 @@ packages=[ "ipalib", ], + install_requires=[ + "ipaplatform", + "ipapython", + "netaddr", + "pyasn1", + "python-nss", + "six", + ], ) diff --git a/ipaplatform/setup.cfg b/ipaplatform/setup.cfg index 34abb12..666b750 100644 --- a/ipaplatform/setup.cfg +++ b/ipaplatform/setup.cfg @@ -1,4 +1,8 @@ +[sdist] +dist-dir = ../dist + [bdist_wheel] +dist-dir = ../dist universal = 1 [metadata] diff --git a/ipaplatform/setup.py b/ipaplatform/setup.py index 82499da..98a9f08 100644 --- a/ipaplatform/setup.py +++ b/ipaplatform/setup.py @@ -39,4 +39,11 @@ "ipaplatform.redhat", "ipaplatform.rhel" ], + install_requires=[ + "cffi", + # "ipalib", # circular dependency + "pyasn1", + "python-nss", + "six", + ], ) diff --git a/ipapython/setup.cfg b/ipapython/setup.cfg index 34abb12..666b750 100644 --- a/ipapython/setup.cfg +++ b/ipapython/setup.cfg @@ -1,4 +1,8 @@ +[sdist] +dist-dir = ../dist + [bdist_wheel] +dist-dir = ../dist universal = 1 [metadata] diff --git a/ipapython/setup.py b/ipapython/setup.py index 47acdd6..e254253 100755 --- a/ipapython/setup.py +++ b/ipapython/setup.py @@ -38,4 +38,21 @@ "ipapython.secrets", "ipapython.install" ], + install_requires=[ + "cffi", + "custodia", + "cryptography", + "dnspython", + "gssapi", + "jwcrypto", + "ipaplatform", + # "ipalib", # circular dependency + "pyldap", + "lxml", + "netaddr", + "netifaces", + "python-nss", + "requests", + "six", + ], ) diff --git a/ipaserver/setup.cfg b/ipaserver/setup.cfg index 34abb12..666b750 100644 --- a/ipaserver/setup.cfg +++ b/ipaserver/setup.cfg @@ -1,4 +1,8 @@ +[sdist] +dist-dir = ../dist + [bdist_wheel] +dist-dir = ../dist universal = 1 [metadata] diff --git a/ipaserver/setup.py b/ipaserver/setup.py index 8ce2970..0cd20da 100755 --- a/ipaserver/setup.py +++ b/ipaserver/setup.py @@ -43,4 +43,27 @@ 'ipaserver.install.plugins', 'ipaserver.install.server', ], + install_requires=[ + "cryptography", + "dnspython", + "dogtag-pki", + "ipaclient", + "ipalib", + "ipaplatform", + "ipapython", + "lxml", + "netaddr", + "memcache", + "pyasn1", + "pyldap", + "python-nss", + "six", + # not available on PyPI + # "python-dbus", + # "python-libipa_hbac", + # "python-sss", + # "python-sss-murmur", + # "python-SSSDConfig", + # "samba-python", + ], ) diff --git a/ipasetup.py.in b/ipasetup.py.in index 2835527..e850b35 100644 --- a/ipasetup.py.in +++ b/ipasetup.py.in @@ -18,6 +18,25 @@ import os import sys + +PACKAGE_VERSION = { + 'cryptography': 'cryptography >= 0.9', + 'dnspython': 'dnspython >= 1.11.1', + 'gssapi': 'gssapi > 1.1.2', + 'ipaclient': 'ipaclient == __VERSION__', + 'ipalib': 'ipalib == __VERSION__', + 'ipaplatform': 'ipaplatform == __VERSION__', + 'ipapython': 'ipapython == __VERSION__', + 'ipaserver': 'ipaserver == __VERSION__', + 'kdcproxy': 'kdcproxy >= 0.3', + 'netifaces': 'netifaces >= 0.10.4', + 'python-nss': 'python-nss >= 0.16', + 'pyldap': 'pyldap >= 2.4.15', + 'qrcode': 'qrcode >= 5.0', + # 'yubico': 'yubico >= 1.2.3', +} + + common_args = dict( version="@VERSION@", license="GPL", @@ -48,11 +67,16 @@ old_path = os.path.abspath(os.getcwd()) def ipasetup(name, doc, **kwargs): doclines = doc.split("\n") + install_requires = list(kwargs.pop('install_requires', [])) + for i, entry in enumerate(install_requires): + install_requires[i] = PACKAGE_VERSION.get(entry, entry) + setup_kwargs = common_args.copy() setup_kwargs.update( name=name, description=doclines[0], long_description="\n".join(doclines[:2]), + install_requires=install_requires, **kwargs ) # exclude setup helpers from getting installed diff --git a/ipatests/setup.cfg b/ipatests/setup.cfg index 34abb12..666b750 100644 --- a/ipatests/setup.cfg +++ b/ipatests/setup.cfg @@ -1,4 +1,8 @@ +[sdist] +dist-dir = ../dist + [bdist_wheel] +dist-dir = ../dist universal = 1 [metadata] diff --git a/ipatests/setup.py b/ipatests/setup.py index 32a5207..1de0bbe 100644 --- a/ipatests/setup.py +++ b/ipatests/setup.py @@ -56,5 +56,26 @@ 'ipatests.test_pkcs10': ['*.csr'], "ipatests.test_ipaserver": ['data/*'], 'ipatests.test_xmlrpc': ['data/*'], - } + }, + install_requires=[ + "cryptography", + "dnspython", + "dogtag-pki", + "ipaclient", + "ipalib", + "ipaplatform", + "ipapython", + "ipaserver", + "lxml", + "nose", + "pyldap", + "pytest", + "python-gssapi", + "python-nss", + "selenium", + "six", + "yaml", + # not available on PyPI + # "python-dbus", + ], ) From 93a1988b763f20c06072b82d05740d0d027ceb37 Mon Sep 17 00:00:00 2001 From: Christian Heimes <chei...@redhat.com> Date: Wed, 9 Nov 2016 18:23:10 +0100 Subject: [PATCH 2/2] fixup! Add install requirements to Python packages --- ipaclient/setup.cfg | 4 ---- ipalib/setup.cfg | 4 ---- ipaplatform/setup.cfg | 4 ---- ipapython/setup.cfg | 4 ---- ipaserver/setup.cfg | 4 ---- ipasetup.py.in | 10 +++++----- ipatests/setup.cfg | 4 ---- 7 files changed, 5 insertions(+), 29 deletions(-) diff --git a/ipaclient/setup.cfg b/ipaclient/setup.cfg index 666b750..34abb12 100644 --- a/ipaclient/setup.cfg +++ b/ipaclient/setup.cfg @@ -1,8 +1,4 @@ -[sdist] -dist-dir = ../dist - [bdist_wheel] -dist-dir = ../dist universal = 1 [metadata] diff --git a/ipalib/setup.cfg b/ipalib/setup.cfg index 666b750..34abb12 100644 --- a/ipalib/setup.cfg +++ b/ipalib/setup.cfg @@ -1,8 +1,4 @@ -[sdist] -dist-dir = ../dist - [bdist_wheel] -dist-dir = ../dist universal = 1 [metadata] diff --git a/ipaplatform/setup.cfg b/ipaplatform/setup.cfg index 666b750..34abb12 100644 --- a/ipaplatform/setup.cfg +++ b/ipaplatform/setup.cfg @@ -1,8 +1,4 @@ -[sdist] -dist-dir = ../dist - [bdist_wheel] -dist-dir = ../dist universal = 1 [metadata] diff --git a/ipapython/setup.cfg b/ipapython/setup.cfg index 666b750..34abb12 100644 --- a/ipapython/setup.cfg +++ b/ipapython/setup.cfg @@ -1,8 +1,4 @@ -[sdist] -dist-dir = ../dist - [bdist_wheel] -dist-dir = ../dist universal = 1 [metadata] diff --git a/ipaserver/setup.cfg b/ipaserver/setup.cfg index 666b750..34abb12 100644 --- a/ipaserver/setup.cfg +++ b/ipaserver/setup.cfg @@ -1,8 +1,4 @@ -[sdist] -dist-dir = ../dist - [bdist_wheel] -dist-dir = ../dist universal = 1 [metadata] diff --git a/ipasetup.py.in b/ipasetup.py.in index e850b35..fcbe47e 100644 --- a/ipasetup.py.in +++ b/ipasetup.py.in @@ -23,11 +23,11 @@ PACKAGE_VERSION = { 'cryptography': 'cryptography >= 0.9', 'dnspython': 'dnspython >= 1.11.1', 'gssapi': 'gssapi > 1.1.2', - 'ipaclient': 'ipaclient == __VERSION__', - 'ipalib': 'ipalib == __VERSION__', - 'ipaplatform': 'ipaplatform == __VERSION__', - 'ipapython': 'ipapython == __VERSION__', - 'ipaserver': 'ipaserver == __VERSION__', + 'ipaclient': 'ipaclient == @VERSION@', + 'ipalib': 'ipalib == @VERSION@', + 'ipaplatform': 'ipaplatform == @VERSION@', + 'ipapython': 'ipapython == @VERSION@', + 'ipaserver': 'ipaserver == @VERSION@', 'kdcproxy': 'kdcproxy >= 0.3', 'netifaces': 'netifaces >= 0.10.4', 'python-nss': 'python-nss >= 0.16', diff --git a/ipatests/setup.cfg b/ipatests/setup.cfg index 666b750..34abb12 100644 --- a/ipatests/setup.cfg +++ b/ipatests/setup.cfg @@ -1,8 +1,4 @@ -[sdist] -dist-dir = ../dist - [bdist_wheel] -dist-dir = ../dist universal = 1 [metadata]
-- Manage your subscription for the Freeipa-devel mailing list: https://www.redhat.com/mailman/listinfo/freeipa-devel Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code