commit
stringlengths
40
40
subject
stringlengths
1
3.25k
old_file
stringlengths
4
311
new_file
stringlengths
4
311
old_contents
stringlengths
0
26.3k
lang
stringclasses
3 values
proba
float64
0
1
diff
stringlengths
0
7.82k
aba0a2f8457a3012260e94512d092abfba62c44a
Bump version to 0.4.3.
setup.py
setup.py
"""Reaktor models that use barrel for encapsulation.""" from setuptools import setup, find_packages setup( name='barrel-reaktor', version='0.4.2', description='Python interface to reaktor API', long_description=__doc__, license='BSD', author='txtr web team', author_email='web-dev@txtr.com', url='https://github.com/txtr/barrel-reaktor/', packages=find_packages(), platforms='any', install_requires=['barrel', 'python-money', ], dependency_links=[ 'https://github.com/txtr/barrel/zipball/master#egg=barrel', 'https://github.com/txtr/python-money/zipball/master#egg=python-money', ] )
Python
0
@@ -150,9 +150,9 @@ 0.4. -2 +3 ',%0A
2117675429b0d446145ca9bd88756a3f20d874f9
Add check-nvp-config utility
setup.py
setup.py
# Copyright 2011 OpenStack, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import setuptools import sys from quantum.openstack.common import setup requires = setup.parse_requirements() depend_links = setup.parse_dependency_links() if sys.platform == 'win32': requires.append('pywin32') requires.append('wmi') requires.remove('pyudev') Name = 'quantum' Url = "https://launchpad.net/quantum" Version = setup.get_version(Name, '2013.1') License = 'Apache License 2.0' Author = 'Netstack' AuthorEmail = 'netstack@lists.launchpad.net' Maintainer = '' Summary = 'Quantum (virtual network service)' ShortDescription = Summary Description = Summary EagerResources = [ 'quantum', ] config_path = 'etc/quantum/' init_path = 'etc/init.d' rootwrap_path = 'etc/quantum/rootwrap.d' ovs_plugin_config_path = 'etc/quantum/plugins/openvswitch' bigswitch_plugin_config_path = 'etc/quantum/plugins/bigswitch' brocade_plugin_config_path = 'etc/quantum/plugins/brocade' cisco_plugin_config_path = 'etc/quantum/plugins/cisco' linuxbridge_plugin_config_path = 'etc/quantum/plugins/linuxbridge' nvp_plugin_config_path = 'etc/quantum/plugins/nicira' ryu_plugin_config_path = 'etc/quantum/plugins/ryu' meta_plugin_config_path = 'etc/quantum/plugins/metaplugin' nec_plugin_config_path = 'etc/quantum/plugins/nec' hyperv_plugin_config_path = 'etc/quantum/plugins/hyperv' plumgrid_plugin_config_path = 'etc/quantum/plugins/plumgrid' if sys.platform == 'win32': # Windows doesn't have an "/etc" directory equivalent DataFiles = [] ConsoleScripts = [ 'quantum-hyperv-agent = ' 'quantum.plugins.hyperv.agent.hyperv_quantum_agent:main', 'quantum-server = quantum.server:main', 'quantum-db-manage = quantum.db.migration.cli:main', ] ProjectScripts = [] else: DataFiles = [ (config_path, ['etc/quantum.conf', 'etc/rootwrap.conf', 'etc/api-paste.ini', 'etc/policy.json', 'etc/dhcp_agent.ini', 'etc/l3_agent.ini', 'etc/metadata_agent.ini']), (rootwrap_path, ['etc/quantum/rootwrap.d/dhcp.filters', 'etc/quantum/rootwrap.d/iptables-firewall.filters', 'etc/quantum/rootwrap.d/l3.filters', 'etc/quantum/rootwrap.d/linuxbridge-plugin.filters', 'etc/quantum/rootwrap.d/nec-plugin.filters', 'etc/quantum/rootwrap.d/openvswitch-plugin.filters', 'etc/quantum/rootwrap.d/ryu-plugin.filters']), (init_path, ['etc/init.d/quantum-server']), (ovs_plugin_config_path, ['etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini']), (cisco_plugin_config_path, ['etc/quantum/plugins/cisco/credentials.ini', 'etc/quantum/plugins/cisco/l2network_plugin.ini', 'etc/quantum/plugins/cisco/nexus.ini', 'etc/quantum/plugins/cisco/cisco_plugins.ini', 'etc/quantum/plugins/cisco/db_conn.ini']), (bigswitch_plugin_config_path, ['etc/quantum/plugins/bigswitch/restproxy.ini']), (brocade_plugin_config_path, ['etc/quantum/plugins/brocade/brocade.ini']), (linuxbridge_plugin_config_path, ['etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini']), (nvp_plugin_config_path, ['etc/quantum/plugins/nicira/nvp.ini']), (ryu_plugin_config_path, ['etc/quantum/plugins/ryu/ryu.ini']), (meta_plugin_config_path, ['etc/quantum/plugins/metaplugin/metaplugin.ini']), (nec_plugin_config_path, ['etc/quantum/plugins/nec/nec.ini']), (hyperv_plugin_config_path, ['etc/quantum/plugins/hyperv/hyperv_quantum_plugin.ini']), (plumgrid_plugin_config_path, ['etc/quantum/plugins/plumgrid/plumgrid.ini']), ] ConsoleScripts = [ 'quantum-dhcp-agent = quantum.agent.dhcp_agent:main', 'quantum-dhcp-agent-dnsmasq-lease-update =' 'quantum.agent.linux.dhcp:Dnsmasq.lease_update', 'quantum-netns-cleanup = quantum.agent.netns_cleanup_util:main', 'quantum-l3-agent = quantum.agent.l3_agent:main', 'quantum-linuxbridge-agent =' 'quantum.plugins.linuxbridge.agent.linuxbridge_quantum_agent:main', 'quantum-metadata-agent =' 'quantum.agent.metadata.agent:main', 'quantum-ns-metadata-proxy =' 'quantum.agent.metadata.namespace_proxy:main', 'quantum-openvswitch-agent =' 'quantum.plugins.openvswitch.agent.ovs_quantum_agent:main', 'quantum-ryu-agent = ' 'quantum.plugins.ryu.agent.ryu_quantum_agent:main', 'quantum-nec-agent = ' 'quantum.plugins.nec.agent.nec_quantum_agent:main', 'quantum-server = quantum.server:main', 'quantum-debug = quantum.debug.shell:main', 'quantum-ovs-cleanup = quantum.agent.ovs_cleanup_util:main', 'quantum-db-manage = quantum.db.migration.cli:main', ] ProjectScripts = [ 'bin/quantum-rootwrap', ] setuptools.setup( name=Name, version=Version, url=Url, author=Author, author_email=AuthorEmail, description=ShortDescription, long_description=Description, license=License, classifiers=[ 'Environment :: OpenStack', 'Intended Audience :: System Administrators', 'Intended Audience :: Information Technology', 'License :: OSI Approved :: Apache Software License', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', ], scripts=ProjectScripts, install_requires=requires, dependency_links=depend_links, include_package_data=True, setup_requires=['setuptools_git>=0.4'], packages=setuptools.find_packages('.'), cmdclass=setup.get_cmdclass(), data_files=DataFiles, eager_resources=EagerResources, entry_points={'console_scripts': ConsoleScripts}, )
Python
0.000001
@@ -5468,32 +5468,147 @@ tion.cli:main',%0A + ('quantum-check-nvp-config = '%0A 'quantum.plugins.nicira.nicira_nvp_plugin.check_nvp_config:main'),%0A %5D%0A%0A Proje
7ff834cc935bbebcea0437b570033e6a6156d483
Version bump
setup.py
setup.py
#!/usr/bin/env python import os import sys from setuptools import setup if sys.argv[-1] == 'publish': os.system('python setup.py register sdist bdist_wheel upload') sys.exit() readme_text = open("README.rst", "r").read() setup( name="django-ormcache", version="1.0.1", description="ORM cache for Django", license="MIT", keywords="cache django", author="Corey Farwell", author_email="coreyf@rwell.org", maintainer="Corey Farwell", maintainer_email="coreyf@rwell.org", url="https://github.com/educreations/django-ormcache", long_description=readme_text, packages=["ormcache"], package_dir={"ormcache": "ormcache"}, install_requires=['Django>=1.7'], classifiers=[ 'Framework :: Django', "Intended Audience :: Developers", 'License :: OSI Approved :: MIT License', "Operating System :: OS Independent", "Programming Language :: Python", 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Topic :: Software Development', ] )
Python
0.000001
@@ -283,10 +283,8 @@ =%221. -0. 1%22,%0A
fd49e2b4f18106b5faf23148633fec59211771dc
Add optional support for setuptools.
setup.py
setup.py
#!/usr/bin/env python ''' The setup script for saltapi ''' from distutils.core import setup # pylint: disable-msg=W0122,E0602 exec(compile(open('saltapi/version.py').read(), 'saltapi/version.py', 'exec')) VERSION = __version__ # pylint: enable-msg=W0122,E0602 NAME = 'salt-api' DESC = ("Generic interface for providing external access APIs to Salt") # Specify the test suite for < 2.7 try: import unittest2 except ImportError: pass setup( name=NAME, version=VERSION, description=DESC, author='Thomas S Hatch', author_email='thatch@saltstack.com', url='http://saltstack.org', classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Development Status :: 2 - Pre-Alpha', 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: Information Technology', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: Apache Software License', 'Operating System :: POSIX :: Linux', 'Topic :: System :: Distributed Computing'], packages=['saltapi', 'saltapi.netapi', 'saltapi.netapi.rest_cherrypy', ], package_data={ 'saltapi.netapi.rest_cherrypy': ['tmpl/*']}, data_files=[('share/man/man1', ['doc/man/salt-api.1']), ('share/man/man7', ['doc/man/salt-api.7'])], scripts=['scripts/salt-api'], test_suite='unittest2.collector' if 'unittest2' in locals() else None)
Python
0
@@ -52,16 +52,424 @@ api%0A'''%0A +%0Aimport os%0A# Use setuptools only if the user opts-in by setting the USE_SETUPTOOLS env var%0A# This ensures consistent behavior but allows for advanced usage with%0A# virtualenv, buildout, and others.%0AUSE_SETUPTOOLS = False%0Aif 'USE_SETUPTOOLS' in os.environ:%0A try:%0A from setuptools import setup%0A USE_SETUPTOOLS = True%0A except:%0A USE_SETUPTOOLS = False%0A%0A%0Aif USE_SETUPTOOLS is False:%0A from dis
52e8734ef54772b4c67e40b887ca7d0ad925c6e8
use project-version format for tag.
setup.py
setup.py
from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext import numpy import os import sys if sys.platform == "darwin": if os.path.exists("/opt/local/include/ta-lib"): include_talib_dir = "/opt/local/include" lib_talib_dir = "/opt/local/lib" else: include_talib_dir = "/usr/local/include/" lib_talib_dir = "/usr/local/lib/" elif sys.platform == "linux2" or "freebsd" in sys.platform: include_talib_dir = "/usr/local/include/" lib_talib_dir = "/usr/local/lib/" elif sys.platform == "win32": include_talib_dir = r"c:\msys\1.0\local\include" lib_talib_dir = r"c:\msys\1.0\local\lib" else: raise NotImplementedError(sys.platform) ext = Extension("talib", ["talib.pyx"], include_dirs=[numpy.get_include(), include_talib_dir], library_dirs=[lib_talib_dir], libraries=["ta_lib"] ) setup( name = 'TA-Lib', version = '0.4.1', description = 'Python wrapper for TA-Lib', author = 'John Benediktsson', author_email = 'mrjbq7@gmail.com', url = 'http://github.com/mrjbq7/ta-lib', download_url = 'https://github.com/mrjbq7/ta-lib/archive/0.4.1.zip', classifiers = [ "Development Status :: 4 - Beta", "Topic :: Scientific/Engineering :: Mathematics", "License :: OSI Approved :: BSD License", ], ext_modules=[ext], cmdclass = {'build_ext': build_ext} )
Python
0
@@ -1180,16 +1180,23 @@ archive/ +TA_Lib- 0.4.1.zi
4437ab3021d5d81c1e4f8682529456e17fe32e74
Fix package_data installation. Code remains to be written to discover the path for namebench.cfg and alexa data
setup.py
setup.py
# Copyright 2009 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """distutils configuration.""" __author__ = 'tstromberg@google.com (Thomas Stromberg)' from namebench import VERSION from distutils.core import setup setup(name='namebench', version=VERSION, py_modules=['namebench'], description='DNS service benchmarking tool', author='Thomas Stromberg', author_email='tstromberg@google.com', url='http://namebench.googlecode.com/', packages=('libnamebench',), platforms=('Any',), requires=['graphy', 'dnspython', 'jinja2'], license='Apache 2.0', scripts=['namebench.py'], package_data = {'libnamebench': ['data/alexa-top-10000-global.txt', 'templates/ascii.tmpl', 'templates/html.tmpl', 'namebench.cfg']}, # package_data=[('data', ['data/alexa-top-10000-global.txt']), # ('templates', ['templates/ascii.tmpl', # 'templates/html.tmpl']), # ('config', ['namebench.cfg'])] )
Python
0
@@ -618,17 +618,41 @@ guration -. +: python setup.py install %22%22%22%0A%0A__a @@ -705,16 +705,17 @@ berg)'%0A%0A +%0A from nam @@ -1032,402 +1032,510 @@ -packages=('libnamebench',),%0A platforms=('Any',),%0A requires=%5B'graphy', 'dnspython', 'jinja2'%5D,%0A license='Apache 2.0',%0A scripts=%5B'namebench.py'%5D,%0A package_data = %7B'libnamebench': %5B'data/alexa-top-10000-global.txt',%0A 'templates/ascii.tmpl',%0A 'templates/html.tmpl',%0A +classifiers=%5B%0A 'Development Status :: 4 - Beta',%0A 'Environment :: Console',%0A 'Intended Audience :: End Users/Desktop',%0A 'Intended Audience :: System Administrators',%0A 'License :: OSI Approved :: Apache 2.0',%0A 'Operating System :: MacOS :: MacOS X',%0A 'Operating System :: Microsoft :: Windows',%0A 'Operating System :: POSIX',%0A 'Programming Language :: Python',%0A 'Topic :: Networking',%0A +%5D,%0A -' + packages=%5B'lib name @@ -1543,206 +1543,216 @@ ench -.cfg '%5D -%7D ,%0A -# p -ackage_data=%5B('data +latforms=%5B'Any'%5D,%0A requires=%5B'graphy ', -%5B 'd -ata/alexa-top-10000-global.txt +nspython', 'jinja2 '%5D -) ,%0A -# - ('templates', %5B'templates/ascii.tmpl',%0A# +license='Apache 2.0',%0A scripts=%5B'namebench.py'%5D, +%0A - 'templates/html.tmpl +data_files=%5B%0A ('namebench', %5B'namebench.cfg '%5D),%0A -# @@ -1761,48 +1761,70 @@ - ('config', %5B'namebench.cfg +('namebench/data', %5B'data/alexa-top-10000-global.txt '%5D) -%5D %0A +%5D%0A )%0A
59cca112feb323630d4749c2a4fab9a2d59553b7
add psycopg2 dependency
setup.py
setup.py
from setuptools import setup setup( name='pg_testenv', version="0.1", author="Teemu Haapoja", author_email="teemu.haapoja@gmail.com", description="PostgreSQL test instance creator", license="BSD", scripts = [ 'pg_testenv' ], )
Python
0
@@ -197,16 +197,48 @@ =%22BSD%22,%0A +%09install_requires=%5B'psycopg2'%5D,%0A %09scripts
ec5cf5b306ea20051cf5b02983fdd356f04a9a5e
switch to pyannote.core 0.8
setup.py
setup.py
#!/usr/bin/env python # encoding: utf-8 # The MIT License (MIT) # Copyright (c) 2016 CNRS # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # AUTHORS # Hervé BREDIN - http://herve.niderb.fr import versioneer from setuptools import setup, find_packages setup( # package namespace_packages=['pyannote'], packages=find_packages(), install_requires=[ 'pyannote.core >= 0.7.2', 'pyannote.metrics >= 0.10.2', 'pyannote.generators >= 0.1.1', 'pyannote.database >= 0.4', 'keras >= 1.1.0', 'theano >= 0.8.2', 'scikit-optimize >= 0.2', ], # versioneer version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), # PyPI name='pyannote.audio', description=('Audio processing'), author='Hervé Bredin', author_email='bredin@limsi.fr', url='http://herve.niderb.fr/', classifiers=[ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Scientific/Engineering" ], )
Python
0.000001
@@ -1400,11 +1400,9 @@ = 0. -7.2 +8 ',%0A @@ -1608,16 +1608,17 @@ %0A %5D,%0A +%0A # ve
fa1f6c534c129dfe8429b4731a5381cbf88a2fde
Version bump to 3.1 for the latest changes
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup setup(name="i3pystatus", version="3", description="Like i3status, this generates status line for i3bar / i3wm", url="http://github.com/enkore/i3pystatus", license="MIT", classifiers=[ "Development Status :: 4 - Beta", "Environment :: X11 Applications", "License :: OSI Approved :: MIT License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3", "Topic :: Desktop Environment :: Window Managers", ], packages=["i3pystatus", "i3pystatus.core", "i3pystatus.mail"], entry_points={ "console_scripts": ["i3pystatus = i3pystatus:main"], }, # install_requires=[ # "gobject", # ], # install_requires=[ # "Jinja2", # "lxml", # "markdown", # "PyRSS2Gen", # ] )
Python
0
@@ -87,16 +87,18 @@ rsion=%223 +.1 %22,%0A
c2e97163f1ccfb45b28239e151102ef0bf7070d3
Bump version, add classifiers.
setup.py
setup.py
from setuptools import setup, find_packages setup(name='corker', version='0.2-pre1', description='Another WSGI Framework', license='BSD', author='Joshua D. Boyd', author_email='jdboyd@jdboyd.net', url='https://github.com/jd-boyd/corker', packages=find_packages(), package_data={'': ['README', 'LICENSE.txt']}, install_requires=['webob', 'routes'], tests_require=['nose', 'webtest'], )
Python
0
@@ -81,13 +81,8 @@ '0.2 --pre1 ',%0A @@ -124,16 +124,512 @@ ework',%0A + classifiers=%5B%22Development Status :: 4 - Beta%22,%0A %22Intended Audience :: Developers%22,%0A %22License :: OSI Approved :: BSD License%22,%0A %22Topic :: Internet :: WWW/HTTP%22,%0A %22Topic :: Software Development :: Libraries :: Python Modules%22,%0A 'Programming Language :: Python',%0A %22Programming Language :: Python :: 2%22,%0A %22Programming Language :: Python :: 2.7%22,%0A %5D,%0A li
c81fa8e41fb1411945ac0c045547c59a09a443c4
bump version
setup.py
setup.py
from setuptools import setup, find_packages setup(name='webdiff', version='0.4.2', description='Two-column web-based git difftool', author='Dan Vanderkam', author_email='danvdk@gmail.com', url='https://github.com/danvk/webdiff/', entry_points={ 'console_scripts': [ 'webdiff = webdiff.app:run', 'git-webdiff = webdiff.gitwebdiff:run' ], }, packages=find_packages(exclude=['tests*']), install_requires=['flask'], include_package_data=True, package_data = { 'static': 'webdiff/static/*', 'templates': 'webdiff/templates/*' }, classifiers=[ 'Environment :: Console', 'Environment :: Web Environment', 'Framework :: Flask', 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Topic :: Software Development :: Version Control' ], )
Python
0
@@ -83,9 +83,9 @@ 0.4. -2 +3 ',%0A
2fde794327214250eed2a8ddaca2f2d7c7f12e7a
Build issue with distutils.
setup.py
setup.py
#!/usr/bin/python from distutils.core import setup, Extension from distutils import sysconfig import class_parser import sys import os import pdb # Distutils is retarded - We need to monkey patch it to make it saner. from distutils import cygwinccompiler PYTHON_HOME = "/home/scudette/.wine/drive_c/Python26/" CONFIG = dict(TSK3_HEADER_LOCATION = "/usr/local/include/tsk3/", LIBRARY_DIRS = [], LIBRARIES = ['tsk3']) CONFIG['HEADERS'] = [CONFIG['TSK3_HEADER_LOCATION']] # This is so horrible but less horrible than interfering with # distutils try: if sys.argv[1] == "mingw-xcompile": sys.argv[1] = "build" sys.argv.extend(("-c", "mingw32")) sysconfig._init_nt() CONFIG['HEADERS'].append(PYTHON_HOME + "/include") CONFIG['LIBRARY_DIRS'].append(PYTHON_HOME + "libs") CONFIG['LIBRARIES'].append('python26') os.environ['CC'] = 'i586-mingw32msvc-gcc' except IndexError: pass # Unfortunately distutils hardcodes compilers etc. We need to monkey # patch it here to make it work with other compilers. class Mingw32CCompiler (cygwinccompiler.CygwinCCompiler): compiler_type = 'mingw32' def __init__ (self, verbose=0, dry_run=0, force=0): cygwinccompiler.CygwinCCompiler.__init__ (self, verbose, dry_run, force) # ld_version >= "2.13" support -shared so use it instead of # -mdll -static if self.ld_version >= "2.13": shared_option = "-shared" else: shared_option = "-mdll -static" # A real mingw32 doesn't need to specify a different entry point, # but cygwin 2.91.57 in no-cygwin-mode needs it. if self.gcc_version <= "2.91.57": entry_point = '--entry _DllMain@12' else: entry_point = '' self.set_executables( compiler=os.environ.get("CC","gcc") + ' -mno-cygwin -O -g -Wall', compiler_so=os.environ.get("CC","gcc") + ' -mno-cygwin -mdll -O -g -Wall', compiler_cxx=os.environ.get("CC","gcc") + ' -mno-cygwin -O -g -Wall', linker_exe=os.environ.get("CC","gcc") + ' -mno-cygwin', linker_so='%s -mno-cygwin -g %s %s' % (os.environ.get('CC', self.linker_dll), shared_option, entry_point)) # Maybe we should also append -mthreads, but then the finished # dlls need another dll (mingwm10.dll see Mingw32 docs) # (-mthreads: Support thread-safe exception handling on `Mingw32') self.dll_libraries=[] # Include the appropriate MSVC runtime library if Python was built # with MSVC 7.0 or later. if cygwinccompiler.get_msvcr(): self.dll_libraries += cygwinccompiler.get_msvcr() # __init__ () # Monkeypatch this: cygwinccompiler.Mingw32CCompiler = Mingw32CCompiler def build_python_bindings(target, sources, env = None, initialization='', free='talloc_free', current_error_function='aff4_get_current_error'): """ A command to generate python bindings """ module_name = os.path.splitext(os.path.basename(target))[0] print("Generating automatic python bindings for module %s" % module_name) env = env or dict(V = 0) ## Sets the free function class_parser.FREE = free p = class_parser.HeaderParser(module_name, verbose=env['V']) p.module.init_string = initialization p.parse_filenames(sources) fd = open(target, 'w') p.write(fd) fd.close() BOUND_FILES = (""" %(TSK3_HEADER_LOCATION)s/libtsk.h %(TSK3_HEADER_LOCATION)s/fs/tsk_fs.h %(TSK3_HEADER_LOCATION)s/base/tsk_base.h %(TSK3_HEADER_LOCATION)s/img/tsk_img.h tsk3.h """ % CONFIG).split() if not os.access("pytsk3.c", os.F_OK): build_python_bindings("pytsk3.c", BOUND_FILES, initialization='tsk_init();' ) SOURCES = ['tsk3.c', 'class.c', 'pytsk3.c', 'talloc.c', 'error.c', 'replace.c'] setup(name='pytsk3', version='0.1', description = "Python bindings for the sluethkit", author = "Michael Cohen", author_email = "scudette@gmail.com", url = "http://code.google.com/p/pytsk/", license = "Apache 2.0", long_description = "Python bindings for the sluethkit (http://www.sleuthkit.org/)", py_modules=['pytsk3.__init__'], ext_modules=[Extension('pytsk3.pytsk3', SOURCES, include_dirs=CONFIG['HEADERS'], libraries=CONFIG['LIBRARIES'], library_dirs = CONFIG['LIBRARY_DIRS'], ) ], )
Python
0
@@ -4018,16 +4018,44 @@ ce.c'%5D%0A%0A +%0Aimport pdb; pdb.set_trace() %0A%0Asetup( @@ -4393,46 +4393,8 @@ )%22,%0A - py_modules=%5B'pytsk3.__init__'%5D,%0A @@ -4429,15 +4429,8 @@ tsk3 -.pytsk3 ', S
123d57e0ef22adb5ae5f09b435c69f0589f521d1
Correct setup.py description field error when it contains new lines
setup.py
setup.py
from setuptools import setup long_description = """A collection of heuristic algorithms for solving the 2D knapsack problem, also known as the bin packing problem. In essence packing a set of rectangles into the smallest number of bins.""" setup( name="rectpack", version="0.2.2", description=long_description, url="https://github.com/secnot/rectpack/", author="SecNot", keywords=["knapsack", "rectangle", "packing 2D", "bin", "binpacking"], license="Apache-2.0", classifiers=[ "Development Status :: 3 - Alpha", "Programming Language :: Python", "Programming Language :: Python :: 3", "License :: OSI Approved :: Apache Software License", ], packages=["rectpack"], zip_safe=False, test_suite="nose.collector", tests_require=["nose"], )
Python
0.000001
@@ -288,16 +288,69 @@ 2%22,%0A +description=%222D Rectangle packing library%22,%0A long_ descript
72cb87ea53a294c2395818c25f42379293b37308
Bump version number
setup.py
setup.py
#!/usr/bin/env python import os from distutils.core import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='blah', version='0.1.4', description='Thin wrapper around source control systems', long_description=read("README"), author='Michael Williamson', url='http://github.com/mwilliamson/blah', scripts=["scripts/blah"], packages=['blah'], install_requires=["argparse==1.2.1"], )
Python
0.000002
@@ -194,9 +194,9 @@ 0.1. -4 +5 ',%0A
d19290c1fa91c08fb6a2de5274f484d9f868da22
Updated email address to be moz.com
setup.py
setup.py
#! /usr/bin/env python from distutils.core import setup from distutils.extension import Extension setup(name = 'simhash_db', version = '0.1.0', description = 'Near-Duplicate Detection with Simhash in Databases', url = 'http://github.com/seomoz/simhash-db', author = 'Dan Lecocq', author_email = 'dan@seomoz.org', packages = ['simhash_db'], package_dir = {'simhash_db': 'simhash_db'}, dependencies = [], classifiers = [ 'Programming Language :: Python', 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Topic :: Internet :: WWW/HTTP' ], )
Python
0.999978
@@ -370,18 +370,15 @@ dan@ -seo moz. -org +com ',%0A
e0993dcf8dc38462604e38d7a31b80d3880e696b
Kill get_version hack
setup.py
setup.py
# coding: utf-8 import os import sys from setuptools import setup PACKAGE_PATH = os.path.join( os.path.abspath(os.path.dirname(__file__)), "relief" ) if sys.version_info[:2] < (2, 7): install_requires = ['ordereddict>=1.1', 'Counter>=1.0.0'] else: install_requires = [] def get_version(): path = os.path.join(PACKAGE_PATH, "__init__.py") with open(path) as f: for line in f: if line.startswith("__version__"): return line.split("=")[1].replace('"', '').strip() else: raise ValueError("__version__ not found in %s" % path) setup( name="Relief", version=get_version(), author="Daniel Neuhäuser", author_email="ich@danielneuhaeuser.de", license="BSD", description="datastructure validation", packages=['relief', 'relief.schema'], install_requires=install_requires, classifiers=[ "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: Implementation :: PyPy", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Libraries" ] )
Python
0.000001
@@ -60,16 +60,48 @@ setup%0A%0A +from relief import __version__%0A%0A %0APACKAGE @@ -317,326 +317,8 @@ %5D%0A%0A%0A -def get_version():%0A path = os.path.join(PACKAGE_PATH, %22__init__.py%22)%0A with open(path) as f:%0A for line in f:%0A if line.startswith(%22__version__%22):%0A return line.split(%22=%22)%5B1%5D.replace('%22', '').strip()%0A else:%0A raise ValueError(%22__version__ not found in %25s%22 %25 path)%0A%0A%0A setu @@ -355,19 +355,17 @@ ion= -get +_ _version (),%0A @@ -364,10 +364,10 @@ sion -() +__ ,%0A
429954c30bc54dcc99cfc67ba59017859b38807c
version number update
setup.py
setup.py
"""setup function for CALLHORIZONS module""" from setuptools import setup, find_packages setup( name="CALLHORIZONS", version="1.0.13", author="Michael Mommert", author_email="michael.mommert@nau.edu", description="CALLHORIZONS is a Python interface to access JPL HORIZONS ephemerides and orbital elements of Solar System bodies.", license="MIT", keywords="solar system, ephemerides, ephemeris, orbital elements, pyephem, asteroids, planets, spacecraft", url="https://github.com/mommermi/callhorizons", packages=['callhorizons'], requires=['numpy'], test_suite='tests', classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Scientific/Engineering :: Astronomy", ], )
Python
0.000002
@@ -135,12 +135,11 @@ =%221. -0 +1 .1 -3 %22,%0A
9232fa78e6a04f25f493fef91014384719c730ee
remove unused import from setup.py
setup.py
setup.py
from setuptools import setup import flask_secure_headers setup( name = 'flask-secure-headers', packages = ['flask_secure_headers'], include_package_data = True, version = '0.2', description = 'Secure Header Wrapper for Flask Applications', long_description = """ Add security headers to a Flask application. This is intended to be a simplified version of the Twitter SecureHeaders Ruby Gem """, license='MIT', author = 'Tristan Waldear', author_email = 'trwaldear@gmail.com', url = 'https://github.com/twaldear/flask-secure-headers', download_url = 'https://github.com/twaldear/flask-secure-headers/tarball/0.1', keywords = ['flask', 'security', 'header'], install_requires = ['flask'], test_suite="nose.collector", tests_require = ['nose'], classifiers=[ 'Development Status :: 4 - Beta', 'Framework :: Flask', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', ] )
Python
0
@@ -27,36 +27,8 @@ up%0A%0A -import flask_secure_headers%0A %0Aset
bd3942724c7a2f04d5eb6277a35e5ebf54ebf6e0
Add python 3.6 in the supported version
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import shutil import os import sys import glob from setuptools import setup, find_packages try: import py2exe except ImportError: pass import smserver for filename in glob.glob("cfg/*.yml*"): shutil.copy(filename, "smserver/_fallback_conf") conf_dir = None if os.path.splitdrive(sys.executable)[0] != "": conf_dir = "conf" if not conf_dir and os.path.isdir("/etc/smserver"): conf_dir = "/etc/smserver" if not conf_dir: try: os.mkdir("/etc/smserver") conf_dir = "/etc/smserver" except: pass if not conf_dir: conf_dir = "conf" setup( name='smserver', version=smserver.__version__, packages=find_packages(), author="Sélim Menouar", author_email="selim.menouar@rez-gif.supelec.fr", description="An implementation of a Stepmania server", long_description=open('README.rst').read(), include_package_data=True, url='http://github.com/ningirsu/stepmania-server', classifiers=[ 'Programming Language :: Python', 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: MIT License', 'Topic :: Games/Entertainment', 'Topic :: Games/Entertainment :: Arcade', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3 :: Only', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', ], extras_require={ ':python_version=="3.3"': ['asyncio', 'enum34'], }, install_requires=[ 'pyyaml', 'sqlalchemy', 'websockets', ], scripts=['scripts/smserver'], console=['scripts/smserver'], options={ "py2exe": { 'packages': ['smserver'], "bundle_files": 0, "optimize": 2 } }, zipfile=None, license="MIT", data_files=[(conf_dir, ['cfg/conf.yml.orig'])], )
Python
0.000001
@@ -1,49 +1,24 @@ -#!/usr/bin/env python%0A# -*- coding: utf-8 -*- +%22%22%22 Setup script %22%22%22 %0A%0Aim @@ -1483,16 +1483,65 @@ : 3.5',%0A + 'Programming Language :: Python :: 3.6',%0A %5D,%0A%0A
235609b1b370fee8f03cdf0d9d6a70075bd6e50e
Update to next dev version
setup.py
setup.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # OpenFisca -- A versatile microsimulation software # By: OpenFisca Team <contact@openfisca.fr> # # Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team # https://github.com/openfisca # # This file is part of OpenFisca. # # OpenFisca is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # OpenFisca is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from setuptools import setup, find_packages setup( name = 'OpenFisca-Web-API', version = '0.5.0', author = 'OpenFisca Team', author_email = 'contact@openfisca.fr', classifiers = [ 'Development Status :: 2 - Pre-Alpha', 'Environment :: Web Environment', 'License :: OSI Approved :: GNU Affero General Public License v3', 'Operating System :: POSIX', 'Programming Language :: Python', 'Topic :: Scientific/Engineering :: Information Analysis', 'Topic :: Internet :: WWW/HTTP :: WSGI :: Server', ], description = u'Web API for OpenFisca', keywords = 'api benefit microsimulation server social tax web', license = 'http://www.fsf.org/licensing/licenses/agpl-3.0.html', url = 'https://github.com/openfisca/openfisca-web-api', data_files = [ ('share/locale/fr/LC_MESSAGES', ['openfisca_web_api/i18n/fr/LC_MESSAGES/openfisca-web-api.mo']), ], entry_points = { 'paste.app_factory': 'main = openfisca_web_api.application:make_app', }, include_package_data = True, install_requires = [ 'Babel >= 0.9.4', 'Biryani >= 0.10.4', 'OpenFisca-Core >= 0.5dev', 'OpenFisca-Parsers >= 0.5dev', 'PasteDeploy', 'PasteScript', 'WebError >= 0.10', 'WebOb >= 1.1', ], message_extractors = {'openfisca_web_api': [ ('**.py', 'python', None), ]}, packages = find_packages(), test_suite = 'nose.collector', )
Python
0
@@ -1024,16 +1024,21 @@ = '0.5. +1.dev 0',%0A%0A
44c5d4e06cd2d7c041eb5f21435013bb6f86b9e2
Add backports.typing requirement
setup.py
setup.py
#!/usr/bin/env python """setup.py Defines the setup instructions for the hug framework Copyright (C) 2016 Timothy Edmund Crosley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import glob import os import subprocess import sys from os import path from setuptools import Extension, find_packages, setup from setuptools.command.test import test as TestCommand class PyTest(TestCommand): extra_kwargs = {'tests_require': ['pytest', 'mock']} def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest sys.exit(pytest.main()) MYDIR = path.abspath(os.path.dirname(__file__)) CYTHON = False JYTHON = 'java' in sys.platform cmdclass = {'test': PyTest} ext_modules = [] try: sys.pypy_version_info PYPY = True except AttributeError: PYPY = False if not PYPY and not JYTHON: try: from Cython.Distutils import build_ext CYTHON = True except ImportError: CYTHON = False if CYTHON: def list_modules(dirname): filenames = glob.glob(path.join(dirname, '*.py')) module_names = [] for name in filenames: module, ext = path.splitext(path.basename(name)) if module != '__init__': module_names.append(module) return module_names ext_modules = [ Extension('hug.' + ext, [path.join('hug', ext + '.py')]) for ext in list_modules(path.join(MYDIR, 'hug'))] cmdclass['build_ext'] = build_ext try: import pypandoc readme = pypandoc.convert('README.md', 'rst') except (IOError, ImportError, OSError, RuntimeError): readme = '' setup(name='hug', version='2.3.0', description='A Python framework that makes developing APIs as simple as possible, but no simpler.', long_description=readme, author='Timothy Crosley', author_email='timothy.crosley@gmail.com', url='https://github.com/timothycrosley/hug', license="MIT", entry_points={ 'console_scripts': [ 'hug = hug:development_runner.hug.interface.cli', ] }, packages=['hug'], requires=['falcon', 'requests'], install_requires=['falcon==1.2.0', 'requests'], cmdclass=cmdclass, ext_modules=ext_modules, keywords='Web, Python, Python3, Refactoring, REST, Framework, RPC', classifiers=['Development Status :: 6 - Mature', 'Intended Audience :: Developers', 'Natural Language :: English', 'Environment :: Console', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Topic :: Software Development :: Libraries', 'Topic :: Utilities'], **PyTest.extra_kwargs)
Python
0.000001
@@ -3193,32 +3193,52 @@ con', 'requests' +, 'backports.typing' %5D,%0A install @@ -3275,16 +3275,36 @@ equests' +, 'backports.typing' %5D,%0A
dc30bf4bf542ec89bb34003b061f7d431f36443a
version bump to v1.3.3
setup.py
setup.py
#!/usr/bin/env python3 import subprocess import fnmatch from setuptools import Command, setup, find_packages from setuptools.command.build_py import build_py as _build_py VERSION = '1.3.2' AUTHOR = 'Rutgers Open System Solutions' class BuildWebpack(Command): description = 'build webpack assets' user_options = [ ('webpack-config', 'c', 'webpack configuration file') ] def initialize_options(self): self.webpack_config = 'webpack.config.js' def finalize_options(self): pass def run(self): subprocess.run(['npx', 'webpack', '--config', self.webpack_config, '--env', 'prod']) class build_py(_build_py): EXCLUDED = ['shrunk/config.py', 'shrunk/test-config.py'] def find_package_modules(self, package, package_dir): modules = super().find_package_modules(package, package_dir) return (mod for mod in modules if not any(fnmatch.fnmatchcase(mod[2], pat) for pat in self.EXCLUDED)) def run(self): self.run_command('build_webpack') return super().run() CMDCLASS = { 'build_py': build_py, 'build_webpack': BuildWebpack } COMMAND_OPTIONS = {} try: from sphinx.setup_command import BuildDoc CMDCLASS['build_sphinx'] = BuildDoc COMMAND_OPTIONS['build_sphinx'] = { 'project': ('setup.py', 'shrunk'), 'version': ('setup.py', VERSION), 'source_dir': ('setup.py', 'doc') } except ImportError: pass with open('pip.req', 'r') as f: requires = [line.rstrip() for line in f] with open('README.md', 'r') as f: readme = f.read() setup( name='shrunk', version=VERSION, packages=find_packages(), package_data={'shrunk': ['static/webpack-stats.json', 'static/dist/*', 'static/img/*', 'templates/*', 'templates/errors/*']}, include_package_data=True, zip_safe=False, install_requires=requires, author=AUTHOR, author_email='oss@oss.rutgers.edu', description='Rutgers University URL Shortener', long_description=readme, long_description_content_type='text/markdown', keywords='shrunk rutgers url shortener', classifiers=[ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3.6', 'Topic :: Utilities' ], url='https://github.com/oss/shrunk', command_options=COMMAND_OPTIONS, cmdclass=CMDCLASS )
Python
0.000001
@@ -182,17 +182,17 @@ = '1.3. -2 +3 '%0A%0AAUTHO
fdb461f000adefff0d1050464e5783c96222f364
Add minimum version for pycryptodome
setup.py
setup.py
from setuptools import setup setup( name='scuevals-api', packages=['scuevals_api'], include_package_data=True, test_suite='tests', entry_points={ 'console_scripts': [ 'app=scuevals_api.cmd:cli' ] }, install_requires=[ 'alembic==0.9.7', 'beautifulsoup4==4.6.0', 'blinker==1.4', 'coveralls==1.2.0', 'Flask-Caching==1.3.3', 'Flask-Cors==3.0.3', 'Flask-JWT-Extended==3.6.0', 'Flask-Migrate==2.1.1', 'Flask-RESTful==0.3.6', 'Flask-Rollbar==1.0.1', 'Flask-SQLAlchemy==2.3.2', 'Flask==0.12.2', 'gunicorn==19.7.1', 'newrelic==2.100.0.84', 'psycopg2==2.7.3.2', 'python-jose==2.0.1', 'PyYAML==3.12', 'requests==2.18.4', 'rollbar==0.13.17', 'vcrpy==1.11.1', 'webargs==1.8.1', ], )
Python
0
@@ -718,24 +718,54 @@ ==2.7.3.2',%0A + 'pycryptodome%3E=3.4.7'%0A 'pyt
3a279370ca4847abfe82f1be99111e04bf2de61b
Remove unnecessary import
setup.py
setup.py
# setup.py for pySerial # # Windows installer: # "python setup.py bdist_wininst" # # Direct install (all systems): # "python setup.py install" # # For Python 3.x use the corresponding Python executable, # e.g. "python3 setup.py ..." import sys try: from setuptools import setup except ImportError: from distutils.core import setup # importing version does not work with Python 3 as files have not yet been # converted. import serial version = serial.VERSION setup( name = "pyserial", description = "Python Serial Port Extension", version = version, author = "Chris Liechti", author_email = "cliechti@gmx.net", url = "https://github.com/pyserial/pyserial", packages = ['serial', 'serial.tools', 'serial.urlhandler'], license = "Python", long_description = "Python Serial Port Extension for Win32, Linux, BSD, Jython, IronPython", classifiers = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Intended Audience :: End Users/Desktop', 'License :: OSI Approved :: BSD License', 'Natural Language :: English', 'Operating System :: POSIX', 'Operating System :: Microsoft :: Windows', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Topic :: Communications', 'Topic :: Software Development :: Libraries', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Terminals :: Serial', ], platforms = 'any', scripts = ['serial/tools/miniterm.py'], )
Python
0.000011
@@ -235,20 +235,8 @@ .%22%0A%0A -import sys%0A%0A try:
3121572d452a58161f9bb9e7f813254b592b680b
bump version
setup.py
setup.py
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='hops', version='1.1.5', author='Robin Andersson', author_email='robin.eric.andersson@gmail.com', description='A helper library for Hops that facilitates development by hiding the complexity of discovering services and setting up security.', license='Apache License 2.0', keywords='HOPS, Hadoop, TensorFlow, Spark', url='https://github.com/hopshadoop/hops-util-py', download_url = 'https://github.com/hopshadoop/hops-util-py/archive/1.1.5.tar.gz', packages=['hops'], long_description=read('README.rst'), classifiers=[ 'Development Status :: 3 - Alpha', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', ], install_requires=[] )
Python
0
@@ -164,17 +164,17 @@ on='1.1. -5 +6 ',%0A a @@ -612,9 +612,9 @@ 1.1. -5 +6 .tar
426247045dacf56fc5c7324fffbc140e9ea1b2e2
Bump tqdm from 4.37.0 to 4.38.0
setup.py
setup.py
#!/usr/bin/env python3 from os import path from setuptools import setup, find_packages here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='ogn-python', version='0.5.0', description='A database backend for the Open Glider Network', long_description=long_description, url='https://github.com/glidernet/ogn-python', author='Konstantin Gründger aka Meisterschueler, Fabian P. Schmidt aka kerel, Dominic Spreitz', author_email='kerel-fs@gmx.de', license='AGPLv3', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'Intended Audience :: Science/Research', 'Topic :: Scientific/Engineering :: GIS', 'License :: OSI Approved :: GNU Affero General Public License v3', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', ], keywords='gliding ogn', packages=find_packages(exclude=['tests', 'tests.*']), install_requires=[ 'Flask==1.1.1', 'Flask-SQLAlchemy==2.4.1', 'Flask-Migrate==2.5.2', 'Flask-Bootstrap==3.3.7.1', 'Flask-WTF==0.14.2', 'Flask-Caching==1.7.2', 'geopy==1.20.0', 'celery==4.3.0', 'redis==3.3.11', 'aerofiles==1.0.0', 'geoalchemy2==0.6.3', 'shapely==1.6.4.post2', 'ogn-client==0.9.5', 'psycopg2-binary==2.8.4', 'mgrs==1.3.5', 'xmlunittest==0.5.0', 'tqdm==4.37.0', 'requests==2.22.0', ], test_require=[ 'pytest==5.0.1', 'flake8==1.1.1', 'xmlunittest==0.4.0', ], zip_safe=False )
Python
0.000001
@@ -1657,17 +1657,17 @@ qdm==4.3 -7 +8 .0',%0A%09'r
2029b86059f538f6ab5ab3e472708a9632141010
add holoviews to dependencies
setup.py
setup.py
from os import path from setuptools import find_packages, setup DISTNAME = 'pyciss' DESCRIPTION = "Software for handling Cassini ISS data" AUTHOR = "K.-Michael Aye" AUTHOR_EMAIL = "michael.aye@lasp.colorado.edu" MAINTAINER_EMAIL = AUTHOR_EMAIL URL = "https://github.com/michaelaye/pyciss" LICENSE = "ISC" KEYWORDS = ['CASSINI', 'science', 'saturn', 'imaging'] DOWNLOAD_URL = "https://github.com/michaelaye/pyciss" here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.rst'), encoding='utf-8') as f: LONG_DESCRIPTION = f.read() setup( name=DISTNAME, version="0.12.0", packages=find_packages(), install_requires=['pandas', 'numpy', 'matplotlib', 'pysis', 'astropy', 'xarray'], setup_requires=['pytest-runner'], tests_require=['pytest'], package_data={ 'pyciss': ['data/*'] }, # metadata author=AUTHOR, maintainer=AUTHOR, author_email=AUTHOR_EMAIL, maintainer_email=AUTHOR_EMAIL, description=DESCRIPTION, long_description=LONG_DESCRIPTION, license=LICENSE, keywords=KEYWORDS, url=URL, download_url=DOWNLOAD_URL, classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: ISC License (ISCL)', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Topic :: Scientific/Engineering', 'Operating System :: OS Independent', 'Topic :: Software Development :: Libraries :: Python Modules', ], )
Python
0
@@ -762,16 +762,29 @@ 'xarray' +, 'holoviews' %5D,%0A s
0cae8f8e892bf40e30598cee3fe32dc496a8ec7b
Fix setup.py setuptools reference
setup.py
setup.py
#!/usr/bin/env python3 from distutils.core import setup setup( name='PyKazoo', version='0.0a1', packages=['pykazoo'], install_requires=['requests==2.7.0'], url='https://github.com/tnewman/PyKazoo', license='MIT', author='Thomas Newman', author_email='tnewman@users.noreply.github.com', description='PyKazoo is a Python API client for 2600hz Kazoo', )
Python
0
@@ -17,16 +17,72 @@ ython3%0A%0A +# noinspection PyUnresolvedReferences%0Aimport setuptools%0A from dis
ea6a22678e8169ced9465269b68fbe9394aa2efb
Bump version to 0.2
setup.py
setup.py
import os import setuptools setuptools.setup( name='factory_djoy', version='0.1', description="Wrappers over Factory Boy's Django Factories", url='http://github.com/jamescooke/factory_djoy', author='James Cooke', author_email='github@jamescooke.info', license='MIT', packages=setuptools.find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), install_requires=[ 'Django>=1.6', 'factory_boy>=2', ], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Framework :: Django', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Topic :: Software Development :: Testing', 'Topic :: Software Development :: Libraries :: Python Modules', ], )
Python
0.000001
@@ -81,17 +81,17 @@ sion='0. -1 +2 ',%0A%0A
226654bfc455991f9f3134c18ac91fced704f09e
Bump version to 0.5.16.
setup.py
setup.py
#!/usr/bin/env python import os from setuptools import setup, find_packages VERSION = '0.5.15' if __name__ == '__main__': setup( name='datastream', version=VERSION, description="Datastream API time-series library.", long_description=open(os.path.join(os.path.dirname(__file__), 'README.rst')).read(), author='wlan slovenija', author_email='open@wlan-si.net', url='https://github.com/wlanslovenija/datastream', license='AGPLv3', packages=find_packages(exclude=('*.tests', '*.tests.*', 'tests.*', 'tests')), package_data={}, classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU Affero General Public License v3', 'Operating System :: OS Independent', 'Programming Language :: Python', ], include_package_data=True, zip_safe=False, install_requires=[ 'pytz>=2012h', ], extras_require={ 'mongodb': [ 'mongoengine>=0.8.1', 'pymongo>=2.7.1,<3.0.0', ], 'influxdb': [ 'python-dateutil>=2.4.2', 'psycopg2>=2.6.1', 'influxdb>=2.10.0', 'backports.lzma>=0.0.6', 'cachetools>=1.1.6', ], }, tests_require=[ 'mongoengine>=0.8.1', 'pymongo>=2.7.1,<3.0.0', 'python-dateutil>=2.4.2', 'psycopg2>=2.6.1', 'influxdb>=2.10.0', 'backports.lzma>=0.0.6', 'cachetools>=1.1.6', ], test_suite='tests', )
Python
0
@@ -88,17 +88,17 @@ = '0.5.1 -5 +6 '%0A%0Aif __
a3f150be3ea89a87eca9902da58aa93d6623da42
bump version to 0.2.6
setup.py
setup.py
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-councilmatic', version='0.2.5', packages=['councilmatic_core'], include_package_data=True, license='MIT License', # example license description='Core functions for councilmatic.org family', long_description=README, url='http://councilmatic.org/', author='DataMade, LLC', author_email='info@datamade.us', install_requires=['requests==2.7.0', 'django-haystack==2.4.0', 'pysolr==3.3.2', 'python-dateutil==2.4.2'], classifiers=[ 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', # example license 'Operating System :: OS Independent', 'Programming Language :: Python', # Replace these appropriately if you are stuck on Python 2. 'Programming Language :: Python :: 3.4', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], )
Python
0.000001
@@ -318,9 +318,9 @@ 0.2. -5 +6 ',%0A
d9544b310f791493633b9d78cc5b257d041366c5
Bump up version
setup.py
setup.py
import os from setuptools import setup, find_packages # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) REQUIREMENTS = ["redis", "redlock-py"] README = """ probit-scheduler - redis backed scheduler for celery beat. This scheduler was made from https://github.com/SPSCommerce/swiss-chard.git with some modifications. The MIT License (MIT) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ setup( name='probit-scheduler', version='0.1.3', license='MIT', packages=find_packages(), include_package_data=True, description='probit scheduler - JSON redis backed scheduler for celery beat.', long_description=README, url='https://github.com/Pro-bit/Probit-RedisCeleryScheduler', author='ProBitDeveloper', author_email='pro4.developer@gmail.com', install_requires=REQUIREMENTS )
Python
0
@@ -1492,9 +1492,9 @@ 0.1. -3 +4 ',%0A
e19826d9da69dbdb704d3d366f864b9317ac2861
Disable unused django-setuptest.
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages try: README = open('README.rst').read() except: README = None try: REQUIREMENTS = open('requirements.txt').read() except: REQUIREMENTS = None setup( name='newspeak', version="0.1", description='Standalone Django based feed aggregator.', long_description=README, install_requires=REQUIREMENTS, author='Mathijs de Bruin', author_email='mathijs@visualspace.nl', url='http://github.com/bitsoffreedom/newspeak/', packages=find_packages('src'), package_dir={'': 'src'}, include_package_data=True, classifiers=['Development Status :: 3 - Alpha', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Utilities'], test_suite='setuptest.setuptest.SetupTestSuite', tests_require=( 'django-setuptest', 'argparse', # apparently needed by django-setuptest on python 2.6 ), entry_points={ 'console_scripts': [ 'newspeak = newspeak.runner:main', ], }, )
Python
0
@@ -1018,191 +1018,8 @@ '%5D,%0A - test_suite='setuptest.setuptest.SetupTestSuite',%0A tests_require=(%0A 'django-setuptest',%0A 'argparse', # apparently needed by django-setuptest on python 2.6%0A ),%0A
105a23c0e07c737b9bbe7face42443a26409df32
Declare Python 3 support in setup.py.
setup.py
setup.py
#!/usr/bin/env python import os from setuptools import setup, find_packages from webassets.six.moves import map from webassets.six.moves import zip try: from sphinx.setup_command import BuildDoc cmdclass = {'build_sphinx': BuildDoc} except ImportError: cmdclass = {} # Figure out the version. This could also be done by importing the # module, the parsing takes place for historical reasons. import re here = os.path.dirname(os.path.abspath(__file__)) version_re = re.compile( r'__version__ = (\(.*?\))') fp = open(os.path.join(here, 'src/webassets', '__init__.py')) version = None for line in fp: match = version_re.search(line) if match: version = eval(match.group(1)) break else: raise Exception("Cannot find version in __init__.py") fp.close() setup( name='webassets', version=".".join(map(str, version)), description='Media asset management for Python, with glue code for '+\ 'various web frameworks', long_description='Merges, minifies and compresses Javascript and ' 'CSS files, supporting a variety of different filters, including ' 'YUI, jsmin, jspacker or CSS tidy. Also supports URL rewriting ' 'in CSS files.', author='Michael Elsdoerfer', author_email='michael@elsdoerfer.com', license='BSD', url='http://github.com/miracle2k/webassets/', classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Software Development :: Libraries', ], entry_points="""[console_scripts]\nwebassets = webassets.script:run\n""", packages=find_packages('src'), package_dir={'': 'src'}, cmdclass=cmdclass, )
Python
0.000001
@@ -1641,16 +1641,63 @@ ython',%0A + 'Programming Language :: Python :: 3',%0A
aa6bc481529022bb878fcd76903bb0ccb93d7048
Fix schema salad pin.
setup.py
setup.py
#!/usr/bin/env python import os import sys import setuptools.command.egg_info as egg_info_cmd import shutil from setuptools import setup, find_packages SETUP_DIR = os.path.dirname(__file__) README = os.path.join(SETUP_DIR, 'README.rst') try: import gittaggers tagger = gittaggers.EggInfoFromGit except ImportError: tagger = egg_info_cmd.egg_info setup(name='cwltool', version='1.0', description='Common workflow language reference implementation', long_description=open(README).read(), author='Common workflow language working group', author_email='common-workflow-language@googlegroups.com', url="https://github.com/common-workflow-language/common-workflow-language", download_url="https://github.com/common-workflow-language/common-workflow-language", license='Apache 2.0', packages=["cwltool"], package_data={'cwltool': ['schemas/draft-3/*.yml', 'schemas/draft-3/*.md', 'schemas/draft-3/salad/schema_salad/metaschema/*.yml', 'schemas/draft-3/salad/schema_salad/metaschema/*.md']}, install_requires=[ 'requests', 'PyYAML', 'rdflib >= 4.2.0', 'rdflib-jsonld >= 0.3.0', 'shellescape', 'schema_salad == 1.5.20160126164443' ], test_suite='tests', tests_require=[], entry_points={ 'console_scripts': [ "cwltool=cwltool.main:main", "cwltest=cwltool.cwltest:main" ] }, zip_safe=True, cmdclass={'egg_info': tagger}, )
Python
0
@@ -1351,13 +1351,13 @@ 1261 -64443 +90004 '%0A
1b5aacb80c4e0131eaea68da0d2d78410ea76980
alphabetize the classifiers
setup.py
setup.py
from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages version = '0.9.6' setup( name="Pylons", version=version, description='Pylons Web Framework', long_description=""" Pylons ====== The Pylons web framework is aimed at making webapps and large programmatic website development in Python easy. Several key points: * A framework to make writing web applications in Python easy * Inspired by Rails and TurboGears * Utilizes a minimalist, component-based philosophy that makes it easy to expand on * Harness existing knowledge about Python Knowing Python makes Pylons easy --------------------------------- Pylons makes it easy to expand on your knowledge of Python to master Pylons for web development. Using a MVC style dispath, Python knowledge is used at various levels: * The Controller is just a basic Python class, called for each request. Customizing the response is as easy as overriding __call__ to make your webapp work how you want. * Mako templating compiles directly to Python byte-code for speed and utilizes Python for template control rather than creating its own template syntax for "for, while, etc" Current Status --------------- Pylons %s described on this page is stable. There is also an unstable `develoment version <http://pylonshq.com/svn/Pylons/trunk#egg=Pylons-dev>`_ of Pylons. Download and Installation ------------------------- Pylons can be installed with `Easy Install <http://peak.telecommunity.com/DevCenter/EasyInstall>`_ by typing:: > easy_install Pylons Dependant packages are automatically installed from the `Pylons download page <http://pylonshq.com/download/>`_ . """ % version, keywords='web wsgi framework sqlalchemy formencode mako templates buffet', license='BSD', author='Ben Bangert, Philip Jenvey, James Gardner', author_email='ben@groovie.org, pjenvey@groovie.org', url='http://www.pylonshq.com/', packages=find_packages(exclude=['ez_setup']), zip_safe=False, include_package_data=True, install_requires=[ "Routes>=1.7", "WebHelpers==dev,>=0.3.1dev-r2037", "Beaker>=0.7.4", "Paste>=1.3", "PasteDeploy>=1.3", "PasteScript>=1.3.2", "FormEncode>=0.7", "simplejson>=1.7.1", "decorator>=2.0.1", "nose>=0.9.2,<=0.9.9", "Mako>=0.1.6" ], dependency_links=[ "http://www.pylonshq.com/download/" ], classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Internet :: WWW/HTTP :: WSGI", "Framework :: Pylons", ], extras_require = { 'pudge': ["docutils>=0.4", "elementtree>=1.2.6", "kid>=0.9", "Pygments>=0.7", "pudge>=0.1.3", "buildutils>=0.1.2"], 'cheetah':["Cheetah>=1.0", "TurboCheetah>=0.9.5"], 'myghty':["Myghty>=1.1"], 'kid':["kid>=0.9", "TurboKid>=0.9.1"], 'genshi':["Genshi>=0.3.6"], 'full':[ "docutils>=0.4", "elementtree>=1.2.6", "Pygments>=0.7", "pudge>=0.1.3", "buildutils>=0.1.2", "Cheetah>=1.0", "TurboCheetah>=0.9.5", "kid>=0.9", "TurboKid>=0.9.", ], }, entry_points=""" [paste.paster_command] controller = pylons.commands:ControllerCommand restcontroller = pylons.commands:RestControllerCommand shell = pylons.commands:ShellCommand [paste.paster_create_template] pylons = pylons.util:PylonsTemplate pylons_minimal = pylons.util:MinimalPylonsTemplate [python.templating.engines] pylonsmyghty = pylons.templating:MyghtyTemplatePlugin [myghty] """, )
Python
0.999794
@@ -2477,24 +2477,55 @@ on/Stable%22,%0A + %22Framework :: Pylons%22,%0A %22Int @@ -2766,16 +2766,65 @@ opic :: +Internet :: WWW/HTTP :: WSGI%22,%0A %22Topic :: Software @@ -2869,88 +2869,8 @@ dule -s%22,%0A %22Topic :: Internet :: WWW/HTTP :: WSGI%22,%0A %22Framework :: Pylon s%22,%0A
e03d38e2ca78aa82c8791b43beaa044e27fc4424
Bump version to 0.2.1
setup.py
setup.py
from setuptools import find_packages, setup setup( name='django-controlcenter', version='0.2.0', description='Set of widgets to build dashboards for your Django-project.', long_description='', url='https://github.com/byashimov/django-controlcenter', author='Murad Byashimov', author_email='byashimov@gmail.com', packages=find_packages( exclude=['controlcenter.stylus', 'controlcenter.images']), include_package_data=True, license='BSD', install_requires=['django-pkgconf'], keywords='django admin dashboard', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Topic :: Software Development :: Libraries :: Python Modules', 'Environment :: Web Environment', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Framework :: Django', 'Framework :: Django :: 1.8', 'Framework :: Django :: 1.9', ], )
Python
0.000001
@@ -95,17 +95,17 @@ on='0.2. -0 +1 ',%0A d @@ -1262,16 +1262,55 @@ : 1.9',%0A + 'Framework :: Django :: 1.10',%0A %5D,%0A)
1c02453275d32109028aa3b915e56640404e74fe
Update setup.py
setup.py
setup.py
# coding:utf-8 import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.version_info < (2, 6): error = 'ERROR: qingcloud-sdk requires Python Version 2.6 or above.' print >> sys.stderr, error sys.exit(1) setup( name='qingcloud-sdk', version='1.2', description='Software Development Kit for QingCloud.', long_description=open('README.rst', 'rb').read().decode('utf-8'), keywords='qingcloud iaas qingstor sdk', author='Yunify Team', author_email='simon@yunify.com', url='https://docs.qingcloud.com/sdk/', packages=['qingcloud', 'qingcloud.conn', 'qingcloud.iaas', 'qingcloud.misc', 'qingcloud.qingstor'], package_dir={'qingcloud-sdk': 'qingcloud'}, namespace_packages=['qingcloud'], include_package_data=True, install_requires=['future'] )
Python
0
@@ -661,16 +661,42 @@ d.iaas', + 'qingcloud.iaas.actions', %0A
b82e851a74c2a3ac4823723be2f6b0caf88cb7c8
use distutils for comming python 3.12
setup.py
setup.py
import sys from distutils.core import setup, Command from distutils.extension import Extension try: from Cython.Build import cythonize ext_modules = cythonize([ Extension("cymysql.packet", ["cymysql/packet.pyx"]), Extension("cymysql.charset", ["cymysql/charset.py"]), Extension("cymysql.converters", ["cymysql/converters.py"]), Extension("cymysql.connections", ["cymysql/connections.py"]), Extension("cymysql.cursors", ["cymysql/cursors.py"]), Extension("cymysql.err", ["cymysql/err.py"]), Extension("cymysql.times", ["cymysql/times.py"]), ], compiler_directives={'language_level': str(sys.version_info[0])}, ) except ImportError: ext_modules = None class TestCommand(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): ''' Finds all the tests modules in tests/, and runs them. ''' from cymysql import tests import unittest unittest.main(tests, argv=sys.argv[:1]) cmdclass = {'test': TestCommand} version_tuple = __import__('cymysql').VERSION if version_tuple[2] is not None: version = "%d.%d.%s" % version_tuple else: version = "%d.%d" % version_tuple[:2] classifiers = [ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Topic :: Database', ] setup( name="cymysql", version=version, url='https://github.com/nakagami/CyMySQL/', classifiers=classifiers, keywords=['MySQL'], author='Yutaka Matsubara', author_email='yutaka.matsubara@gmail.com', maintainer='Hajime Nakagami', maintainer_email='nakagami@gmail.com', description='Python MySQL Driver using Cython', long_description=open('README.rst').read(), license="MIT", packages=['cymysql', 'cymysql.constants', 'cymysql.tests'], cmdclass=cmdclass, ext_modules=ext_modules, )
Python
0
@@ -4,16 +4,98 @@ ort sys%0A +try:%0A from setuptools import setup, Command, Extension%0Aexcept ImportError:%0A from dis @@ -128,16 +128,20 @@ Command%0A + from dis
2998e76c9129ef5740ab177343db262c391594a6
Bump pytest-spec version.
setup.py
setup.py
#!/usr/bin/env python # encoding: utf-8 from __future__ import print_function import os import sys import codecs try: from setuptools.core import setup, find_packages except ImportError: from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand if sys.version_info < (2, 6): raise SystemExit("Python 2.6 or later is required.") elif sys.version_info > (3, 0) and sys.version_info < (3, 2): raise SystemExit("Python 3.2 or later is required.") exec(open(os.path.join("marrow", "cache", "release.py")).read()) class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest sys.exit(pytest.main(self.test_args)) here = os.path.abspath(os.path.dirname(__file__)) tests_require = ['pytest', 'pytest-cov', 'pytest-flakes', 'pytest-cagoule', 'pytest-spec<=0.2.22'] setup( name = "marrow.cache", version = version, description = description, long_description = codecs.open(os.path.join(here, 'README.rst'), 'r', 'utf8').read(), url = url, author = author.name, author_email = author.email, license = 'MIT', keywords = '', classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "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.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], packages = find_packages(exclude=['test', 'script', 'example']), include_package_data = True, namespace_packages = ['marrow'], install_requires = ['mongoengine>=0.8.5', 'marrow.package<2.0', 'wrapt<2.0'], extras_require = dict( development = tests_require, ), tests_require = tests_require, dependency_links = [ 'git+https://github.com/illico/pytest-spec.git@feature/py26#egg=pytest-spec-0.2.22' ], zip_safe = False, cmdclass = dict( test = PyTest, ) )
Python
0
@@ -911,31 +911,8 @@ ule' -, 'pytest-spec%3C=0.2.22' %5D%0A%0As @@ -2276,95 +2276,8 @@ = %5B%0A -%09%09%09'git+https://github.com/illico/pytest-spec.git@feature/py26#egg=pytest-spec-0.2.22'%0A %09%09%5D,
8866c06ee9131cf0e52c08e0ae9e08db90347590
increment version
setup.py
setup.py
# coding: utf-8 from setuptools import setup setup( name='graphite_raintank', version='0.1', url='https://github.com/raintank/graphite_raintank', license='apache2', author='Anthony Woods', author_email='awoods@raintank.io', description=('Raintank backend plugin for graphite_api'), long_description='', py_modules=('graphite_raintank',), zip_safe=False, include_package_data=True, platforms='any', classifiers=( 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Topic :: System :: Monitoring', ), install_requires=( 'requests', 'elasticsearch<2.0.0', 'flask', 'graphite_api' ), )
Python
0.000004
@@ -95,9 +95,9 @@ ='0. -1 +2 ',%0A
6664997352f6138028260de4264ec86e014b91e6
version number updated
setup.py
setup.py
#!/usr/bin/env python import sys try: from setuptools import setup, Command except ImportError: from distutils.core import setup, Command if sys.version_info < (3, 5, 0): warn("The minimum Python version supported by pdf2xlsx is 3.5.") exit() long_description = """ Extract zip, search for pdf, get invoices from pdf, write them to xlsx file """ setup( name="pdf2xlsx", # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html version="0.1", description="Invoice extraction from zip", long_description=long_description, url="https://github.com/etibger/pdf2xlsx", # Author details author="Tibor Gerlai", author_email="tibor.gerlai@gmail.com", license='MIT' # See https://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers = [ "Development Status :: 2 - Pre-Alpha", "Environment :: Console", "Environment :: Win32 (MS Windows)", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: Microsoft :: Windows", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3 :: Only", "Topic :: Office/Business :: Financial :: Spreadsheet", ], # What does your project relate to? keywords='pdf to excel conversion', # You can just specify the packages manually here if your project is # simple. Or you can use find_packages(). packages=find_packages(exclude=['contrib', 'docs', 'tests']), # List run-time dependencies here. These will be installed by pip when # your project is installed. For an analysis of "install_requires" vs pip's # requirements files see: # https://packaging.python.org/en/latest/requirements.html install_requires=['PyPDF2', 'XlsxWriter'], # List additional groups of dependencies here (e.g. development # dependencies). You can install these using the following syntax, # for example: # $ pip install -e .[dev,test] extras_require={ 'doc': ['Sphinx', 'autodoc'], 'test': ['pytest'], 'freezing': ['cx-Freeze>=5'] }, )
Python
0.000001
@@ -631,16 +631,18 @@ ion=%220.1 +.0 %22,%0A %0A
ba6f96fe310387b88afb9a17ef4309cb7f987663
Version 0.4.7
setup.py
setup.py
from setuptools import setup, find_packages setup( name="filebrowser_safe", version="0.4.6", description="A snapshot of the filebrowser_3 branch of django-filebrowser, " "packaged as a dependency for the Mezzanine CMS for Django.", long_description=open("README.rst").read(), author="Patrick Kranzlmueller, Axel Swoboda (vonautomatisch)", author_email="werkstaetten@vonautomatisch.at", maintainer="Stephen McDonald", maintainer_email="stephen.mc@gmail.com", url="http://github.com/stephenmcd/filebrowser-safe", packages=find_packages(), include_package_data=True, zip_safe=False, classifiers=[ "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", ], )
Python
0
@@ -96,9 +96,9 @@ 0.4. -6 +7 %22,%0A
e71fed207a64c429894f455513fcef38e0f215c9
Fix version retrieval
setup.py
setup.py
#!/usr/bin/env python # Filename: setup.py """ KM3Pipe setup script. """ from setuptools import setup try: import builtins except ImportError: import __builtin__ as builtins # so we can detect in __init__.py that it's called from setup.py builtins.__KM3PIPE_SETUP__ = True from pkg_resources import get_distribution, DistributionNotFound with open('requirements.txt') as fobj: requirements = [l.strip() for l in fobj.readlines()] from pkg_resources import get_distribution, DistributionNotFound try: __version__ = get_distribution(__name__).version except DistributionNotFound: # package is not installed pass setup( name='km3pipe', url='http://github.com/tamasgal/km3pipe/', description='An analysis framework for KM3NeT', author='Tamas Gal and Moritz Lotze', author_email='tgal@km3net.de', packages=[ 'km3pipe', 'km3pipe.io', 'km3pipe.utils', 'km3modules', 'pipeinspector' ], include_package_data=True, platforms='any', setup_requires=[ 'numpy>=1.12', 'setuptools_scm', ], use_scm_version=True, install_requires=requirements, python_requires='>=2.7', entry_points={ 'console_scripts': [ 'km3pipe=km3pipe.cmd:main', 'km3srv=km3pipe.srv:main', 'tohdf5=km3pipe.utils.tohdf5:main', 'qtohdf5=km3pipe.utils.qtohdf5:main', 'hdf2root=km3pipe.utils.hdf2root:main', 'pipeinspector=pipeinspector.app:main', 'rtree=km3pipe.utils.rtree:main', 'h5info=km3pipe.utils.h5info:main', 'h5tree=km3pipe.utils.h5tree:main', 'h5header=km3pipe.utils.h5header:main', 'ptconcat=km3pipe.utils.ptconcat:main', 'meantots=km3pipe.utils.meantots:main', 'pushover=km3pipe.utils.pushover:main', 'ztplot=km3pipe.utils.ztplot:main', 'k40calib=km3pipe.utils.k40calib:main', 'totmonitor=km3pipe.utils.totmonitor:main', 'calibrate=km3pipe.utils.calibrate:main', 'rba=km3pipe.utils.rba:main', 'i3toroot=km3pipe.utils.i3toroot:main', 'i3root2hdf5=km3pipe.utils.i3root2hdf5:main', 'i3shower2hdf5=km3pipe.utils.i3shower2hdf5:main', 'streamds=km3pipe.utils.streamds:main', 'triggermap=km3pipe.utils.triggermap:main', 'nb2sphx=km3pipe.utils.nb2sphx:main', 'km3h5concat=km3pipe.utils.km3h5concat:main', 'triggersetup=km3pipe.utils.triggersetup:main', 'ligiermirror=km3pipe.utils.ligiermirror:main', 'runtable=km3pipe.utils.runtable:main', 'runinfo=km3pipe.utils.runinfo:main', 'qrunprocessor=km3pipe.utils.qrunprocessor:main', 'wtd=km3pipe.utils.wtd:main', ], }, classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'Intended Audience :: Science/Research', 'Programming Language :: Python', ], ) __author__ = 'Tamas Gal and Moritz Lotze'
Python
0.000006
@@ -550,16 +550,17 @@ ion( -__name__ +'km3pipe' ).ve
4744e2df3a99ddca3caae4359985daffb30bb94b
Update Flask-Z3950
setup.py
setup.py
# -*- coding: utf8 -*- """ pybossa-z3950 ------------- A PyBossa plugin for Z39.50 integration. """ import re import os from setuptools import setup version = re.search('^__version__\s*=\s*"(.*)"', open('pybossa_z3950/__init__.py').read(), re.M).group(1) try: here = os.path.dirname(__file__) long_description = open(os.path.join(here, 'docs', 'readme.rst')).read() except: long_description = "" requirements = ["Flask-Z3950>=0.2.2"] setup( name="pybossa-z3950", version=version, author="Alexander Mendes", author_email="alexanderhmendes@gmail.com", description="A PyBossa plugin that provides Z39.50 integration.", license="BSD", url="https://github.com/alexandermendes/pybossa-z3950", packages=['pybossa_z3950'], long_description=long_description, zip_safe=False, include_package_data=True, platforms="any", install_requires=requirements, classifiers=[ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Internet :: Z39.50", ], )
Python
0
@@ -483,17 +483,17 @@ 50%3E=0.2. -2 +3 %22%5D%0A%0A%0Aset
70ba4f53312ba3d77b5fd4f1d66dcb672f1365ba
Version bump
setup.py
setup.py
# -*- coding: utf-8 -*- from __future__ import print_function try: from setuptools import setup, find_packages, Extension except ImportError: from distutils.core import setup, Extension def find_packages(): return ['treeCl', 'treeCl.interfacing', 'treeCl.tasks', 'treeCl.utils'] from Cython.Distutils import build_ext import pkg_resources import platform import re import subprocess # Facilities to install properly on Mac using clang def is_clang(bin): proc = subprocess.Popen([bin, '-v'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = proc.communicate() output = str(b'\n'.join([stdout, stderr]).decode('ascii', 'ignore')) return not re.search(r'clang', output) is None class my_build_ext(build_ext): def build_extensions(self): binary = self.compiler.compiler[0] if is_clang(binary): for e in self.extensions: e.extra_compile_args.append('-stdlib=libc++') if platform.system() == 'Darwin': e.extra_compile_args.append('-mmacosx-version-min=10.7') e.extra_link_args.append('-mmacosx-version-min=10.7') build_ext.build_extensions(self) compile_args = ['-std=c++11'] extensions = [ Extension(name='tree_collection', sources=[ 'extensions/tree_collection/cython/py_wrapper.pyx', 'extensions/tree_collection/src/ProblemParser.cc', 'extensions/tree_collection/src/MinSqTree.cc', 'extensions/tree_collection/src/newick.cc', ], language='c++', include_dirs=['extensions/tree_collection/src/eigen3'], extra_compile_args=compile_args, ), ] # Install splash VERSION = '0.1.22' logo = """ ═══════════ ╔═╗┬ ┌┬┐┬─┐┌─┐┌─┐║ │ │ ├┬┘├┤ ├┤ ╚═╝┴─┘ ┴ ┴└─└─┘└─┘╭───── ┈┈┈┈┈┈┄┄┄┄┄─┤ ╭── {versionfmt}╰──┤ ══════════════ ╰── """.format(versionfmt=VERSION.center(12)) print(logo) setup(name="treeCl", version=VERSION, author='Kevin Gori', author_email='kgori@ebi.ac.uk', description='Phylogenetic Clustering Package', url='https://github.com/kgori/treeCl.git', packages=find_packages(), include_package_data=True, package_data={ 'treeCl': ['logging/logging.yaml'] }, scripts=[ # 'bin/simulator', 'bin/collapse', # 'bin/treeCl', # 'bin/seqconvert', 'bin/bootstrap', # 'bin/npbs.py', # 'bin/pre_npbs.py', ], install_requires=[ 'biopython', 'cython>=0.19.0', 'dendropy>=4.0.0', 'fastcluster', 'futures', 'ipython', 'matplotlib', 'nose', 'numpy', 'pandas', 'phylo_utils', 'progressbar-latest==2.4', 'PyYaml', 'scipy', 'scikit-bio==0.4.2', 'scikit-learn', 'tree_distance>=1.0.5', ], cmdclass={'build_ext': my_build_ext}, ext_modules=extensions, test_suite='tests', )
Python
0.000001
@@ -1784,17 +1784,17 @@ = '0.1.2 -2 +3 '%0A%0Alogo @@ -2999,9 +2999,9 @@ 1.0. -5 +6 ',%0A
43dc6dc0a9b33de0db1f79f7470d69519192dc1f
Put tests_require into extras_require also
setup.py
setup.py
from setuptools import setup, find_packages try: import nose.commands extra_args = dict( cmdclass={'test': nose.commands.nosetests}, ) except ImportError: extra_args = dict() setup( name='dear_astrid', version='0.1.0', author='Randy Stauner', author_email='randy@magnificent-tears.com', packages=find_packages(), #['dear_astrid', 'dear_astrid.test'], #scripts=['bin/dear_astrid.py'], url='http://github.com/rwstauner/dear_astrid/', license='MIT', description='Migrate tasks from Astrid backup xml', long_description=open('README.rst').read(), install_requires=[ 'pyrtm>=0.4.1', ], setup_requires=['nose>=1.0'], tests_require=[ 'nose', 'mock', ], **extra_args )
Python
0.000001
@@ -182,16 +182,183 @@ dict()%0A%0A +# TODO: would this work? (is the file included in the dist?)%0A#tests_require = %5Bl.strip() for l in open('test-requirements.txt').readlines()%5D%0Atests_require = %5B'mock'%5D%0A%0A setup(%0A @@ -841,37 +841,73 @@ ire= -%5B%0A 'nose',%0A 'mock' +tests_require,%0A%0A extras_require=%7B%0A 'test': tests_require ,%0A -%5D +%7D ,%0A%0A
1c2e79fb67fb2d71e1d8714f47552af3b442fda8
bump version to 1.0.6
setup.py
setup.py
try: from setuptools import setup except ImportError: raise ImportError( "setuptools module required, please go to " "https://pypi.python.org/pypi/setuptools and follow the instructions " "for installing setuptools" ) with open("README.md", "r") as fh: long_description = fh.read() setup( name='python-geosupport', version='1.0.5', url='https://github.com/ishiland/python-geosupport', description='Python bindings for NYC Geosupport Desktop Edition', long_description=long_description, long_description_content_type='text/markdown', author='Ian Shiland, Jeremy Neiman', author_email='ishiland@gmail.com', packages=['geosupport'], include_package_data=True, license='MIT', keywords=['NYC', 'geocoder', 'python-geosupport', 'geosupport'], classifiers=[ 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ], test_suite="tests", extras_require={ 'dev': [ 'coverage', 'invoke>=1.1.1', 'nose' ] } )
Python
0
@@ -373,17 +373,17 @@ on='1.0. -5 +6 ',%0A u
8ebb408c23038ac3a003727cb907ff23dd02e130
Set long_description_content_type in setup.py
setup.py
setup.py
# coding: utf-8 # # Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com> # Copyright 2012 Google, Inc & contributors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import importlib.util import sys import os import os.path from platform import machine from setuptools import setup, find_packages from setuptools.extension import Extension from setuptools.command.build_ext import build_ext SRC_DIR = 'src' WATCHDOG_PKG_DIR = os.path.join(SRC_DIR, 'watchdog') # Load the module version spec = importlib.util.spec_from_file_location( 'version', os.path.join(WATCHDOG_PKG_DIR, 'version.py')) version = importlib.util.module_from_spec(spec) spec.loader.exec_module(version) # Ignored Apple devices on which compiling watchdog_fsevents.c would fail. # The FORCE_MACOS_MACHINE envar, when set to 1, will force the compilation. _apple_devices = ('appletv', 'iphone', 'ipod', 'ipad', 'watch') is_macos = sys.platform == 'darwin' and not machine().lower().startswith(_apple_devices) ext_modules = [] if is_macos or os.getenv('FORCE_MACOS_MACHINE', '0') == '1': ext_modules = [ Extension( name='_watchdog_fsevents', sources=[ 'src/watchdog_fsevents.c', ], libraries=['m'], define_macros=[ ('WATCHDOG_VERSION_STRING', '"' + version.VERSION_STRING + '"'), ('WATCHDOG_VERSION_MAJOR', version.VERSION_MAJOR), ('WATCHDOG_VERSION_MINOR', version.VERSION_MINOR), ('WATCHDOG_VERSION_BUILD', version.VERSION_BUILD), ], extra_link_args=[ '-framework', 'CoreFoundation', '-framework', 'CoreServices', ], extra_compile_args=[ '-std=c99', '-pedantic', '-Wall', '-Wextra', '-fPIC', # Issue #620 '-Wno-nullability-completeness', # Issue #628 '-Wno-nullability-extension', '-Wno-newline-eof', # required w/Xcode 5.1+ and above because of '-mno-fused-madd' '-Wno-error=unused-command-line-argument' ] ), ] extras_require = { 'watchmedo': ['PyYAML>=3.10', 'argh>=0.24.1'], } with open('README.rst', encoding='utf-8') as f: readme = f.read() with open('changelog.rst', encoding='utf-8') as f: changelog = f.read() setup(name="watchdog", version=version.VERSION_STRING, description="Filesystem events monitoring", long_description=readme + '\n\n' + changelog, author="Yesudeep Mangalapilly", author_email="yesudeep@gmail.com", license="Apache License 2.0", url="https://github.com/gorakhargosh/watchdog", keywords=' '.join([ 'python', 'filesystem', 'monitoring', 'monitor', 'FSEvents', 'kqueue', 'inotify', 'ReadDirectoryChangesW', 'polling', 'DirectorySnapshot', ]), classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: Apache Software License', 'Natural Language :: English', 'Operating System :: POSIX :: Linux', 'Operating System :: MacOS :: MacOS X', 'Operating System :: POSIX :: BSD', 'Operating System :: Microsoft :: Windows :: Windows Vista', 'Operating System :: Microsoft :: Windows :: Windows 7', 'Operating System :: Microsoft :: Windows :: Windows 8', 'Operating System :: Microsoft :: Windows :: Windows 8.1', 'Operating System :: Microsoft :: Windows :: Windows 10', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3 :: Only', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: Implementation :: PyPy', 'Programming Language :: C', 'Topic :: Software Development :: Libraries', 'Topic :: System :: Monitoring', 'Topic :: System :: Filesystems', 'Topic :: Utilities', ], package_dir={'': SRC_DIR}, packages=find_packages(SRC_DIR), include_package_data=True, extras_require=extras_require, cmdclass={ 'build_ext': build_ext, }, ext_modules=ext_modules, entry_points={'console_scripts': [ 'watchmedo = watchdog.watchmedo:main [watchmedo]', ]}, python_requires='>=3.6', zip_safe=False )
Python
0
@@ -3137,16 +3137,66 @@ ngelog,%0A + long_description_content_type=%22text/x-rst%22,%0A au
797d2ea521b40bbbdab5430f1d08dbb3e5fb1eb1
Fix repo URL in setup.py
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Setup script for the pyasdf module. :copyright: Lion Krischer (krischer@geophysik.uni-muenchen.de), 2014 :license: BSD 3-Clause ("BSD New" or "BSD Simplified") """ import inspect import os from setuptools import setup, find_packages def get_package_data(): """ Returns a list of all files needed for the installation relative to the 'pyasdf' subfolder. """ filenames = [] # The lasif root dir. root_dir = os.path.join(os.path.dirname(os.path.abspath( inspect.getfile(inspect.currentframe()))), "pyasdf") # Recursively include all files in these folders: folders = [os.path.join(root_dir, "tests", "data")] for folder in folders: for directory, _, files in os.walk(folder): for filename in files: # Exclude hidden files. if filename.startswith("."): continue filenames.append(os.path.relpath( os.path.join(directory, filename), root_dir)) return filenames setup_config = dict( name="pyasdf", version="0.0.1a", description="Module for creating and processing ASDF files.", author="Lion Krischer", author_email="krischer@geophysik.uni-muenchen.de", url="http: //github.com/SeismicData/pyasdf", packages=find_packages(), license="BSD", platforms="OS Independent", install_requires=["numpy", "obspy>=0.10.1", "h5py", "colorama", "pytest", "flake8", "prov"], extras_require={"mpi": ["mpi4py"]}, package_data={ "pyasdf": get_package_data()}, ) if __name__ == "__main__": setup(**setup_config)
Python
0.000001
@@ -1316,18 +1316,18 @@ rl=%22http +s : - //github
dbf1da4da04fd926e96e1f370efb938e99cbec05
Bump version patch level
setup.py
setup.py
import warnings try: from Cython.Distutils import build_ext from setuptools import setup, Extension HAVE_CYTHON = True except ImportError as e: warnings.warn(e.message) from setuptools import setup, Extension from setuptools.command.build_ext import build_ext HAVE_CYTHON = False import numpy _hdbscan_tree = Extension('hdbscan._hdbscan_tree', sources=['hdbscan/_hdbscan_tree.pyx'], include_dirs=[numpy.get_include()]) _hdbscan_linkage = Extension('hdbscan._hdbscan_linkage', sources=['hdbscan/_hdbscan_linkage.pyx'], include_dirs=['hdbscan', numpy.get_include()]) _hdbscan_boruvka = Extension('hdbscan._hdbscan_boruvka', sources=['hdbscan/_hdbscan_boruvka.pyx'], include_dirs=['hdbscan', numpy.get_include()]) _hdbscan_reachability = Extension('hdbscan._hdbscan_reachability', sources=['hdbscan/_hdbscan_reachability.pyx'], include_dirs=[numpy.get_include()]) dist_metrics = Extension('hdbscan.dist_metrics', sources=['hdbscan/dist_metrics.pyx'], include_dirs=[numpy.get_include()]) def readme(): with open('README.rst') as readme_file: return readme_file.read() configuration = { 'name' : 'hdbscan', 'version' : '0.8', 'description' : 'Clustering based on density with variable density clusters', 'long_description' : readme(), 'classifiers' : [ 'Development Status :: 3 - Alpha', 'Intended Audience :: Science/Research', 'Intended Audience :: Developers', 'License :: OSI Approved', 'Programming Language :: C', 'Programming Language :: Python', 'Topic :: Software Development', 'Topic :: Scientific/Engineering', 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX', 'Operating System :: Unix', 'Operating System :: MacOS', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.4', ], 'keywords' : 'cluster clustering density hierarchical', 'url' : 'http://github.com/lmcinnes/hdbscan', 'maintainer' : 'Leland McInnes', 'maintainer_email' : 'leland.mcinnes@gmail.com', 'license' : 'BSD', 'packages' : ['hdbscan'], 'install_requires' : ['scikit-learn>=0.16', 'cython >= 0.17'], 'ext_modules' : [_hdbscan_tree, _hdbscan_linkage, _hdbscan_boruvka, _hdbscan_reachability, dist_metrics], 'cmdclass' : {'build_ext' : build_ext}, 'test_suite' : 'nose.collector', 'tests_require' : ['nose'], } if not HAVE_CYTHON: _hdbscan_tree.sources[0] = '_hdbscan_tree.c' _hdbscan_linkage.sources[0] = '_hdbscan_linkage.c' configuration['install_requires'] = ['scikit-learn>=0.16'] setup(**configuration)
Python
0
@@ -1450,16 +1450,18 @@ ' : '0.8 +.1 ',%0A '
7519e8c1a5e97aa65968e3fad4c500d39328f74b
bump version
setup.py
setup.py
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from setuptools.extension import Extension from Cython.Build import cythonize import numpy as np import io PACKAGE_NAME = 'pysaliency' VERSION = '0.2.1' DESCRIPTION = 'A Python Framework for Saliency Modeling and Evaluation' AUTHOR = 'Matthias Kümmerer' EMAIL = 'matthias.kuemmerer@bethgelab.org' URL = "https://github.com/matthiask/pysaliency" from os import path try: this_directory = path.abspath(path.dirname(__file__)) with io.open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read() except IOError: long_description = '' extensions = [ Extension("pysaliency.roc", ['pysaliency/*.pyx'], include_dirs = [np.get_include()], extra_compile_args = ['-fopenmp', '-O3'], extra_link_args=["-fopenmp"]), ] setup( name = PACKAGE_NAME, version = VERSION, description = 'python library to develop, evaluate and benchmark saliency models', long_description = long_description, long_description_content_type='text/markdown', classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Scientific/Engineering", ], packages = find_packages(), author = AUTHOR, author_email = EMAIL, url = URL, license = 'MIT', install_requires=[ 'boltons', 'imageio', 'natsort', 'numba', 'numpy', 'requests', 'scipy', 'setuptools', 'tqdm', ], include_package_data = True, package_data={'pysaliency': ['scripts/*.m', 'scripts/models/*.m', 'scripts/models/*/*.m', 'scripts/models/*/*/*', 'scripts/models/BMS/patches/*', 'scripts/models/GBVS/patches/*', 'scripts/models/Judd/patches/*', ]}, ext_modules = cythonize(extensions), )
Python
0
@@ -218,9 +218,9 @@ 0.2. -1 +2 '%0ADE
d214fbfacd52d64ac9ad742a2af0047f5fb0a115
update version to trigger build
setup.py
setup.py
from setuptools import setup, find_packages import os with open("README.md", "r") as fh: long_description = fh.read() setup(name='donkeycar', version='2.5.2', description='Self driving library for python.', long_description=long_description, long_description_content_type="text/markdown", url='https://github.com/autorope/donkeycar', download_url='https://github.com/autorope/donkeycar/archive/2.1.5.tar.gz', author='Will Roscoe', author_email='wroscoe@gmail.com', license='MIT', entry_points={ 'console_scripts': [ 'donkey=donkeycar.management.base:execute_from_command_line', ], }, install_requires=['numpy', 'pillow', 'docopt', 'tornado==4.5.3', 'requests', 'h5py', 'python-socketio', 'flask', 'eventlet', 'moviepy', 'pandas', ], extras_require={ 'tf': ['tensorflow>=1.9.0'], 'tf_gpu': ['tensorflow-gpu>=1.9.0'], 'pi': [ 'picamera', 'Adafruit_PCA9685', ], 'dev': [ 'pytest', 'pytest-cov', 'responses' ], 'ci': ['codecov'] }, include_package_data=True, classifiers=[ # How mature is this project? Common values are # 3 - Alpha # 4 - Beta # 5 - Production/Stable 'Development Status :: 3 - Alpha', # Indicate who your project is intended for 'Intended Audience :: Developers', 'Topic :: Scientific/Engineering :: Artificial Intelligence', # Pick your license as you wish (should match "license" above) 'License :: OSI Approved :: MIT License', # Specify the Python versions you support here. In particular, ensure # that you indicate whether you support Python 2, Python 3 or both. 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', ], keywords='selfdriving cars donkeycar diyrobocars', packages=find_packages(exclude=(['tests', 'docs', 'site', 'env'])), )
Python
0
@@ -162,17 +162,17 @@ on='2.5. -2 +5 ',%0A
e31b93d1fdda810d70d3050c73c6638b29219d12
Increase the allowed version of aniso8601 (#1072)
setup.py
setup.py
import ast import codecs import re import sys from setuptools import find_packages, setup from setuptools.command.test import test as TestCommand _version_re = re.compile(r"VERSION\s+=\s+(.*)") with open("graphene/__init__.py", "rb") as f: version = ast.literal_eval(_version_re.search(f.read().decode("utf-8")).group(1)) path_copy = sys.path[:] sys.path.append("graphene") try: from pyutils.version import get_version version = get_version(version) except Exception: version = ".".join([str(v) for v in version]) sys.path[:] = path_copy class PyTest(TestCommand): user_options = [("pytest-args=", "a", "Arguments to pass to py.test")] def initialize_options(self): TestCommand.initialize_options(self) self.pytest_args = [] def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): # import here, cause outside the eggs aren't loaded import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) tests_require = [ "pytest", "pytest-benchmark", "pytest-cov", "pytest-mock", "pytest-asyncio", "snapshottest", "coveralls", "promise", "six", "mock", "pytz", "iso8601", ] setup( name="graphene", version=version, description="GraphQL Framework for Python", long_description=codecs.open( "README.rst", "r", encoding="ascii", errors="replace" ).read(), url="https://github.com/graphql-python/graphene", author="Syrus Akbary", author_email="me@syrusakbary.com", license="MIT", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Topic :: Software Development :: Libraries", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", ], keywords="api graphql protocol rest relay graphene", packages=find_packages(exclude=["tests", "tests.*", "examples"]), install_requires=[ "graphql-core>=3.0.0a0,<4", "graphql-relay>=3.0.0a0,<4", "aniso8601>=6,<8", ], tests_require=tests_require, extras_require={"test": tests_require}, cmdclass={"test": PyTest}, )
Python
0
@@ -2159,17 +2159,17 @@ 601%3E=6,%3C -8 +9 %22,%0A %5D
9031637554fa0b844f33d208d2527825fdd629fc
Update pypi classifiers.
setup.py
setup.py
#!/usr/bin/env python import sys from admin_honeypot import __version__, __description__, __license__ try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup, find_packages setup( name='django-admin-honeypot', version=__version__, description=__description__, long_description=open('./README.rst', 'r').read(), classifiers=[ 'Development Status :: 5 - Production/Stable', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', '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.2', 'Programming Language :: Python :: 3.3', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], keywords='django admin honeypot trap', maintainer='Derek Payton', maintainer_email='derek.payton@gmail.com', url='https://github.com/dmpayton/django-admin-honeypot', download_url='https://github.com/dmpayton/django-admin-honeypot/tarball/v%s' % __version__, license=__license__, include_package_data=True, packages=find_packages(), zip_safe=False, )
Python
0
@@ -796,9 +796,9 @@ : 2. -6 +7 ',%0A @@ -831,35 +831,33 @@ ge :: Python :: -2.7 +3 ',%0A 'Prog @@ -878,32 +878,34 @@ ge :: Python :: +3. 3',%0A 'Pro @@ -937,17 +937,17 @@ on :: 3. -2 +4 ',%0A @@ -978,33 +978,33 @@ :: Python :: 3. -3 +5 ',%0A 'Topi
f1c87e5e4a5f948e17024b2d6bf90026bb70aaa4
version 0.3
setup.py
setup.py
from setuptools import setup setup(name='tropopause', version='0.2', description='Extra utilities for troposphere', classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2.7', ], url='http://github.com/adragomir/tropopause', author='Andrei Dragomir', author_email='adragomir@gmail.com', license='MIT', packages=['tropopause'], install_requires=[ 'troposphere', 'awacs' ], zip_safe=True)
Python
0.000001
@@ -65,17 +65,17 @@ sion='0. -2 +3 ',%0A
a387f0f91bd7fa8a86401de5060b073f1e9b2e82
fix packages in setup.py for PyPI
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages from glob import glob name = "jcvi" classifiers = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Topic :: Scientific/Engineering :: Bio-Informatics', ] setup( name=name, version='0.4.7', author='Haibao Tang', author_email='tanghaibao@gmail.com', package_dir={name: '.'}, packages=[x for x in find_packages("../") if x.split('.')[0] == name], include_package_data=True, data_files=[(name + '/data', glob("data/*"))], classifiers=classifiers, zip_safe=False, license='BSD', url='http://github.com/tanghaibao/jcvi', description='Python utility libraries on genome assembly, '\ 'annotation and comparative genomics', long_description=open("README.rst").read(), install_requires=['biopython', 'numpy', 'matplotlib'] )
Python
0
@@ -558,66 +558,61 @@ es=%5B -x for x in find_packages(%22../%22) if x.split('.')%5B0%5D == name +name%5D + %5B'.'.join((name, x)) for x in find_packages() %5D,%0A
0801bdf14ede5d10b75d9adb39d0083f32d52c2f
version bump
setup.py
setup.py
from setuptools import setup setup( name='pyinapp', version='0.1.3', packages=['pyinapp'], install_requires=['rsa', 'requests'], description="InApp purchase validation API wrappers", keywords='inapp store purchase googleplay appstore market', author='Ivan Mukhin', author_email='muhin.ivan@gmail.com', url='https://github.com/keeprocking/pyinapp', long_description=open('README.rst').read(), license='MIT' )
Python
0.000001
@@ -72,9 +72,9 @@ 0.1. -3 +4 ',%0A
f428dace08e11cdba34767dea989380fa6d4e423
Add long_description
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup requires = [ 'mecab-python3', ] setup( name='miura', version='0.1.0', description='MIURA: pattern matcher for morpheme sequences', author='Yuya Unno', author_email='unnonouno@gmail.com', url='https://github.com/unnonouno/miura', packages=['miura', ], scripts=[ 'command/miura', ], install_requires=requires, license='MIT', test_suite='test', classifiers = [ 'Operating System :: OS Independent', 'Environment :: Console', 'Programming Language :: Python', 'License :: OSI Approved :: MIT License', 'Development Status :: 2 - Pre-Alpha', 'Intended Audience :: Information Technology', 'Intended Audience :: Science/Research', 'Topic :: Utilities', ], )
Python
0.001235
@@ -16,16 +16,26 @@ python%0A%0A +import os%0A from set @@ -97,16 +97,103 @@ %0A %5D%0A%0A +def read(name):%0A return open(os.path.join(os.path.dirname(__file__), name)).read()%0A%0A setup(%0A @@ -291,24 +291,65 @@ sequences',%0A + long_description=read('README.rst'),%0A author='
d24daa18023d0d59d70a4328466613f3a03de039
add tests_require packages
setup.py
setup.py
import codecs from os import path from setuptools import find_packages, setup def read(*parts): filename = path.join(path.dirname(__file__), *parts) with codecs.open(filename, encoding="utf-8") as fp: return fp.read() setup( author="", author_email="", description="", name="pinax-comments", long_description=read("README.rst"), version="0.1", url="http://github.com/pinax/pinax-comments/", license="MIT", install_requires=[ "django-appconf>=1.0.1" ], packages=find_packages(), package_data={ "comments": [] }, test_suite="runtests.runtests", tests_require=[ ], classifiers=[ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules", ], zip_safe=False )
Python
0.000001
@@ -506,16 +506,17 @@ %3E=1.0.1%22 +, %0A %5D,%0A @@ -650,16 +650,124 @@ quire=%5B%0A + %22django-test-plus%3E=1.0.11%22,%0A %22django-appconf%3E=1.0.1%22,%0A %22django-user-accounts%3E=1.3.1%22,%0A %5D,%0A
97dde7daf96211278d039a764c4203df39bea77d
Implement next to satisfy Iterator interface
uplink/clients/io/interfaces.py
uplink/clients/io/interfaces.py
# Standard library imports import collections class IllegalRequestStateTransition(RuntimeError): """An improper request state transition was attempted.""" def __init__(self, state, transition): self._state = state self._transition = transition def __str__(self): return ( "Illegal transition [%s] from request state [%s]: this is " "possibly due to a badly designed RequestTemplate." % (self._transition, self._state) ) class SendCallback(object): """ Callbacks to continue the running request execution after sending the request. """ def on_success(self, response): """ Handles a successful request. Args: response: The server's response. """ raise NotImplementedError def on_failure(self, exc_type, exc_val, exc_tb): """ Handles a failed request. Args: exc_type: The exception class. exc_val: The exception object. exc_tb: The exception's stacktrace. """ raise NotImplementedError class SleepCallback(object): """ Callbacks to continue the running request execution after an intended pause. """ def on_success(self): """Handles a successful pause.""" raise NotImplementedError def on_failure(self, exc_type, exc_val, exc_tb): """ Handles a failed pause. Args: exc_type: The exception class. exc_val: The exception object. exc_tb: The exception's stacktrace. """ raise NotImplementedError class Executable(collections.Iterator): """An abstraction for iterating over the execution of a request.""" def __next__(self): return self.execute() def execute(self): """Start or continue the request's execution.""" raise NotImplementedError class ExecutionContext(Executable): """A state machine representing the execution lifecycle of a request.""" @property def state(self): """The current state of the request.""" raise NotImplementedError def send(self, request, callback): """ Sends the given request. Args: request: The intended request data to be sent. callback (SendCallback): A callback that resumes execution after the request is sent. """ raise NotImplementedError def sleep(self, duration, callback): """ Pauses the execution for the allotted duration. Args: duration: The number of seconds to delay execution. callback (:obj:`SleepCallback`): A callback that resumes execution after the delay. """ raise NotImplementedError def finish(self, response): """ Completes the execution. Args: response: The object to return to the execution's invoker. """ raise NotImplementedError def fail(self, exc_type, exc_val, exc_tb): """ Fails the execution with a specific error. Args: exc_type: The exception class. exc_val: The exception object. exc_tb: The exception's stacktrace. """ raise NotImplementedError def execute(self): """Performs the next sequence of steps in the execution.""" raise NotImplementedError def before_request(self, request): """Handles transitioning the execution before the request is sent.""" raise NotImplementedError def after_response(self, request, response): """Handles transitioning the execution after a successful request.""" raise NotImplementedError def after_exception(self, request, exc_type, exc_val, exc_tb): """Handles transitioning the execution after a failed request.""" raise NotImplementedError class RequestState(object): @property def request(self): raise NotImplementedError def send(self, request): raise IllegalRequestStateTransition(self, "send") def prepare(self, request): raise IllegalRequestStateTransition(self, "prepare") def sleep(self, duration): raise IllegalRequestStateTransition(self, "sleep") def finish(self, response): raise IllegalRequestStateTransition(self, "finish") def fail(self, exc_type, exc_val, exc_tb): raise IllegalRequestStateTransition(self, "fail") def execute(self, context): raise NotImplementedError class RequestTemplate(object): """ Hooks for managing the lifecycle of a request. To modify behavior of a specific part of the request, override the appropriate hook and return the intended transition from :mod:`uplink.clients.io.transitions`. To fallback to the default behavior, either don't override the hook or return :obj:`None` instead, in case of conditional overrides (e.g., retry the request if it has failed less than a certain number of times). """ def before_request(self, request): """ Handles the request before it is sent. Args: request: The prospective request data. Returns: ``None`` or a transition from :mod:`uplink.clients.io.transitions`. """ def after_response(self, request, response): """ Handles the response after a successful request. Args: request: The data sent to the server. response: The response returned by server. Returns: ``None`` or a transition from :mod:`uplink.clients.io.transitions`. """ def after_exception(self, request, exc_type, exc_val, exc_tb): """ Handles the error after a failed request. Args: request: The attempted request. exc_type: The exception class. exc_val: The exception object. exc_tb: The exception's stacktrace. Returns: ``None`` or a transition from :mod:`uplink.clients.io.transitions`. """ class Client(object): """An HTTP Client implementation.""" def send(self, request): """ Sends the given request. Args: request: The intended request data to be sent. """ raise NotImplementedError class ExecutionStrategy(object): """An adapter for a specific I/O model.""" def send(self, client, request, callback): """ Sends the given request using the provided client. Args: client (Client): An HTTP client that should abide by the I/O framework of this strategy. request: The intended request data to be sent. callback (:obj:`SendCallback`): A callback that resumes execution after the request is sent. """ raise NotImplementedError def sleep(self, duration, callback): """ Pauses the execution for the allotted duration. Args: duration: The number of seconds to delay execution. callback (:obj:`SleepCallback`): A callback that resumes execution after the delay. """ raise NotImplementedError def finish(self, response): """ Completes the execution. Args: response: The object to return to the execution's invoker. """ raise NotImplementedError def fail(self, exc_type, exc_val, exc_tb): """ Fails the execution with a specific error. Args: exc_type: The exception class. exc_val: The exception object. exc_tb: The exception's stacktrace. """ # TODO: Reraise properly raise exc_val def execute(self, executable): """ Runs a request's execution to completion using the I/O framework of this strategy. """ raise NotImplementedError
Python
0
@@ -1816,16 +1816,37 @@ cute()%0A%0A + next = __next__%0A%0A def
4b0ed8b6030450e6d99909a7c683e9642e546387
fix test_remove_watch_file flakiness
urwid/tests/test_event_loops.py
urwid/tests/test_event_loops.py
import os import unittest import platform import urwid from urwid.compat import PYTHON3 class EventLoopTestMixin(object): def test_event_loop(self): rd, wr = os.pipe() evl = self.evl out = [] def step1(): out.append("writing") os.write(wr, "hi".encode('ascii')) def step2(): out.append(os.read(rd, 2).decode('ascii')) raise urwid.ExitMainLoop handle = evl.alarm(0, step1) handle = evl.watch_file(rd, step2) evl.run() self.assertEqual(out, ["writing", "hi"]) def test_remove_alarm(self): evl = self.evl handle = evl.alarm(50, lambda: None) self.assertTrue(evl.remove_alarm(handle)) self.assertFalse(evl.remove_alarm(handle)) def test_remove_watch_file(self): evl = self.evl handle = evl.watch_file(5, lambda: None) self.assertTrue(evl.remove_watch_file(handle)) self.assertFalse(evl.remove_watch_file(handle)) _expected_idle_handle = 1 def test_run(self): evl = self.evl out = [] rd, wr = os.pipe() self.assertEqual(os.write(wr, "data".encode('ascii')), 4) def say_hello(): out.append("hello") def say_waiting(): out.append("waiting") def exit_clean(): out.append("clean exit") raise urwid.ExitMainLoop def exit_error(): 1/0 handle = evl.alarm(0.01, exit_clean) handle = evl.alarm(0.005, say_hello) idle_handle = evl.enter_idle(say_waiting) if self._expected_idle_handle is not None: self.assertEqual(idle_handle, 1) evl.run() self.assertTrue("hello" in out, out) self.assertTrue("clean exit"in out, out) handle = evl.watch_file(rd, exit_clean) del out[:] evl.run() self.assertEqual(out, ["clean exit"]) self.assertTrue(evl.remove_watch_file(handle)) handle = evl.alarm(0, exit_error) self.assertRaises(ZeroDivisionError, evl.run) handle = evl.watch_file(rd, exit_error) self.assertRaises(ZeroDivisionError, evl.run) class SelectEventLoopTest(unittest.TestCase, EventLoopTestMixin): def setUp(self): self.evl = urwid.SelectEventLoop() try: import gi.repository except ImportError: pass else: class GLibEventLoopTest(unittest.TestCase, EventLoopTestMixin): def setUp(self): self.evl = urwid.GLibEventLoop() try: import tornado except ImportError: pass else: class TornadoEventLoopTest(unittest.TestCase, EventLoopTestMixin): def setUp(self): from tornado.ioloop import IOLoop self.evl = urwid.TornadoEventLoop(IOLoop()) try: import twisted except ImportError: pass else: class TwistedEventLoopTest(unittest.TestCase, EventLoopTestMixin): def setUp(self): self.evl = urwid.TwistedEventLoop() # can't restart twisted reactor, so use shortened tests def test_event_loop(self): pass def test_run(self): evl = self.evl out = [] rd, wr = os.pipe() self.assertEqual(os.write(wr, "data".encode('ascii')), 4) def step2(): out.append(os.read(rd, 2).decode('ascii')) def say_hello(): out.append("hello") def say_waiting(): out.append("waiting") def exit_clean(): out.append("clean exit") raise urwid.ExitMainLoop def exit_error(): 1/0 handle = evl.watch_file(rd, step2) handle = evl.alarm(0.01, exit_clean) handle = evl.alarm(0.005, say_hello) self.assertEqual(evl.enter_idle(say_waiting), 1) evl.run() self.assertTrue("da" in out, out) self.assertTrue("ta" in out, out) self.assertTrue("hello" in out, out) self.assertTrue("clean exit" in out, out) try: import asyncio except ImportError: pass else: class AsyncioEventLoopTest(unittest.TestCase, EventLoopTestMixin): def setUp(self): self.evl = urwid.AsyncioEventLoop() _expected_idle_handle = None
Python
0
@@ -835,32 +835,80 @@ evl = self.evl%0A + fd_r, fd_w = os.pipe()%0A try:%0A handle = @@ -923,17 +923,20 @@ ch_file( -5 +fd_r , lambda @@ -935,32 +935,36 @@ , lambda: None)%0A + self.ass @@ -1002,32 +1002,36 @@ andle))%0A + + self.assertFalse @@ -1057,24 +1057,95 @@ ile(handle)) +%0A finally:%0A os.close(fd_r)%0A os.close(fd_w) %0A%0A _expec
a61b79a6d427745f3bf240554b3dd852d8e6ed65
Add classifiers
setup.py
setup.py
from distutils.core import setup setup(name='Fridge', version='0.1', py_modules=['fridge'], description='Persistent JSON-encoded distionary', author='Anton Barkovsky', author_email='swarmer.pm@gmail.com', url='http://fridge.readthedocs.org/')
Python
0.000907
@@ -284,10 +284,515 @@ cs.org/' +,%0A classifiers=%5B%0A 'Development Status :: 3 - Alpha',%0A 'Intended Audience :: Developers',%0A 'License :: OSI Approved :: MIT License',%0A 'Operating System :: OS Independent',%0A 'Programming Language :: Python :: 2',%0A 'Programming Language :: Python :: 2.7',%0A 'Programming Language :: Python :: 3',%0A 'Programming Language :: Python :: 3.2',%0A 'Topic :: Software Development :: Libraries :: Python Modules'%5D )%0A
59608bca60edc3414f875c0238fabb5be10de759
version bump
setup.py
setup.py
from setuptools import setup setup( name='polygon-cli', version='1.0.5', packages=['polygon_cli', 'polygon_cli.actions'], url='https://github.com/kunyavskiy/polygon-cli', license='MIT', author='Pavel Kunyavskiy', author_email='kunyavskiy@gmail.com', description='Commandline tool for polygon', install_requires=['colorama', 'requests', 'prettytable'], entry_points={ 'console_scripts': [ 'polygon-cli=polygon_cli:main' ], } )
Python
0.000001
@@ -83,9 +83,9 @@ 1.0. -5 +6 ',%0A
1ad53aaf27ce8dda87298d35b6d7d4bf6862c420
remove debug output
State.py
State.py
# -*- coding: utf-8 -*- from utils import * from Song import Song def loadQueue(state): print "load queue" def songs(): if state.curSong: # We just started the player and we have a current song from persistent storage. # Yield it now so that we begin playing with this song. # Yield the Song object itself, though, not the ObjectProxy. The ObjectProxy # would result in very strange behavior later for onSongChange events. song = state.curSong.__get__(None) song.openFile() yield song import queue while True: song = queue.getNextSong() song.openFile() yield song return songs() from collections import deque class RecentlyplayedList: Limit = 500 def __init__(self, list=[], previous=None, index=0): self.index = index self.list = deque(list) self.previous = None def append(self, song): if not song: return self.list.append(song) if len(self.list) >= self.Limit: newList = PersistentObject(RecentlyplayedList, "recentlyplayed-%i.dat" % self.index, persistentRepr=True) newList.index = self.index newList.list = self.list newList.previous = self.previous newList.save() self.index += 1 self.previous = newList self.list = deque() def getLastN(self, n): #return list(self.list)[-n:] # not using this for now as a bit too heavy. I timeit'd it. this is 14 times slower for n=10, len(l)=10000 l = self.list # better for multithreading to keep the ref return [l[-i] for i in range(1,min(len(l),n)+1)] def __repr__(self): return "RecentlyplayedList(list=%s, previous=%s, index=%i)" % ( betterRepr(self.list), betterRepr(self.previous), self.index) class Actions: def play(self): state.player.playing = True def pause(self): state.player.playing = False def next(self): state.player.nextSong() def forward10s(self): state.player.seekRel(10) actions = Actions() from player import loadPlayer, PlayerEventCallbacks import Traits class State(object): def playPauseUpdate(self, attrib, *args): if self.player.playing: attrib.name = "❚❚" else: attrib.name = "▶" @UserAttrib(type=Traits.Action, name="▶", updateHandler=playPauseUpdate) def playPause(self): self.player.playing = not self.player.playing @UserAttrib(type=Traits.Action, name="▶▶|", alignRight=True) def nextSong(self): print "state nextSong" self.player.nextSong() print "state nextSong finish" @UserAttrib(type=Traits.OneLineText, updateHandler=lambda *args:None, alignRight=True, variableWidth=True) @property def curSongStr(self): if not self.player.curSong: return "" try: return self.player.curSong.userString except: return "???" @UserAttrib(type=Traits.OneLineText, updateHandler=lambda *args:None, alignRight=True) @property def curSongPos(self): if not self.player.curSong: return "" try: return formatTime(self.player.curSongPos) + " / " + formatTime(self.player.curSong.duration) except: return "???" @UserAttrib(type=Traits.SongDisplay) def curSongDisplay(self): pass @UserAttrib(type=Traits.List) @initBy def recentlyPlayedList(self): return PersistentObject(RecentlyplayedList, "recentlyplayed.dat") @UserAttrib(type=Traits.Object, updateHandler=lambda *args:None) @initBy def curSong(self): return PersistentObject(Song, "cursong.dat") @UserAttrib(type=Traits.List) @initBy def queue(self): return loadQueue(self) @initBy def updates(self): return OnRequestQueue() @initBy def player(self): return loadPlayer(self) def quit(self): """ This works in all threads except the main thread. It will quit the whole app. For more information about why we do it this way, read the comment in main.py. """ import sys, os, signal os.kill(0, signal.SIGINT) sys.exit() # Only init new state if it is new, not at module reload. try: state except NameError: state = State() try: modules except NameError: modules = [] def getModule(modname): for m in modules: if m.name == modname: return m return None for modname in [ "player", "queue", "tracker", "mediakeys", "gui", "stdinconsole", "notifications", ]: if not getModule(modname): modules.append(Module(modname)) for m in modules: print m def reloadModules(): # reload some custom random Python modules import utils reload(utils) import Song, State reload(Song) reload(State) # reload all our modules for m in modules: m.reload()
Python
0.000101
@@ -2310,87 +2310,30 @@ :%0A%09%09 -print %22state nextSong%22%0A%09%09self.player.nextSong()%0A%09%09print %22state nextSong finish%22 +self.player.nextSong() %0A%0A%09@
a4bcfed20cab98154df3a67572c27333cfcbfed1
Version bump
setup.py
setup.py
from setuptools import setup setup( name = "PySPED", version = "0.1.3", author = "Aristides Caldeira", author_email = 'aristides.caldeira@tauga.com.br', test_suite='tests', keywords = ['nfe', 'nfse', 'cte', 'sped', 'edf', 'ecd'], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Plugins', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', ], packages = [ 'pysped', 'pysped.nfe', 'pysped.nfe.leiaute', 'pysped.nfe.danfe', 'pysped.nfe.manual_300', 'pysped.nfe.manual_401', 'pysped.cte', 'pysped.cte.leiaute', 'pysped.cte.dacte', 'pysped.efd', # 'pysped.nfse', 'pysped.xml_sped', 'pysped.ecd', 'pysped.nf_paulista', 'pysped.relato_sped', 'pysped.exemplos', ], package_data = { 'pysped.nfe.danfe': ['fonts/*'], 'pysped.relato_sped': ['fonts/*'], 'pysped.nfe.leiaute': ['schema/*/*'], 'pysped.cte.leiaute': ['schema/*/*'], 'pysped.xml_sped': ['cadeia-certificadora/*/*'] }, url = 'https://github.com/aricaldeira/PySPED', license = 'LGPL-v2.1+', description = 'PySPED is a library to implement all requirements of the public system of bookkeeping digital', long_description = open('README.rst').read(), requires=[ 'Geraldo(>=0.4.16)', 'xmlsec(>=1.0.5)', 'qrcode(>=5.3)', 'py3o.template(>=0.9.11)', 'sh(>=1.12.9)' ], tests_require=[ 'pyflakes>=0.6.1', ], )
Python
0
@@ -70,13 +70,13 @@ = %22 +1. 0.1 -.3 %22,%0A @@ -1628,24 +1628,21 @@ ' -Geraldo(%3E=0.4.16 +lxml(%3E=3.7.3) )',%0A @@ -1663,17 +1663,46 @@ c(%3E=1.0. -5 +7)',%0A 'Geraldo(%3E=0.4.16 )',%0A
3bf4ce1f01d3e67702d91ccf4119ad6d956af99e
bump to 0.4.4
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 - # # This file is part of socketpool. # See the NOTICE for more information. import os from setuptools import setup, find_packages CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries'] # read long description with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f: long_description = f.read() DATA_FILES = [ ('socketpool', ["LICENSE", "MANIFEST.in", "NOTICE", "README.rst", "THANKS", "UNLICENSE"]) ] setup(name='socketpool', version='0.4.3', description = 'Python socket pool', long_description = long_description, classifiers = CLASSIFIERS, license = 'BSD', url = 'http://github.com/benoitc/socketpool', packages=find_packages(), data_files = DATA_FILES)
Python
0.000019
@@ -804,9 +804,9 @@ 0.4. -3 +4 ',%0A
590a7b926af1e57d48a087f18556caa4f3e1170c
Remove the duplicated filter in PreferenceAdmin
admin.py
admin.py
# -*- coding: utf-8 -*- # File: src/webframe/admin.py # Date: 2019-11-21 14:55 # Author: Kenson Man <kenson@breakthrough.org.hk> # Desc: The file provide the Admin-Tools in webframe module from django.contrib import admin from django.utils.translation import ugettext_lazy as _, ugettext from .models import * import logging logger=logging.getLogger('webframe.admin') class PreferenceChildParentFilter(admin.SimpleListFilter): title=_('webframe.models.Preference.childParentFilter') parameter_name='child_parent_filter' def lookups(self, req, modelAdmin): rst=[ ('parent', _('webframe.models.Preference.childParentFilter.parent')), ('child', _('webframe.models.Preference.childParentFilter.child')), ] return rst def queryset(self, req, q): logger.info('Filtering by PreferenceChildParentFilter: {0}'.format(self.value())) if self.value() is None: return q elif self.value()=='parent': return q.filter(id__in=Preference.objects.filter(parent__isnull=False).values('parent__id')) else: return q.filter(parent__isnull=False) @admin.register(Preference) class PreferenceAdmin(admin.ModelAdmin): list_display=('id', 'name', 'parent', 'reserved', 'lmb', 'lmd') list_filter=('reserved', PreferenceChildParentFilter, 'tipe',) search_fields=('name', 'value', 'owner__username', 'owner__username') ordering=('owner__username', 'name', 'value')
Python
0.000001
@@ -1367,27 +1367,8 @@ ue', - 'owner__username', 'ow
b6b4e423ede0a63a6c0a058cacc665aa08849046
Replace Unwrapped with Value on proto method names (#2283)
synth.py
synth.py
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """This script is used to synthesize generated parts of this library.""" import os import synthtool as s import synthtool.gcp as gcp import logging logging.basicConfig(level=logging.DEBUG) gapic = gcp.GAPICGenerator() common = gcp.CommonTemplates() for version in ['V1', 'V1beta2']: lower_version = version.lower() library = gapic.php_library( service='dataproc', version=lower_version, artman_output_name=f'google-cloud-dataproc-{lower_version}') # copy all src including partial veneer classes s.move(library / 'src') # copy proto files to src also s.move(library / 'proto/src/Google/Cloud/Dataproc', 'src/') s.move(library / 'tests/') # copy GPBMetadata file to metadata s.move(library / 'proto/src/GPBMetadata/Google/Cloud/Dataproc', 'metadata/') # Use new namespaces s.replace( f'src/{version}/Gapic/JobControllerGapicClient.php', r'ListJobsRequest_JobStateMatcher', r'ListJobsRequest\\JobStateMatcher') # document and utilize apiEndpoint instead of serviceAddress s.replace( "**/Gapic/*GapicClient.php", r"'serviceAddress' =>", r"'apiEndpoint' =>") s.replace( "**/Gapic/*GapicClient.php", r"@type string \$serviceAddress\n\s+\*\s+The address", r"""@type string $serviceAddress * **Deprecated**. This option will be removed in a future major release. Please * utilize the `$apiEndpoint` option instead. * @type string $apiEndpoint * The address""") s.replace( "**/Gapic/*GapicClient.php", r"\$transportConfig, and any \$serviceAddress", r"$transportConfig, and any `$apiEndpoint`") # prevent proto messages from being marked final s.replace( "src/V*/**/*.php", r"final class", r"class") # fix year for client in ['ClusterController', 'JobController']: s.replace( f'**/V1/Gapic/{client}GapicClient.php', r'Copyright \d{4}', 'Copyright 2017') s.replace( f'**/V1/{client}Client.php', r'Copyright \d{4}', 'Copyright 2017') s.replace( '**/V1beta2/Gapic/*GapicClient.php', r'Copyright \d{4}', r'Copyright 2019') s.replace( '**/V1beta2/*Client.php', r'Copyright \d{4}', r'Copyright 2019') s.replace( '**/V1/Gapic/WorkflowTemplateServiceGapicClient.php', r'Copyright \d{4}', 'Copyright 2018') s.replace( '**/V1/WorkflowTemplateServiceClient.php', r'Copyright \d{4}', 'Copyright 2018') s.replace( 'tests/**/V1/*Test.php', r'Copyright \d{4}', 'Copyright 2018') s.replace( 'tests/**/V1beta2/*Test.php', r'Copyright \d{4}', 'Copyright 2019')
Python
0
@@ -2366,16 +2366,179 @@ lass%22)%0A%0A +# Replace %22Unwrapped%22 with %22Value%22 for method names.%0As.replace(%0A %22src/V*/**/*.php%22,%0A r%22public function (%5Cw%7B0,%7D)Unwrapped%22,%0A r%22public function %5C1Value%22%0A)%0A%0A # fix ye
e11a786f28e84e8bfa313ca252a33ccd10ae2664
Use latest artman version and remove final keyword (#2274)
synth.py
synth.py
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """This script is used to synthesize generated parts of this library.""" import os # https://github.com/googleapis/artman/pull/655#issuecomment-507784277 os.environ["SYNTHTOOL_ARTMAN_VERSION"] = "0.29.1" import synthtool as s import synthtool.gcp as gcp import logging logging.basicConfig(level=logging.DEBUG) gapic = gcp.GAPICGenerator() common = gcp.CommonTemplates() library = gapic.php_library( service='automl', version='v1beta1', config_path='/google/cloud/automl/artman_automl_v1beta1.yaml', artman_output_name='google-cloud-automl-v1beta1') # copy all src including partial veneer classes s.move(library / 'src') # copy proto files to src also s.move(library / 'proto/src/Google/Cloud/AutoMl', 'src/') s.move(library / 'tests/') # copy GPBMetadata file to metadata s.move(library / 'proto/src/GPBMetadata/Google/Cloud/Automl', 'metadata/') # document and utilize apiEndpoint instead of serviceAddress s.replace( "**/Gapic/*GapicClient.php", r"'serviceAddress' =>", r"'apiEndpoint' =>") s.replace( "**/Gapic/*GapicClient.php", r"@type string \$serviceAddress\n\s+\*\s+The address", r"""@type string $serviceAddress * **Deprecated**. This option will be removed in a future major release. Please * utilize the `$apiEndpoint` option instead. * @type string $apiEndpoint * The address""") s.replace( "**/Gapic/*GapicClient.php", r"\$transportConfig, and any \$serviceAddress", r"$transportConfig, and any `$apiEndpoint`") # fix year s.replace( '**/Gapic/*GapicClient.php', r'Copyright \d{4}', r'Copyright 2019') s.replace( 'tests/**/V1beta1/*Test.php', r'Copyright \d{4}', r'Copyright 2019') # Fix class references in gapic samples for version in ['V1beta1']: pathExprs = [ 'src/' + version + '/Gapic/AutoMlGapicClient.php', 'src/' + version + '/Gapic/PredictionServiceGapicClient.php' ] for pathExpr in pathExprs: types = { 'new AutoMlClient': r'new Google\\Cloud\\AutoMl\\' + version + r'\\AutoMlClient', 'new PredictionServiceClient': r'new Google\\Cloud\\AutoMl\\' + version + r'\\PredictionServiceClient', '= AudioEncoding::': r'= Google\\Cloud\\Speech\\' + version + r'\\RecognitionConfig\\AudioEncoding::', 'new Dataset': r'new Google\\Cloud\\AutoMl\\' + version + r'\\Dataset', '= new ModelExportOutputConfig': r'= new Google\\Cloud\\AutoMl\\' + version + r'\\ModelExportOutputConfig', '= new ExportEvaluatedExamplesOutputConfig': r'= new Google\\Cloud\\AutoMl\\' + version + r'\\ExportEvaluatedExamplesOutputConfig', '= new ExportEvaluatedExamplesOutputConfig': r'= new Google\\Cloud\\AutoMl\\' + version + r'\\ExportEvaluatedExamplesOutputConfig', '= new TableSpec': r'= new Google\\Cloud\\AutoMl\\' + version + r'\\TableSpec', '= new ColumnSpec': r'= new Google\\Cloud\\AutoMl\\' + version + r'\\ColumnSpec', '= new BatchPredictInputConfig': r'= new Google\\Cloud\\AutoMl\\' + version + r'\\BatchPredictInputConfig', '= new BatchPredictOutputConfig': r'= new Google\\Cloud\\AutoMl\\' + version + r'\\BatchPredictOutputConfig', } for search, replace in types.items(): s.replace( pathExpr, search, replace)
Python
0
@@ -656,129 +656,8 @@ os%0A -# https://github.com/googleapis/artman/pull/655#issuecomment-507784277%0Aos.environ%5B%22SYNTHTOOL_ARTMAN_VERSION%22%5D = %220.29.1%22%0A impo @@ -1988,16 +1988,134 @@ int%60%22)%0A%0A +# prevent proto messages from being marked final%0As.replace(%0A %22src/V*/**/*.php%22,%0A r%22final class%22,%0A r%22class%22)%0A%0A # fix ye
83dd154759a430918931072e8e82db413c4f5741
Use proper settings
tasks.py
tasks.py
# encoding: utf-8 from invoke import task from waterbutler.server import settings @task def tornado(port=settings.PORT, address=settings.ADDRESS, debug=settings.DEBUG): from waterbutler.server import serve serve(port, address, debug)
Python
0.000008
@@ -45,39 +45,32 @@ from waterbutler -.server import settings
2c750eb0f8449f1276ecce7b4502570fccb72220
Fix some hwhoops.
tasks.py
tasks.py
# -*- coding: utf-8 -*- import functools import os import invoke def _out(name, message): print('[\033[1;37m{}\033[0m] {}'.format(name, message)) @invoke.task(name='collect') def asset_collect(verbose=False, **kwargs): out = functools.partial(_out, 'project.collect') hide = 'out' if not verbose else None # Build and send it off. out('Using `buildstatic` to concatenate assets.') invoke.run('python manage.py buildstatic --configuration=Production', hide=hide) out('Updating `settings/manifest.json` with new asset hashes.') invoke.run('python manage.py createstaticmanifest --configuration=Production', hide=hide) out('Uploading and post-processing all of the assets.') invoke.run('python manage.py eccollect --configuration=Production --noinput', hide=hide) @invoke.task(name='test') def development_test(verbose=True, coverage=False, **kwargs): out = functools.partial(_out, 'development.test') hide = 'out' if not verbose else None pytest = 'py.test tests/' if coverage: out('Running tests (with Coverage report).') invoke.run('coverage run --branch --source base -m %s' % pytest, pty=True, hide=hide) invoke.run('coverage html', pty=True, hide=hide) invoke.run('open htmlcov/index.html') else: out('Running tests.') invoke.run('%s' % pytest, pty=True, hide=hide) @invoke.task(name='deploy', pre=[development_test, asset_collect]) def deploy(verbose=False, migrate=False, **kwargs): out = functools.partial(_out, 'project.deploy') hide = 'out' if not verbose else None # Before deploying, check if manifest.json has updated. MANIFEST = 'base/settings/manifest.json' out('Checking if manifest.json has been updated.') if invoke.run('git diff --name-only {0}'.format(MANIFEST), hide=hide).stdout: # manifest.json has been updated, let's commit it. out('manifest.json has been updated. Committing.') invoke.run('git add {0}'.format(MANIFEST), hide=hide) invoke.run('git commit -m "Static manifest has updated; committing updated manifest.json."', hide=hide) # Ready? Let's go. if migrate: out('Snapshotting the production database.') invoke.run('heroku pgbackups:capture --expire', hide=hide) out('The migrations flag has been triggered, disable preboot.') invoke.run('heroku labs:disable preboot', hide=hide) out('Deploying project to Heroku.') invoke.run('git push heroku master') if migrate: out('Deploy to Heroku complete. Migrating...') invoke.run('heroku run python manage.py migrate') out('Re-enabling preboot.') invoke.run('heroku labs:enable preboot', hide=hide) # Done! out('All done~!') @invoke.task(name='compile') def asset_compile(verbose=False, **kwargs): out = functools.partial(_out, 'development.compile') hide = 'out' if not verbose else None STATIC_ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'base', 'static') # Pre-compile all of our assets. out('Compiling Handlebars templates.') invoke.run('handlebars base/templates/partials/handlebars -f base/static/javascripts/application/templates.js', hide=hide) out('Compiling stylesheets using production environment settings.') invoke.run('compass compile -e production --force', hide=hide) # Compile the application-specific Javascript. invoke.run('yuglify {input} --type js --combine {output}'.format( input=os.path.join(STATIC_ROOT, 'javascripts', 'application', '*.js'), output=os.path.join(STATIC_ROOT, 'javascripts', 'application')), hide=hide) out('javascripts/application.min.js created and minified.') # Compile the 3rd-party Javascript base.apps. invoke.run('yuglify {input} --type js --combine {output}'.format( input=os.path.join(STATIC_ROOT, 'javascripts', 'components', '*.js'), output=os.path.join(STATIC_ROOT, 'javascripts', 'components')), hide=hide) out('javascripts/base.apps.min.js created and minified.') # Compile the stylesheets. invoke.run('autoprefixer -b "> 1%, last 3 versions, ff 17, opera 12.1" {input}'.format( input=os.path.join(STATIC_ROOT, 'stylesheets', 'application.css')), hide=hide) out('stylesheets/application.css auto-prefixed.') invoke.run('yuglify {input} --type css --combine {output}'.format( input=os.path.join(STATIC_ROOT, 'stylesheets', 'application.css'), output=os.path.join(STATIC_ROOT, 'stylesheets', 'production')), hide=hide) out('stylesheets/production.min.css created and minified.') @invoke.task(name='flake') def development_flake(**kwargs): invoke.run('flake8 --max-complexity 6 > flake8.txt') @invoke.task(name='server') def development_server(**kwargs): # Use Foreman to start all the development processes. invoke.run('foreman start -f Procfile.dev', pty=True) @invoke.task(name='capture') def heroku_capture(verbose=False, **kwargs): out = functools.partial(_out, 'heroku.capture') hide = 'out' if not verbose else None out('Snapshotting the production database.') invoke.run('heroku pgbackups:capture --expire', hide=hide) @invoke.task(name='imagekit') def heroku_imagekit(verbose=False, **kwargs): out = functools.partial(_out, 'heroku.imagekit') hide = 'out' if not verbose else None invoke.run('heroku run python manage.py generateimages', hide=hide) out('Thumbnails successfully generated by ImageKit.') @invoke.task(name='migrate') def heroku_migrate(app='', **kwargs): invoke.run('heroku run python manage.py migrate %s' % app) @invoke.task(name='pull') def heroku_pull(verbose=False, database='hello-base', **kwargs): out = functools.partial(_out, 'heroku.pull') hide = 'out' if not verbose else None # Fetch the latest database dump. invoke.run('curl -o latest.dump `heroku pgbackups:url`', hide=hide) out('Latest database dump (latest.dump) grabbed via curl.') # Restore it. invoke.run('pg_restore --verbose --clean --no-acl --no-owner -h localhost -d %s latest.dump' % database, hide=hide) invoke.run('rm latest.dump', hide=hide) out('Restored latest production dump to local database.') @invoke.task(name='syncdb') def heroku_syncdb(**kwargs): invoke.run('heroku run python manage.py syncdb') ns = invoke.Collection( asset_collect, asset_compile, deploy, development_flake, development_server, development_test, heroku=invoke.Collection( heroku_capture, heroku_imagekit, heroku_migrate, heroku_pull, heroku_syncdb, ) )
Python
0.000003
@@ -1,8 +1,9 @@ + # -*- co @@ -3769,24 +3769,25 @@ ascript -base.app +component s.%0A i @@ -4037,16 +4037,17 @@ pts/ -base.app +component s.mi
040cc5e6f384f68ae4a64a3cc6905b11c771f3c8
fix call
tasks.py
tasks.py
import logging import celery import os from totalimpact import item as item_module from totalimpact import db from totalimpact import tiredis from totalimpact.providers.provider import ProviderFactory, ProviderError logger = logging.getLogger("core.tasks") celery_app = celery.Celery('tasks', broker=os.getenv("CLOUDAMQP_URL", "amqp://guest@localhost//") ) myredis = tiredis.from_url(os.getenv("REDISTOGO_URL")) class TaskAlertIfFail(celery.Task): def __call__(self, *args, **kwargs): """In celery task this function call the run method, here you can set some environment variable before the run of the task""" # logger.info(u"Starting to run") return self.run(*args, **kwargs) def on_failure(self, exc, task_id, args, kwargs, einfo): url_slug="unknown" # for arg in args: # if isinstance(arg, User): # url_slug = arg.url_slug logger.error(u"Celery task failed on {task_name}, task_id={task_id}".format( task_name=self.name, task_id=task_id)) def provider_method_wrapper(tiid, input_aliases_dict, provider, method_name, analytics_credentials, myredis, aliases_providers_run, callback): logger.info(u"{:20}: in provider_method_wrapper with {tiid} {provider_name} {method_name} with {aliases}".format( "wrapper", tiid=tiid, provider_name=provider.provider_name, method_name=method_name, aliases=input_aliases_dict)) provider_name = provider.provider_name worker_name = provider_name+"_worker" input_alias_tuples = item_module.alias_tuples_from_dict(input_aliases_dict) method = getattr(provider, method_name) try: if provider.uses_analytics_credentials(method_name): method_response = method(input_alias_tuples, analytics_credentials=analytics_credentials) else: method_response = method(input_alias_tuples) except ProviderError: method_response = None logger.info(u"{:20}: **ProviderError {tiid} {method_name} {provider_name} ".format( worker_name, tiid=tiid, provider_name=provider_name.upper(), method_name=method_name.upper())) logger.info(u"{:20}: AFTER METHOD in provider_method_wrapper with {tiid} {provider_name} {method_name} with {aliases}".format( "wrapper", tiid=tiid, provider_name=provider.provider_name, method_name=method_name, aliases=input_aliases_dict)) if method_name == "aliases": # update aliases to include the old ones too aliases_providers_run += [provider_name] if method_response: new_aliases_dict = item_module.alias_dict_from_tuples(method_response) new_canonical_aliases_dict = item_module.canonical_aliases(new_aliases_dict) response = item_module.merge_alias_dicts(new_canonical_aliases_dict, input_aliases_dict) else: response = input_aliases_dict else: response = method_response logger.info(u"{:20}: /biblio_print, RETURNED {tiid} {method_name} {provider_name} : {response}".format( worker_name, tiid=tiid, method_name=method_name.upper(), provider_name=provider_name.upper(), response=response)) logger.info(u"{:20}: BEFORE CALLBACK in provider_method_wrapper with {tiid} {provider_name} {method_name} with {aliases}".format( "wrapper", tiid=tiid, provider_name=provider.provider_name, method_name=method_name, aliases=input_aliases_dict)) callback(tiid, response, method_name, analytics_credentials, myredis, provider_name, aliases_providers_run) logger.info(u"{:20}: AFTER CALLBACK in provider_method_wrapper with {tiid} {provider_name} {method_name} with {aliases}".format( "wrapper", tiid=tiid, provider_name=provider.provider_name, method_name=method_name, aliases=input_aliases_dict)) return response # last variable is an artifact so it has same call signature as other callbacks def add_to_database_if_nonzero( tiid, new_content, method_name, analytics_credentials, myredis, provider_name, dummy_already_run=None): try: if new_content: # don't need item with metrics for this purpose, so don't bother getting metrics from db print tiid, new_content item_obj = item_module.Item.query.get(tiid) if item_obj: if method_name=="aliases": item_obj = item_module.add_aliases_to_item_object(new_content, item_obj) elif method_name=="biblio": updated_item_doc = item_module.update_item_with_new_biblio(new_content, item_obj, provider_name) elif method_name=="metrics": for metric_name in new_content: item_obj = item_module.add_metric_to_item_object(metric_name, new_content[metric_name], item_obj) else: logger.warning(u"ack, supposed to save something i don't know about: " + str(new_content)) finally: db.session.remove() # do this no matter what, but as last thing if method_name=="metrics": myredis.set_provider_finished(tiid, provider_name) return def add_to_alias_queue_and_database( tiid, aliases_dict, method_name, analytics_credentials, myredis, provider_name, alias_providers_already_run): add_to_database_if_nonzero(tiid, aliases_dict, method_name, analytics_credentials) alias_message = { "tiid": tiid, "aliases_dict": aliases_dict, "analytics_credentials": analytics_credentials, "alias_providers_already_run": alias_providers_already_run } # always push to highest priority queue if we're already going alias_queues["high"].push(alias_message) @celery_app.task(base=TaskAlertIfFail) def provider_run(provider_message, provider_name): print "GOT A MESSAGE" global myredis provider = ProviderFactory.get_provider(provider_name) logger.info(u"POPPED from queue for {provider}".format( provider=provider.provider_name)) tiid = provider_message["tiid"] aliases_dict = provider_message["aliases_dict"] method_name = provider_message["method_name"] analytics_credentials = provider_message["analytics_credentials"] alias_providers_already_run = provider_message["alias_providers_already_run"] if (method_name == "metrics") and provider.provides_metrics: myredis.set_provider_started(tiid, provider.provider_name) if method_name == "aliases": callback = add_to_alias_queue_and_database else: callback = add_to_database_if_nonzero provider_method_wrapper(tiid, aliases_dict, provider, method_name, analytics_credentials, myredis, alias_providers_already_run, callback) print "FINISHED MESSAGE"
Python
0.000001
@@ -5531,16 +5531,69 @@ dentials +, myredis, provider_name, alias_providers_already_run )%0A%0A a
cae6d756294c90b93e5505ce5eec9f93ced83398
Improve test task; switch flake8->syntax
tasks.py
tasks.py
# -*- coding: utf-8 -*- import os import sys import webbrowser from invoke import task docs_dir = 'docs' build_dir = os.path.join(docs_dir, '_build') @task def test(ctx): flake(ctx) import pytest errcode = pytest.main(['tests']) sys.exit(errcode) @task def flake(ctx): """Run flake8 on codebase.""" ctx.run('flake8 .', echo=True) @task def watch(ctx): """Run tests when a file changes. Requires pytest-xdist.""" import pytest errcode = pytest.main(['-f']) sys.exit(errcode) @task def clean(ctx): ctx.run('rm -rf build') ctx.run('rm -rf dist') ctx.run('rm -rf apispec.egg-info') clean_docs(ctx) print('Cleaned up.') @task def clean_docs(ctx): ctx.run('rm -rf %s' % build_dir) @task def browse_docs(ctx): path = os.path.join(build_dir, 'index.html') webbrowser.open_new_tab(path) def build_docs(ctx, browse): ctx.run('sphinx-build %s %s' % (docs_dir, build_dir), echo=True) if browse: browse_docs(ctx) @task def docs(ctx, clean=False, browse=False, watch=False): """Build the docs.""" if clean: clean_docs(ctx) if watch: watch_docs(ctx, browse=browse) else: build_docs(ctx, browse=browse) @task def watch_docs(ctx, browse=False): """Run build the docs when a file changes.""" try: import sphinx_autobuild # noqa except ImportError: print('ERROR: watch task requires the sphinx_autobuild package.') print('Install it with:') print(' pip install sphinx-autobuild') sys.exit(1) ctx.run('sphinx-autobuild {0} {1} {2} -z apispec'.format( '--open-browser' if browse else '', docs_dir, build_dir), echo=True, pty=True) @task def readme(ctx, browse=False): ctx.run('rst2html.py README.rst > README.html') if browse: webbrowser.open_new_tab('README.html')
Python
0.000005
@@ -168,51 +168,301 @@ (ctx -):%0A flake(ctx)%0A import pytest%0A err +, watch=False, last_failing=False):%0A %22%22%22Run the tests.%0A%0A Note: --watch requires pytest-xdist to be installed.%0A %22%22%22%0A import pytest%0A syntax(ctx)%0A args = %5B%5D%0A if watch:%0A args.append('-f')%0A if last_failing:%0A args.append('--lf')%0A args.append('tests')%0A ret code @@ -480,17 +480,12 @@ ain( -%5B'tests'%5D +args )%0A @@ -487,35 +487,35 @@ s)%0A sys.exit( -err +ret code)%0A%0A@task%0Adef @@ -515,21 +515,22 @@ ask%0Adef -flake +syntax (ctx):%0A @@ -579,16 +579,34 @@ un(' -flake8 . +pre-commit run --all-files ', e @@ -1829,32 +1829,41 @@ (1)%0A ctx.run( +%0A 'sphinx-autobuil @@ -1896,16 +1896,20 @@ format(%0A + @@ -1955,32 +1955,42 @@ s_dir, build_dir +,%0A ), echo=True, pt @@ -1991,24 +1991,30 @@ ue, pty=True +,%0A )%0A%0A@task%0Adef
45f5928d578851108ee28cf036dbadaceb69a0f7
Update pytest.
tasks.py
tasks.py
#!/usr/bin/env python """ Deployment file to facilitate releases of matgendb. """ from __future__ import division import glob import datetime import re import json import requests import os from invoke import task from monty.os import cd __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "0.1" __maintainer__ = "Shyue Ping Ong" __email__ = "shyue@mit.edu" __date__ = "Apr 29, 2012" NEW_VER = datetime.datetime.today().strftime("%Y.%-m.%-d") @task def make_doc(ctx): with cd("docs_rst"): ctx.run("cp ../CHANGES.rst change_log.rst") ctx.run("sphinx-apidoc -d 6 -o . -f ../matgendb") ctx.run("rm matgendb*.tests.rst") for f in glob.glob("*.rst"): if f.startswith('matgendb') and f.endswith('rst'): newoutput = [] suboutput = [] subpackage = False with open(f, 'r') as fid: for line in fid: clean = line.strip() if clean == "Subpackages": subpackage = True if not subpackage and not clean.endswith("tests"): newoutput.append(line) else: if not clean.endswith("tests"): suboutput.append(line) if clean.startswith("pymatgen") and not clean.endswith("tests"): newoutput.extend(suboutput) subpackage = False suboutput = [] with open(f, 'w') as fid: fid.write("".join(newoutput)) ctx.run("make html") ctx.run("cp _static/* ../docs/html/_static") with cd("docs"): ctx.run("cp -r html/* .") ctx.run("rm -r html") # Avoid ths use of jekyll so that _dir works as intended. ctx.run("touch .nojekyll") @task def set_ver(ctx): lines = [] with open("matgendb/__init__.py", "rt") as f: for l in f: if "__version__" in l: lines.append('__version__ = "%s"' % NEW_VER) else: lines.append(l.rstrip()) with open("matgendb/__init__.py", "wt") as f: f.write("\n".join(lines)) lines = [] with open("setup.py", "rt") as f: for l in f: lines.append(re.sub(r'version=([^,]+),', 'version="%s",' % NEW_VER, l.rstrip())) with open("setup.py", "wt") as f: f.write("\n".join(lines)) @task def update_doc(ctx): make_doc(ctx) with cd("docs"): ctx.run("git add .") ctx.run("git commit -a -m \"Update dev docs\"") ctx.run("git push") @task def publish(ctx): ctx.run("rm dist/*.*", warn=True) ctx.run("python setup.py register sdist bdist_wheel") ctx.run("twine upload dist/*") @task def release_github(ctx): payload = { "tag_name": "v" + NEW_VER, "target_commitish": "master", "name": "v" + NEW_VER, "body": "v" + NEW_VER, "draft": False, "prerelease": False } response = requests.post( "https://api.github.com/repos/materialsproject/pymatgen-db/releases", data=json.dumps(payload), headers={"Authorization": "token " + os.environ["GITHUB_RELEASES_TOKEN"]}) print(response.text) @task def test(ctx): ctx.run("nosetests") @task def release(ctx): set_ver(ctx) #test(ctx) update_doc(ctx) publish(ctx) release_github(ctx)
Python
0
@@ -3487,17 +3487,23 @@ un(%22 -nosetests +pytest matgendb %22)%0A%0A
1235589dae5cf5dc1a8bf1114f65f0b36bb7bca1
Simplify tests
tests.py
tests.py
""" Unit tests runner for ``django-guardian`` based on boundled example project. Tests are independent from this example application but setuptools need instructions how to interpret ``test`` command when we run:: python setup.py test """ import os import sys import django os.environ["DJANGO_SETTINGS_MODULE"] = 'guardian.testapp.testsettings' from guardian.testapp import testsettings as settings def run_tests(settings): from django.test.utils import get_runner from utils import show_settings show_settings(settings, 'tests') django.setup() TestRunner = get_runner(settings) test_runner = TestRunner(interactive=False) failures = test_runner.run_tests(['guardian']) return failures def main(): failures = run_tests(settings) sys.exit(failures) if __name__ == '__main__': main()
Python
0.000002
@@ -263,34 +263,57 @@ sys%0A -import django%0A%0Aos.environ%5B +%0A%0Adef main():%0A os.environ.setdefault(%0A %22DJA @@ -336,13 +336,11 @@ ULE%22 -%5D = ' +, %22 guar @@ -368,209 +368,81 @@ ings -'%0Afrom guardian.testapp import testsettings as settings%0A%0A%0Adef run_tests(settings):%0A from django.test.utils import get_runner%0A from utils import show_settings%0A%0A show_settings(settings, 'tests') +%22)%0A%0A import django%0A from django.core.management import call_command %0A%0A @@ -462,213 +462,33 @@ p()%0A -%0A -TestRunner = get_runner(settings)%0A test_runner = TestRunner(interactive=False)%0A failures = test_runner.run_tests(%5B'guardian'%5D)%0A return failures%0A%0Adef main():%0A failures = run_tests(settings) +call_command('test')%0A %0A @@ -501,16 +501,9 @@ xit( -failures +0 )%0A%0Ai
64986995b8f13c5ce1f9adf9e3abfe2e6661a3d7
Improve precision of docstring wording
tests.py
tests.py
import unittest from pysenbug import pysenbug class TestPysenbug(unittest.TestCase): """ Due to the intentionally unpredictable nature of some of pysenbug's use cases, there is no simple deterministic test that will always conclusively prove that the function worked as intended in a finite number of steps; though for sufficiently large test cases, it is exceedingly unlikely the results would fall outside of calculable probability distributions. In the interest of making dependable tests, all default tests have been designed to be deterministic in nature. It is possible to create tests that determine if pysenbug is working as expected even when random functions are used using scary, highly invasive code inspection. (This feature will be implemented pending ethics committee review.) """ def test_unparameterized_decorator(self): """ Use the shotgun approach to check for random exceptions. """ for each_iteration in range(0, 100): @pysenbug def open_box(): return 'meow' for each_iteration in range(0, 1000): open_box() def test_chance_parameter(self): """ Test whether or not the `chance` parameter works as expected when given values of 0 or 1. """ for each_iteration in range(0, 100): @pysenbug(chance=1) def lead_box(): return 'miao' for each_iteration in range(0, 1000): self.assertEqual(lead_box(), 'miao') for each_iteration in range(0, 100): @pysenbug(chance=0) def polonium_box(): return 'miao' for each_iteration in range(0, 1000): self.assertEqual(polonium_box(), None) def test_return_value_parameter(self): """ Test that the `return_value` parameter works as expected. """ for each_iteration in range(0, 100): @pysenbug(return_value='bark', chance=0) def uranium_box(): return 'miow' for each_iteration in range(0, 1000): self.assertEqual(uranium_box(), 'bark') for each_iteration in range(0, 100): @pysenbug(return_value='bark', chance=1) def lead_lined_uranium_box(): return 'miow' for each_iteration in range(0, 1000): self.assertEqual(lead_lined_uranium_box(), 'miow') def test_probability_function_parameter(self): """ Test whether or not the `probability_function` parameter works as expected. """ def hidden_variable(): while True: yield False yield True for each_iteration in range(0, 100): bohm_interpretation = hidden_variable() @pysenbug(probability_function=bohm_interpretation.next) def bismuth_box(): return 'miau' for each_iteration in range(0, 1000): if each_iteration % 2 == 0: self.assertEqual(bismuth_box(), 'miau') else: self.assertEqual(bismuth_box(), None) if __name__ == '__main__': # Not Yet Implemented: # Add command line argument support for optional nondeterministic testing! unittest.main()
Python
0.000463
@@ -88,16 +88,93 @@ %0A %22%22%22 + Subclass unittest's TestCase in order to unit test the pysenbug module.%0A%0A Due to @@ -336,24 +336,25 @@ hat the -function +decorator worked @@ -640,18 +640,25 @@ gned to -be +test only determi @@ -668,17 +668,23 @@ tic -in nature +execution paths .%0A%0A @@ -785,23 +785,29 @@ hen -random +%60probability_ function s ar @@ -806,24 +806,102 @@ tion +%60 s -are used using +with probabilistic behavior are%0A used, but this can only be accomplished by calling upon sca @@ -910,16 +910,20 @@ , highly +%0A invasiv @@ -939,16 +939,27 @@ spection + techniques .%0A (T @@ -971,19 +971,25 @@ eature w -ill +ould only be impl @@ -1139,14 +1139,20 @@ for -random +adventitious exc
3826d023191a9c1c559a4b53768a67293c7c2aba
Tweak coverage excludes.
tests.py
tests.py
import os import sys import unittest import doctest import django south = () try: if django.VERSION < (1,7): import south south = ('south',) except ImportError: pass BASE_PATH = os.path.dirname(__file__) def main(): """ Standalone django model test with a 'memory-only-django-installation'. You can play with a django model without a complete django app installation. http://www.djangosnippets.org/snippets/1044/ """ os.environ["DJANGO_SETTINGS_MODULE"] = "django.conf.global_settings" from django.conf import global_settings global_settings.INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', ) + south + ( 'boardinghouse', 'django.contrib.admin', ) global_settings.DATABASES = { 'default': { 'ENGINE': 'boardinghouse.backends.postgres', 'NAME': os.environ['USER'] } } global_settings.SOUTH_DATABASE_ADAPTERS = { 'default': 'boardinghouse.backends.south_backend', 'boardinghouse.backends.postgres': 'boardinghouse.backends.south_backend', } global_settings.ROOT_URLCONF = 'boardinghouse.tests.urls' global_settings.STATIC_URL = "/static/" global_settings.MEDIA_ROOT = os.path.join(BASE_PATH, 'static') global_settings.STATIC_ROOT = global_settings.MEDIA_ROOT global_settings.TEMPLATE_DIRS = ( os.path.join(BASE_PATH, 'boardinghouse', 'tests', 'templates'), ) global_settings.SECRET_KEY = 'd1a1f7a0-7f88-4638-86d1-d71dc21634d7' global_settings.PASSWORD_HASHERS = ( 'django.contrib.auth.hashers.MD5PasswordHasher', ) global_settings.COVERAGE_REPORT_HTML_OUTPUT_DIR = os.path.join(BASE_PATH, '.coverage') global_settings.COVERAGE_USE_STDOUT = True global_settings.COVERAGE_PATH_EXCLUDES = ['.hg', 'templates', 'tests', 'sql', '__pycache__'] global_settings.COVERAGE_MODULE_EXCLUDES = ['boardinghouse.settings'] if django.VERSION < (1,7): global_settings.COVERAGE_MODULE_EXCLUDES += ['boardinghouse.apps', 'boardinghouse.backends.postgres.schema'] if django.VERSION >= (1, 7): global_settings.COVERAGE_MODULE_EXCLUDES += ['boardinghouse.backends.south_backend'] if os.environ.get('COVERAGE', None): from django_coverage import coverage_runner test_runner = coverage_runner.CoverageRunner else: from django.test.utils import get_runner test_runner = get_runner(global_settings) if getattr(django, 'setup', None): django.setup() test_runner = test_runner() failures = test_runner.run_tests(['boardinghouse']) sys.exit(failures) if __name__ == '__main__': main()
Python
0
@@ -1987,16 +1987,42 @@ UDES = %5B +'boardinghouse.__init__', 'boardin
f71b0193481fe06d0b5101fd3ed70fd91fa76e85
Create socket Stub as a test attribute in setUp().
tests.py
tests.py
import logging import logging.handlers import unittest import redispatcher from redispatcher import Redis, fmtcmd, logcmd, wirecmd try: NullHandler = logging.NullHandler except AttributeError: class NullHandler(logging.Handler): def emit(self, record): pass log = logging.getLogger(__name__) log.addHandler(NullHandler()) class Stub(object): def __init__(self, obj=None, attr=None): self.obj = obj self.attr = attr self.unpatched = None self.called = [] def __call__(self, *args, **kwargs): self.called.append((args, kwargs)) return self.__class__(self.obj, self.attr) def __getattr__(self, attr): return self.__class__() def patch(self): self.unpatched = getattr(self.obj, self.attr) setattr(self.obj, self.attr, self) return self def unpatch(self): setattr(self.obj, self.attr, self.unpatched) self.unpatched = None class BaseTest(unittest.TestCase): pass class TestUtils(BaseTest): def test_wirecmd_noargs(self): result = wirecmd("COMMAND", tuple()) self.assertEquals(result, "*1\r\n$7\r\nCOMMAND\r\n") def test_wirecmd_args(self): result = wirecmd("COMMAND", ("arg1", "arg2")) self.assertEquals(result, "*3\r\n$7\r\nCOMMAND\r\n$4\r\narg1\r\n$4\r\narg2\r\n") def test_wirecmd_separator(self): result = wirecmd("COMMAND", ("arg1", "arg2"), separator="!") self.assertEquals(result, "*3!$7!COMMAND!$4!arg1!$4!arg2!") def test_fmtcmd_noargs(self): result = fmtcmd("COMMAND", tuple()) self.assertEquals(result, "%s") def test_fmtcmd_args(self): result = fmtcmd("COMMAND", ("arg1", "arg2")) self.assertEquals(result, "%s %r %r") def test_fmtcmd_separator(self): result = fmtcmd("COMMAND", ("arg1", "arg2"), separator="!") self.assertEquals(result, "%s!%r!%r") def tmplog(name="tmp", size=100): log = logging.getLogger(name) log.propagate = 0 buffer = logging.handlers.BufferingHandler(size) log.addHandler(buffer) log.buffer = buffer.buffer return log class TestLogging(BaseTest): def setUp(self): BaseTest.setUp(self) self.log = tmplog() def test_logcmd_explicit_logger(self): logcmd(None, "COMMAND", ("arg1", "arg2"), log=self.log) self.assertEqual(len(self.log.buffer), 1) record = self.log.buffer[0] self.assertEqual(record.msg, "%s %r %r") self.assertEqual(record.args, ("COMMAND", "arg1", "arg2")) def test_logcmd_get_logger(self): logcmd("tmp", "COMMAND", ("arg1", "arg2")) self.assertEqual(len(self.log.buffer), 1) record = self.log.buffer[0] self.assertEqual(record.msg, "%s %r %r") self.assertEqual(record.args, ("COMMAND", "arg1", "arg2")) class TestRedis(BaseTest): def setUp(self): BaseTest.setUp(self) self.patched = [ Stub(redispatcher.asyncore.dispatcher, "__init__").patch(), Stub(redispatcher.asyncore.dispatcher, "connect").patch(), Stub(redispatcher.asyncore.dispatcher, "set_socket").patch(), Stub(redispatcher.socket, "socket").patch(), ] self.redis = Redis() def tearDown(self): BaseTest.tearDown(self) for stub in self.patched: stub.unpatch() def test_init(self): redis = Redis() def test_connect(self): redis = self.redis sock = Stub() redis.connect(sock=sock, data="data", callback="callback") self.assertEqual(redis.callbacks, [("CONNECT", (), "callback", "data")]) def test_connect_build_sock(self): redis = self.redis socket = Stub(redispatcher.socket, "socket").patch() try: redis.connect() finally: socket.unpatch() self.assertEqual(len(socket.called), 1) def test_do(self): redis = self.redis redis.do("callback", "data", "command", "arg1", "arg2") self.assertEqual(redis.buffer, "*3\r\n$7\r\ncommand\r\n$4\r\narg1\r\n$4\r\narg2\r\n") self.assertEqual(redis.callbacks, [('command', ('arg1', 'arg2'), 'callback', 'data')])
Python
0
@@ -2977,32 +2977,98 @@ est.setUp(self)%0A + self.socket = Stub(redispatcher.socket, %22socket%22).patch()%0A self.pat @@ -3309,51 +3309,19 @@ -Stub(redispatcher.socket, %22socket%22).patch() +self.socket ,%0A @@ -3832,154 +3832,30 @@ dis%0A - socket = Stub(redispatcher.socket, %22socket%22).patch()%0A%0A try:%0A redis.connect()%0A finally:%0A socket.unpatch +%0A redis.connect ()%0A%0A @@ -3883,16 +3883,21 @@ ual(len( +self. socket.c
e6f14f8ef1bb0ab247d331b6ef023d35543663be
Update tests.
tests.py
tests.py
from io import open import unittest from partitioned_hash_join import ( build_hash_table, h1, join, write ) class PartitionedHashJoinTests(unittest.TestCase): def test_h1(self): self.assertEqual(h1('H1234567890'), 12) def test_join(self): r = open('r_test_bucket.txt', 'r') s = open('s_test_bucket.txt', 'r') hash_table = build_hash_table(r) result = join(hash_table, s) self.assertEqual(len(result.get('9019095166')), 3) def test_create_result_file(self): results = {488552576: set([u'D488552576\n', u'B488552576\n']), 482241448: set([u'G482241448\n']), 486356299: set([u'B486356299\n', u'D486356299\n', u'A486356299\n'])} write(results) expected_results = ['D488552576\n', 'B488552576\n', 'G482241448\n', 'B486356299\n', 'D486356299\n', 'A486356299\n'] with open('result.txt') as f: for line in f: self.assertTrue(line in expected_results) if __name__=='__main__': unittest.main()
Python
0
@@ -103,28 +103,93 @@ -join,%0A write +is_duplicate,%0A join,%0A letters_for_result,%0A value_for_letter,%0A LETTERS %0A)%0A%0A -%0A clas @@ -305,16 +305,197 @@ 90'), 12 +3)%0A%0A def test_is_duplicate(self):%0A self.assertTrue(is_duplicate(100, 100))%0A self.assertTrue(is_duplicate(10, 1010))%0A self.assertFalse(is_duplicate(100, 1010) )%0A%0A d @@ -707,12 +707,8 @@ ual( -len( resu @@ -731,14 +731,20 @@ 66') -) , -3)%0A +100010001) %0A%0A @@ -758,684 +758,181 @@ est_ -create_result_file(self):%0A results = %7B488552576: set(%5Bu'D488552576%5Cn', u'B488552576%5Cn'%5D),%0A 482241448: set(%5Bu'G482241448%5Cn'%5D),%0A 486356299: set(%5Bu'B486356299%5Cn',%0A u'D486356299%5Cn',%0A u'A486356299%5Cn'%5D)%7D%0A write(results)%0A expected_results = %5B'D488552576%5Cn',%0A 'B488552576%5Cn',%0A 'G482241448%5Cn',%0A 'B486356299%5Cn',%0A 'D486356299%5Cn',%0A 'A486356299%5Cn'%5D%0A with open('result.txt') as f:%0A for line in f:%0A +value_for_letter(self):%0A for idx, l in enumerate(LETTERS):%0A self.assertEqual(10**idx, value_for_letter(l))%0A%0A def test_letters_for_result(self):%0A sel @@ -919,33 +919,32 @@ (self):%0A - self.assertTrue( @@ -947,33 +947,69 @@ rue( -line in expected_results) +x in letters_for_result(100100010) for x in %5B'F', 'B', 'I'%5D)%0A %0A%0Aif
cf9a0130d76e3be8a436e866ed4a1dab62b74831
Rename TestHitMiss to reflect function name
tests.py
tests.py
#!/usr/bin/env python3 import nose.tools as nose import simulator as sim def test_get_bin_addr_unpadded(): """get_bin_addr should return unpadded binary address of word address""" nose.assert_equal( sim.get_bin_addr(180, num_addr_bits=8), '10110100') def test_get_bin_addr_padded(): """get_bin_addr should return padded binary address of word address""" nose.assert_equal( sim.get_bin_addr(44, num_addr_bits=8), '00101100') def test_prettify_bin_addr_16_bit(): """prettify_bin_addr should prettify 8-bit string into groups of 3""" nose.assert_equal( sim.prettify_bin_addr('1010101110101011', min_bits_per_group=3), '1010 1011 1010 1011') def test_prettify_bin_addr_8_bit(): """prettify_bin_addr should prettify 8-bit string into groups of 3""" nose.assert_equal( sim.prettify_bin_addr('10101011', min_bits_per_group=3), '1010 1011') def test_prettify_bin_addr_7_bit(): """prettify_bin_addr should prettify 7-bit string into groups of 3""" nose.assert_equal( sim.prettify_bin_addr('1011010', min_bits_per_group=3), '101 1010') def test_prettify_bin_addr_6_bit(): """prettify_bin_addr should prettify 6-bit string into groups of 3""" nose.assert_equal( sim.prettify_bin_addr('101011', min_bits_per_group=3), '101 011') def test_prettify_bin_addr_5_bit(): """prettify_bin_addr should prettify 5-bit string into groups of 3""" nose.assert_equal( sim.prettify_bin_addr('10110', min_bits_per_group=3), '10110') def test_get_tag_5_bit(): """get_tag should return correct 5 tag bits for an address""" nose.assert_equal( sim.get_tag('10110100', num_tag_bits=5), '10110') def test_get_index_2_bit(): """get_index should return correct 2 index bits for an address""" nose.assert_equal( sim.get_index('11111101', num_offset_bits=1, num_index_bits=2), '10') def test_get_index_0_bit(): """get_index should return '0' if no bits are allocated to an index""" nose.assert_equal( sim.get_index('11111111', num_offset_bits=1, num_index_bits=0), '0') def test_get_offset_2_bit(): """get_offset should return correct 2 offset bits for an address""" nose.assert_equal( sim.get_offset('11111101', num_offset_bits=2), '01') def test_get_offset_0_bit(): """get_offset should return '0' if no bits are allocated to an offset""" nose.assert_equal( sim.get_offset('10110100', num_offset_bits=1), '0') def test_get_consecutive_words_1_word(): """get_consecutive_words should return same word for 1-word blocks""" nose.assert_list_equal( sim.get_consecutive_words(23, num_words_per_block=1), [23]) def test_get_consecutive_words_2_word(): """get_consecutive_words should return correct words for 2-word blocks""" nose.assert_list_equal( sim.get_consecutive_words(22, num_words_per_block=2), [22, 23]) def test_get_consecutive_words_4_word(): """get_consecutive_words should return correct words for 2-word blocks""" nose.assert_list_equal( sim.get_consecutive_words(21, num_words_per_block=4), [20, 21, 22, 23]) class TestCacheHitMiss(object): "is_hit should behave correctly in all cases" def __init__(self): self.cache = { '010': [{ 'tag': '1011', 'data': [180, 181] }] } def test_is_hit_true(self): """is_hit should return True if index and tag exist in cache""" nose.assert_true(sim.is_hit(self.cache, '010', '1011')) def test_is_hit_false_index_mismatch(self): """is_hit should return False if index does not exist in cache""" nose.assert_false(sim.is_hit(self.cache, '011', '1011')) def test_is_hit_false_tag_mismatch(self): """is_hit should return False if tag does not exist in cache""" nose.assert_false(sim.is_hit(self.cache, '010', '1010'))
Python
0
@@ -3283,20 +3283,13 @@ Test -CacheHitMiss +IsHit (obj
2a9f27c46810cb14d25ddb3282c72de4303ee5bd
raise KeyError on getitem
tests.py
tests.py
import unittest class KV(object): def __len__(self): return 0 class KVTest(unittest.TestCase): def test_new_kv_is_empty(self): self.assertEqual(len(KV()), 0)
Python
0
@@ -71,16 +71,72 @@ turn 0%0A%0A + def __getitem__(self, key):%0A raise KeyError%0A%0A %0Aclass K @@ -237,8 +237,134 @@ ()), 0)%0A +%0A def test_get_missing_value_raises_key_error(self):%0A with self.assertRaises(KeyError):%0A KV()%5B'missing'%5D%0A
9ad9cd796168dbc8a2a8e79528ecc3ff14b6f2b5
fix ssl var
tport.py
tport.py
#!/usr/bin/env python import sys import fileinput import json import logging from elasticsearch import Elasticsearch from elasticsearch.helpers import bulk import boto from boto.s3.key import Key import pymongo import happybase from docopt import docopt from addict import Dict import urllib3 from settings import (JSON_SETTINGS, ES_SETTINGS, S3_SETTINGS, MONGO_SETTINGS, HBASE_SETTINGS, KAFKA_SETTINGS) # disable annoying SSL certificate warnings urllib3.disable_warnings() # set up a logger logging.basicConfig(level=logging.INFO) class JsonPort(object): """ Parses out a JSON iterator object. parse(): Returns an JSON iterator object. Each iteration is a verified object. """ def __init__(self, jsonlist): self.jsonlist = jsonlist def parse(self): for i in self.jsonlist: try: yield json.loads(i) except ValueError: raise class ElasticPort(object): """Class to handle Elastic Search actions. index: Data input is a JSON generator. If using the command-line tool, this is handled via the JsonPort method which creates a JSON generator from lines read in from files. """ def __init__(self, host, ssl, logger=None): self.es = Elasticsearch(host, set_ssl=True) self.logger = logger or logging.getLogger(__name__) # self.logger.setLevel(logging.DEBUG) def query(self): pass def index(self, jsonit, iname, dtype): self.es.indices.create(iname, ignore=400) print dir(self) # Create a list of JSON objects for elastic search bulk indexing jsonbulk = [] for jobj in jsonit: jsonbulk.append({'_index': iname, '_type': dtype, '_id': jobj['id'], '_source': jobj }) self.logger.debug('done with %s' % jobj['id']) self.logger.info('sending %s records to the bulk api' % len(jsonbulk)) r = bulk(client=self.es, actions=jsonbulk, stats_only=True) self.logger.info('successful: %s; failed: %s' % (r[0], r[1])) def map(self): return None self.es.indices.put_mapping(index=ES_SETTINGS['index'], doc_type=ES_SETTINGS['dtype'], body=ES_SETTINGS['mapping'] ) class S3Port(object): def __init__(self): self.conn = boto.connect_s3(S3_SETTINGS['s3_access_key'], S3_SETTINGS['s3_secret_key']) def __str__(self): return "Connected to: {}".format(S3_SETTINGS['s3_access_key']) def compress(self): pass def upload(self, bucket_name, keylist): self.bucket = self.conn.create_bucket(bucket_name) for i in keylist: k = Key(self.bucket) k.key = i k.set_contents_from_filename(i) logging.info('{} file was uploaded to: {}'.format(i, bucket_name)) def download(self): pass class MongoPort(object): def connect(self): pass def add(self): pass class HbasePort(object): def connect(self): pass class KafkaPort(object): def connect(self): pass def produce(self): pass def consume(self): pass def main(): """ transporter: Transport JSON data to different outputs. Usage: tport es (<index> | <map> | <query>) --indexname=<indexname> --type=<type> FILE ... tport s3 (<upload> | <download>) --bucket=<bucket> FILE ... tport mongo --host=<host> --db=<db> --collection=<collection> FILE ... tport hbase FILE ... tport kafka (<produce> | <consume> ) --broker=<broker> --topic=<topic> FILE ... Examples: Upload files (preferably serialized JSON ) to S3 tport s3 upload --bucket=<bucket> FILE ... Options: Notes: Might want to pass in the SETTINGS file in the command line rather than having it in the import process. """ args = docopt(main.__doc__) f = args['FILE'] if args['es']: # Connect to elastic search esi = ElasticPort(ES_SETTINGS['host'], ES_SETTINGS['ssl']) if args['<index>']: cli_iname = args['--indexname'] cli_dtype = args['--type'] cli_jsonit = JsonPort(fileinput.input(f)) esi.index(cli_jsonit.parse(), cli_iname, cli_dtype) if args['s3']: if args['<upload>']: s3u = S3Port() logging.info('upload starting...') s3u.upload(args['--bucket'], f) logging.info('upload complete') if args['<download>']: pass if args['mongo']: pass if args['hbase']: pass if args['kafka']: pass if __name__ == '__main__': sys.exit(main())
Python
0.000469
@@ -1341,20 +1341,19 @@ set_ssl= -True +ssl )%0A
7090057e5d2c747cb2ee9550dba651537ce06664
Add comment
train.py
train.py
#!/usr/bin/python3 import os import time import pickle import configparser import shutil from time import localtime, strftime from subprocess import call from optparse import OptionParser parser = OptionParser() parser.add_option("--config_file", dest="config_file") (options, args) = parser.parse_args() config_file = options.config_file config_parser = configparser.ConfigParser() config_parser.read(config_file) model_name = config_parser['MODEL']['ModelName'] basename = config_parser['PATHS']['BaseName'] nb_iterations = int(config_parser['MODEL']['NumberOfIterations']) if os.path.exists(basename): basename = basename config_file = os.path.join(basename, config_file) else: basename = strftime("%Y_%m_%d_%H%M%S_", localtime()) + model_name os.makedirs(basename) # copy configuration file shutil.copyfile(config_file, os.path.join(basename, config_file)) config_file = os.path.join(basename, config_file) weight_file_path = os.path.join(basename, "weights.h5") history_file_path = os.path.join(basename, "history.pkl") tmp_history_file_path = os.path.join(basename, "history_tmp.pkl") lock_file = os.path.join(basename, "file.lock") # Arguments qsub_args = [ "qsub", "-cwd", "-l", "gpu=1", "-e", os.path.join(basename, "stderr.error"), "-o", os.path.join(basename, "stdout.log"), "./run_job.sh", weight_file_path, tmp_history_file_path, lock_file, config_file ] def train(): print("#############################") print("# Training Settings") print("#############################") print("Model : ", model_name) print("Weight path : ", weight_file_path) print("History path : ", history_file_path) train_loss = [] valid_loss = [] train_acc = [] valid_acc = [] # if exists means we are restarting a crashed training if os.path.isfile(history_file_path): print("Loading previous history data...") with open(history_file_path, 'rb') as input: train_loss = pickle.load(input) valid_loss = pickle.load(input) train_acc = pickle.load(input) valid_acc = pickle.load(input) for i in range(nb_iterations): # create lock file print("Creating lock file: ", lock_file) open(lock_file, 'a').close() # submit job, train once print("Submitting Job ", str(i), "/", str(nb_iterations)) if not i == 0: call(qsub_args + ['False']) else: call(qsub_args + ['True']) # block until job is finished while os.path.exists(lock_file): time.sleep(5) print("Job " + str(i) + " is done.") # load all history data and append print("Loading temporary history data...") with open(tmp_history_file_path, 'rb') as input: train_loss = train_loss + pickle.load(input) valid_loss = valid_loss + pickle.load(input) train_acc = train_acc + pickle.load(input) valid_acc = valid_acc + pickle.load(input) # save all collected history data print("Save all collected history data...") with open(history_file_path, 'wb') as output: pickle.dump(train_loss, output, pickle.HIGHEST_PROTOCOL) pickle.dump(valid_loss, output, pickle.HIGHEST_PROTOCOL) pickle.dump(train_acc, output, pickle.HIGHEST_PROTOCOL) pickle.dump(valid_acc, output, pickle.HIGHEST_PROTOCOL) train()
Python
0
@@ -1174,17 +1174,205 @@ %0A%0A# -Arguments +This was designed to run in a queue system. If this is not what you want to do%0A# simply comment out the five first elements in the qsub_args list, and just run%0A# the script directly on the GPU/CPU. %0Aqsu
36fe33f9058c32b2ab96484746c7a98d84b7850f
Reorganize the output that is printed by default with an option -s to print scores.
train.py
train.py
#!/usr/bin/env python # # Copyright 2012 Ajay Narayan, Madhusudan C.S., Shobhit N.S. # # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import argparse import cProfile import numpy from sklearn import cross_validation from sklearn.feature_extraction.text import Vectorizer from sklearn import metrics from sklearn.svm import LinearSVC from parser import parse_imdb_corpus from parser import parse_training_corpus SENTIMENT_MAP = { 'positive': 1, 'negative': -1, 'neutral': 0, 'irrelevant': 0, } def vectorize(classification, tweets): """Maps the classification and tweets to numerical values for classifier. Args: classification: A list containing the classification to each individual tweet in the tweets list. tweets: A list of already hand classified tweets to train our classifier. """ # We map the sentiments to the values specified in the SENTIMENT_MAP. # For any sentiment that is not part of the map we give a value 0. classification_vector = numpy.array(map( lambda s: SENTIMENT_MAP.get(s.lower(), 0), classification)) vectorizer = Vectorizer() feature_vector = vectorizer.fit_transform(tweets) return (classification_vector, feature_vector) def train_and_validate(classification, tweets): """Trains the SVC with the training data and validates with the test data. We do a K-Fold cross validation with K = 10. Args: classification: A list containing the classification to each individual tweet in the tweets list. tweets: A list of already hand classified tweets to train our classifier. """ classification_vector, feature_vector = vectorize(classification, tweets) classifier = LinearSVC(loss='l2', penalty='l1', C=1000, dual=False, tol=1e-3) # The value for the keyword argument cv is the K value in the K-Fold cross # validation that will be used. scores = cross_validation.cross_val_score( classifier, feature_vector, classification_vector, cv=10, score_func= ( lambda true, predicted: metrics.precision_recall_fscore_support( true, predicted, pos_label=None))) return scores def build_ui(scores): """Prints out all the scores calculated. """ for i, score in enumerate(scores): print "Cross Validation: %d" % (i + 1) print "*" * 40 print "Class\t\t\tPrecision\tRecall\t\tF-Score" print "~~~~~\t\t\t~~~~~~~~~\t~~~~~~\t\t~~~~~~~" precision = score[0] recall = score[1] f_score = score[2] print "Positive:\t\t%f\t%f\t%f" % (precision[0], recall[0], f_score[0]) print "Negative:\t\t%f\t%f\t%f" % (precision[1], recall[1], f_score[1]) print "Neutral:\t\t%f\t%f\t%f" % (precision[2], recall[2], f_score[2]) print def bootstrap(): """Bootstrap the entire training process. """ parser = argparse.ArgumentParser(description='Trainer arguments.') parser.add_argument('-c', '--corpus-file', dest='corpus_file', metavar='Corpus', type=file, nargs='?', help='name of the input corpus file.') parser.add_argument('-p', '--profile', metavar='Profile', type=str, nargs='?', help='Run the profiler.') args = parser.parse_args() corpus_file =open('/Users/shobhitns/sentiment-analyzer/full-corpus.csv') if not corpus_file: print ( "If you are running this as a standalone program supply the " "corpus file for training data to option -c/--corpus-file. Use " "-h option for more help on usage.") return classification, tweets = parse_training_corpus(corpus_file) tweetsPos = parse_imdb_corpus('/Users/shobhitns/sentiment-analyzer/positive') classPos = len(tweetsPos) * ['positive'] tweetsNeg = parse_imdb_corpus('/Users/shobhitns/sentiment-analyzer/negative') classNeg = len(tweetsNeg) * ['negative'] scores = train_and_validate(classification + classPos + classNeg, tweets + tweetsPos + tweetsNeg) return scores if args.profile: if isinstance(args.profile, str): cProfile.run('train_and_validate(classification, tweets)', args.profile) print 'Profile stored in %s' % args.profile else: cProfile.run('train_and_validate(classification, tweets)') else: scores = train_and_validate(classification, tweets) return scores if __name__ == '__main__': scores = bootstrap()
Python
0
@@ -3821,24 +3821,164 @@ profiler.')%0A + parser.add_argument(%0A '-s', '--scores', action='store_true',%0A help='Prints the scores. Cannot be run with -p turned on.')%0A args = p @@ -4808,16 +4808,18 @@ :%0A + if isins @@ -4844,32 +4844,36 @@ , str):%0A + cProfile.run('tr @@ -4860,33 +4860,53 @@ cProfile.run -( +ctx(%0A 'train_and_valid @@ -4934,16 +4934,113 @@ weets)', +%0A globals(), %7B'classification': classification, 'tweets': tweets%7D,%0A args.pr @@ -5044,18 +5044,23 @@ .profile +, )%0A + @@ -5105,30 +5105,36 @@ ofile%0A + else:%0A + cPro @@ -5141,17 +5141,37 @@ file.run -( +ctx(%0A 'train_a @@ -5206,16 +5206,128 @@ tweets)' +,%0A globals(), %7B'classification': classification, 'tweets': tweets%7D,%0A args.profile, )%0A el @@ -5326,24 +5326,26 @@ )%0A else:%0A + scores @@ -5390,16 +5390,72 @@ tweets)%0A + if args.scores:%0A build_ui(scores)%0A%0A re @@ -5468,17 +5468,16 @@ cores%0A%0A%0A -%0A if __nam
6ad32a429163b5fd92093170fd9f0adb1f98931c
Add info key to response json
src/model.py
src/model.py
# -*- coding: utf-8 -*- import sha, json, time, uuid, operator # placeholders deposits = [] users = [] class User(object): @classmethod def user_dennis(cls): return User(name="Dennis Blommesteijn", email="dennis.blommesteijn@surfsara.nl", password="dennis123") @classmethod def user_emanuel(cls): return User(name="Emanuel Dima", email="emanuel.dima@uni-tuebingen.de", password="eman$123") @classmethod def user_carl(cls): return User(name="Carl Johan Håkansson", email="cjhak@kth.se", password="carl$123") @classmethod def user_lassi(cls): return User(name="Lassi Lehtinen", email="lassi.lehtinen@csc.fi", password="lassi$123") @classmethod def user_sarah(cls): return User(name="Sarah Berenji", email="sarahba@pdc.kth.se", password="lassi$123") def __init__(self, name, email, password): self._name = name self._email = email self._password = sha.new(email + ":" + password).hexdigest() self.new_token() def gen_token(self): time_ms = str(int(round(time.time() *1000))) return str(sha.new(self._email + ":" + time_ms).hexdigest()) def new_token(self): self._token = self.gen_token() return self._token def to_dict(self): return {'user': { 'name': self._name, 'email': self._email, 'token': self._token }} def get_email(self): return self_email def to_json(self): return json.dumps(self.to_dict()) def get_email(self): return self._email def get_token(self): return self._token @classmethod def find_user(cls, email=None, password=None, token=None): for u in users: if email and password: if u.verify_email_password(email=email, password=password): return u elif token: if u.verify_token(token=token): return u return None def verify_email_password(self, email, password): ep = sha.new(email + ":" + password).hexdigest() return (email == self._email and ep == self._password) def verify_token(self, token): # verify token and generate new one if self._token == token: self.new_token() return True # invalid token else: return False @classmethod def to_users_json(cls, us, user=None): return json.dumps({'users': [u.to_json() for u in us]}) class Deposit(object): def __init__(self, title, description): self._uuid = str(uuid.uuid4()) self._title = title self._description = description self._created_at = time.time() def to_dict(self): return {'deposit': { 'uuid': self._uuid, 'title': self._title, 'description': self._description, 'authors': [], 'domain': "", 'created_at': str(int(self._created_at*1000)), 'modified_at': str(int(time.time()*1000)), 'pid': '', 'files': [], 'license': '' }} def to_json(self, user=None): return json.dumps(self.to_dict()) def get_created_at(self): return self._created_at def get_uuid(self): return self._uuid @classmethod def to_deposits_json(cls, ds, user=None): return json.dumps({'deposits': [d.to_dict() for d in ds]}) @classmethod def get_deposits(cls, page, size, order_by, order, user=None): start = (page - 1) * size end = start + size # sort reverse = order == 'asc' ds = sorted(deposits, key=lambda d: d.get_created_at(), reverse=reverse) return ds[start:end] @classmethod def find_deposit(cls, uuid, user=None): for d in deposits: if d.get_uuid() == uuid: return d return None # user, deposit test values users = [ User.user_dennis(), User.user_emanuel(), User.user_sarah(), User.user_lassi(), User.user_carl() ] for i in range(1000): d = Deposit(title="Deposit "+str(i), description="Description of deposit " + str(i)) deposits.append(d) time.sleep(.001)
Python
0
@@ -1469,24 +1469,26 @@ self._token +%7D, %0A %7D%7D%0A @@ -1484,19 +1484,28 @@ +'info':%7B %7D%7D%0A +%0A def @@ -3234,16 +3234,35 @@ nse': '' +%7D,%0A 'info':%7B %0A @@ -3457,16 +3457,83 @@ ._uuid%0A%0A + @classmethod%0A def count(cls):%0A return len(deposits)%0A%0A @cla @@ -3651,16 +3651,64 @@ d in ds%5D +,%0A 'info': %7B'count': Deposit.count()%7D %7D)%0A%0A
561340c241dcbd9021e27dda44675ff8eaed9ad3
add unix_socket argument
src/mysql.py
src/mysql.py
#!/usr/bin/env python # # igcollect - Mysql Status # # Copyright (c) 2016, InnoGames GmbH # try: from mysql.connector import connect except ImportError: from MySQLdb import connect from argparse import ArgumentParser from time import time def parse_args(): parser = ArgumentParser() parser.add_argument('--prefix', default='mysql') parser.add_argument('--host', default='localhost') parser.add_argument('--user') parser.add_argument('--password') return parser.parse_args() def main(): args = parse_args() template = args.prefix + '.{}.{} {} ' + str(int(time())) db = connect( user=args.user, passwd=args.password, host=args.host, ) cur = db.cursor() # Check for global status cur.execute('SHOW GLOBAL STATUS') for row in cur.fetchall(): if row[1].isdigit(): print(template.format('status', row[0], row[1])) cur.execute('SHOW VARIABLES') for row in cur.fetchall(): if row[1].isdigit(): print(template.format('variables', row[0], row[1])) # Find out how much space we can recover by Optimize sysdbs = { 'information_schema', 'performance_schema', 'mysql', 'sys', 'test', } free = 0 cur.execute('SHOW DATABASES') for row in cur.fetchall(): if row[0] in sysdbs: continue cur.execute( 'SELECT table_name, ' 'ROUND(data_free / 1024 / 1024), ' 'ROUND((data_length + index_length), 2) ' 'FROM information_schema.tables ' 'WHERE table_schema = %s', [row[0]] ) for value in cur.fetchall(): print(template.format('table_size', value[0], value[2])) free += value[1] print(template.format('status', 'optimize_freeable', free)) if __name__ == '__main__': main()
Python
0.000015
@@ -472,16 +472,119 @@ sword')%0A + parser.add_argument(%0A '--unix-socket',%0A default='/var/run/mysqld/mysqld.sock',%0A )%0A retu @@ -802,16 +802,54 @@ s.host,%0A + unix_socket=args.unix_socket,%0A )%0A
b33ffb6d15c29697c158743f89c2adf5a2e19e32
Update working draft URL.
src/setup.py
src/setup.py
#!/usr/bin/env python # # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. # * Neither the name of Google Inc. nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """Set up script for mod_pywebsocket. """ from distutils.core import setup import sys _PACKAGE_NAME = 'mod_pywebsocket' if sys.version < '2.3': print >>sys.stderr, '%s requires Python 2.3 or later.' % _PACKAGE_NAME sys.exit(1) setup(author='Yuzo Fujishima', author_email='yuzo@chromium.org', description='Web Socket extension for Apache HTTP Server.', long_description=( 'mod_pywebsocket is an Apache HTTP Server extension for ' 'Web Socket (http://tools.ietf.org/html/' 'draft-hixie-thewebsocketprotocol). ' 'See mod_pywebsocket/__init__.py for more detail.'), license='See COPYING', name=_PACKAGE_NAME, packages=[_PACKAGE_NAME, _PACKAGE_NAME + '.handshake'], url='http://code.google.com/p/pywebsocket/', version='0.5.2', ) # vi:sts=4 sw=4 et
Python
0
@@ -2103,13 +2103,17 @@ aft- -hixie +ietf-hybi -the
51084b951d7d878d5400a6bfca1c8da1793b0a17
Modify init method of staffto take in staff person type only
src/staff.py
src/staff.py
from .person import Person class Staff(Person): def __init__(self, first_name, last_name, person_type, person_id, has_living_space = None, has_office = None): super(Staff, self).__init__(first_name, last_name, person_type, "N", person_id, has_living_space, has_office)
Python
0
@@ -89,29 +89,16 @@ st_name, - person_type, person_ @@ -209,19 +209,15 @@ me, -person_type +%22staff%22 , %22N
4ff9bfee6cba0ac2bd28af5c3864be4826d43a2d
Fix crash UnicodeEncodeError on url
src/tools.py
src/tools.py
# -*- coding: utf-8 -*- import json import os import sys import urllib2 def decode_to_string(data): """ Decode the strings in the list/set so we can call print the strings without the 'u' in front Args: data (list(str) or set(str)) """ return str([x.encode('UTF8') for x in data]) def try_address(fqdn): """ Check if the fqdn is valid Args: fqdn (str): fully qualified domain name """ import socket try: socket.gethostbyname_ex(fqdn) except socket.gaierror: return False else: return True def validate_uri(uri, error_field, callback): """ Args: uri (str): MongoDB URI error_field (urwid.Text): field that displays the error callback (function): callback to call on success """ parsed = parse_mongo_uri(uri) if parsed and try_address(parsed['nodelist'][0][0]): callback(parsed) else: error_field.set_error("Invalid domain") def validate_email(email): import re valid = re.compile(r"^[^@]+@[^@]+\.[^@]+$") return valid.match(email.strip()) def parse_mongo_uri(conn): """ Args: conn (str): MongoDB URI Returns: dict(str: str) or None: parsed MongoDB URI { 'nodelist': <list of (host, port) tuples>, 'username': <username> or None, 'password': <password> or None, 'database': <database name> or None, 'collection': <collection name> or None, 'options': <dict of MongoDB URI options> } """ from pymongo import uri_parser conn = conn.split('://')[-1] try: uri = uri_parser.parse_uri("mongodb://" + conn) except (uri_parser.InvalidURI, ValueError, uri_parser.ConfigurationError): return None else: return uri def send_result(email, result, title, urn): """ Args: email (str): address to send the results result (obj): results to send title (str): urn (str): uniform resource name Returns: str: response from endpoint """ url = 'https://mongoaud.it/results' headers = {'Content-type': 'application/json', 'Accept': 'application/json'} values = {'email': email, 'result': result, 'title': title, 'urn': urn, 'date': get_date()} try: req = urllib2.Request(url, json.dumps(values), headers) response = urllib2.urlopen(req) return response.read() except (urllib2.HTTPError, urllib2.URLError) as exc: return "Sadly enough, we are having technical difficulties at the moment, " \ "please try again later.\n\n%s" % str(exc) def load_test(path): base_path = getattr(sys, '_MEIPASS', os.path.abspath(".")) with open(os.path.join(base_path, 'rsc/' + path)) as json_data: return json.load(json_data) def get_date(): import time import calendar local = time.localtime(time.time()) nth = ["st", "nd", "rd", None][min(3, local.tm_mday % 10 - 1)] or 'th' return "%s %d%s %d @ %02d:%02d" % ( calendar.month_abbr[local.tm_mon], local.tm_mday, nth, local.tm_year, local.tm_hour, local.tm_min) def check_version(version): # if application is binary then check for latest version if getattr(sys, 'frozen', False): try: url = "https://api.github.com/repos/stampery/mongoaudit/releases/latest" req = urllib2.urlopen(url) releases = json.loads(req.read()) latest = releases["tag_name"] if version < latest: print("mongoaudit version " + version) print("There's a new version " + latest) _upgrade(releases) except (urllib2.HTTPError, urllib2.URLError): print("Couldn't check for upgrades") except os.error: print("Couldn't write mongoaudit binary") def _check_md5(file_path, md5): import hashlib with open(file_path) as mongoaudit_bin: binary_md5 = hashlib.md5(mongoaudit_bin.read()).hexdigest() return binary_md5 == md5 def _clean_upgrade(binary_ok, binary_path, path, temp_path): if binary_ok: import stat # save the permissions from the current binary old_stat = os.stat(binary_path) # rename the current binary in order to replace it with the latest os.rename(binary_path, path + "/old") os.rename(temp_path, binary_path) # set the same permissions that had the previous binary os.chmod(binary_path, old_stat.st_mode | stat.S_IEXEC) # delete the old binary os.remove(path + "/old") print("mongoaudit updated, restarting...") os.execl(binary_path, binary_path, *sys.argv) else: os.remove(temp_path) print("couldn't download the latest binary") def _download_binary(release, temp_path): req = urllib2.urlopen(release["binary"]) binary_ok = False attempts = 0 while not binary_ok and attempts < 3: with open(temp_path, "wb+") as mongoaudit_bin: mongoaudit_bin.write(req.read()) # verify integrity of downloaded file print("Verifing mongoaudit integrity") if _check_md5(temp_path, release["md5"]): binary_ok = True print("Integrity check passed") attempts += 1 return binary_ok def _upgrade(releases): release = _get_release_link(releases["assets"]) if release: print("Upgrading to latest version") binary_path = sys.executable path = os.path.dirname(binary_path) temp_path = path + "/temp" binary_ok = _download_binary(release, temp_path) _clean_upgrade(binary_ok, binary_path, path, temp_path) else: print("There's no binary for this platform") def _get_md5(link, uname): md5 = urllib2.urlopen(link).read().split("\n") for line in md5: if uname in line: return line.split()[0] return None def _get_release_link(assets): import platform platform_system = platform.system().lower() uname = "macosx" if platform_system == "darwin" else platform_system release = {} for asset in assets: download_url = asset["browser_download_url"] release_platform = download_url.rsplit('-', 1)[1] if release_platform == uname: release["binary"] = download_url elif release_platform == "checksums.txt": release["md5"] = _get_md5(download_url, uname) if len(release) == 2: return release return None def in_range(num, minimum, maximum): return minimum <= num <= maximum
Python
0.00001
@@ -508,16 +508,17 @@ except +( socket.g @@ -520,24 +520,45 @@ ket.gaierror +, UnicodeEncodeError) :%0A re
b4564cedb3e2829846ded5dc07cdb9dec45b6808
allow for no body of with expression
src/parse.py
src/parse.py
import tokenize import ast bools = ['true', 'false'] class Parser: def __init__(self, source_string): self.tokenizer = tokenize.Tokenizer(source_string) self.function_map = { 'if': self.if_, 'define': self.define, 'lambda': self.lambda_, 'struct': self.struct, 'member': self.member, 'with': self.with_, } def parse_expression(self): current = self.tokenizer.chomp() if current == '(': return self.func_call() elif current.isdigit() or (current[1:].isdigit() and current[0] == '-'): return ast.IntNode(current) elif current in bools: return ast.BoolNode(current) else: return ast.VariableNode(current) def maybe_parse_expression(self): if self.tokenizer.peek() == '': return ast.GetEnvironmentBindingNode() else: return self.parse_expression() def func_call(self): func_name = self.tokenizer.chomp() if func_name in self.function_map: func = self.function_map[func_name]() if func_name != 'define': close = self.tokenizer.chomp() return func else: operands = [] while True: if self.tokenizer.peek() == ')': break operands.append(self.parse_expression()) close = self.tokenizer.chomp() return ast.FunctionCallNode(func_name, operands) def define(self): name = self.tokenizer.chomp() expression = self.parse_expression() close = self.tokenizer.chomp() body = self.maybe_parse_expression() return ast.BindingNode(name, expression, body) def if_(self): cond_expr = self.parse_expression() then_expr = self.parse_expression() else_expr = self.parse_expression() return ast.ConditionalNode(cond_expr, then_expr, else_expr) def lambda_(self): remaining_args = None open_bracket = self.tokenizer.chomp() args = [] while True: if self.tokenizer.peek() == ']': break if self.tokenizer.peek() == '...': elipsis = self.tokenizer.chomp() remaining_args = self.tokenizer.chomp() break args.append(self.tokenizer.chomp()) close_bracket = self.tokenizer.chomp() body = self.parse_expression() return ast.LambdaNode(body, args, remaining_args) def struct(self): members = [] while True: if self.tokenizer.peek() == ')': break members.append(self.tokenizer.chomp()) return ast.StructDeclarationNode(members) def member(self): struct_name = self.tokenizer.chomp() member_name = self.tokenizer.chomp() return ast.MemberAccessNode(struct_name, member_name) def with_(self): module_name = self.tokenizer.chomp() close = self.tokenizer.chomp() body = self.parse_expression() return ast.LoadingNode(module_name, body)
Python
0.000019
@@ -3110,32 +3110,38 @@ body = self. +maybe_ parse_expression
54b7a22465be75a81257a4f3f31cc3247fd67550
fix encoding issues during indexation
core/processor.py
core/processor.py
""" """ import sys sys.path.append('gen-py.twisted') sys.path.append('../lib') import lru from memorystructure import MemoryStructure as ms # TODO: # - handle errorcode # - metadataItems -> parsing later ? def generate_cache_from_pages_list(pageList, precision_limit = 1, precision_exceptions = [], verbose = False) : if verbose : print "### createCache" pages = {} links = {} original_link_number = 0 nodes = {} for page_item in pageList : page_item["lru"] = lru.cleanLRU(page_item["lru"]) is_full_precision = lru.isFullPrecision(page_item["lru"], precision_exceptions) lru_head = lru.getLRUHead(page_item["lru"], precision_exceptions) is_node = lru.isLRUNode(page_item["lru"], precision_limit, lru_head=lru_head) node_lru = page_item["lru"] if is_node else lru.getLRUNode(page_item["lru"], precision_limit, lru_head=lru_head) nodes[node_lru] = 1 # Create index of crawled pages from queue if page_item["lru"] not in pages: pages[page_item["lru"]] = ms.PageItem(str(page_item["_id"]), page_item["url"], page_item["lru"], str(page_item["timestamp"]), int(page_item["status"]), int(page_item["depth"]), str(page_item["error"]), ['CRAWL'], is_full_precision, is_node, {}) else: if 'CRAWL' not in pages[page_item["lru"]].sourceSet: pages[page_item["lru"]].sourceSet.append('CRAWL') pages[page_item["lru"]].depth = max(0, min(pages[page_item["lru"]].depth, int(page_item["depth"]))) # Add to index linked pages and index all links between nodes if "lrulinks" in page_item: for index,lrulink in enumerate(page_item["lrulinks"]) : lrulink = lru.cleanLRU(lrulink) is_full_precision = lru.isFullPrecision(lrulink, precision_exceptions) lru_head = lru.getLRUHead(lrulink, precision_exceptions) is_node = lru.isLRUNode(lrulink, precision_limit, lru_head=lru_head) target_node = lrulink if is_node else lru.getLRUNode(lrulink, precision_limit, lru_head=lru_head) nodes[target_node] = 1 original_link_number += 1 # check False {} errorcode if lrulink not in pages: pages[lrulink] = ms.PageItem(str(page_item["_id"])+"_"+str(index), lru.lru_to_url(lrulink), lrulink, str(page_item["timestamp"]), None, int(page_item["depth"])+1, None, ['LINK'], is_full_precision, is_node, {}) elif 'LINK' not in pages[lrulink].sourceSet: pages[lrulink].sourceSet.append('LINK') links[(node_lru,target_node)] = links[(node_lru,target_node)] + 1 if (node_lru,target_node) in links else 1 if verbose: print str(len(pages))+" unique pages ; "+str(original_link_number)+" links ; "+str(len(links.values()))+" unique links / identified "+str(len(nodes))+" nodes" return (pages, [(source, target, weight) for (source,target),weight in links.iteritems()])
Python
0.000006
@@ -1,12 +1,58 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A %22%22%22%0A%0A%22%22%22%0A%0Aim @@ -1153,16 +1153,31 @@ m%5B%22url%22%5D +.encode('utf8') , page_i @@ -1186,16 +1186,31 @@ m%5B%22lru%22%5D +.encode('utf8') , str(pa @@ -2452,17 +2452,47 @@ ink) -, lrulink +.encode('utf8'), lrulink.encode('utf8') , st
74c294d11c3ba98f497df73fdd5d5061da601975
add the -j argument
src/scons.py
src/scons.py
#!/usr/bin/env python import getopt import os.path import string import sys opts, targets = getopt.getopt(sys.argv[1:], 'f:') Scripts = [] for o, a in opts: if o == '-f': Scripts.append(a) if not Scripts: Scripts.append('SConstruct') # XXX The commented-out code here adds any "scons" subdirs in anything # along sys.path to sys.path. This was an attempt at setting up things # so we can import "node.FS" instead of "scons.Node.FS". This doesn't # quite fit our testing methodology, though, so save it for now until # the right solutions pops up. # #dirlist = [] #for dir in sys.path: # scons = os.path.join(dir, 'scons') # if os.path.isdir(scons): # dirlist = dirlist + [scons] # dirlist = dirlist + [dir] # #sys.path = dirlist from scons.Node.FS import init, Dir, File, lookup from scons.Environment import Environment init() def Conscript(filename): Scripts.append(filename) while Scripts: file, Scripts = Scripts[0], Scripts[1:] execfile(file) for path in targets: target = lookup(File, path) target.build()
Python
0.009493
@@ -75,56 +75,474 @@ ys%0A%0A -opts, targets = getopt.getopt(sys.argv%5B1:%5D, 'f:' +def PrintUsage():%0A print %22Usage: scons %5BOPTION%5D... TARGET...%22%0A print %22Build TARGET or multiple TARGET(s)%22%0A print %22 %22%0A print ' -f CONSCRIPT execute CONSCRIPT instead of %22SConstruct%22'%0A print %22 -j N execute N parallel jobs%22%0A print %22 --help print this message and exit%22%0A%0Atry:%0A opts, targets = getopt.getopt(sys.argv%5B1:%5D, 'f:j:', %5B'help'%5D)%0Aexcept getopt.GetoptError, x:%0A print x%0A PrintUsage()%0A sys.exit( )%0A%0AS @@ -554,16 +554,29 @@ s = %5B%5D%0A%0A +num_jobs = 1%0A for o, a @@ -622,16 +622,299 @@ end(a)%0A%0A + if o == '-j':%0A try:%0A num_jobs = int(a)%0A except:%0A PrintUsage()%0A sys.exit(1)%0A%0A if num_jobs %3C= 0:%0A PrintUsage()%0A sys.exit(1)%0A %0A if o == '--help':%0A PrintUsage()%0A sys.exit(0)%0A %0A if not S @@ -1380,17 +1380,21 @@ cons):%0A# -%09 + dirlist @@ -1467,16 +1467,17 @@ irlist%0A%0A +%0A from sco @@ -1559,16 +1559,67 @@ ironment +%0Aimport scons.Job%0Afrom scons.Builder import Builder %0A%0Ainit() @@ -1764,27 +1764,310 @@ %0A%0A%0A%0A -for path in +class Task:%0A %22this is here only until the build engine is implemented%22%0A%0A def __init__(self, target):%0A self.target = target%0A%0A def execute(self):%0A self.target.build()%0A%0A%0A%0Aclass Taskmaster:%0A %22this is here only until the build engine is implemented%22%0A%0A def __init__(self, targets :%0A%09t @@ -2066,51 +2066,553 @@ gets +) :%0A -%09target = lookup(File, path)%0A%09target.build + self.targets = targets%0A self.num_iterated = 0%0A%0A%0A def next_task(self):%0A if self.num_iterated == len(self.targets):%0A return None%0A else:%0A current = self.num_iterated%0A self.num_iterated = self.num_iterated + 1%0A return Task(self.targets%5Bcurrent%5D)%0A%0A def is_blocked(self):%0A return 0%0A%0A def executed(self, task):%0A pass%0A%0A%0A%0Ataskmaster = Taskmaster(map(lambda x: lookup(File, x), targets))%0A%0Ajobs = scons.Job.Jobs(num_jobs, taskmaster)%0Ajobs.start()%0Ajobs.wait ()%0A +%0A%0A
ee5f6d2481168179f2da25251b086b11a6e3ef00
allow override s3 connection to s3file
splits/s3.py
splits/s3.py
import StringIO import gzip import boto.s3 import boto.s3.connection import urlparse from itertools import groupby def is_s3_uri(uri): uri = str(uri) return uri.startswith('s3://') or uri.startswith('s3n://') class S3Uri(object): def __init__(self, uri): uri = str(uri) assert is_s3_uri(uri), "Invalid S3 uri - '{0}'".format(uri) self._parseresult = urlparse.urlparse(uri) @property def bucket(self): return self._parseresult.netloc @property def path(self): p = self._parseresult.path if p.startswith('/'): p = p[1:] return p @property def name(self): return self._parseresult.geturl() @property def type(self): return self.is_file() and "file" or "dir" def is_file(self): return len(self.path) and not self.path.endswith('/') def __str__(self): return self.name class S3(object): def __init__(self, region='us-east-1'): self._conn = boto.s3.connect_to_region( region, calling_format=boto.s3.connection.OrdinaryCallingFormat() ) @property def access_key(self): return self._conn.access_key @property def secret_key(self): return self._conn.secret_key @property def security_token(self): return self._conn.provider.security_token def _list_prefix(self, s3uri): results = self._conn.get_bucket(s3uri.bucket).list(s3uri.path, delimiter='/') return (S3Uri('s3://{0}/{1}'.format(s3uri.bucket, i.name)) for i in results) def _list_buckets(self): return (S3Uri('s3://{0}'.format(i.name)) for i in self._conn.get_all_buckets()) def ls(self, uri=None): if uri: s3uri = S3Uri(uri) return self._list_prefix(s3uri) return self._list_buckets() def get_key(self, uri): uri = S3Uri(uri) assert uri.is_file() return self._conn.get_bucket(uri.bucket)\ .get_key(uri.path) def putfile(self, file, uri): uri = S3Uri(uri) assert uri.is_file() self._conn.get_bucket(uri.bucket)\ .new_key(uri.path)\ .set_contents_from_file(file, rewind=True) def getfile(self, uri, file): uri = S3Uri(uri) assert uri.is_file() self._conn.get_bucket(uri.bucket)\ .new_key(uri.path)\ .get_contents_to_file(file) def getstring(self, uri): uri = S3Uri(uri) assert uri.is_file() return self._conn.get_bucket(uri.bucket).new_key(uri.path).get_contents_as_string() def putstring(self, string, uri): uri = S3Uri(uri) assert uri.is_file() self._conn.get_bucket(uri.bucket).new_key(uri.path).set_contents_from_string(string) def rm(self, uris): uris = [S3Uri(uri) for uri in uris] for bucket, group in groupby( sorted(uris, key=lambda uri: uri.bucket), lambda i: i.bucket): returned_keys = self._conn.get_bucket(bucket)\ .delete_keys( boto.s3.key.Key(bucket, i.path) for i in group) if(len(returned_keys.errors) > 0): raise IOError('Could not delete keys: {keys}'.format( keys=[k for k in returned_keys.errors])) class S3File(StringIO.StringIO): s3 = None def __init__(self, uri, mode='r'): self.mode = mode self.s3uri = S3Uri(uri) assert self.s3uri.is_file(), "Uri (got {0}) must be a file (not directory or bucket) on S3.".format(uri) self.__init_s3() StringIO.StringIO.__init__(self) if self.mode == 'r': self.s3.getfile(self.s3uri, self) self.seek(0) def __init_s3(cls): if not cls.s3: cls.s3 = S3() def __enter__(self): return self def __exit__(self, type, value, traceback): self.close() def close(self): if self.mode == 'w': self.flush() self.s3.putfile(self, self.s3uri) class GzipS3File(gzip.GzipFile): def __init__(self, uri, *args, **kwargs): mode = kwargs['mode'] if 'mode' in kwargs else 'r' self.s3File = S3File(uri, mode=mode) super(GzipS3File, self).__init__(fileobj=self.s3File, mode=mode) def close(self): super(GzipS3File, self).close() self.s3File.close()
Python
0.000001
@@ -78,16 +78,31 @@ rlparse%0A +import zipfile%0A from ite @@ -566,17 +566,16 @@ ult.path - %0A @@ -3521,16 +3521,27 @@ mode='r' +, s3 = None ):%0A @@ -3697,32 +3697,90 @@ 3.%22.format(uri)%0A + if s3:%0A self.s3 = s3%0A else:%0A self.__i @@ -4243,17 +4243,16 @@ s3uri)%0A%0A -%0A class Gz
28efacf9c2c27e99925a5dce72c7ffc9ff5677ac
Resolve infinite loop
projects_controller.py
projects_controller.py
import psycopg2 import config PROJECTS_KEY_ORDER = ['id', 'name', 'slug', 'description', 'photo_url', 'past_project'] GET_PROJECTS_QUERY = 'SELECT project_id, name, slug, description, photo_url, past_project FROM projects ORDER BY display_order;' GET_PROJECT_PHOTOS_QUERY = 'SELECT photo_url FROM project_photos WHERE project_id = %s ORDER BY display_order;' GET_PROJECT_NEEDS_QUERY = 'SELECT need_text FROM project_needs WHERE project_id = %s ORDER BY display_order;' PROJECT_LEADER_KEY_ORDER = ['name', 'phone', 'email', 'bio', 'photo_url'] GET_PROJECT_LEADERS_QUERY = ( 'SELECT name, phone, email, bio, photo_url FROM leaders WHERE leader_id IN ' '(SELECT leader_id FROM project_leaders WHERE project_id = %s ORDER BY display_order);' ) def dict_from_array_with_keys(raw_data_array, ordered_keys): data_dict = {} for attr_num in xrange(len(raw_data_array)): key_name = ordered_keys[attr_num] data_dict[key_name] = raw_data_array[attr_num] return data_dict class ProjectsController: def __init__(self): self.current_projects = None self.projects_loaded = False self.past_projects = None self.all_projects = None self.pg_conn = psycopg2.connect(host=config.DB_SETTINGS['HOST'], database=config.DB_SETTINGS['DATABASE'], user=config.DB_SETTINGS['USER'], password=config.DB_SETTINGS['PASSWORD']) def __enter__(self): return self def __exit__(self): self.__exit__() def close(self): try: if self.pg_conn: self.pg_conn.close() except UnboundLocalError: pass def get_current_projects(self): if not self.projects_loaded: self.load_projects() return self.current_projects def get_past_projects(self): if not self.projects_loaded: self.load_projects() return self.past_projects def get_all_projects(self): if not self.all_projects: self.load_projects() return self.all_projects def load_projects(self): self.current_projects = {} self.past_projects = {} self.all_projects = {} try: cur = self.pg_conn.cursor() projects_data = {} cur.execute(GET_PROJECTS_QUERY) projects = cur.fetchall() for project_raw in projects: project_data = dict_from_array_with_keys(project_raw, PROJECTS_KEY_ORDER) cur.execute(GET_PROJECT_LEADERS_QUERY, (project_data['id'],)) leaders_raw = cur.fetchall() leaders_data = [] for leader_raw in leaders_raw: leader_data = dict_from_array_with_keys(leader_raw, PROJECT_LEADER_KEY_ORDER) leaders_data.append(leader_data) project_data['leaders'] = leaders_data cur.execute(GET_PROJECT_NEEDS_QUERY, (project_data['id'],)) needs = [need_text_raw[0] for need_text_raw in cur.fetchall()] project_data['needs'] = needs cur.execute(GET_PROJECT_PHOTOS_QUERY, (project_data['id'],)) photos = [photo_url_raw[0] for photo_url_raw in cur.fetchall()] project_data['photos'] = photos projects_data[project_data['slug']] = project_data self.current_projects = {} self.past_projects = {} self.all_projects = projects_data for slug in projects_data: project_data = projects_data[slug] if project_data['past_project']: self.past_projects[slug] = project_data else: self.current_projects[slug] = project_data self.projects_loaded = True except psycopg2.DatabaseError, e: try: if self.pg_conn: self.pg_conn.rollback() except UnboundLocalError: pass raise e
Python
0.000021
@@ -1578,24 +1578,21 @@ self. -__exit__ +close ()%0A%0A
194687d9b3809bb2e976c194c2245264c395000a
add some doctest cases of anyconfig.tests.common.MaskedImportLoader
anyconfig/tests/common.py
anyconfig/tests/common.py
# # Copyright (C) 2011 - 2014 Satoru SATOH <ssato at redhat.com> # import imp import os.path import sys import tempfile def selfdir(): return os.path.dirname(__file__) def setup_workdir(): return tempfile.mkdtemp(dir="/tmp", prefix="python-anyconfig-tests-") def cleanup_workdir(workdir): """ FIXME: Danger! """ os.system("rm -rf " + workdir) class MaskedImportLoader(object): """ Mask specified module[s] and block importing that module / these modules to raise ImportError on purpose. see also: http://pymotw.com/2/sys/imports.html """ def __init__(self, *modules): """ :param modules: A list of name of modules to mask """ self.masked = modules def find_module(self, fullname, path=None): if fullname in self.masked: return self return None def load_module(self, fullname): """ :param fullname: Full name of the module to load """ if fullname in self.masked: raise ImportError("Could not import %s as it's masked" % fullname) # Stallen from NoisyMetaImportLoader.load_module. if fullname in sys.modules: mod = sys.modules[fullname] else: mod = sys.modules.setdefault(fullname, imp.new_module(fullname)) # Set a few properties required by PEP 302 mod.__file__ = fullname mod.__name__ = fullname mod.__loader__ = self mod.__package__ = '.'.join(fullname.split('.')[:-1]) return mod def mask_modules(*modules): sys.meta_path.append(MaskedImportLoader(*modules)) # vim:sw=4:ts=4:et:
Python
0
@@ -693,285 +693,812 @@ ask%0A - %22%22%22%0A self.masked = modules%0A%0A def find_module(self, fullname, path=None):%0A if fullname in self.masked:%0A return self%0A return None%0A%0A def load_module(self, fullname):%0A %22%22%22%0A :param fullname: Full name of the module to load +%0A %3E%3E%3E ms = %5B%22lxml%22, %22yaml%22, %22json%22%5D%0A %3E%3E%3E mil = MaskedImportLoader(*ms)%0A %3E%3E%3E mil.masked == ms%0A True%0A %22%22%22%0A self.masked = modules%0A%0A def find_module(self, fullname, path=None):%0A %22%22%22%0A %3E%3E%3E mil = MaskedImportLoader(%22lxml%22, %22yaml%22)%0A %3E%3E%3E mil.find_module(%22lxml.etree%22) is None%0A True%0A %22%22%22%0A if fullname in self.masked:%0A return self%0A return None%0A%0A def load_module(self, fullname):%0A %22%22%22%0A :param fullname: Full name of the module to load%0A%0A %3E%3E%3E mil = MaskedImportLoader(%22os.path%22)%0A %3E%3E%3E try:%0A ... mil.load_module(%22os.path%22)%0A ... except ImportError:%0A ... pass%0A %3E%3E%3E mil.load_module(%22os%22) is not None%0A %3E%3E%3E mil.load_module(%22platform%22) is not None %0A
73f20bde3e0d66b9b6bd787b0c2a0a581e132faa
Add `list` command to show available instances
bossimage/cli.py
bossimage/cli.py
# Copyright 2016 Joseph Wright <rjosephwright@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. import click import os import yaml import bossimage.core as bc @click.group() def main(): pass @main.command() @click.argument('instance') @click.option('-v', '--verbosity', count=True, help='Verbosity, may be repeated up to 4 times') def run(instance, verbosity): config = load_config() bc.create_working_dir() instance_info = bc.load_or_create_instance(config, instance) bc.wait_for_ssh(instance_info['ip']) bc.run(instance, verbosity) @main.command() @click.argument('instance') def image(instance): bc.image(instance) @main.command() @click.argument('instance') def delete(instance): bc.delete(instance) @bc.cached def load_config(): try: with open('.boss.yml') as f: c = yaml.load(f) return c except IOError as e: click.echo('Error loading .boss.yml: {}'.format(e.strerror)) raise click.Abort()
Python
0.000001
@@ -1766,16 +1766,330 @@ tance)%0A%0A +@main.command('list')%0Adef lst():%0A platforms = list_of('platforms')%0A profiles = list_of('profiles')%0A instances = %5B'%7B%7D-%7B%7D'.format(pl, pr) for pl in platforms for pr in profiles%5D%0A for i in instances: click.echo(i)%0A%0Adef list_of(key):%0A config = load_config()%0A return %5Bk%5B'name'%5D for k in config%5Bkey%5D%5D%0A%0A @bc.cach
b22ac590b9a3049f647307fe877e6d68bf02d8c5
check last modified date (stagecoach doesn't always return a 301 response)
bustimes/management/commands/import_bod.py
bustimes/management/commands/import_bod.py
"""Import timetable data "fresh from the cow" """ import os import requests import time from ciso8601 import parse_datetime from email.utils import parsedate_to_datetime from django.core.management.base import BaseCommand from django.conf import settings from django.utils import timezone from busstops.models import DataSource, Service, Operator from .import_gtfs import download_if_modified, write_zip_file from .import_transxchange import Command as TransXChangeCommand from .import_passenger import handle_file from ...models import Route, Calendar session = requests.Session() def clean_up(operators, sources): Route.objects.filter(service__operator__in=operators).exclude(source__in=sources).delete() Service.objects.filter(operator__in=operators, current=True, route=None).update(current=False) Calendar.objects.filter(trip=None).delete() def get_command(): command = TransXChangeCommand() command.undefined_holidays = set() command.notes = {} command.corrections = {} return command # like download_if_modified but different... def download_if_changed(path, url): headers = {} modified = True if os.path.exists(path): last_modified = time.localtime(os.path.getmtime(path)) headers['if-modified-since'] = time.asctime(last_modified) response = requests.head(url, headers=headers) if response.status_code == 304: modified = False if modified: response = requests.get(url, headers=headers, stream=True) if response.status_code == 304: modified = False else: write_zip_file(path, response) if 'x-amz-meta-cb-modifiedtime' in response.headers: last_modified = response.headers['x-amz-meta-cb-modifiedtime'] elif 'last-modified' in response.headers: last_modified = response.headers['last-modified'] return modified, last_modified def bus_open_data(api_key): command = get_command() for operator_id, region_id, operators in settings.BOD_OPERATORS: command.operators = operators command.region_id = region_id command.service_descriptions = {} command.service_codes = set() command.calendar_cache = {} sources = [] url = 'https://data.bus-data.dft.gov.uk/api/v1/dataset/' params = { 'api_key': api_key, 'noc': operator_id, 'status': ['published', 'expiring'] } while url: response = session.get(url, params=params) json = response.json() for result in json['results']: filename = result['name'] url = result['url'] path = os.path.join(settings.DATA_DIR, filename) modified = parse_datetime(result['modified']) command.source, created = DataSource.objects.get_or_create({'name': filename}, url=url) if command.source.datetime != modified: print(response.url, filename) command.source.datetime = modified download_if_modified(path, url) handle_file(command, filename) if not created: command.source.name = filename command.source.save(update_fields=['name', 'datetime']) print(' ', Operator.objects.filter(service__route__source=command.source).distinct().values('id')) sources.append(command.source) url = json['next'] params = None command.mark_old_services_as_not_current() clean_up(operators.values(), sources) def first(): command = get_command() for operator, region_id, operators in settings.FIRST_OPERATORS: filename = operator + '.zip' url = 'http://travelinedatahosting.basemap.co.uk/data/first/' + filename modified = download_if_modified(os.path.join(settings.DATA_DIR, filename), url) if modified: print(operator) command.operators = operators command.region_id = region_id command.service_descriptions = {} command.service_codes = set() command.calendar_cache = {} command.source, created = DataSource.objects.get_or_create({'name': operator}, url=url) command.source.datetime = timezone.now() handle_file(command, filename) command.mark_old_services_as_not_current() clean_up(operators.values(), [command.source]) command.source.save(update_fields=['datetime']) print(' ', command.source.route_set.order_by('end_date').distinct('end_date').values('end_date')) print(' ', Operator.objects.filter(service__route__source=command.source).distinct().values('id')) def stagecoach(): command = get_command() for region_id, noc, operator, operators in settings.STAGECOACH_OPERATORS: filename = f'stagecoach-{noc}-route-schedule-data-transxchange.zip' url = f'https://opendata.stagecoachbus.com/{filename}' path = os.path.join(settings.DATA_DIR, filename) command.source, created = DataSource.objects.get_or_create({'name': operator}, url=url) modified, last_modified = download_if_changed(path, url) if modified: print(operator) command.operators = operators command.region_id = region_id command.service_descriptions = {} command.service_codes = set() command.calendar_cache = {} # avoid importing old data command.source.datetime = timezone.now() handle_file(command, filename) command.mark_old_services_as_not_current() clean_up(command.operators.values(), [command.source]) command.source.datetime = parsedate_to_datetime(last_modified) command.source.save(update_fields=['datetime']) print(' ', command.source.route_set.order_by('end_date').distinct('end_date').values('end_date')) print(' ', {o['id']: o['id'] for o in Operator.objects.filter(service__route__source=command.source).distinct().values('id')}) class Command(BaseCommand): @staticmethod def add_arguments(parser): parser.add_argument('api_key', type=str) def handle(self, api_key, **options): stagecoach() bus_open_data(api_key) first()
Python
0
@@ -1871,16 +1871,73 @@ dified'%5D +%0A last_modified = parsedate_to_datetime(last_modified) %0A%0A re @@ -5394,32 +5394,156 @@ ged(path, url)%0A%0A + if modified and command.source.datetime and command.source.datetime %3E= last_modified:%0A modified = False%0A%0A if modif @@ -6088,38 +6088,16 @@ etime = -parsedate_to_datetime( last_mod @@ -6101,17 +6101,16 @@ modified -) %0A
0f6272aef4fd37ca1b6cf1a0a86ccaab6ff90f82
Add year-month parsing to monthfield in admin.
dkmodelfields/adminforms/monthfield.py
dkmodelfields/adminforms/monthfield.py
# -*- coding: utf-8 -*- """Admin support code for MonthFields. """ from dk import ttcal from django.forms.fields import CharField from django.forms import ValidationError from django.forms.util import flatatt from django.forms.widgets import TextInput from django.utils.safestring import mark_safe class MonthInput(TextInput): "Month input widget." def render(self, name, value, attrs=None): if value is None: value = u'' final_attrs = self.build_attrs(attrs, type='month', name=name) if value != u'': #if isinstance(value, (int, long)): # value = ttcal.Month(value) assert isinstance(value, ttcal.Month), type(value) final_attrs['value'] = unicode(value.format("Y-m")) return mark_safe(u'<input%s />' % flatatt(final_attrs)) class MonthField(CharField): "Month field widget." widget = MonthInput def __init__(self, *args, **kwargs): super(MonthField, self).__init__(*args, **kwargs) def _str_to_month(self, sval): # pylint:disable=R0201 # 2008-01 if not isinstance(sval, (str, unicode)): print "NOT ISINSTANCE:", repr(sval) if not sval.strip(): return None parts = sval.split('-') y = int(parts[0]) m = int(parts[1]) return ttcal.Month(y, m) def clean(self, value): super(MonthField, self).clean(value) try: return self._str_to_month(value) except: raise ValidationError('Invalid month: %r' % value) def to_python(self, value): # pylint:disable=R0201 "convert value to ttcal.Year()." try: return self._str_to_month(value) except: raise ValidationError('Invalid month: %r' % value)
Python
0
@@ -555,17 +555,16 @@ -# if isins @@ -601,18 +601,16 @@ - # valu @@ -624,32 +624,234 @@ al.Month(value)%0A + if isinstance(value, unicode):%0A parts = value.split('-')%0A y = int(parts%5B0%5D, 10)%0A m = int(parts%5B1%5D, 10)%0A value = ttcal.Month(y, m)%0A asse
6bd9d8de1066bcd4b63ad41da676cf764b4ff00d
Update reference to sv-benchmarks
benchexec/tools/sv_benchmarks_util.py
benchexec/tools/sv_benchmarks_util.py
# This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 """ This module contains some useful functions related to tasks in the sv-benchmarks repository: https://github.com/sosy-lab/sv-benchmarks Note the following points before using any function in this util: 1. This is not a part of stable benchexec API. We do not provide any guarantee of backward compatibility of this module. 2. Out-of-tree modules should not use this util 3. Any function in this util may change at any point in time """ import benchexec.tools.template # Defining constants for data model. ILP32 = "ILP32" LP64 = "LP64" def get_data_model_from_task(task, param_dict): """ This function tries to extract tool parameter for data model depending on the data model in the task. @param task: An instance of of class Task, e.g., with the input files @param param_dict: Dictionary mapping data model to the tool param value """ if isinstance(task.options, dict) and task.options.get("language") == "C": data_model = task.options.get("data_model") if data_model: try: return param_dict[data_model] except KeyError: raise benchexec.tools.template.UnsupportedFeatureException( f"Unsupported data_model '{data_model}' defined for task '{task}'" ) return None
Python
0
@@ -323,34 +323,34 @@ ory: https://git -hu +la b.com/sosy-lab/s @@ -348,16 +348,29 @@ osy-lab/ +benchmarking/ sv-bench