[Freeipa-devel] [freeipa PR#195][synchronized] [WIP] Make ipaclient pip install-able

2016-11-16 Thread tiran
   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 7a44180f941121e73419e7a7ed13b6b73c692e96 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Thu, 27 Oct 2016 14:04:58 +0200
Subject: [PATCH] Add install requirements to Python packages

https://fedorahosted.org/freeipa/ticket/6468

Signed-off-by: Christian Heimes 
---
 .gitignore   |  1 -
 Makefile.am  | 21 -
 Makefile.python.am   |  6 ++
 ipaclient/setup.py   | 14 ++
 ipalib/setup.py  | 11 +++
 ipaplatform/setup.py | 10 ++
 ipapython/setup.py   | 23 +++
 ipaserver/setup.py   | 26 ++
 ipasetup.py.in   | 23 +++
 ipatests/setup.py| 25 -
 10 files changed, 157 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index de61aff..2bacc85 100644
--- a/.gitignore
+++ b/.gitignore
@@ -88,4 +88,3 @@ freeipa2-dev-doc
 /ipaplatform/paths.py
 /ipaplatform/services.py
 /ipaplatform/tasks.py
-/ipaplatform/setup.py
diff --git a/Makefile.am b/Makefile.am
index 159d396..807a4f3 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 \
 		   ignore_import_errors.pyc ignore_import_errors.pyo \
@@ -162,3 +163,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 c9c1a1f..2d62853 100644
--- a/Makefile.python.am
+++ b/Makefile.python.am
@@ -44,3 +44,9 @@ 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.py b/ipaclient/setup.py
index 722d99d..fc5609b 100644
--- a/ipaclient/setup.py
+++ b/ipaclient/setup.py
@@ -43,4 +43,18 @@
 "ipaclient.remote_plugins.2_156",
 "ipaclient.remote_plugins.2_164",
 ],
+install_requires=[
+"cryptography",
+"ipalib",
+"ipapython",
+"python-nss",
+"qrcode",
+"six",
+],
+setup_requires=[
+"wheel",
+],
+extra_requires={
+"otptoken_yubikey": ["yubico", "usb"]
+}
 )
diff --git a/ipalib/setup.py b/ipalib/setup.py
index a828c37..98af7ab 100644
--- a/ipalib/setup.py
+++ b/ipalib/setup.py
@@ -36,4 +36,15 @@
 "ipalib",
 "ipalib.install",
 ],
+install_requires=[
+"ipaplatform",
+"ipapython",
+"netaddr",
+"pyasn1",
+"python-nss",
+"six",
+],
+setup_requires=[
+"wheel",
+],
 )
diff --git a/ipaplatform/setup.py b/ipaplatform/setup.py
index 82499da..97311de 100644
--- a/ipaplatform/setup.py
+++ b/ipaplatform/setup.py
@@ -39,4 +39,14 @@
 "ipaplatform.redhat",
 "ipaplatform.rhel"
 ],
+install_requires=[
+"cffi",
+# "ipalib",  # circular dependency
+"pyasn1",
+"python-nss",
+"six",
+],
+setup_requires=[
+"wheel",
+],
 )
diff --git a/ipapython/setup.py b/ipapython/setup.py
index 47acdd6..0f181ab 100755
--- a/ipapython/setup.py
+++ b/ipapython/setup.py
@@ -38,4 +38,27 @@
 "ipapython.secrets",
 "ipapython.install"
 ],
+install_requires=[
+"cffi",
+"custodia",
+"cryptography",
+"dnspython",
+"gssapi",
+"jwcrypto",
+"ipaplatform",
+# 

[Freeipa-devel] [freeipa PR#195][synchronized] [WIP] Make ipaclient pip install-able

2016-11-15 Thread tiran
   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 e76c4470159f9b2cc475ce02e07d38fe0a977c30 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Thu, 27 Oct 2016 14:04:58 +0200
Subject: [PATCH] Add install requirements to Python packages

Signed-off-by: Christian Heimes 
---
 .gitignore   |  1 -
 Makefile.am  | 21 -
 Makefile.python.am   |  6 ++
 ipaclient/setup.py   | 14 ++
 ipalib/setup.py  | 11 +++
 ipaplatform/setup.py | 10 ++
 ipapython/setup.py   | 23 +++
 ipaserver/setup.py   | 26 ++
 ipasetup.py.in   | 23 +++
 ipatests/setup.py| 25 -
 10 files changed, 157 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index de61aff..2bacc85 100644
--- a/.gitignore
+++ b/.gitignore
@@ -88,4 +88,3 @@ freeipa2-dev-doc
 /ipaplatform/paths.py
 /ipaplatform/services.py
 /ipaplatform/tasks.py
-/ipaplatform/setup.py
diff --git a/Makefile.am b/Makefile.am
index 159d396..807a4f3 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 \
 		   ignore_import_errors.pyc ignore_import_errors.pyo \
@@ -162,3 +163,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..2ccd383 100644
--- a/Makefile.python.am
+++ b/Makefile.python.am
@@ -36,3 +36,9 @@ 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.py b/ipaclient/setup.py
index 722d99d..0a9d075 100644
--- a/ipaclient/setup.py
+++ b/ipaclient/setup.py
@@ -43,4 +43,18 @@
 "ipaclient.remote_plugins.2_156",
 "ipaclient.remote_plugins.2_164",
 ],
+install_requires=[
+"cryptography",
+"ipalib",
+"ipapython",
+"python-nss",
+"qrcode",
+"six",
+],
+setup_requires=[
+"wheel",
+],
+extra_requires = {
+"otptoken_yubikey": ["yubico", "usb"]
+}
 )
diff --git a/ipalib/setup.py b/ipalib/setup.py
index a828c37..98af7ab 100644
--- a/ipalib/setup.py
+++ b/ipalib/setup.py
@@ -36,4 +36,15 @@
 "ipalib",
 "ipalib.install",
 ],
+install_requires=[
+"ipaplatform",
+"ipapython",
+"netaddr",
+"pyasn1",
+"python-nss",
+"six",
+],
+setup_requires=[
+"wheel",
+],
 )
diff --git a/ipaplatform/setup.py b/ipaplatform/setup.py
index 82499da..97311de 100644
--- a/ipaplatform/setup.py
+++ b/ipaplatform/setup.py
@@ -39,4 +39,14 @@
 "ipaplatform.redhat",
 "ipaplatform.rhel"
 ],
+install_requires=[
+"cffi",
+# "ipalib",  # circular dependency
+"pyasn1",
+"python-nss",
+"six",
+],
+setup_requires=[
+"wheel",
+],
 )
diff --git a/ipapython/setup.py b/ipapython/setup.py
index 47acdd6..0f181ab 100755
--- a/ipapython/setup.py
+++ b/ipapython/setup.py
@@ -38,4 +38,27 @@
 "ipapython.secrets",
 "ipapython.install"
 ],
+install_requires=[
+"cffi",
+"custodia",
+"cryptography",
+"dnspython",
+"gssapi",
+"jwcrypto",
+"ipaplatform",
+# "ipalib",  # circular dependency
+

[Freeipa-devel] [freeipa PR#195][synchronized] [WIP] Make ipaclient pip install-able

2016-11-14 Thread tiran
   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 f7e0d1a9d0e59c3ef8f65186ecfdad5d19b4586f Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Thu, 27 Oct 2016 14:04:58 +0200
Subject: [PATCH] Add install requirements to Python packages

Signed-off-by: Christian Heimes 
---
 Makefile.am  | 21 -
 Makefile.python.am   |  6 ++
 ipaclient/setup.py   | 11 +++
 ipalib/setup.py  |  8 
 ipaplatform/setup.py |  7 +++
 ipapython/setup.py   | 17 +
 ipaserver/setup.py   | 23 +++
 ipasetup.py.in   | 24 
 ipatests/setup.py| 23 ++-
 9 files changed, 138 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 159d396..807a4f3 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 \
 		   ignore_import_errors.pyc ignore_import_errors.pyo \
@@ -162,3 +163,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..2ccd383 100644
--- a/Makefile.python.am
+++ b/Makefile.python.am
@@ -36,3 +36,9 @@ 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.py b/ipaclient/setup.py
index 722d99d..43ebf5b 100644
--- a/ipaclient/setup.py
+++ b/ipaclient/setup.py
@@ -43,4 +43,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.py b/ipalib/setup.py
index a828c37..f3ebb63 100644
--- a/ipalib/setup.py
+++ b/ipalib/setup.py
@@ -36,4 +36,12 @@
 "ipalib",
 "ipalib.install",
 ],
+install_requires=[
+"ipaplatform",
+"ipapython",
+"netaddr",
+"pyasn1",
+"python-nss",
+"six",
+],
 )
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.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.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=[
+

[Freeipa-devel] [freeipa PR#195][synchronized] [WIP] Make ipaclient pip install-able

2016-11-09 Thread tiran
   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 86ed56da96246e7bda1cdf79eb7fa88acbaeb054 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Thu, 27 Oct 2016 14:04:58 +0200
Subject: [PATCH] Add install requirements to Python packages

Signed-off-by: Christian Heimes 
---
 Makefile.am  | 21 -
 Makefile.python.am   |  6 ++
 ipaclient/setup.py   | 11 +++
 ipalib/setup.py  |  8 
 ipaplatform/setup.py |  7 +++
 ipapython/setup.py   | 17 +
 ipaserver/setup.py   | 23 +++
 ipasetup.py.in   | 24 
 ipatests/setup.py| 23 ++-
 9 files changed, 138 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..2ccd383 100644
--- a/Makefile.python.am
+++ b/Makefile.python.am
@@ -36,3 +36,9 @@ 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.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.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.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.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.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",
+ 

[Freeipa-devel] [freeipa PR#195][synchronized] [WIP] Make ipaclient pip install-able

2016-11-09 Thread tiran
   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 
Date: Thu, 27 Oct 2016 14:04:58 +0200
Subject: [PATCH 1/2] Add install requirements to Python packages

Signed-off-by: Christian Heimes 
---
 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