def main(args): """ Invoke twisted.python.dist with the appropriate metadata about the Twisted package. """ if os.path.exists('twisted'): sys.path.insert(0, '.') from twisted import copyright from twisted.python.dist import getDataFiles, getExtensions, getScripts, \ getPackages, setup, twisted_subprojects # "" is included because core scripts are directly in bin/ projects = [''] + [x for x in os.listdir('bin') if os.path.isdir(os.path.join("bin", x)) and x in twisted_subprojects] scripts = [] for i in projects: scripts.extend(getScripts(i)) setup_args = dict( # metadata name="Twisted", version=copyright.version, description="An asynchronous networking framework written in Python", author="Twisted Matrix Laboratories", author_email="*****@*****.**", maintainer="Glyph Lefkowitz", maintainer_email="*****@*****.**", url="http://twistedmatrix.com/", license="MIT", long_description="""\ An extensible framework for Python programming, with special focus on event-based network programming and multiprotocol integration. """, packages = getPackages('twisted'), conditionalExtensions = getExtensions(), scripts = scripts, data_files=getDataFiles('twisted'), classifiers=[ "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", ]) if 'setuptools' in sys.modules: from pkg_resources import parse_requirements requirements = ["zope.interface"] try: list(parse_requirements(requirements)) except: print """You seem to be running a very old version of setuptools. This version of setuptools has a bug parsing dependencies, so automatic dependency resolution is disabled. """ else: setup_args['install_requires'] = requirements setup_args['include_package_data'] = True setup_args['zip_safe'] = False setup(**setup_args)
def main(args): """ Invoke twisted.python.dist with the appropriate metadata about the Twisted package. """ if os.path.exists('twisted'): sys.path.insert(0, '.') from twisted import copyright from twisted.python.dist import getDataFiles, getExtensions, getScripts, \ getPackages, setup, twisted_subprojects # "" is included because core scripts are directly in bin/ projects = [''] + [x for x in os.listdir('bin') if os.path.isdir(os.path.join("bin", x)) and x in twisted_subprojects] scripts = [] for i in projects: scripts.extend(getScripts(i)) setup_args = dict( # metadata name="Twisted", version=copyright.version, description="An asynchronous networking framework written in Python", author="Twisted Matrix Laboratories", author_email="*****@*****.**", maintainer="Glyph Lefkowitz", maintainer_email="*****@*****.**", url="http://twistedmatrix.com/", license="MIT", long_description="""\ An extensible framework for Python programming, with special focus on event-based network programming and multiprotocol integration. """, packages = getPackages('twisted'), conditionalExtensions = getExtensions(), scripts = scripts, data_files=getDataFiles('twisted'), classifiers=[ "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", ]) if 'setuptools' in sys.modules: from pkg_resources import parse_requirements requirements = ["zope.interface"] try: list(parse_requirements(requirements)) except: print("""You seem to be running a very old version of setuptools. This version of setuptools has a bug parsing dependencies, so automatic dependency resolution is disabled. """) else: setup_args['install_requires'] = requirements setup_args['include_package_data'] = True setup_args['zip_safe'] = False setup(**setup_args)
def main(args): """ Invoke twisted.python.dist with the appropriate metadata about the Twisted package. """ # On Python 3, use setup3.py until Python 3 port is done: if sys.version_info[0] > 2: import setup3 setup3.main() return if os.path.exists("twisted"): sys.path.insert(0, ".") setup_args = {} if "setuptools" in sys.modules: from pkg_resources import parse_requirements requirements = ["zope.interface >= 3.6.0"] try: list(parse_requirements(requirements)) except: print( """You seem to be running a very old version of setuptools. This version of setuptools has a bug parsing dependencies, so automatic dependency resolution is disabled. """ ) else: setup_args["install_requires"] = requirements setup_args["include_package_data"] = True setup_args["zip_safe"] = False from twisted.python.dist import ( STATIC_PACKAGE_METADATA, getDataFiles, getExtensions, getAllScripts, getPackages, setup, _EXTRAS_REQUIRE, ) scripts = getAllScripts() setup_args.update( dict( packages=getPackages("twisted"), conditionalExtensions=getExtensions(), scripts=scripts, extras_require=_EXTRAS_REQUIRE, data_files=getDataFiles("twisted"), **STATIC_PACKAGE_METADATA ) ) setup(**setup_args)
def main(args): """ Invoke twisted.python.dist with the appropriate metadata about the Twisted package. """ # On Python 3, use setup3.py until Python 3 port is done: if sys.version_info[0] > 2: import setup3 setup3.main() return if os.path.exists('twisted'): sys.path.insert(0, '.') setup_args = {} if 'setuptools' in sys.modules: from pkg_resources import parse_requirements requirements = ["zope.interface >= 3.6.0"] try: list(parse_requirements(requirements)) except: print("""You seem to be running a very old version of setuptools. This version of setuptools has a bug parsing dependencies, so automatic dependency resolution is disabled. """) else: setup_args['install_requires'] = requirements setup_args['include_package_data'] = True setup_args['zip_safe'] = False from twisted.python.dist import (STATIC_PACKAGE_METADATA, getDataFiles, getExtensions, getAllScripts, getPackages, setup, _EXTRAS_REQUIRE) scripts = getAllScripts() setup_args.update( dict(packages=getPackages('twisted'), conditionalExtensions=getExtensions(), scripts=scripts, extras_require=_EXTRAS_REQUIRE, data_files=getDataFiles('twisted'), **STATIC_PACKAGE_METADATA)) setup(**setup_args)
def main(args): """ Invoke twisted.python.dist with the appropriate metadata about the Twisted package. """ if os.path.exists('twisted'): sys.path.insert(0, '.') setup_args = {} if 'setuptools' in sys.modules: from pkg_resources import parse_requirements requirements = ["zope.interface >= 3.6.0"] try: list(parse_requirements(requirements)) except: print("""You seem to be running a very old version of setuptools. This version of setuptools has a bug parsing dependencies, so automatic dependency resolution is disabled. """) else: setup_args['install_requires'] = requirements setuptools._TWISTED_NO_CHECK_REQUIREMENTS = True setup_args['include_package_data'] = True setup_args['zip_safe'] = False from twisted.python.dist import ( STATIC_PACKAGE_METADATA, getDataFiles, getExtensions, getAllScripts, getPackages, setup) scripts = getAllScripts() setup_args.update(dict( packages=getPackages('twisted'), conditionalExtensions=getExtensions(), scripts=scripts, data_files=getDataFiles('twisted'), **STATIC_PACKAGE_METADATA)) setup(**setup_args)
def main(args): """ Invoke twisted.python.dist with the appropriate metadata about the Twisted package. """ # On Python 3, use setup3.py until Python 3 port is done: if sys.version_info[0] > 2: import setup3 setup3.main() return if os.path.exists('twisted'): sys.path.insert(0, '.') setup_args = {} requirements = ["zope.interface >= 3.6.0"] setup_args['install_requires'] = requirements setup_args['include_package_data'] = True setup_args['zip_safe'] = False from twisted.python.dist import (STATIC_PACKAGE_METADATA, getDataFiles, getExtensions, getScripts, getPackages, setup, _EXTRAS_REQUIRE) scripts = getScripts() setup_args.update( dict(packages=getPackages('twisted'), conditionalExtensions=getExtensions(), scripts=scripts, extras_require=_EXTRAS_REQUIRE, data_files=getDataFiles('twisted'), **STATIC_PACKAGE_METADATA)) setup(**setup_args)
def main(args): """ Invoke twisted.python.dist with the appropriate metadata about the Twisted package. """ # On Python 3, use setup3.py until Python 3 port is done: if sys.version_info[0] > 2: import setup3 setup3.main() return if os.path.exists('twisted'): sys.path.insert(0, '.') setup_args = {} requirements = ["zope.interface >= 3.6.0"] setup_args['install_requires'] = requirements setup_args['include_package_data'] = True setup_args['zip_safe'] = False from twisted.python.dist import ( STATIC_PACKAGE_METADATA, getDataFiles, getExtensions, getScripts, getPackages, setup, _EXTRAS_REQUIRE) scripts = getScripts() setup_args.update(dict( packages=getPackages('twisted'), conditionalExtensions=getExtensions(), scripts=scripts, extras_require=_EXTRAS_REQUIRE, data_files=getDataFiles('twisted'), **STATIC_PACKAGE_METADATA)) setup(**setup_args)
# Ripped out of install_scripts, might as well be consistent. if os.name == 'posix' and infile in package_scripts: if self.dry_run: log.info("changing mode of %s", outfile) else: mode = ((os.stat(outfile)[stat.ST_MODE]) | 0555) & 07777 log.info("changing mode of %s to %o", outfile, mode) os.chmod(outfile, mode) setup_args = dict( name = "nagcat", author = "Michael Marineau", author_email = "*****@*****.**", url = "http://code.google.com/p/nagcat/", license = "Apache 2.0", packages = getPackages("python/nagcat") + getPackages("python/snapy") + getPackages("python/twirrdy"), package_data = {'nagcat': ["plugins/dropin.cache", "unittests/trend_data*", "unittests/ssl/*", "unittests/queries/oracle_package.sql", "unittests/queries/simple_subprocess"], 'snapy': ["netsnmp/unittests/snmpd.conf"]}, package_dir = {'': "python"}, scripts = glob("bin/*"), data_files = [('share/doc/nagcat', ["README", "LICENSE"]), ('share/doc/nagcat/docs', glob("docs/*.*"))], cmdclass = {'build_py': build_py}, )
author="Twisted Matrix Laboratories", author_email="*****@*****.**", maintainer="Glyph Lefkowitz", url="http://twistedmatrix.com/", license="MIT", long_description="""\ This is the core of Twisted, including: * Networking support (twisted.internet) * Trial, the unit testing framework (twisted.trial) * AMP, the Asynchronous Messaging Protocol (twisted.protocols.amp) * Twisted Spread, a remote object system (twisted.spread) * Utility code (twisted.python) * Basic abstractions that multiple subprojects use (twisted.cred, twisted.application, twisted.plugin) * Database connectivity support (twisted.enterprise) * A few basic protocols and protocol abstractions (twisted.protocols) """, # build stuff packages=getPackages('twisted', ignore=twisted_subprojects + ['plugins']), plugins=plugins, data_files=getDataFiles('twisted', ignore=twisted_subprojects), conditionalExtensions=extensions, scripts = getScripts(""), ) if __name__ == '__main__': setup(**setup_args)
version=copyright.version, description="The core parts of the Twisted networking framework", author="Twisted Matrix Laboratories", author_email="*****@*****.**", maintainer="Glyph Lefkowitz", url="http://twistedmatrix.com/", license="MIT", long_description="""\ This is the core of Twisted, including: * Networking support (twisted.internet) * Trial, the unit testing framework (twisted.trial) * AMP, the Asynchronous Messaging Protocol (twisted.protocols.amp) * Twisted Spread, a remote object system (twisted.spread) * Utility code (twisted.python) * Basic abstractions that multiple subprojects use (twisted.cred, twisted.application, twisted.plugin) * Database connectivity support (twisted.enterprise) * A few basic protocols and protocol abstractions (twisted.protocols) """, # build stuff packages=getPackages("twisted", ignore=twisted_subprojects + ["plugins"]), plugins=plugins, data_files=getDataFiles("twisted", ignore=twisted_subprojects), conditionalExtensions=extensions, scripts=getScripts(""), ) if __name__ == "__main__": setup(**setup_args)
pkgs = dict.fromkeys( [_top_level_package(k) for k in cmd.distribution.iter_distribution_names() if _top_level_package(k) != "twisted" ] ) cmd.write_file("top-level names", filename, '\n'.join(pkgs) + '\n') egg_info.write_toplevel_names = _hacked_write_toplevel_names from twisted.python.dist import getPackages setup( name='restkin', version='0.1', description="A REST interface for Twitter's Zipkin", packages=getPackages('restkin') + ['twisted.plugins'], scripts=['bin/restkin-api', 'bin/restkin-scribe'], install_requires=['Twisted', 'tryfer'] ) # Make Twisted regenerate the dropin.cache, if possible. This is necessary # because in a site-wide install, dropin.cache cannot be rewritten by # normal users. try: from twisted.plugin import IPlugin, getPlugins except ImportError: pass else: list(getPlugins(IPlugin))
return name.split('.', 1)[0] def _hacked_write_toplevel_names(cmd, basename, filename): pkgs = dict.fromkeys([ _top_level_package(k) for k in cmd.distribution.iter_distribution_names() if _top_level_package(k) != "twisted" ]) cmd.write_file("top-level names", filename, '\n'.join(pkgs) + '\n') egg_info.write_toplevel_names = _hacked_write_toplevel_names from twisted.python.dist import getPackages setup(name='restkin', version='0.1', description="A REST interface for Twitter's Zipkin", packages=getPackages('restkin') + ['twisted.plugins'], scripts=['bin/restkin-api', 'bin/restkin-scribe'], install_requires=['Twisted', 'tryfer']) # Make Twisted regenerate the dropin.cache, if possible. This is necessary # because in a site-wide install, dropin.cache cannot be rewritten by # normal users. try: from twisted.plugin import IPlugin, getPlugins except ImportError: pass else: list(getPlugins(IPlugin))