From 5ff29dc57e2877a14e705d09b7042cddf4165d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Wed, 6 Mar 2013 15:27:23 -0300 Subject: Remove everything to start from scratch --- setup.py | 222 --------------------------------------------------------------- 1 file changed, 222 deletions(-) delete mode 100755 setup.py (limited to 'setup.py') diff --git a/setup.py b/setup.py deleted file mode 100755 index 64c2a4f5..00000000 --- a/setup.py +++ /dev/null @@ -1,222 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -from __future__ import print_function -import sys - -try: - from setuptools import setup, find_packages -except ImportError: - from pkg import distribute_setup - distribute_setup.use_setuptools() - from setuptools import setup, find_packages -import os - -from pkg import utils -from pkg import branding -import versioneer -versioneer.versionfile_source = 'src/leap/_version.py' -versioneer.versionfile_build = 'leap/_version.py' -versioneer.tag_prefix = '' # tags are like 1.2.0 -#versioneer.parentdir_prefix = 'leap_client-' -versioneer.parentdir_prefix = branding.APP_PREFIX - -branding.brandingfile = 'src/leap/_branding.py' -branding.brandingfile_build = 'leap/_branding.py' -branding.cert_path = 'src/leap/certs' - -setup_root = os.path.dirname(__file__) -sys.path.insert(0, os.path.join(setup_root, "src")) - -trove_classifiers = [ - "Development Status :: 3 - Alpha", - "Environment :: X11 Applications :: Qt", - "Intended Audience :: End Users/Desktop", - ("License :: OSI Approved :: GNU General " - "Public License v3 or later (GPLv3+)"), - "Operating System :: OS Independent", - "Programming Language :: Python", - "Programming Language :: Python :: 2.6", - "Programming Language :: Python :: 2.7", - "Topic :: Communications", - "Topic :: Security", - "Topic :: System :: Networking", - "Topic :: Utilities" -] - -BRANDING_OPTS = """ -# Do NOT manually edit this file! -# This file has been written from pkg/branding/config.py data by leap setup.py -# script. - -BRANDING = { - 'short_name': "%(short_name)s", - 'provider_domain': "%(provider_domain)s", - 'provider_ca_file': "%(provider_ca_file)s"} -""" - - -def write_to_branding_file(filename, branding_dict): - f = open(filename, "w") - f.write(BRANDING_OPTS % branding_dict) - f.close() - - -def copy_pemfile_to_certdir(frompath, topath): - with open(frompath, "r") as cert_f: - cert_s = cert_f.read() - with open(topath, "w") as f: - f.write(cert_s) - - -def do_branding(targetfile=branding.brandingfile): - if branding.BRANDED_BUILD: - opts = branding.BRANDED_OPTS - print("DOING BRANDING FOR LEAP") - certpath = opts['provider_ca_path'] - shortname = opts['short_name'] - tocertfile = shortname + '-cacert.pem' - topath = os.path.join( - branding.cert_path, - tocertfile) - copy_pemfile_to_certdir( - certpath, - topath) - opts['provider_ca_file'] = tocertfile - write_to_branding_file( - targetfile, - opts) - else: - print('not running branding because BRANDED_BUILD set to False') - - -from setuptools import Command - - -class DoBranding(Command): - description = "copy the branding info the the top level package" - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - do_branding() - -from distutils.command.build import build as _build -from distutils.command.sdist import sdist as _sdist - - -class cmd_build(_build): - def run(self): - #versioneer.cmd_build(self) - _build.run(self) - - # versioneer - versions = versioneer.get_versions(verbose=True) - # now locate _version.py in the new build/ directory and replace it - # with an updated value - target_versionfile = os.path.join( - self.build_lib, - versioneer.versionfile_build) - print("UPDATING %s" % target_versionfile) - os.unlink(target_versionfile) - f = open(target_versionfile, "w") - f.write(versioneer.SHORT_VERSION_PY % versions) - f.close() - - # branding - target_brandingfile = os.path.join( - self.build_lib, - branding.brandingfile_build) - do_branding(targetfile=target_brandingfile) - - -class cmd_sdist(_sdist): - def run(self): - # versioneer: - versions = versioneer.get_versions(verbose=True) - self._versioneer_generated_versions = versions - # unless we update this, the command will keep using the old version - self.distribution.metadata.version = versions["version"] - - # branding: - do_branding() - return _sdist.run(self) - - def make_release_tree(self, base_dir, files): - _sdist.make_release_tree(self, base_dir, files) - # now locate _version.py in the new base_dir directory (remembering - # that it may be a hardlink) and replace it with an updated value - target_versionfile = os.path.join( - base_dir, versioneer.versionfile_source) - print("UPDATING %s" % target_versionfile) - os.unlink(target_versionfile) - f = open(target_versionfile, "w") - f.write( - versioneer.SHORT_VERSION_PY % self._versioneer_generated_versions) - f.close() - -cmdclass = versioneer.get_cmdclass() -cmdclass["branding"] = DoBranding - -# Uncomment this to have the branding command run automatically -# on the build and sdist commands. -#cmdclass["build"] = cmd_build -#cmdclass["sdist"] = cmd_sdist - -launcher_name = branding.get_shortname() -if launcher_name: - leap_launcher = 'leap-%s-client=leap.app:main' % launcher_name -else: - leap_launcher = 'leap-client=leap.app:main' - -setup( - name=branding.get_name(), - package_dir={"": "src"}, - version=versioneer.get_version(), - cmdclass=cmdclass, - description="the internet encryption toolkit", - long_description=( - "Desktop Client for the LEAP Platform." - "\n" - "LEAP (LEAP Encryption Access Project) develops " - "a multi-year plan to secure everyday communication, breaking down" - "into discrete services, to be rolled out one at a time.\n" - "The client for the current phase gives support to the EIP Service." - "EIP (the Encrypted Internet Proxy) provides circumvention, location " - "anonymization, and traffic " - "encryption in a hassle-free, automatically self-configuring fashion, " - "and has an enhanced level of security." - ), - classifiers=trove_classifiers, - install_requires=utils.parse_requirements(), - test_suite='nose.collector', - test_requires=utils.parse_requirements( - reqfiles=['pkg/test-requirements.pip']), - keywords='LEAP, client, qt, encryption, proxy, openvpn', - author='The LEAP Encryption Access Project', - author_email='info@leap.se', - url='https://leap.se', - license='GPLv3+', - packages=find_packages( - 'src', - exclude=['ez_setup', 'setup', 'examples', 'tests']), - include_package_data=True, - zip_safe=False, - - # not being used since setuptools does not like it. - # XXX it should be only for linux! - data_files=[ - ("share/man/man1", - ["docs/man/leap.1"]), - ("share/polkit-1/actions", - ["pkg/linux/polkit/net.openvpn.gui.leap.policy"]) - ], - platforms="all", - entry_points={ - 'console_scripts': [leap_launcher] - }, -) -- cgit v1.2.3 From caba70c5cee5e772761f9bbb2e4a9c5beab0be1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Thu, 7 Mar 2013 19:38:42 -0300 Subject: Add setup script and linux distribution files --- setup.py | 222 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 222 insertions(+) create mode 100755 setup.py (limited to 'setup.py') diff --git a/setup.py b/setup.py new file mode 100755 index 00000000..f37d44e2 --- /dev/null +++ b/setup.py @@ -0,0 +1,222 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from __future__ import print_function + +import sys + +try: + from setuptools import setup, find_packages +except ImportError: + from pkg import distribute_setup + distribute_setup.use_setuptools() + from setuptools import setup, find_packages +import os + +from pkg import utils +#from pkg import branding +#from setuptools import Command +from distutils.command.build import build as _build +from distutils.command.sdist import sdist as _sdist + +import versioneer +versioneer.versionfile_source = 'src/leap/_version.py' +versioneer.versionfile_build = 'leap/_version.py' +versioneer.tag_prefix = '' # tags are like 1.2.0 +versioneer.parentdir_prefix = 'leap_client-' +#versioneer.parentdir_prefix = branding.APP_PREFIX + +#branding.brandingfile = 'src/leap/_branding.py' +#branding.brandingfile_build = 'leap/_branding.py' +#branding.cert_path = 'src/leap/certs' + +setup_root = os.path.dirname(__file__) +sys.path.insert(0, os.path.join(setup_root, "src")) + +trove_classifiers = [ + "Development Status :: 3 - Alpha", + "Environment :: X11 Applications :: Qt", + "Intended Audience :: End Users/Desktop", + ("License :: OSI Approved :: GNU General " + "Public License v3 or later (GPLv3+)"), + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Topic :: Communications", + "Topic :: Security", + "Topic :: System :: Networking", + "Topic :: Utilities" +] + +# BRANDING_OPTS = """ +# # Do NOT manually edit this file! +# # This file has been written from pkg/branding/config.py data by leap setup.py +# # script. + +# BRANDING = { +# 'short_name': "%(short_name)s", +# 'provider_domain': "%(provider_domain)s", +# 'provider_ca_file': "%(provider_ca_file)s"} +# """ + + +# def write_to_branding_file(filename, branding_dict): +# f = open(filename, "w") +# f.write(BRANDING_OPTS % branding_dict) +# f.close() + + +# def copy_pemfile_to_certdir(frompath, topath): +# with open(frompath, "r") as cert_f: +# cert_s = cert_f.read() +# with open(topath, "w") as f: +# f.write(cert_s) + + +# def do_branding(targetfile=branding.brandingfile): +# if branding.BRANDED_BUILD: +# opts = branding.BRANDED_OPTS +# print("DOING BRANDING FOR LEAP") +# certpath = opts['provider_ca_path'] +# shortname = opts['short_name'] +# tocertfile = shortname + '-cacert.pem' +# topath = os.path.join( +# branding.cert_path, +# tocertfile) +# copy_pemfile_to_certdir( +# certpath, +# topath) +# opts['provider_ca_file'] = tocertfile +# write_to_branding_file( +# targetfile, +# opts) +# else: +# print('not running branding because BRANDED_BUILD set to False') + + +# class DoBranding(Command): +# description = "copy the branding info the the top level package" +# user_options = [] + +# def initialize_options(self): +# pass + +# def finalize_options(self): +# pass + +# def run(self): +# do_branding() + + +class cmd_build(_build): + def run(self): + _build.run(self) + + versions = versioneer.get_versions(verbose=True) + # now locate _version.py in the new build/ directory and replace it + # with an updated value + target_versionfile = os.path.join( + self.build_lib, + versioneer.versionfile_build) + print("UPDATING %s" % target_versionfile) + os.unlink(target_versionfile) + f = open(target_versionfile, "w") + f.write(versioneer.SHORT_VERSION_PY % versions) + f.close() + + # branding + # target_brandingfile = os.path.join( + # self.build_lib, + # branding.brandingfile_build) + # do_branding(targetfile=target_brandingfile) + + +class cmd_sdist(_sdist): + def run(self): + # versioneer: + versions = versioneer.get_versions(verbose=True) + self._versioneer_generated_versions = versions + # unless we update this, the command will keep using the old version + self.distribution.metadata.version = versions["version"] + + # branding: + #do_branding() + return _sdist.run(self) + + def make_release_tree(self, base_dir, files): + _sdist.make_release_tree(self, base_dir, files) + # now locate _version.py in the new base_dir directory (remembering + # that it may be a hardlink) and replace it with an updated value + target_versionfile = os.path.join( + base_dir, versioneer.versionfile_source) + print("UPDATING %s" % target_versionfile) + os.unlink(target_versionfile) + f = open(target_versionfile, "w") + f.write( + versioneer.SHORT_VERSION_PY % self._versioneer_generated_versions) + f.close() + +cmdclass = versioneer.get_cmdclass() +#cmdclass["branding"] = DoBranding + +# Uncomment this to have the branding command run automatically +# on the build and sdist commands. +#cmdclass["build"] = cmd_build +#cmdclass["sdist"] = cmd_sdist + +#launcher_name = branding.get_shortname() +#if launcher_name: +# leap_launcher = 'leap-%s-client=leap.app:main' % launcher_name +#else: +# leap_launcher = 'leap-client=leap.app:main' +leap_launcher = 'leap-client=leap.app:main' + +setup( + name="leap-client", # branding.get_name(), + package_dir={"": "src"}, + version=versioneer.get_version(), + cmdclass=cmdclass, + description="The Internet Encryption Toolkit", + long_description=( + "Desktop Client for the LEAP Platform." + "\n" + "LEAP (LEAP Encryption Access Project) develops " + "a multi-year plan to secure everyday communication, breaking down" + "into discrete services, to be rolled out one at a time.\n" + "The client for the current phase gives support to the EIP Service." + "EIP (the Encrypted Internet Proxy) provides circumvention, location " + "anonymization, and traffic " + "encryption in a hassle-free, automatically self-configuring fashion, " + "and has an enhanced level of security." + ), + classifiers=trove_classifiers, + install_requires=utils.parse_requirements(), + # Uncomment when tests are done + # test_suite='nose.collector', + # test_requires=utils.parse_requirements( + # reqfiles=['pkg/test-requirements.pip']), + keywords='LEAP, client, qt, encryption, proxy, openvpn', + author='The LEAP Encryption Access Project', + author_email='info@leap.se', + url='https://leap.se', + license='GPL-3+', + packages=find_packages( + 'src', + exclude=['ez_setup', 'setup', 'examples', 'tests']), + include_package_data=True, + zip_safe=False, + + # not being used since setuptools does not like it. + # looks like debhelper is honoring it... + data_files=[ + # ("share/man/man1", + # ["docs/man/leap-client.1"]), + ("share/polkit-1/actions", + ["pkg/linux/polkit/net.openvpn.gui.leap.policy"]) + ], + platforms="all", + entry_points={ + 'console_scripts': [leap_launcher] + }, +) -- cgit v1.2.3 From 34243a55d2483ed4a3d67e25c7212b4a13c5d41a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Mon, 11 Mar 2013 10:11:44 -0300 Subject: Remove branding --- setup.py | 130 +-------------------------------------------------------------- 1 file changed, 1 insertion(+), 129 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index f37d44e2..bdb3cc3e 100755 --- a/setup.py +++ b/setup.py @@ -14,21 +14,12 @@ except ImportError: import os from pkg import utils -#from pkg import branding -#from setuptools import Command -from distutils.command.build import build as _build -from distutils.command.sdist import sdist as _sdist import versioneer versioneer.versionfile_source = 'src/leap/_version.py' versioneer.versionfile_build = 'leap/_version.py' versioneer.tag_prefix = '' # tags are like 1.2.0 versioneer.parentdir_prefix = 'leap_client-' -#versioneer.parentdir_prefix = branding.APP_PREFIX - -#branding.brandingfile = 'src/leap/_branding.py' -#branding.brandingfile_build = 'leap/_branding.py' -#branding.cert_path = 'src/leap/certs' setup_root = os.path.dirname(__file__) sys.path.insert(0, os.path.join(setup_root, "src")) @@ -49,131 +40,12 @@ trove_classifiers = [ "Topic :: Utilities" ] -# BRANDING_OPTS = """ -# # Do NOT manually edit this file! -# # This file has been written from pkg/branding/config.py data by leap setup.py -# # script. - -# BRANDING = { -# 'short_name': "%(short_name)s", -# 'provider_domain': "%(provider_domain)s", -# 'provider_ca_file': "%(provider_ca_file)s"} -# """ - - -# def write_to_branding_file(filename, branding_dict): -# f = open(filename, "w") -# f.write(BRANDING_OPTS % branding_dict) -# f.close() - - -# def copy_pemfile_to_certdir(frompath, topath): -# with open(frompath, "r") as cert_f: -# cert_s = cert_f.read() -# with open(topath, "w") as f: -# f.write(cert_s) - - -# def do_branding(targetfile=branding.brandingfile): -# if branding.BRANDED_BUILD: -# opts = branding.BRANDED_OPTS -# print("DOING BRANDING FOR LEAP") -# certpath = opts['provider_ca_path'] -# shortname = opts['short_name'] -# tocertfile = shortname + '-cacert.pem' -# topath = os.path.join( -# branding.cert_path, -# tocertfile) -# copy_pemfile_to_certdir( -# certpath, -# topath) -# opts['provider_ca_file'] = tocertfile -# write_to_branding_file( -# targetfile, -# opts) -# else: -# print('not running branding because BRANDED_BUILD set to False') - - -# class DoBranding(Command): -# description = "copy the branding info the the top level package" -# user_options = [] - -# def initialize_options(self): -# pass - -# def finalize_options(self): -# pass - -# def run(self): -# do_branding() - - -class cmd_build(_build): - def run(self): - _build.run(self) - - versions = versioneer.get_versions(verbose=True) - # now locate _version.py in the new build/ directory and replace it - # with an updated value - target_versionfile = os.path.join( - self.build_lib, - versioneer.versionfile_build) - print("UPDATING %s" % target_versionfile) - os.unlink(target_versionfile) - f = open(target_versionfile, "w") - f.write(versioneer.SHORT_VERSION_PY % versions) - f.close() - - # branding - # target_brandingfile = os.path.join( - # self.build_lib, - # branding.brandingfile_build) - # do_branding(targetfile=target_brandingfile) - - -class cmd_sdist(_sdist): - def run(self): - # versioneer: - versions = versioneer.get_versions(verbose=True) - self._versioneer_generated_versions = versions - # unless we update this, the command will keep using the old version - self.distribution.metadata.version = versions["version"] - - # branding: - #do_branding() - return _sdist.run(self) - - def make_release_tree(self, base_dir, files): - _sdist.make_release_tree(self, base_dir, files) - # now locate _version.py in the new base_dir directory (remembering - # that it may be a hardlink) and replace it with an updated value - target_versionfile = os.path.join( - base_dir, versioneer.versionfile_source) - print("UPDATING %s" % target_versionfile) - os.unlink(target_versionfile) - f = open(target_versionfile, "w") - f.write( - versioneer.SHORT_VERSION_PY % self._versioneer_generated_versions) - f.close() cmdclass = versioneer.get_cmdclass() -#cmdclass["branding"] = DoBranding - -# Uncomment this to have the branding command run automatically -# on the build and sdist commands. -#cmdclass["build"] = cmd_build -#cmdclass["sdist"] = cmd_sdist - -#launcher_name = branding.get_shortname() -#if launcher_name: -# leap_launcher = 'leap-%s-client=leap.app:main' % launcher_name -#else: -# leap_launcher = 'leap-client=leap.app:main' leap_launcher = 'leap-client=leap.app:main' setup( - name="leap-client", # branding.get_name(), + name="leap-client", package_dir={"": "src"}, version=versioneer.get_version(), cmdclass=cmdclass, -- cgit v1.2.3 From d0dfad6ac2af360de6421ce74a6831b5b81ad019 Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 14 Mar 2013 07:08:31 +0900 Subject: namespace leap + leap.common split leap is a namespace package from here on. common folder will be deleted and moved to leap_pycommon repository. --- setup.py | 1 + 1 file changed, 1 insertion(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index bdb3cc3e..3412b51e 100755 --- a/setup.py +++ b/setup.py @@ -76,6 +76,7 @@ setup( packages=find_packages( 'src', exclude=['ez_setup', 'setup', 'examples', 'tests']), + namespace_packages=["leap"], include_package_data=True, zip_safe=False, -- cgit v1.2.3 From 116f559198e0a9c26e9291209e81190bb27ef5cf Mon Sep 17 00:00:00 2001 From: drebs Date: Tue, 28 May 2013 20:51:58 -0300 Subject: Move KeyManager submodule from leap.common to here. --- setup.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 3412b51e..5f8940ca 100755 --- a/setup.py +++ b/setup.py @@ -21,6 +21,11 @@ versioneer.versionfile_build = 'leap/_version.py' versioneer.tag_prefix = '' # tags are like 1.2.0 versioneer.parentdir_prefix = 'leap_client-' +# The following import avoids the premature unloading of the `util` submodule +# when running tests, which would cause an error when nose finishes tests and +# calls the exit function of the multiprocessing module. +from multiprocessing import util + setup_root = os.path.dirname(__file__) sys.path.insert(0, os.path.join(setup_root, "src")) @@ -64,10 +69,9 @@ setup( ), classifiers=trove_classifiers, install_requires=utils.parse_requirements(), - # Uncomment when tests are done - # test_suite='nose.collector', - # test_requires=utils.parse_requirements( - # reqfiles=['pkg/test-requirements.pip']), + test_suite='nose.collector', + tests_require=utils.parse_requirements( + reqfiles=['pkg/requirements-testing.pip']), keywords='LEAP, client, qt, encryption, proxy, openvpn', author='The LEAP Encryption Access Project', author_email='info@leap.se', -- cgit v1.2.3 From c4ba840c7c0df81fa928bab2edd1f2a2e3379952 Mon Sep 17 00:00:00 2001 From: kali Date: Mon, 27 May 2013 21:42:10 +0900 Subject: adapt test suite to latest client code * fix run_tests * add tox.ini * cleanup/update requirements * fix coverage reports * add pypi badge --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 3412b51e..2027d3b9 100755 --- a/setup.py +++ b/setup.py @@ -65,10 +65,10 @@ setup( classifiers=trove_classifiers, install_requires=utils.parse_requirements(), # Uncomment when tests are done - # test_suite='nose.collector', - # test_requires=utils.parse_requirements( - # reqfiles=['pkg/test-requirements.pip']), - keywords='LEAP, client, qt, encryption, proxy, openvpn', + test_suite='nose.collector', + test_requires=utils.parse_requirements( + reqfiles=['pkg/requirements-testing.pip']), + keywords='LEAP, client, qt, encryption, proxy, openvpn, imap, smtp', author='The LEAP Encryption Access Project', author_email='info@leap.se', url='https://leap.se', -- cgit v1.2.3 From a5e8645b8b34ef736825ae06cdf4d360eaa32db6 Mon Sep 17 00:00:00 2001 From: kali Date: Fri, 31 May 2013 06:22:38 +0900 Subject: copy processed reqs to util/ --- setup.py | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 62 insertions(+), 6 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index ed793392..b788d9aa 100755 --- a/setup.py +++ b/setup.py @@ -21,10 +21,13 @@ versioneer.versionfile_build = 'leap/_version.py' versioneer.tag_prefix = '' # tags are like 1.2.0 versioneer.parentdir_prefix = 'leap_client-' +from setuptools import Command + # The following import avoids the premature unloading of the `util` submodule # when running tests, which would cause an error when nose finishes tests and # calls the exit function of the multiprocessing module. from multiprocessing import util +assert(util) setup_root = os.path.dirname(__file__) sys.path.insert(0, os.path.join(setup_root, "src")) @@ -46,9 +49,62 @@ trove_classifiers = [ ] +parsed_reqs = utils.parse_requirements() + cmdclass = versioneer.get_cmdclass() leap_launcher = 'leap-client=leap.app:main' +from distutils.command.build import build as _build +from distutils.command.sdist import sdist as _sdist + + +def copy_reqs(path, withsrc=False): + # add a copy of the processed requirements to the package + _reqpath = ('leap', 'util', 'reqs.txt') + if withsrc: + reqsfile = os.path.join(path, 'src', *_reqpath) + else: + reqsfile = os.path.join(path, *_reqpath) + + print("UPDATING %s" % reqsfile) + + if os.path.isfile(reqsfile): + os.unlink(reqsfile) + f = open(reqsfile, "w") + f.write('\n'.join(parsed_reqs)) + f.close() + + +class cmd_build(_build): + def run(self): + # versioneer: + versions = versioneer.get_versions(verbose=True) + self._versioneer_generated_versions = versions + # unless we update this, the command will keep using the old version + self.distribution.metadata.version = versions["version"] + + _build.run(self) + copy_reqs(self.build_lib) + + +class cmd_sdist(_sdist): + def run(self): + # versioneer: + versions = versioneer.get_versions(verbose=True) + self._versioneer_generated_versions = versions + # unless we update this, the command will keep using the old version + self.distribution.metadata.version = versions["version"] + return _sdist.run(self) + + def make_release_tree(self, base_dir, files): + _sdist.make_release_tree(self, base_dir, files) + copy_reqs(base_dir, withsrc=True) + + +#cmdclass["build"] = cmd_build +#cmdclass["sdist"] = cmd_sdist + + setup( name="leap-client", package_dir={"": "src"}, @@ -68,9 +124,9 @@ setup( "and has an enhanced level of security." ), classifiers=trove_classifiers, - install_requires=utils.parse_requirements(), + install_requires=parsed_reqs, test_suite='nose.collector', - test_requires=utils.parse_requirements( + tests_require=utils.parse_requirements( reqfiles=['pkg/requirements-testing.pip']), keywords='LEAP, client, qt, encryption, proxy, openvpn, imap, smtp', author='The LEAP Encryption Access Project', @@ -81,17 +137,17 @@ setup( 'src', exclude=['ez_setup', 'setup', 'examples', 'tests']), namespace_packages=["leap"], + package_data={'': ['util/*.txt']}, include_package_data=True, - zip_safe=False, - - # not being used since setuptools does not like it. + # not being used? -- setuptools does not like it. # looks like debhelper is honoring it... data_files=[ # ("share/man/man1", # ["docs/man/leap-client.1"]), ("share/polkit-1/actions", - ["pkg/linux/polkit/net.openvpn.gui.leap.policy"]) + ["pkg/linux/polkit/net.openvpn.gui.leap.policy"]), ], + zip_safe=False, platforms="all", entry_points={ 'console_scripts': [leap_launcher] -- cgit v1.2.3 From a32149bb11fe5bba0b9c1b97774c7a62001ef901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Fri, 31 May 2013 13:43:15 -0300 Subject: Recursively include docs files and uncomment build/sdist --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index b788d9aa..f7b1ec30 100755 --- a/setup.py +++ b/setup.py @@ -101,8 +101,8 @@ class cmd_sdist(_sdist): copy_reqs(base_dir, withsrc=True) -#cmdclass["build"] = cmd_build -#cmdclass["sdist"] = cmd_sdist +cmdclass["build"] = cmd_build +cmdclass["sdist"] = cmd_sdist setup( -- cgit v1.2.3 From 5cb114cda57aacea4273ba0e41ad52f6d4ccf25f Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Mon, 3 Jun 2013 15:49:07 -0300 Subject: Add custom develop command for setup.py --- setup.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index f7b1ec30..7554c7dd 100755 --- a/setup.py +++ b/setup.py @@ -56,6 +56,7 @@ leap_launcher = 'leap-client=leap.app:main' from distutils.command.build import build as _build from distutils.command.sdist import sdist as _sdist +from setuptools.command.develop import develop as _develop def copy_reqs(path, withsrc=False): @@ -87,6 +88,18 @@ class cmd_build(_build): copy_reqs(self.build_lib) +class cmd_develop(_develop): + def run(self): + # versioneer: + versions = versioneer.get_versions(verbose=True) + self._versioneer_generated_versions = versions + # unless we update this, the command will keep using the old version + self.distribution.metadata.version = versions["version"] + + _develop.run(self) + copy_reqs(self.egg_path) + + class cmd_sdist(_sdist): def run(self): # versioneer: @@ -103,6 +116,7 @@ class cmd_sdist(_sdist): cmdclass["build"] = cmd_build cmdclass["sdist"] = cmd_sdist +cmdclass["develop"] = cmd_develop setup( -- cgit v1.2.3 From 9557edfad010411b284a6a9cbb30390cff2002d8 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Sat, 22 Jun 2013 02:29:16 +0900 Subject: fix versioneer build and sdist commands It turns out that I was using remnants of old functions in which I had to hook the branding mechanism, but that's not needed anymore, so it's much simple. With this change, we get the correct _version generated after a build or sdist command. For the bundles, we should use that _version. Ideally we should use the whole build tree for bundles instead of the source tree directly. --- setup.py | 47 ++++++++++++++++++----------------------------- 1 file changed, 18 insertions(+), 29 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 7554c7dd..4b39189c 100755 --- a/setup.py +++ b/setup.py @@ -54,8 +54,6 @@ parsed_reqs = utils.parse_requirements() cmdclass = versioneer.get_cmdclass() leap_launcher = 'leap-client=leap.app:main' -from distutils.command.build import build as _build -from distutils.command.sdist import sdist as _sdist from setuptools.command.develop import develop as _develop @@ -66,27 +64,11 @@ def copy_reqs(path, withsrc=False): reqsfile = os.path.join(path, 'src', *_reqpath) else: reqsfile = os.path.join(path, *_reqpath) - print("UPDATING %s" % reqsfile) - if os.path.isfile(reqsfile): os.unlink(reqsfile) - f = open(reqsfile, "w") - f.write('\n'.join(parsed_reqs)) - f.close() - - -class cmd_build(_build): - def run(self): - # versioneer: - versions = versioneer.get_versions(verbose=True) - self._versioneer_generated_versions = versions - # unless we update this, the command will keep using the old version - self.distribution.metadata.version = versions["version"] - - _build.run(self) - copy_reqs(self.build_lib) - + with open(reqsfile, "w") as f: + f.write('\n'.join(parsed_reqs)) class cmd_develop(_develop): def run(self): @@ -99,24 +81,31 @@ class cmd_develop(_develop): _develop.run(self) copy_reqs(self.egg_path) +cmdclass["develop"] = cmd_develop -class cmd_sdist(_sdist): +# next two classes need to augment the versioneer modified ones + +versioneer_build = cmdclass['build'] +versioneer_sdist = cmdclass['sdist'] + + +class cmd_build(versioneer_build): def run(self): - # versioneer: - versions = versioneer.get_versions(verbose=True) - self._versioneer_generated_versions = versions - # unless we update this, the command will keep using the old version - self.distribution.metadata.version = versions["version"] - return _sdist.run(self) + versioneer_build.run(self) + copy_reqs(self.build_lib) + + +class cmd_sdist(versioneer_sdist): + def run(self): + return versioneer_sdist.run(self) def make_release_tree(self, base_dir, files): - _sdist.make_release_tree(self, base_dir, files) + versioneer_sdist.make_release_tree(self, base_dir, files) copy_reqs(base_dir, withsrc=True) cmdclass["build"] = cmd_build cmdclass["sdist"] = cmd_sdist -cmdclass["develop"] = cmd_develop setup( -- cgit v1.2.3