def setupPackage(): # setup package setup( name='obspy', version=get_git_version(), description=DOCSTRING[1], long_description="\n".join(DOCSTRING[3:]), url="http://www.obspy.org", author='The ObsPy Development Team', author_email='*****@*****.**', license='GNU Lesser General Public License, Version 3 (LGPLv3)', platforms='OS Independent', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Intended Audience :: Science/Research', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU Library or ' + 'Lesser General Public License (LGPL)', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Scientific/Engineering', 'Topic :: Scientific/Engineering :: Physics'], keywords=KEYWORDS, packages=find_packages(), namespace_packages=[], zip_safe=False, install_requires=INSTALL_REQUIRES, download_url=("https://github.com/obspy/obspy/zipball/master" "#egg=obspy=dev"), # this is needed for "easy_install obspy==dev" include_package_data=True, entry_points=ENTRY_POINTS, ext_package='obspy.lib', configuration=configuration)
def get_current_version(release): try: import version current_version = version.get_git_version(release=release) with open('ptracker/__init__.py', 'w') as init: init.write("VERSION = '{0}'\n".format(current_version)) print("Wrote ptracker/__init__.py with version {0}".format(current_version)) return current_version except ImportError: return ptracker.VERSION
def get_current_version(release): try: import version current_version = version.get_git_version(release=release) with open('ptracker/__init__.py', 'w') as init: init.write("VERSION = '{0}'\n".format(current_version)) print("Wrote ptracker/__init__.py with version {0}".format( current_version)) return current_version except ImportError: return ptracker.VERSION
def main(): # Version of this software version = '0.9a2' parser = argparse.ArgumentParser() parser.add_argument('-H', '--host', help='Address where this server listens.', default='localhost') parser.add_argument('-P', '--port', help='Port where this server listens.', default='7000') parser.add_argument('-c', '--config', help='Config file.', default='ownDC.cfg') parser.add_argument('--version', action='version', version='ownDC %s' % get_git_version()) args = parser.parse_args() # Check arguments (IP, port) host = args.host configP = configparser.RawConfigParser() configP.read(args.config) verbo = configP.get('Service', 'verbosity') verboNum = getattr(logging, verbo.upper(), 30) logging.basicConfig(logLevel=verboNum) loclog = logging.getLogger('main') loclog.setLevel(verboNum) try: port = int(args.port) except: loclog.error('Error while interpreting port %s' % args.port) sys.exit(-1) # Create the object that will resolve and execute all the queries loclog.info('Creating a DataSelectQuery object. Wait...') ServerHandler.wi = DataSelectQuery('ownDC.log', './data/ownDC-routes.xml', configFile=args.config) loclog.info('Ready to answer queries!') Handler = ServerHandler httpd = socsrv.TCPServer((host, port), Handler) loclog.info("Virtual Datacentre at: http://%s:%s/fdsnws/dataselect/1/" % (host, port)) httpd.serve_forever()
def setupPackage(): # setup package setup( name="obspy", version=get_git_version(), description=DOCSTRING[1], long_description="\n".join(DOCSTRING[3:]), url="http://www.obspy.org", author="The ObsPy Development Team", author_email="*****@*****.**", license="GNU Lesser General Public License, Version 3 (LGPLv3)", platforms="OS Independent", classifiers=[ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Science/Research", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Library or " + "Lesser General Public License (LGPL)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Physics", ], keywords=KEYWORDS, packages=find_packages(), namespace_packages=[], zip_safe=False, install_requires=INSTALL_REQUIRES, extras_require=EXTRAS_REQUIRE, features=add_features(), # this is needed for "easy_install obspy==dev" download_url=("https://github.com/obspy/obspy/zipball/master" "#egg=obspy=dev"), include_package_data=True, entry_points=ENTRY_POINTS, ext_package="obspy.lib", cmdclass={"build_man": Help2ManBuild, "install_man": Help2ManInstall}, configuration=configuration, )
def connect(self, data): """ Connects to the server if both hostname and username is set. """ if self.host is None: raise Warning(' '.join(['You must set the server\'s', 'hostname and your name before', 'connecting'])) self.nick = data[2].split()[0] name = ' '.join(data[2].split()[1:]) try: self.tcp.connect((self.host, int(self.port))) except socket.error as e: return self.denied([e.strerror]) self.tcp.send( bytes('CONNECT: "{0}" "{1}" {2}\r\n'.format(self.nick, name, get_git_version())) ) self.tcp.handle.start()
import version __version__ = version.get_git_version()
from setuptools.command.build_py import build_py class build_py_with_sub_commands(build_py): def run(self): for cmd_name in self.get_sub_commands(): self.run_command(cmd_name) build_py.run(self) build_py_with_sub_commands.sub_commands.append(('build_uml', None)) setup( name='gaphor', version=get_git_version(), url='http://gaphor.sourceforge.net', author='Arjan J. Molenaar', author_email='*****@*****.**', license='GNU General Public License', description='Gaphor is a UML modeling tool', long_description=""" Gaphor is a UML modeling tool written in Python. It uses the GTK+ environment for user interaction. """, classifiers = [ 'Development Status :: 5 - Production/Stable', 'Environment :: X11 Applications :: GTK', 'Intended Audience :: Developers', 'Intended Audience :: End Users/Desktop',
#!/usr/bin/env python import os import sys import fnmatch import subprocess ## prepare to run PyTest as a command from distutils.core import Command from setuptools import setup, find_packages from version import get_git_version VERSION, SOURCE_LABEL = get_git_version() PROJECT = 'streamcorpus-filter' AUTHOR = 'Diffeo, Inc.' AUTHOR_EMAIL = '*****@*****.**' DESC = 'example illustration of interfaces to use in making a faster filter in C++' LICENSE = 'MIT/X11 license http://opensource.org/licenses/MIT' URL = 'http://github.com/trec-kba/streamcorpus-filter' def read_file(file_name): file_path = os.path.join( os.path.dirname(__file__), file_name ) return open(file_path).read() def recursive_glob(treeroot, pattern): results = [] for base, dirs, files in os.walk(treeroot):
import os import sys import fnmatch import subprocess ## prepare to run PyTest as a command from distutils.core import Command ## explain this... #from distribute_setup import use_setuptools #use_setuptools() from setuptools import setup, find_packages from version import get_git_version VERSION = get_git_version() PROJECT = 'kba.scorer' AUTHOR = 'Diffeo, Inc.' AUTHOR_EMAIL = '*****@*****.**' DESC = 'Tools for scoring output of systems built to compete in TREC KBA.' def read_file(file_name): file_path = os.path.join( os.path.dirname(__file__), file_name ) return open(file_path).read() def recursive_glob(treeroot, pattern): results = [] for base, dirs, files in os.walk(treeroot):
from setuptools import setup import os import version def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='mqtt-malaria', url="https://github.com/etactica/mqtt-malaria", maintainer="eTactica ehf. - Software Department", maintainer_email="*****@*****.**", version=str(version.get_git_version()), description="Attacking MQTT systems with Mosquittos", long_description=read('README.md'), license="License :: OSI Approved :: BSD License", scripts=["malaria"], packages=['beem', 'beem.cmds'], include_package_data=True, zip_safe=False, install_requires=['paho-mqtt>=1.1', 'fusepy'], tests_require=['fabric', 'fabtools', 'nose', 'coverage'], classifiers=[ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "Programming Language :: Python", "Topic :: Software Development :: Quality Assurance", "Topic :: Software Development :: Testing", "Topic :: Software Development :: Testing :: Traffic Generation",
# possible, according to krischer import sys import os import inspect SETUP_DIRECTORY = os.path.dirname(os.path.abspath(inspect.getfile( inspect.currentframe()))) # Import the version string. UTIL_PATH = os.path.join(SETUP_DIRECTORY, "nsl", "util") sys.path.insert(0, UTIL_PATH) from version import get_git_version # @UnresolvedImport sys.path.pop(0) s_args = { 'name': 'nsl.common', 'version': get_git_version(), 'description': 'NSL Common libraries and utilities for Python', 'author': 'Nevada Seismological Lab', 'url': 'https//github.com/NVSeismoLab', 'packages': [ 'nsl', 'nsl.common', 'nsl.common.logging', 'nsl.antelope', 'nsl.antelope.base', 'nsl.antelope.packets', 'nsl.antelope.rows', 'nsl.antelope.util', 'nsl.converters', 'nsl.obspy', 'nsl.obspy.patches',
def gen_iso(iso_image, authorized_key, cdpack=None): with tempfile.TemporaryDirectory() as d: inclusion = [] with open(os.path.join(d, "dns_bootstrap_lines"), "w") as outfile: outfile.writelines(setup.dns_bootstrap_lines()) inclusion += ["dns_bootstrap_lines"] util.copy(authorized_key, os.path.join(d, "authorized.pub")) util.writefile(os.path.join(d, "keyservertls.pem"), authority.get_pubkey_by_filename("./server.pem")) resource.copy_to("postinstall.sh", os.path.join(d, "postinstall.sh")) os.chmod(os.path.join(d, "postinstall.sh"), 0o755) inclusion += ["authorized.pub", "keyservertls.pem", "postinstall.sh"] for variant in configuration.KEYCLIENT_VARIANTS: util.writefile(os.path.join(d, "keyclient-%s.yaml" % variant), configuration.get_keyclient_yaml(variant).encode()) inclusion.append("keyclient-%s.yaml" % variant) resource.copy_to("sshd_config", os.path.join(d, "sshd_config.new")) preseeded = resource.get_resource("preseed.cfg.in") generated_password = util.pwgen(20) creation_time = datetime.datetime.now().isoformat() git_hash = get_git_version().encode() add_password_to_log(generated_password, creation_time) print("generated password added to log") preseeded = preseeded.replace(b"{{HASH}}", util.mkpasswd(generated_password)) preseeded = preseeded.replace(b"{{BUILDDATE}}", creation_time.encode()) preseeded = preseeded.replace(b"{{GITHASH}}", git_hash) util.writefile(os.path.join(d, "preseed.cfg"), preseeded) inclusion += ["sshd_config.new", "preseed.cfg"] for package_name, (short_filename, package_bytes) in packages.verified_download_full( PACKAGES).items(): assert "/" not in short_filename, "invalid package name: %s for %s" % ( short_filename, package_name) assert short_filename.startswith( package_name + "_"), "invalid package name: %s for %s" % (short_filename, package_name) assert short_filename.endswith( "_amd64.deb"), "invalid package name: %s for %s" % ( short_filename, package_name) util.writefile(os.path.join(d, short_filename), package_bytes) inclusion.append(short_filename) if cdpack is not None: subprocess.check_call(["tar", "-C", d, "-xzf", cdpack, "cd"]) else: subprocess.check_output( ["tar", "-C", d, "-xz", "cd"], input=resource.get_resource("debian-cdpack.tgz")) subprocess.check_output([ "cpio", "--create", "--append", "--format=newc", "--file=cd/initrd" ], input="".join( "%s\n" % filename for filename in inclusion).encode(), cwd=d) subprocess.check_call(["gzip", os.path.join(d, "cd/initrd")]) files_for_md5sum = subprocess.check_output( ["find", ".", "-follow", "-type", "f", "-print0"], cwd=os.path.join(d, "cd")).decode().split("\0") assert files_for_md5sum.pop() == "" md5s = subprocess.check_output(["md5sum", "--"] + files_for_md5sum, cwd=os.path.join(d, "cd")) util.writefile(os.path.join(d, "cd", "md5sum.txt"), md5s) subprocess.check_call([ "genisoimage", "-quiet", "-o", iso_image, "-r", "-J", "-no-emul-boot", "-boot-load-size", "4", "-boot-info-table", "-b", "isolinux.bin", "-c", "isolinux.cat", os.path.join(d, "cd") ])
c_files, include_dirs=include_dirs, libraries=libraries, library_dirs=library_dirs, define_macros=macros, extra_compile_args=compile_args, extra_link_args=link_args, ) ] install_requires = [] tests_require = [] setup( name="pylzma", version=get_git_version().decode("utf-8"), description=descr, author="Joachim Bauch", author_email="*****@*****.**", url="http://www.joachim-bauch.de/projects/pylzma/", download_url="http://pypi.python.org/pypi/pylzma/", license="LGPL", keywords="lzma compression", long_description=long_descr, classifiers=[ "Development Status :: 5 - Production/Stable", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
import setuptools from version import get_git_version with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="tk-framework-consuladoutils", version=get_git_version().decode("ASCII"), scripts=["tk-framework-consuladoutils"], author="Gabriel Valderramos", author_email="*****@*****.**", description="A Shotgun Framework package", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/consulado/tk-framework-consuladoutils", packages=setuptools.find_packages(), package_data={"tk-framework-consuladoutils": ["icon_256.png", "*.yml"]}, include_package_data=True, classifiers=[ "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Operating System :: OS Independent", ], )
if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() with open(os.path.join(os.path.dirname(__file__), 'README.md')) as f: readme = f.read() package_data = { } requires = [ ] try: version = git_versioning.get_git_version() except git_versioning.GitVersionNotFound: print >> sys.stderr, 'Could not determine git version. Please add a tag with "git tag -a" or "git tag -s"' sys.exit(1) classifiers = [ "Development Status :: 1 - Planning", "Development Status :: 2 - Pre-Alpha", "Development Status :: 3 - Alpha", "Development Status :: 4 - Beta", "Development Status :: 5 - Production/Stable", "Development Status :: 6 - Mature", "Development Status :: 7 - Inactive", "Environment :: Console", "Environment :: Console :: Curses", "Environment :: Console :: Framebuffer",
if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() with open(os.path.join(os.path.dirname(__file__), 'README.md')) as f: readme = f.read() package_data = { } requires = [ ] try: version = git_versioning.get_git_version() except git_versioning.GitVersionNotFound: print >> sys.stderr, 'Could not determine git version. Please add a tag with "git tag -a" or "git tag -s"' sys.exit(1) classifiers = [ "Development Status :: 3 - Alpha", # "Development Status :: 4 - Beta", # "Development Status :: 5 - Production/Stable", # "Development Status :: 6 - Mature", # "Development Status :: 7 - Inactive", "Environment :: Plugins", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Operating System :: OS Independent", "Programming Language :: Python",
req_txt_path = os.path.join(os.path.dirname(__file__), "requirements.txt") if os.path.exists(req_txt_path): with open(req_txt_path) as f: req_list = f.readlines() req_list = [x.strip() for x in req_list] else: req_list = [] def readme(): """读取README.md文件""" with open('README.md', encoding="utf-8") as f: return f.read() print("use latest tag as version: {}".format(get_git_version())) print("use requirements.txt as install_requires: {}".format(req_list)) setup( name="serial_module", version=get_git_version(), url="https://github.com/KD-Group/serial_module", description="串行接口模块简单包装,支持模拟接口和真实接口", long_description=readme(), long_description_content_type='text/markdown', author="Jefung", author_email="*****@*****.**", license="MIT", classifiers=[ "Programming Language :: Python :: 3", ],
from setuptools import setup, find_packages from version import get_git_version with open('README') as f: long_description = ''.join(f.readlines()) setup( name='dzisholiday', version=get_git_version().decode('utf-8').split('-')[0], description='Finds Czech holiday for given year', long_description=long_description, author='Jan Novak', author_email='*****@*****.**', keywords='holiday,dates', license='Public Domain', url='https://github.com/zichd/dzisholiday', packages=find_packages(), classifiers=[ 'Intended Audience :: Developers', 'License :: Public Domain', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Topic :: Software Development :: Libraries', ], zip_safe=False, )
def main(name, datatype, cmdargs=None): v = version.get_git_version() options, args = parse_args(datatype, cmdargs) if not args: # Help has already been printed return 2 log.info("------------- %s %s -----------------", name, v) start_time = datetime.datetime.now().replace(microsecond=0) # start the clock ticking check_python_version() # Load, using the first argument as the folder try: cfg = config.Configuration(datatype, options.phylogeny_program, options.save_phylofiles, options.cmdline_extras, options.cluster_weights, options.greediest_schemes, options.greediest_percent) # Set up the progress callback progress.TextProgress(cfg) cfg.load_base_path(args[0]) if options.check_only: log.info("Exiting without processing (because of the -c/--check-only option ...") else: # Now try processing everything.... method = analysis_method.choose_method(cfg.search) reporter.TextReporter(cfg) anal = method(cfg, options.force_restart, options.processes) results = anal.analyse() if options.dump_results: results.dump(cfg) elif options.compare_results: results.compare(cfg) # Successful exit end_time = datetime.datetime.now().replace(microsecond=0) processing_time = end_time - start_time log.info("Total processing time: %s (h:m:s)" % processing_time) log.info("Processing complete.") return 0 except util.PartitionFinderError: log.error("Failed to run. See previous errors.") # Reraise if we were called by call_main, or if the options is set if options.show_python_exceptions or cmdargs is not None: raise except KeyboardInterrupt: log.error("User interrupted the Program") finally: # Make sure that we reset the configuration cfg.reset() return 1
def main(): ownDCver = '0.9a2' parser = argparse.ArgumentParser(description=\ 'Client to download waveforms from different datacentres via FDSN-WS') parser.add_argument('-c', '--config', help='Config file.', default='ownDC.cfg') parser.add_argument('-p', '--post-file', default=None, help='File with the streams and timewindows requested.') parser.add_argument('-o', '--output', default='request', help='Filename (without extension) used to save the data and the logs.') parser.add_argument('-r', '--retries', type=int, help='Number of times that data should be requested if there is no answer or if there is an error', default=0) group = parser.add_mutually_exclusive_group() group.add_argument("-s", "--seconds", type=int, help='Number of seconds between retries for the lines without data') group.add_argument("-m", "--minutes", type=int, help='Number of minutes between retries for the lines without data') parser.add_argument('-v', '--verbosity', action="count", default=0, help='Increase the verbosity level') parser.add_argument('--version', action='version', version='ownDC-cli %s ' % get_git_version()) args = parser.parse_args() # Read the streams and timewindows to download if args.post_file is not None: fh = open(args.post_file, 'r') else: fh = sys.stdin lines = fh.read() summary = SummarizedRun() ds = DataSelectQuery(summary, routesFile='data/ownDC-routes.xml', configFile=args.config) outwav = open('%s.mseed' % args.output, 'wb') # Attempt number to download the waveforms attempt = 0 while ((attempt <= args.retries) and (len(lines.splitlines()) > 0)): print '\n\nAttempt Nr. %d of %d' % (attempt+1, args.retries+1) iterObj = ds.makeQueryPOST(lines) for chunk in iterObj: outwav.write(chunk) print '.', print lines = '' for k, v in summary.iteritems(): # Print summary totBytes = sum([l[2] for l in v]) status = ','.join([l[1] for l in v]) print '[%s] %s %d bytes' % ('\033[92mOK\033[0m' if totBytes else \ '\033[91m' + status + '\033[0m', k, totBytes) # Check the total amount of bytes received if totBytes <= 0: lines = '%s%s\n' % (lines, k) attempt += 1 if args.minutes: print 'Waiting %d minutes to retry again...' % args.minutes sleep(args.minutes * 60) else: seconds = 2 if args.seconds is None else args.seconds print 'Waiting %d seconds to retry again...' % seconds sleep(seconds) outwav.close() # FIXME I should decide here a nice format for the output # and also if it should be to stdout, a file or a port with open('%s.log' % args.output, 'w') as outlog: for k, v in summary.iteritems(): outlog.write('%s %s %d bytes\n' % (k, [le[1] for le in v], sum([le[2] for le in v])))
#!/usr/bin/env python import os from setuptools import setup, find_packages import subprocess import shlex import version reqs = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'requirements.txt') REQUIRES = filter(None, open(reqs).read().splitlines()) ver = version.get_git_version() # Listing inflection module as requirements is not working in windows for some # reason. So install it using pip install. setup( name="robotframework-pageobjects", version=ver, description="Lets you use the page object pattern with Robot Framework and plain python", author="National Center for Biotechnology Information", url="https://github.com/ncbi/robotframework-pageobjects", keywords="robotframework testing testautomation selenium selenium2 webdriver web", install_requires=REQUIRES, packages=find_packages(exclude=("tests",)), zip_safe=False )
from version import get_git_version __productname__ = 'alot' __version__ = get_git_version() __copyright__ = "Copyright (C) 2011 Patrick Totzke" __author__ = "Patrick Totzke" __author_email__ = "*****@*****.**" __description__ = "Terminal MUA using notmuch mail" __url__ = "https://github.com/pazz/alot" __license__ = "Licensed under the GNU GPL v3+."
def gen_iso(iso_image, authorized_key, mode=None): with tempfile.TemporaryDirectory() as d: inclusion = [] with open(os.path.join(d, "dns_bootstrap_lines"), "w") as outfile: outfile.write(setup.dns_bootstrap_lines()) inclusion += ["dns_bootstrap_lines"] util.copy(authorized_key, os.path.join(d, "authorized.pub")) util.writefile(os.path.join(d, "keyservertls.pem"), authority.get_pubkey_by_filename("./server.pem")) resource.copy_to("postinstall.sh", os.path.join(d, "postinstall.sh")) os.chmod(os.path.join(d, "postinstall.sh"), 0o755) inclusion += ["authorized.pub", "keyservertls.pem", "postinstall.sh"] for variant in configuration.KEYCLIENT_VARIANTS: util.writefile(os.path.join(d, "keyclient-%s.yaml" % variant), configuration.get_keyclient_yaml(variant).encode()) inclusion.append("keyclient-%s.yaml" % variant) resource.copy_to("sshd_config", os.path.join(d, "sshd_config.new")) preseeded = resource.get_resource("preseed.cfg.in") generated_password = util.pwgen(20) creation_time = datetime.datetime.now().isoformat() git_hash = get_git_version().encode() add_password_to_log(generated_password, creation_time) print("generated password added to log") preseeded = preseeded.replace(b"{{HASH}}", util.mkpasswd(generated_password)) preseeded = preseeded.replace(b"{{BUILDDATE}}", creation_time.encode()) preseeded = preseeded.replace(b"{{GITHASH}}", git_hash) mirror = configuration.get_config().mirror if mirror.count("/") < 1 or mirror.count(".") < 1: command.fail( "invalid mirror specification '%s'; must be of the form HOST.NAME/PATH" ) mirror_host, mirror_dir = mirror.split("/", 1) preseeded = preseeded.replace(b"{{MIRROR-HOST}}", mirror_host.encode()) preseeded = preseeded.replace(b"{{MIRROR-DIR}}", ("/" + mirror_dir).encode()) realm = configuration.get_config().realm preseeded = preseeded.replace(b"{{KERBEROS-REALM}}", realm.encode()) cidr_nodes, upstream_dns_servers = configuration.get_config( ).cidr_nodes, configuration.get_config().dns_upstreams node_cidr_prefix = ".".join(str(cidr_nodes.ip).split(".")[:-1]) + "." preseeded = preseeded.replace(b"{{IP-PREFIX}}", node_cidr_prefix.encode()) node_cidr_gateway = cidr_nodes.gateway() preseeded = preseeded.replace(b"{{GATEWAY}}", str(node_cidr_gateway).encode()) node_cidr_netmask = cidr_nodes.netmask() preseeded = preseeded.replace(b"{{NETMASK}}", str(node_cidr_netmask).encode()) preseeded = preseeded.replace( b"{{NAMESERVERS}}", " ".join(str(server_ip) for server_ip in upstream_dns_servers).encode()) util.writefile(os.path.join(d, "preseed.cfg"), preseeded) inclusion += ["sshd_config.new", "preseed.cfg"] for package_name, (short_filename, package_bytes) in packages.verified_download_full( PACKAGES).items(): assert "/" not in short_filename, "invalid package name: %s for %s" % ( short_filename, package_name) assert short_filename.startswith( package_name + "_"), "invalid package name: %s for %s" % (short_filename, package_name) assert short_filename.endswith( "_amd64.deb"), "invalid package name: %s for %s" % ( short_filename, package_name) util.writefile(os.path.join(d, short_filename), package_bytes) inclusion.append(short_filename) cddir = os.path.join(d, "cd") os.mkdir(cddir) subprocess.check_call( ["bsdtar", "-C", cddir, "-xzf", "/usr/share/homeworld/debian.iso"]) subprocess.check_call(["chmod", "+w", "--recursive", cddir]) if mode is not None: if mode not in MODES: command.fail("no such ISO mode: %s" % mode) MODES[mode](d, cddir, inclusion) with gzip.open(os.path.join(cddir, "initrd.gz"), "ab") as f: subprocess.run(["cpio", "--create", "--format=newc"], check=True, stdout=f, input="".join("%s\n" % filename for filename in inclusion).encode(), cwd=d) files_for_md5sum = subprocess.check_output( ["find", ".", "-follow", "-type", "f", "-print0"], cwd=cddir).decode().split("\0") assert files_for_md5sum.pop() == "" md5s = subprocess.check_output(["md5sum", "--"] + files_for_md5sum, cwd=cddir) util.writefile(os.path.join(cddir, "md5sum.txt"), md5s) temp_iso = os.path.join(d, "temp.iso") subprocess.check_call([ "xorriso", "-as", "mkisofs", "-quiet", "-o", temp_iso, "-r", "-J", "-c", "boot.cat", "-b", "isolinux.bin", "-no-emul-boot", "-boot-load-size", "4", "-boot-info-table", cddir ]) subprocess.check_call(["isohybrid", "-h", "64", "-s", "32", temp_iso]) util.copy(temp_iso, iso_image)
#!/usr/bin/env python from __future__ import absolute_import from setuptools import setup from distutils.command.install_data import install_data from version import get_git_version import os VERSION, SOURCE_HASH = get_git_version() PROJECT = 'diffeo-sphinx' URL = 'http://diffeo.com' AUTHOR = 'Diffeo, Inc.' AUTHOR_EMAIL = '*****@*****.**' DESC = 'Master Diffeo documentation set.' LICENSE = 'Diffeo Proprietary Commercial Computer Software' def subtree(t, d): for dirpath, dirnames, filenames in os.walk(d): yield (os.path.join(t, os.path.relpath(dirpath, d)), [os.path.join(dirpath, filename) for filename in filenames]) class install_data_sphinx(install_data): def run(self): self.run_command('build_sphinx') self.data_files.remove('MARKER.txt') sphinx = self.get_finalized_command('build_sphinx') self.data_files += list( subtree('docs/html', os.path.join(sphinx.build_dir, 'html'))) install_data.run(self)
#!/usr/bin/env python import os from setuptools import setup, find_packages from version import get_git_version VERSION, SOURCE_HASH = get_git_version() PROJECT = 'streamcorpus_elasticsearch' URL = 'https://github.com/trec-kba' AUTHOR = 'Diffeo, Inc.' AUTHOR_EMAIL = '*****@*****.**' DESC = 'Tool for loading streamcorpus.StreamItems into ElasticSearch' LICENSE ='MIT/X11 license http://opensource.org/licenses/MIT' def read_file(file_name): file_path = os.path.join( os.path.dirname(__file__), file_name ) return open(file_path).read() setup( name=PROJECT, version=VERSION, #source_label=SOURCE_HASH, license=LICENSE, description=DESC, author=AUTHOR, author_email=AUTHOR_EMAIL, url=URL,
('/usr/local/share/helpim/templates/forms', 'helpim/questionnaire/templates/forms'), ('/usr/local/share/helpim/fixtures', 'helpim/fixtures'), ('/usr/local/share/helpim/doc/debian/example', 'helpim/doc/debian/example'), ] static_files = [] for target, include_dir in include_dirs: for root, dirs, files in walk(include_dir): static_files.append(( join(target, root[len(include_dir)+1:]), [join(root, f) for f in files] )) setup( name=name, version=get_git_version().lstrip('v'), url='http://www.python.org/pypi/'+name, license='AGPL', description='A chat-system for online psycho-social counselling', long_description=long_description, author='e-hulp.nl HelpIM Team', author_email='*****@*****.**', packages=find_packages('.'), package_dir={'': '.'}, install_requires=install_requires, zip_safe = False, namespace_packages=[], data_files=static_files, include_package_data = True, classifiers = [ "Programming Language :: Python",
#!/usr/bin/env python import os from setuptools import setup, find_packages from version import get_git_version VERSION, SOURCE_LABEL = get_git_version() PROJECT = 'dossier.label' AUTHOR = 'Diffeo, Inc.' AUTHOR_EMAIL = '*****@*****.**' URL = 'http://github.com/dossier/dossier.label' DESC = 'Label (ground truth) storage for DossierStack' def read_file(file_name): file_path = os.path.join(os.path.dirname(__file__), file_name) return open(file_path).read() setup( name=PROJECT, version=VERSION, description=DESC, license='MIT', long_description=read_file('README.md'), author=AUTHOR, author_email=AUTHOR_EMAIL, url=URL, packages=find_packages(), namespace_packages=['dossier'],
import os import sys import fnmatch import subprocess ## prepare to run PyTest as a command from distutils.core import Command ## explain this... #from distribute_setup import use_setuptools #use_setuptools() from setuptools import setup, find_packages from version import get_git_version VERSION = get_git_version() PROJECT = 'kba.scorer' AUTHOR = 'Diffeo, Inc.' AUTHOR_EMAIL = '*****@*****.**' DESC = 'Tools for scoring output of systems built to compete in TREC KBA.' def read_file(file_name): file_path = os.path.join(os.path.dirname(__file__), file_name) return open(file_path).read() def recursive_glob(treeroot, pattern): results = [] for base, dirs, files in os.walk(treeroot): goodfiles = fnmatch.filter(files, pattern)
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ PyRK is a point reactor kinetics and thermal hydraulics solver module for coupled, 0-D transient analysis. """ from version import get_git_version try: __version__ = get_git_version() except (ValueError, IOError): __version__ = 'unknown'
#!/usr/bin/env python import os from setuptools import setup, find_packages import subprocess import shlex import version reqs = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'requirements.txt') REQUIRES = filter(None, open(reqs).read().splitlines()) ver = version.get_git_version() # Listing inflection module as requirements is not working in windows for some # reason. So install it using pip install. setup( name="robotframework-pageobjects", version=ver, description="Lets you use the page object pattern with Robot Framework and plain python", author="National Center for Biotechnology Information", install_requires=REQUIRES, packages=find_packages(exclude=("tests",)), zip_safe=False )
errno = subprocess.call(cmd) if errno: raise SystemExit(errno) # reload sys.path for any new libraries installed import site site.main() print sys.path # use pytest to run tests pytest = __import__('pytest') exitcode = pytest.main( ['--cov', 'pyaccumulo', '--cov-report', 'term', '-vvs', 'tests']) sys.exit(exitcode) VERSION, HASH = version.get_git_version() setup( name='pyaccumulo', version=VERSION, author='Jason Trost', author_email='jason.trost AT gmail.com', maintainer='Jason Trost', maintainer_email='jason.trost AT gmail.com', description='Python client library for Apache Accumulo', long_description=long_description, url='https://github.com/accumulo/pyaccumulo', keywords='accumulo client db distributed thrift', packages=['pyaccumulo', 'pyaccumulo.iterators', 'pyaccumulo.proxy'], install_requires=['thrift'], tests_require=[
def __init__(self): directory = get_directory() self.logger = logging.getLogger('ZODB.FileStorage') fh = logging.FileHandler(directory + 'db.log') self.logger.addHandler(fh) self.storage = FileStorage.FileStorage(directory + 'db.fs') self.db = DB(self.storage) self.connection = self.db.open() dbroot = self.connection.root() if not dbroot.has_key('job_key'): from BTrees.OOBTree import OOBTree dbroot['job_key'] = OOBTree() dbroot['job_key']['val'] = 0 self.job_key = dbroot['job_key'] # Ensure that a 'job_db' key is present # in the root if not dbroot.has_key('job_db'): from BTrees.OOBTree import OOBTree dbroot['job_db'] = OOBTree() self.job_db = dbroot['job_db'] if not dbroot.has_key('user_db'): from BTrees.OOBTree import OOBTree dbroot['user_db'] = OOBTree() self.user_db = dbroot['user_db'] self.user_db['user'] = User('unknown', 'unknown', 'unknown') self.user_db = dbroot['user_db'] if not dbroot.has_key('site_db'): from BTrees.OOBTree import OOBTree dbroot['site_db'] = OOBTree() self.site_db = dbroot['site_db'] self.site_db = dbroot['site_db'] if scheduler is not None: self.site_db[scheduler.name()] = Site(scheduler.name(), scheduler.scheduler_type()) if not dbroot.has_key('queue_db'): from BTrees.OOBTree import OOBTree dbroot['queue_db'] = OOBTree() self.queue_db = dbroot['queue_db'] self.queue_db = dbroot['queue_db'] from version import get_git_version if not dbroot.has_key('version'): dbroot['version'] = get_git_version() else: current_version = dbroot['version'] new_version = get_git_version() # Add any migrations required here if current_version != new_version: pass dbroot['version'] = new_version if not dbroot.has_key('remote_site_db'): from BTrees.OOBTree import OOBTree dbroot['remote_site_db'] = OOBTree() self.remote_site_db = dbroot['remote_site_db'] self.remote_site_db = dbroot['remote_site_db']
#source_encoding = 'utf-8' # The master toctree document. master_doc = 'index' # General information about the project. project = u'atrain_match' copyright = u'2010, Adam Dybbroe, Karl-Göran Karlsson, Erik Johansson, Jakob Malm' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # from version import get_git_version # The full version, including alpha/beta/rc tags. release = get_git_version() # The short X.Y version. version = release.split('-')[0] # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of documents that shouldn't be included in the build. #unused_docs = []
if self.distribution.tests_require: cmd.extend(self.distribution.tests_require) errno = subprocess.call(cmd) if errno: raise SystemExit(errno) # reload sys.path for any new libraries installed import site site.main() print sys.path # use pytest to run tests pytest = __import__('pytest') exitcode = pytest.main(['--cov', 'pyaccumulo', '--cov-report', 'term', '-vvs', 'tests']) sys.exit(exitcode) VERSION, HASH = version.get_git_version() setup( name = 'pyaccumulo', version = VERSION, author = 'Jason Trost', author_email = 'jason.trost AT gmail.com', maintainer = 'Jason Trost', maintainer_email = 'jason.trost AT gmail.com', description = 'Python client library for Apache Accumulo', long_description = long_description, url = 'https://github.com/accumulo/pyaccumulo', keywords = 'accumulo client db distributed thrift', packages = ['pyaccumulo', 'pyaccumulo.iterators', 'pyaccumulo.proxy'
def setupPackage(): # setup package setup( name='obspy', version=get_git_version(), description=DOCSTRING[1], long_description="\n".join(DOCSTRING[3:]), url="https://www.obspy.org", project_urls={ "Bug Tracker": "https://github.com/obspy/obspy/issues", "Documentation": "https://docs.obspy.org/", "Source Code": "https://github.com/obspy/obspy", }, author='The ObsPy Development Team', author_email='*****@*****.**', license='GNU Lesser General Public License, Version 3 (LGPLv3)', platforms='OS Independent', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Intended Audience :: Science/Research', 'Intended Audience :: Developers', 'License :: OSI Approved :: ' 'GNU Lesser General Public License v3 (LGPLv3)', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Topic :: Scientific/Engineering', 'Topic :: Scientific/Engineering :: Physics' ], keywords=KEYWORDS, packages=find_packages(), include_package_data=True, exclude_package_data={ 'obspy.io.css': ['contrib/*'], # NOTE: If the libmseed test data wasn't used in our tests, we # could just ignore src/* everywhere. 'obspy.io.gse2': ['src/*'], 'obspy.io.mseed': [ # Only keep src/libmseed/test/* except for the C files. 'src/*.c', 'src/*.def', 'src/libmseed/.clang-format', 'src/libmseed/ChangeLog', 'src/libmseed/Makefile*', 'src/libmseed/README.byteorder', 'src/libmseed/doc/*', 'src/libmseed/example/*', 'src/libmseed/test/Makefile', 'src/libmseed/*.h', 'src/libmseed/*.in', 'src/libmseed/*.map', 'src/libmseed/*.md', ], 'obspy.io.segy': ['src/*'], 'obspy.signal': ['src/*'], 'obspy.taup': ['src/*'], }, namespace_packages=[], zip_safe=False, python_requires=f'>={MIN_PYTHON_VERSION[0]}.{MIN_PYTHON_VERSION[1]}', install_requires=INSTALL_REQUIRES, tests_require=EXTRAS_REQUIRES['tests'], extras_require=EXTRAS_REQUIRES, features=add_features(), entry_points=ENTRY_POINTS, ext_modules=get_extensions(), ext_package='obspy.lib', cmdclass={ 'build_man': Help2ManBuild, 'install_man': Help2ManInstall }, )
try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages import version import sys Name = 'quantum-openvswitch-plugin' ProjecUrl = "" Version = version.get_git_version() License = 'Apache License 2.0' Author = 'Open vSwitch Team' AuthorEmail = '*****@*****.**' Maintainer = '' Summary = 'OpenVSwitch plugin for Quantum' ShortDescription = Summary Description = Summary requires = [ 'quantum-common', 'quantum-server', ] EagerResources = [ 'quantum', ]
def test_client_connect_to_server(self): self.assertEquals(self.data, 'CONNECT: "joe" "Cake Man" {0}\r\n'.format(get_git_version()))
EXTRAS_REQUIRE = { 'tests': [ 'click', 'netCDF4', 'pytest-xdist', 'flake8>=3', 'pytest>=3.0', 'responses' ] } # Add mock for Python 2.x. Starting with Python 3 it is part of the standard # library. if sys.version_info[0] == 2: INSTALL_REQUIRES.append("mock") setup_config = dict( name="instaseis", version=get_git_version(), description=DOCSTRING[0], long_description="\n".join(DOCSTRING[2:]), author=u"Lion Krischer, Martin van Driel, and Simon Stähler", author_email="*****@*****.**", url="http://instaseis.net", packages=find_packages(), package_data={ "instaseis": [os.path.join("lib", "instaseis.so")] + [os.path.join("gui", "qt_window.ui")] + get_package_data() }, license="GNU Lesser General Public License, version 3 (LGPLv3) for " "non-commercial/academic use", platforms="OS Independent", install_requires=INSTALL_REQUIRES, extras_require=EXTRAS_REQUIRE,
Extension('pylzma', c_files, include_dirs=include_dirs, libraries=libraries, library_dirs=library_dirs, define_macros=macros, extra_compile_args=compile_args, extra_link_args=link_args), ] install_requires = [] tests_require = [] setup( name="pylzma", version=get_git_version().decode('utf-8'), description=descr, author="Joachim Bauch", author_email="*****@*****.**", url="http://www.joachim-bauch.de/projects/pylzma/", download_url="http://pypi.python.org/pypi/pylzma/", license='LGPL', keywords="lzma compression", long_description=long_descr, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Libraries :: Python Modules', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
'adhocracy_kit', ] test_requires = [ 'adhocracy_frontend[test]', 'adhocracy_kit[test]', ] debug_requires = [ 'adhocracy_frontend[debug]', 'adhocracy_kit[debug]', ] setup( name='euth', version=version.get_git_version(), description='Adhocracy meta package for backend/frontend customization.', long_description=README + '\n\n' + CHANGES, classifiers=[ "Programming Language :: Python", "Framework :: Pylons", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", ], author='', author_email='', url='', keywords='web pyramid pylons adhocracy', packages=find_packages(), include_package_data=True, zip_safe=False,
lzma_files += ('src/compat/LzmaCompatDecode.c', ) macros.append(('WITH_COMPAT', 1)) c_files += [os.path.normpath(os.path.join('.', x)) for x in lzma_files] extens = [ Extension('pylzma', c_files, include_dirs=include_dirs, libraries=libraries, library_dirs=library_dirs, define_macros=macros, extra_compile_args=compile_args, extra_link_args=link_args), ] install_requires = [] tests_require = [] setup( name = "pylzma", version = get_git_version().decode('utf-8'), description = descr, author = "Joachim Bauch", author_email = "*****@*****.**", url = "http://www.joachim-bauch.de/projects/pylzma/", download_url = "http://pypi.python.org/pypi/pylzma/", license = 'LGPL', keywords = "lzma compression", long_description = long_descr, classifiers = [ 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Libraries :: Python Modules', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',