From 2a59ac4d632a18e88edc04657ba9d5cb3859501c Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 11 Feb 2011 16:12:21 +0100 Subject: [PATCH] Improve python packaging for release 1.9.1 --- MANIFEST.in | 4 ++-- check-sdist.sh | 4 +++- setup.py | 23 ++++++++++++++++------- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 845f9e8f8..aa793941a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,9 +1,9 @@ recursive-include tests *.db *.py -recursive-include templates *.html *.txt yadis.xrdf recursive-include media *.css *.js *.ico *.gif *.png *.jpg README -recursive-include authentic2 README fixtures/*.json templates/*/*.html js/*.js templates/*/*/*.html locale/*/*/*.po +recursive-include authentic2 README fixtures/*.json templates/*.html templates/*/*.html js/*.js templates/*/*/*.html locale/*/*/*.po xrds.xml *.txt yadis.xrdf include authentic2/sslauth/authentic_ssl.vhost include COPYING include README.rst include authentic2/vendor/oath/TODO include authentic2/vendor/totp_js/README.rst +include diagnose.py diff --git a/check-sdist.sh b/check-sdist.sh index 56e2d7eb6..f0f97206b 100755 --- a/check-sdist.sh +++ b/check-sdist.sh @@ -2,5 +2,7 @@ VERSION=`cat authentic2/__init__.py | grep VERSION | sed 's/VERSION = "\(.*\)"/\1/'` -python setup.py sdist + +rm -f dist/authentic2-$VERSION.tar.gz && \ +python setup.py sdist && \ diff <(git ls-files|sort) <(tar tf dist/authentic2-$VERSION.tar.gz|sort|grep -v '/$'|sed "s#.*-$VERSION/##") diff --git a/setup.py b/setup.py index 97c237596..63f129447 100755 --- a/setup.py +++ b/setup.py @@ -7,11 +7,14 @@ import distutils.core import authentic2 import os -def ls_R(directory): +def ls_R(directory, target): '''Recursively list files in @directory''' - for root, dirs, files in os.walk(directory): - for file in files: - yield os.path.join(root, file) + path = os.path.join(os.path.dirname(__file__), directory) + to_remove = os.path.dirname(path) + for root, dirs, files in os.walk(path): + root = root.replace(to_remove + '/', '') + file_list = [ os.path.join(root, file) for file in files] + yield (os.path.join(target, root), file_list) # Build the authentic package. distutils.core.setup(name="authentic2", @@ -23,7 +26,6 @@ distutils.core.setup(name="authentic2", author_email="authentic-devel@lists.labs.libre-entreprise.org", maintainer="Benjamin Dauvergne", maintainer_email="bdauvergne@entrouvert.com", - py_modules=['manage'], packages=[ 'authentic2', 'authentic2/admin_log_view', 'authentic2/auth2_auth', @@ -42,10 +44,17 @@ distutils.core.setup(name="authentic2", 'authentic2/sslauth', 'authentic2/vendor', 'authentic2/vendor/oath', - 'authentic2/vendor/totp_js',], + 'authentic2/vendor/totp_js', + 'authentic2/sslauth/migrations', + 'authentic2/saml/migrations', + 'authentic2/auth2_auth/auth2_oath/migrations', + 'authentic2/auth2_auth/migrations', + 'authentic2/authsaml2/migrations', + 'authentic2/idp/idp_openid/migrations', + ], package_data={ '': ['fixtures/*.json', 'templates/*.html','templates/*/*.html','js/*.js'] }, - data_files=[('/share/authentic2/media/', list(ls_R('media')))], + data_files=list(ls_R('media', 'share/authentic2/')), requires=[ 'django (>=1.2.0)', 'registration (>=0.7)',