commit stringlengths 40 40 | old_file stringlengths 4 150 | new_file stringlengths 4 150 | old_contents stringlengths 0 3.26k | new_contents stringlengths 1 4.43k | subject stringlengths 15 501 | message stringlengths 15 4.06k | lang stringclasses 4 values | license stringclasses 13 values | repos stringlengths 5 91.5k | diff stringlengths 0 4.35k |
|---|---|---|---|---|---|---|---|---|---|---|
4754c220e79aba7fc4c1ab67a1e834cc306d4493 | setup.py | setup.py | #!/usr/bin/env python
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist bdist_wininst upload -r pypi')
sys.exit()
with open('README.rst') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='django-rest-surveys',
version='0.1.0',
description='A RESTful backend for giving surveys.',
long_description=readme,
author='Designlab',
author_email='hello@trydesignlab.com',
url='https://github.com/danxshap/django-rest-surveys',
packages=['rest_surveys'],
package_data={'': ['LICENSE']},
package_dir={'rest_surveys': 'rest_surveys'},
install_requires=['Django', 'djangorestframework', 'django-inline-ordering'],
license=license,
)
| #!/usr/bin/env python
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist bdist_wininst upload -r pypi')
sys.exit()
with open('README.rst') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='django-rest-surveys',
version='0.1.0',
description='A RESTful backend for giving surveys.',
long_description=readme,
author='Designlab',
author_email='hello@trydesignlab.com',
url='https://github.com/danxshap/django-rest-surveys',
packages=['rest_surveys'],
package_data={'': ['LICENSE']},
package_dir={'rest_surveys': 'rest_surveys'},
install_requires=['Django', 'django-inline-ordering'],
license=license,
)
| Remove Django REST Framework from dependencies | Remove Django REST Framework from dependencies
| Python | mit | danxshap/django-rest-surveys | ---
+++
@@ -28,6 +28,6 @@
packages=['rest_surveys'],
package_data={'': ['LICENSE']},
package_dir={'rest_surveys': 'rest_surveys'},
- install_requires=['Django', 'djangorestframework', 'django-inline-ordering'],
+ install_requires=['Django', 'django-inline-ordering'],
license=license,
) |
9272e0fb2f3c3190f53ea440a9d15610667d6072 | manage.py | manage.py | # -*- coding: utf-8 -*-
from flask.ext.script import Manager, Server
from massa import create_app
manager = Manager(create_app)
manager.add_option('-c', '--configfile', dest='configfile', required=False)
manager.add_command('runserver', Server(
use_debugger = True,
use_reloader = True,
host = '0.0.0.0',
port = 8080,
))
if __name__ == '__main__':
manager.run()
| # -*- coding: utf-8 -*-
from flask.ext.script import Manager, Server, prompt_bool
from massa import create_app
from massa.domain import make_tables, drop_tables
manager = Manager(create_app)
manager.add_option('-c', '--configfile', dest='configfile', required=False)
manager.add_command('runserver', Server(
use_debugger = True,
use_reloader = True,
host = '0.0.0.0',
port = 8080,
))
@manager.command
def dbmake():
"""Make all the db tables."""
make_tables()
@manager.command
def dbdrop():
"""Drop all the db tables."""
if prompt_bool('Are you sure you want to drop all the db tables?'):
drop_tables()
if __name__ == '__main__':
manager.run()
| Add commands to make and drop db tables from a terminal. | Add commands to make and drop db tables from a terminal. | Python | mit | jaapverloop/massa | ---
+++
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-from flask.ext.script import Manager, Server
+from flask.ext.script import Manager, Server, prompt_bool
from massa import create_app
+from massa.domain import make_tables, drop_tables
manager = Manager(create_app)
@@ -14,5 +15,16 @@
port = 8080,
))
+@manager.command
+def dbmake():
+ """Make all the db tables."""
+ make_tables()
+
+@manager.command
+def dbdrop():
+ """Drop all the db tables."""
+ if prompt_bool('Are you sure you want to drop all the db tables?'):
+ drop_tables()
+
if __name__ == '__main__':
manager.run() |
7c88518c9447b4504efc510c70320abaac50680f | setup.py | setup.py | # -*- coding: utf-8 -*-
import os
import sys
from setuptools import (
find_packages,
setup,
)
here = os.path.dirname(__file__)
requires = [
'jsonschema==2.4.0',
]
if sys.version_info <= (3, 5):
requires.append('zipp == 1.2.0')
tests_require = [
'pytest',
'pytest-cov',
'pytest-flake8',
]
def _read(name):
return open(os.path.join(here, name)).read()
setup(
name='jsmapper',
version='0.1.9',
description='A Object - JSON Schema Mapper.',
long_description=_read("README.rst"),
license='MIT',
url='https://github.com/yosida95/python-jsmapper',
author='Kohei YOSHIDA',
author_email='kohei@yosida95.com',
packages=find_packages(),
python_requires='>= 3.5',
install_requires=requires,
tests_require=tests_require,
extras_require={
'testing': tests_require,
},
test_suite='jsmapper',
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Libraries :: Python Modules",
],
)
| # -*- coding: utf-8 -*-
import os
import sys
from setuptools import (
find_packages,
setup,
)
here = os.path.dirname(__file__)
requires = [
'jsonschema==2.6.0',
]
if sys.version_info <= (3, 5):
requires.append('zipp == 1.2.0')
tests_require = [
'pytest',
'pytest-cov',
'pytest-flake8',
]
def _read(name):
return open(os.path.join(here, name)).read()
setup(
name='jsmapper',
version='0.1.9',
description='A Object - JSON Schema Mapper.',
long_description=_read("README.rst"),
license='MIT',
url='https://github.com/yosida95/python-jsmapper',
author='Kohei YOSHIDA',
author_email='kohei@yosida95.com',
packages=find_packages(),
python_requires='>= 3.5',
install_requires=requires,
tests_require=tests_require,
extras_require={
'testing': tests_require,
},
test_suite='jsmapper',
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Libraries :: Python Modules",
],
)
| Update dependency jsonschema to v2.6.0 | Update dependency jsonschema to v2.6.0
| Python | mit | yosida95/python-jsmapper | ---
+++
@@ -10,7 +10,7 @@
here = os.path.dirname(__file__)
requires = [
- 'jsonschema==2.4.0',
+ 'jsonschema==2.6.0',
]
if sys.version_info <= (3, 5):
requires.append('zipp == 1.2.0') |
c5783f385d406f8ccfa5e0cef6dfdf248d7ea02b | matrix.py | matrix.py | from __future__ import division
import itertools
def get_offsets(span):
"""
Get matrix offsets for a square of distance `span`.
"""
if span < 0:
raise ValueError('Cannot return neighbours for negative distance')
all_offsets = set(itertools.product([x for x in range(-span, span + 1)], repeat=2))
if span > 1:
inner_offsets = set(itertools.product([x for x in range(-(span - 1), span)], repeat=2))
else:
inner_offsets = set()
return all_offsets - inner_offsets
def find_neighbours_2D(array, start, span):
"""
Return neighbours in a 2D array, given a start point and range.
"""
x, y = start # Start coords
rows = len(array) # How many rows
cols = len(array[0]) # Assume square matrix
return
def new(size, value=None):
""" Initialize a new square matrix. """
return [[value] * size for _ in range(size)]
| from __future__ import division
import itertools
def get_offsets(span):
"""
Get matrix offsets for a square of distance `span`.
"""
if span < 0:
raise ValueError('Cannot return neighbours for negative distance')
all_offsets = set(itertools.product([x for x in range(-span, span + 1)], repeat=2))
if span >= 1:
inner_offsets = set(itertools.product([x for x in range(-(span - 1), span)], repeat=2))
else:
inner_offsets = set()
return all_offsets - inner_offsets
def find_neighbours_2D(array, start, span):
"""
Return neighbours in a 2D array, given a start point and range.
"""
x, y = start # Start coords
rows = len(array) # How many rows
cols = len(array[0]) # Assume square matrix
return
def new(size, value=None):
""" Initialize a new square matrix. """
return [[value] * size for _ in range(size)]
| Fix bug in get_offsets with span == 1 | Fix bug in get_offsets with span == 1
Very specific bug made span of 1 include center (start) point.
| Python | mit | supermitch/Island-Gen | ---
+++
@@ -11,7 +11,7 @@
raise ValueError('Cannot return neighbours for negative distance')
all_offsets = set(itertools.product([x for x in range(-span, span + 1)], repeat=2))
- if span > 1:
+ if span >= 1:
inner_offsets = set(itertools.product([x for x in range(-(span - 1), span)], repeat=2))
else:
inner_offsets = set() |
8d3f2ded898b1bfcac1f3ce407787cf5075dc383 | setup.py | setup.py | #!/usr/bin/env python
import os, sys, glob
from setuptools import setup, find_packages
setup(
name='aegea',
version='0.1.0',
url='https://github.com/kislyuk/aegea',
license='Proprietary',
author='Andrey Kislyuk',
author_email='kislyuk@gmail.com',
description='Amazon Web Services Operator Interface',
long_description=open('README.rst').read(),
install_requires=[
'boto3 >= 1.2.6',
'argcomplete >= 1.1.0',
'paramiko >= 1.16.0',
'requests >= 2.9.1',
'tweak >= 0.0.2',
'keymaker >= 0.1.7',
'pyyaml >= 3.11'
],
extras_require={
':python_version == "2.7"': ['enum34 >= 1.0.4', 'ipaddress >= 1.0.16'],
':python_version == "3.3"': ['enum34 >= 1.0.4']
},
packages=find_packages(exclude=['test']),
scripts=glob.glob('scripts/*'),
platforms=['MacOS X', 'Posix'],
test_suite='test',
include_package_data=True
)
| #!/usr/bin/env python
import os, sys, glob
from setuptools import setup, find_packages
setup(
name='aegea',
version='0.2.0',
url='https://github.com/kislyuk/aegea',
license='Proprietary',
author='Andrey Kislyuk',
author_email='kislyuk@gmail.com',
description='Amazon Web Services Operator Interface',
long_description=open('README.rst').read(),
install_requires=[
'boto3 >= 1.2.6',
'argcomplete >= 1.1.0',
'paramiko >= 1.16.0',
'requests >= 2.9.1',
'tweak >= 0.1.0',
'keymaker >= 0.1.7',
'pyyaml >= 3.11'
],
extras_require={
':python_version == "2.7"': ['enum34 >= 1.0.4', 'ipaddress >= 1.0.16'],
':python_version == "3.3"': ['enum34 >= 1.0.4']
},
packages=find_packages(exclude=['test']),
scripts=glob.glob('scripts/*'),
platforms=['MacOS X', 'Posix'],
test_suite='test',
include_package_data=True
)
| Update deps to pull in YAML support | Update deps to pull in YAML support
| Python | apache-2.0 | wholebiome/aegea,kislyuk/aegea,kislyuk/aegea,wholebiome/aegea,kislyuk/aegea,wholebiome/aegea | ---
+++
@@ -5,7 +5,7 @@
setup(
name='aegea',
- version='0.1.0',
+ version='0.2.0',
url='https://github.com/kislyuk/aegea',
license='Proprietary',
author='Andrey Kislyuk',
@@ -17,7 +17,7 @@
'argcomplete >= 1.1.0',
'paramiko >= 1.16.0',
'requests >= 2.9.1',
- 'tweak >= 0.0.2',
+ 'tweak >= 0.1.0',
'keymaker >= 0.1.7',
'pyyaml >= 3.11'
], |
d9c3211def0141754fa05b64e06b99d3d1db0c75 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
from setuptools import find_packages
import derpibooru
setup(
name = "DerPyBooru",
description = "Python bindings for Derpibooru's API"
url = "https://github.com/joshua-stone/DerPyBooru",
version = "0.4",
author = "Joshua Stone",
license = "Simplified BSD License",
platforms = ["any"],
packages = find_packages(),
install_requires = ["requests"],
include_package_data = True,
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: Simplified BSD License",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Internet"
]
)
| #!/usr/bin/env python
from setuptools import setup
from setuptools import find_packages
import derpibooru
setup(
name = "DerPyBooru",
description = "Python bindings for Derpibooru's API",
url = "https://github.com/joshua-stone/DerPyBooru",
version = "0.4",
author = "Joshua Stone",
license = "Simplified BSD License",
platforms = ["any"],
packages = find_packages(),
install_requires = ["requests"],
include_package_data = True,
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: Simplified BSD License",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Internet"
]
)
| Fix broken line in setip.py | Fix broken line in setip.py
| Python | bsd-2-clause | joshua-stone/DerPyBooru | ---
+++
@@ -7,7 +7,7 @@
setup(
name = "DerPyBooru",
- description = "Python bindings for Derpibooru's API"
+ description = "Python bindings for Derpibooru's API",
url = "https://github.com/joshua-stone/DerPyBooru",
version = "0.4",
author = "Joshua Stone", |
10fe1c33e29d509778b4b65c00ec24a52f5d9854 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name="handlebar.py",
version="0.1",
author="José Pedro Arvela",
author_email="jparvela@gmail.com",
description="Debian build system with copy-on-write containers",
license="MIT",
packages=find_packages(),
scripts=['handlebar'], requires=['toml']
)
| from setuptools import setup, find_packages
setup(
name="handlebar.py",
version="0.1",
author="José Pedro Arvela",
author_email="jparvela@gmail.com",
description="Debian build system with copy-on-write containers",
license="MIT",
packages=find_packages(),
scripts=['handlebar'], requires=['toml.py']
)
| Correct dependencies so it depends on toml.py | Correct dependencies so it depends on toml.py
| Python | mit | jparvela/handlebar | ---
+++
@@ -10,5 +10,5 @@
license="MIT",
packages=find_packages(),
- scripts=['handlebar'], requires=['toml']
+ scripts=['handlebar'], requires=['toml.py']
) |
2e18e3cd1a510dc9af3a4debc244006997baa1c9 | setup.py | setup.py | from setuptools.command.test import test as TestCommand
import sys
class PyTest(TestCommand):
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.test_args)
sys.exit(errno)
from setuptools import setup, find_packages
setup(
name='squadron',
version='0.0.2',
packages=find_packages(),
license='MIT',
scripts=['scripts/squadron'],
tests_require=[
'pytest>=2.5.1',
'mock>=1.0.1'
],
cmdclass = {'test': PyTest},
install_requires=[
'jsonschema>=2.3.0',
'gitpython>=0.3.2.RC1',
'quik>=0.2.2',
'requests>=2.2.0',
'py>=1.4.19']
)
| from setuptools.command.test import test as TestCommand
import sys
import os
class PyTest(TestCommand):
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.test_args)
sys.exit(errno)
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
from setuptools import setup, find_packages
setup(
name='squadron',
version='0.0.2',
author='Squadron',
author_email='info@gosquadron.com',
description='Easy-to-use configuration and release management tool',
long_description=read('README.md'),
license='MIT',
url='http://www.gosquadron.com',
keywords='configuration management release deployment tool',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX',
'Topic :: Software Development :: Testing',
'Topic :: Utilities',
],
packages=find_packages(),
scripts=['scripts/squadron'],
tests_require=[
'pytest>=2.5.1',
'mock>=1.0.1'
],
cmdclass = {'test': PyTest},
install_requires=[
'jsonschema>=2.3.0',
'gitpython>=0.3.2.RC1',
'quik>=0.2.2',
'requests>=2.2.0',
'py>=1.4.19']
)
| Add PyPI description and such | Add PyPI description and such
| Python | mit | gosquadron/squadron,gosquadron/squadron | ---
+++
@@ -1,5 +1,6 @@
from setuptools.command.test import test as TestCommand
import sys
+import os
class PyTest(TestCommand):
def finalize_options(self):
@@ -12,12 +13,30 @@
errno = pytest.main(self.test_args)
sys.exit(errno)
+def read(fname):
+ return open(os.path.join(os.path.dirname(__file__), fname)).read()
+
from setuptools import setup, find_packages
setup(
name='squadron',
version='0.0.2',
+ author='Squadron',
+ author_email='info@gosquadron.com',
+ description='Easy-to-use configuration and release management tool',
+ long_description=read('README.md'),
+ license='MIT',
+ url='http://www.gosquadron.com',
+ keywords='configuration management release deployment tool',
+ classifiers=[
+ 'Development Status :: 3 - Alpha',
+ 'Intended Audience :: Developers',
+ 'Intended Audience :: System Administrators',
+ 'License :: OSI Approved :: MIT License',
+ 'Operating System :: POSIX',
+ 'Topic :: Software Development :: Testing',
+ 'Topic :: Utilities',
+ ],
packages=find_packages(),
- license='MIT',
scripts=['scripts/squadron'],
tests_require=[
'pytest>=2.5.1', |
0c470222a131b3fe8b9a7483dd039c513b29e978 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='cosmo',
version='1.0.0',
description='Monitors for HST/COS',
keywords=['astronomy'],
classifiers=[
'Programming Language :: Python :: 3',
'License :: BSD-3 :: Association of Universities for Research in Astronomy',
'Operating System :: Linux'
],
python_requires='~=3.7', # 3.7 and higher, but not 4
packages=find_packages(),
install_requires=[
'setuptools',
'numpy>=1.11.1',
'astropy>=1.0.1',
'plotly>=4.0.0',
'dask',
'pandas',
'pytest',
'pyyaml',
'peewee',
'monitorframe @ git+https://github.com/spacetelescope/monitor-framework#egg=monitorframe'
],
package_data={'cosmo': ['pytest.ini']}
)
| from setuptools import setup, find_packages
setup(
name='cosmo',
version='1.0.1',
description='Monitors for HST/COS',
keywords=['astronomy'],
classifiers=[
'Programming Language :: Python :: 3',
'License :: BSD-3 :: Association of Universities for Research in Astronomy',
'Operating System :: Linux'
],
python_requires='~=3.7', # 3.7 and higher, but not 4
packages=find_packages(),
install_requires=[
'setuptools',
'numpy>=1.11.1',
'astropy>=1.0.1',
'plotly>=4.0.0',
'dask',
'pandas>=0.25.0',
'pytest',
'pyyaml',
'peewee',
'monitorframe @ git+https://github.com/spacetelescope/monitor-framework#egg=monitorframe'
],
package_data={'cosmo': ['pytest.ini']},
entry_points={
'console_scripts':
['cosmo=cosmo.run_monitors:runner']
}
)
| Add entry point for monitor runner | Add entry point for monitor runner
| Python | bsd-3-clause | justincely/cos_monitoring | ---
+++
@@ -2,7 +2,7 @@
setup(
name='cosmo',
- version='1.0.0',
+ version='1.0.1',
description='Monitors for HST/COS',
keywords=['astronomy'],
classifiers=[
@@ -18,11 +18,15 @@
'astropy>=1.0.1',
'plotly>=4.0.0',
'dask',
- 'pandas',
+ 'pandas>=0.25.0',
'pytest',
'pyyaml',
'peewee',
'monitorframe @ git+https://github.com/spacetelescope/monitor-framework#egg=monitorframe'
],
- package_data={'cosmo': ['pytest.ini']}
+ package_data={'cosmo': ['pytest.ini']},
+ entry_points={
+ 'console_scripts':
+ ['cosmo=cosmo.run_monitors:runner']
+ }
) |
345773b4ab1025ce64318014ebdbe2ec52998482 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='ckanext-archiver',
version='0.1',
packages=find_packages(),
install_requires=[
'celery==2.4.2',
'kombu==2.1.3',
'kombu-sqlalchemy==1.1.0',
'SQLAlchemy>=0.6.6',
'requests==1.1.0',
'messytables>=0.1.4',
'urllib3==1.7',
'flask==0.8' # flask needed for tests
],
author='Open Knowledge Foundation',
author_email='info@okfn.org',
description='Archive ckan resources',
long_description='Archive ckan resources',
license='MIT',
url='http://ckan.org/wiki/Extensions',
download_url='',
include_package_data=True,
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules'
],
entry_points='''
[paste.paster_command]
archiver = ckanext.archiver.commands:Archiver
[ckan.plugins]
archiver = ckanext.archiver.plugin:ArchiverPlugin
[ckan.celery_task]
tasks = ckanext.archiver.celery_import:task_imports
'''
)
| from setuptools import setup, find_packages
setup(
name='ckanext-archiver',
version='0.1',
packages=find_packages(),
install_requires=[
'celery==2.4.2',
'kombu==2.1.3',
'kombu-sqlalchemy==1.1.0',
'SQLAlchemy>=0.6.6',
'requests==1.1.0',
'messytables>=0.1.4',
'flask==0.8' # flask needed for tests
],
author='Open Knowledge Foundation',
author_email='info@okfn.org',
description='Archive ckan resources',
long_description='Archive ckan resources',
license='MIT',
url='http://ckan.org/wiki/Extensions',
download_url='',
include_package_data=True,
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules'
],
entry_points='''
[paste.paster_command]
archiver = ckanext.archiver.commands:Archiver
[ckan.plugins]
archiver = ckanext.archiver.plugin:ArchiverPlugin
[ckan.celery_task]
tasks = ckanext.archiver.celery_import:task_imports
'''
)
| Drop requirement for urllib3 - it is part of requests. | Drop requirement for urllib3 - it is part of requests.
| Python | mit | datagovuk/ckanext-archiver,DanePubliczneGovPl/ckanext-archiver,ckan/ckanext-archiver,datagovuk/ckanext-archiver,datagovuk/ckanext-archiver,ckan/ckanext-archiver,ckan/ckanext-archiver,DanePubliczneGovPl/ckanext-archiver,DanePubliczneGovPl/ckanext-archiver | ---
+++
@@ -11,7 +11,6 @@
'SQLAlchemy>=0.6.6',
'requests==1.1.0',
'messytables>=0.1.4',
- 'urllib3==1.7',
'flask==0.8' # flask needed for tests
],
author='Open Knowledge Foundation', |
0b324258a4872d1038ca5ef3b10d7978b6c03a22 | setup.py | setup.py | from pip import req
import pip
from setuptools import find_packages
from setuptools import setup
_install_requirements = req.parse_requirements(
'requirements.txt', session=pip.download.PipSession())
setup(
name='grow',
version=open('grow/VERSION').read().strip(),
description=(
'Develop everywhere and deploy anywhere: a declarative '
'static site generator/CMS for building high-quality web sites.'
),
long_description=open('description.txt').read().strip(),
url='https://growsdk.org',
license='MIT',
author='Grow SDK Authors',
author_email='hello@grow.io',
include_package_data=True,
install_requires=[str(ir.req) for ir in _install_requirements],
packages=find_packages(),
scripts=[
'bin/grow',
],
keywords=[
'grow',
'cms',
'static site generator',
's3',
'google cloud storage',
'content management'
],
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development :: Libraries :: Python Modules',
])
| from pip import req
import pip
from setuptools import find_packages
from setuptools import setup
_install_requirements = req.parse_requirements(
'requirements.txt', session=pip.download.PipSession())
setup(
name='grow',
version=open('grow/VERSION').read().strip(),
description=(
'Develop everywhere and deploy anywhere: a declarative '
'static site generator/CMS for building high-quality web sites.'
),
long_description=open('description.txt').read().strip(),
url='https://growsdk.org',
zip_safe=False,
license='MIT',
author='Grow SDK Authors',
author_email='hello@grow.io',
include_package_data=True,
install_requires=[str(ir.req) for ir in _install_requirements],
packages=find_packages(),
scripts=[
'bin/grow',
],
keywords=[
'grow',
'cms',
'static site generator',
's3',
'google cloud storage',
'content management'
],
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development :: Libraries :: Python Modules',
])
| Set `zip_safe` to false so that we can install pygrow from source. | Set `zip_safe` to false so that we can install pygrow from source.
| Python | mit | codedcolors/pygrow,grow/grow,codedcolors/pygrow,denmojo/pygrow,denmojo/pygrow,grow/grow,codedcolors/pygrow,grow/pygrow,denmojo/pygrow,grow/grow,grow/pygrow,grow/pygrow,denmojo/pygrow,grow/grow | ---
+++
@@ -16,6 +16,7 @@
),
long_description=open('description.txt').read().strip(),
url='https://growsdk.org',
+ zip_safe=False,
license='MIT',
author='Grow SDK Authors',
author_email='hello@grow.io', |
54456e42e2c9d90095b34a30a16940584ebdb29c | setup.py | setup.py | #!/usr/bin/env python
#coding: utf-8
from setuptools import setup, find_packages
from os.path import join, dirname
setup(
name='mosecom_air',
version='1.2',
description='Web service dedicated to air pollution in Moscow.',
long_description=open('README.md').read(),
author='elsid',
author_email='elsid.mail@gmail.com',
packages=find_packages(),
scripts=['manage.py', 'parse_html.py', 'request.py'],
install_requires=[
'django >= 1.6.1',
'djangorestframework >= 2.3.12',
'flup >= 1.0.2',
'johnny-cache >= 1.4',
'psycopg2 >= 2.4.5',
'pyquery >= 1.2.4',
'simplejson >= 3.3.1',
'yaml >= 3.10',
],
)
| #!/usr/bin/env python
#coding: utf-8
from setuptools import setup, find_packages
from os.path import join, dirname
setup(
name='mosecom_air',
version='1.2',
description='Web service dedicated to air pollution in Moscow.',
long_description=open('README.md').read(),
author='elsid',
author_email='elsid.mail@gmail.com',
packages=find_packages(),
scripts=['manage.py', 'parse_html.py', 'request.py'],
install_requires=[
'django >= 1.6.1',
'djangorestframework >= 2.3.12',
'flup >= 1.0.2',
'johnny-cache >= 1.4',
'memcache >= 1.53',
'psycopg2 >= 2.4.5',
'pyquery >= 1.2.4',
'simplejson >= 3.3.1',
'yaml >= 3.10',
],
)
| Add python module memcache dependency | Add python module memcache dependency
| Python | mit | elsid/mosecom-air,elsid/mosecom-air,elsid/mosecom-air | ---
+++
@@ -18,6 +18,7 @@
'djangorestframework >= 2.3.12',
'flup >= 1.0.2',
'johnny-cache >= 1.4',
+ 'memcache >= 1.53',
'psycopg2 >= 2.4.5',
'pyquery >= 1.2.4',
'simplejson >= 3.3.1', |
229c5be9e0ad67c7cdea8c5404efff157d996372 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.8.0.4'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredispy',
version=__version__ + __build__,
description='Mock for redis-py',
url='http://www.github.com/locationlabs/mockredis',
license='Apache2',
packages=find_packages(exclude=['*.tests']),
setup_requires=[
'nose'
],
extras_require={
'lua': ['lunatic-python-bugfix==1.1.1'],
},
tests_require=[
'redis>=2.8.0'
],
test_suite='mockredis.tests',
entry_points={
'nose.plugins.0.10': [
'with_redis = mockredis.tests.fixtures:WithRedis'
]
})
| #!/usr/bin/env python
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.9.0.0'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredispy',
version=__version__ + __build__,
description='Mock for redis-py',
url='http://www.github.com/locationlabs/mockredis',
license='Apache2',
packages=find_packages(exclude=['*.tests']),
setup_requires=[
'nose'
],
extras_require={
'lua': ['lunatic-python-bugfix==1.1.1'],
},
tests_require=[
'redis>=2.9.0'
],
test_suite='mockredis.tests',
entry_points={
'nose.plugins.0.10': [
'with_redis = mockredis.tests.fixtures:WithRedis'
]
})
| Update to 2.9.0.0 and use equivalent version of redis-py | Update to 2.9.0.0 and use equivalent version of redis-py
| Python | apache-2.0 | yossigo/mockredis,matejkloska/mockredis,locationlabs/mockredis,path/mockredis | ---
+++
@@ -3,7 +3,7 @@
from setuptools import setup, find_packages
# Match releases to redis-py versions
-__version__ = '2.8.0.4'
+__version__ = '2.9.0.0'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
@@ -21,7 +21,7 @@
'lua': ['lunatic-python-bugfix==1.1.1'],
},
tests_require=[
- 'redis>=2.8.0'
+ 'redis>=2.9.0'
],
test_suite='mockredis.tests',
entry_points={ |
2a8b2a7324682df81de91c2f9ee27bbb67a7d894 | setup.py | setup.py | from setuptools import setup, find_packages
import politicalplaces
setup(
name='django-political-map',
version=politicalplaces.__version__,
description='Django application to store geolocalized places and organize them according to political hierarchy.',
author='20tab S.r.l.',
author_email='info@20tab.com',
#url='https://gitlab.20tab.com/20tab/django-political-map',
url='https://github.com/20tab/django-political-map.git',
license='MIT License',
install_requires=[
'googlemaps==2.4.6',
],
packages=find_packages(),
include_package_data=True,
package_data={
'': ['*.html', '*.css', '*.js', '*.gif', '*.png', ],
}
)
| from setuptools import setup, find_packages
import politicalplaces
setup(
name='django-political-map',
version=politicalplaces.__version__,
description='Django application to store geolocalized places and organize them according to political hierarchy.',
author='20tab S.r.l.',
author_email='info@20tab.com',
#url='https://gitlab.20tab.com/20tab/django-political-map',
url='https://github.com/20tab/django-political-map.git',
license='MIT License',
install_requires=[
'googlemaps==2.5.0',
],
packages=find_packages(),
include_package_data=True,
package_data={
'': ['*.html', '*.css', '*.js', '*.gif', '*.png', ],
}
)
| Update googlemaps to 2.5.0 version | Update googlemaps to 2.5.0 version | Python | mit | 20tab/django-political-map,20tab/django-political-map,20tab/django-political-map | ---
+++
@@ -11,7 +11,7 @@
url='https://github.com/20tab/django-political-map.git',
license='MIT License',
install_requires=[
- 'googlemaps==2.4.6',
+ 'googlemaps==2.5.0',
],
packages=find_packages(),
include_package_data=True, |
da9628271be108b1236b9dbbcaf6cda9494b7b63 | setup.py | setup.py | #!/usr/bin/env python
from os.path import dirname, join
from distutils.core import setup
from colorama import VERSION
NAME = 'colorama'
def get_long_description(filename):
readme = join(dirname(__file__), filename)
return open(readme).read()
setup(
name=NAME,
version=VERSION,
description='Cross-platform colored terminal text.',
long_description=get_long_description('README.txt'),
keywords='color colour terminal text ansi windows crossplatform xplatform',
author='Jonathan Hartley',
author_email='tartley@tartley.com',
url='http://code.google.com/p/colorama/',
license='BSD',
packages=[NAME],
# see classifiers http://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.5',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.1',
'Topic :: Terminals',
]
)
| #!/usr/bin/env python
from os.path import dirname, join
from distutils.core import setup
from colorama import VERSION
NAME = 'colorama'
def get_long_description(filename):
readme = join(dirname(__file__), filename)
return open(readme).read()
setup(
name=NAME,
version=VERSION,
description='Cross-platform colored terminal text.',
long_description=get_long_description('README.txt'),
keywords='color colour terminal text ansi windows crossplatform xplatform',
author='Jonathan Hartley',
author_email='tartley@tartley.com',
url='http://code.google.com/p/colorama/',
license='BSD',
packages=[NAME],
# see classifiers http://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.5',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Topic :: Terminals',
]
)
| Change PyPI development status from pre-alpha to beta. | Change PyPI development status from pre-alpha to beta.
| Python | bsd-3-clause | nghung270192/colorama,nghung270192/colorama | ---
+++
@@ -27,7 +27,7 @@
packages=[NAME],
# see classifiers http://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
- 'Development Status :: 2 - Pre-Alpha',
+ 'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
@@ -38,6 +38,7 @@
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.1',
+ 'Programming Language :: Python :: 3.2',
'Topic :: Terminals',
]
) |
1d196e4f65a02bdd7437ade213fbf86c711a78d0 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='django-crumbs',
version=__import__('crumbs').__version__,
author='Caktus Consulting Group',
author_email='solutions@caktusgroup.com',
include_package_data=True,
packages=find_packages(exclude=['sample_project']),
exclude_package_data={'': ['*.sql', '*.pyc']},
url='http://github.com/caktus/django-crumbs/',
license='BSD',
description='A pluggable Django app for adding breadcrumbs to your project. ',
classifiers=[
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
'Development Status :: 4 - Beta',
'Operating System :: OS Independent',
],
long_description=open('README.rst').read(),
zip_safe=False,
)
| from setuptools import setup, find_packages
setup(
name='django-crumbs',
version=__import__('crumbs').__version__,
author='Caktus Consulting Group',
author_email='solutions@caktusgroup.com',
include_package_data=True,
packages=find_packages(),
exclude_package_data={'': ['*.sql', '*.pyc']},
url='http://github.com/caktus/django-crumbs/',
license='BSD',
description='A pluggable Django app for adding breadcrumbs to your project. ',
classifiers=[
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
'Development Status :: 4 - Beta',
'Operating System :: OS Independent',
],
long_description=open('README.rst').read(),
zip_safe=False,
)
| Remove a ref to now-gone sample_project. | Remove a ref to now-gone sample_project.
| Python | bsd-3-clause | caktus/django-crumbs | ---
+++
@@ -6,7 +6,7 @@
author='Caktus Consulting Group',
author_email='solutions@caktusgroup.com',
include_package_data=True,
- packages=find_packages(exclude=['sample_project']),
+ packages=find_packages(),
exclude_package_data={'': ['*.sql', '*.pyc']},
url='http://github.com/caktus/django-crumbs/',
license='BSD', |
def100f95abe6a85301b8d9b7f31ff44353a5e27 | setup.py | setup.py | import re
import setuptools
with open("README.md", "r") as fin:
long_description = fin.read()
long_description = re.sub(
"^(!\[.*\]\()(.*\))",
lambda m: m.group(1) + "https://github.com/davidalber/geneagrapher/raw/master/" + m.group(2),
long_description,
flags=re.MULTILINE
)
setuptools.setup(
name="geneagrapher",
version="1.0",
author="David Alber",
author_email="alber.david@gmail.com",
description="Mathematical genealogy grapher.",
entry_points={
'console_scripts':
['ggrapher=geneagrapher.geneagrapher:ggrapher']
},
install_requires=['beautifulsoup4==4.6.3', 'lxml==4.2.5'],
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/davidalber/geneagrapher",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 2.7",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
)
| import re
import setuptools
with open("README.md", "r") as fin:
long_description = fin.read()
long_description = re.sub(
"^(!\[.*\]\()(.*\))",
lambda m: m.group(1) + "https://github.com/davidalber/geneagrapher/raw/master/" + m.group(2),
long_description,
flags=re.MULTILINE
)
setuptools.setup(
name="geneagrapher",
version="1.0",
author="David Alber",
author_email="alber.david@gmail.com",
description="Mathematical genealogy grapher.",
entry_points={
'console_scripts':
['ggrapher=geneagrapher.geneagrapher:ggrapher']
},
install_requires=['beautifulsoup4==4.6.3', 'lxml==4.2.5'],
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/davidalber/geneagrapher",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 2.7",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
package_data={'tests': ['geneagrapher/testdata/*.html']},
include_package_data=True,
)
| Include test data files in package. Otherwise, they are not copied to the build directory and the tests fail. | Include test data files in package. Otherwise, they are not copied to the build directory and the tests fail.
| Python | mit | davidalber/Geneagrapher,davidalber/Geneagrapher | ---
+++
@@ -31,4 +31,6 @@
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
+ package_data={'tests': ['geneagrapher/testdata/*.html']},
+ include_package_data=True,
) |
f308ae32a372f8e288bcc4e9bed98b403795baa1 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
tests_require = []
setup(
name='ashlar',
version='0.0.2',
description='Define and validate schemas for metadata for geotemporal event records',
author='Azavea, Inc.',
author_email='info@azavea.com',
keywords='gis jsonschema',
packages=find_packages(exclude=['tests']),
dependency_links=[
'https://github.com/azavea/djsonb/tarball/feature/pattern-search-OR#egg=djsonb-0.1.6'
],
install_requires=[
'Django ==1.8.6',
'djangorestframework >=3.1.1',
'djangorestframework-gis >=0.8.1',
'django-filter >=0.9.2',
'djsonb >=0.1.6',
'jsonschema >=2.4.0',
'psycopg2 >=2.6',
'django-extensions >=1.6.1',
'python-dateutil >=2.4.2',
'PyYAML >=3.11',
'pytz >=2015.7',
'requests >=2.8.1'
],
extras_require={
'dev': [],
'test': tests_require
},
test_suite='tests',
tests_require=tests_require,
)
| #!/usr/bin/env python
from setuptools import setup, find_packages
tests_require = []
setup(
name='ashlar',
version='0.0.2',
description='Define and validate schemas for metadata for geotemporal event records',
author='Azavea, Inc.',
author_email='info@azavea.com',
keywords='gis jsonschema',
packages=find_packages(exclude=['tests']),
dependency_links=[
'https://github.com/azavea/djsonb/tarball/develop#egg=djsonb-0.1.6'
],
install_requires=[
'Django ==1.8.6',
'djangorestframework >=3.1.1',
'djangorestframework-gis >=0.8.1',
'django-filter >=0.9.2',
'djsonb >=0.1.6',
'jsonschema >=2.4.0',
'psycopg2 >=2.6',
'django-extensions >=1.6.1',
'python-dateutil >=2.4.2',
'PyYAML >=3.11',
'pytz >=2015.7',
'requests >=2.8.1'
],
extras_require={
'dev': [],
'test': tests_require
},
test_suite='tests',
tests_require=tests_require,
)
| Use develop for djsonb repository | Use develop for djsonb repository
| Python | mit | azavea/ashlar,flibbertigibbet/ashlar,flibbertigibbet/ashlar,azavea/ashlar | ---
+++
@@ -13,7 +13,7 @@
keywords='gis jsonschema',
packages=find_packages(exclude=['tests']),
dependency_links=[
- 'https://github.com/azavea/djsonb/tarball/feature/pattern-search-OR#egg=djsonb-0.1.6'
+ 'https://github.com/azavea/djsonb/tarball/develop#egg=djsonb-0.1.6'
],
install_requires=[
'Django ==1.8.6', |
582db33a03509324c02d9861b48138c7ce54947e | setup.py | setup.py | import sys
from setuptools import setup, find_packages
if sys.version_info < (2, 7, 0):
print("Error: signac requires python version >= 2.7.x.")
sys.exit(1)
setup(
name='signac',
version='0.6.2',
packages=find_packages(),
zip_safe=True,
author='Carl Simon Adorf',
author_email='csadorf@umich.edu',
description="Simple data management framework.",
keywords='simulation database index collaboration workflow',
url="https://bitbucket.org/glotzer/signac",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Topic :: Scientific/Engineering :: Physics",
],
extras_require={
'db': ['pymongo>=3.0'],
'mpi': ['mpi4py'],
'gui': ['PySide'],
},
entry_points={
'console_scripts': [
'signac = signac.__main__:main',
'signac-gui = signac.gui:main',
],
},
)
| import sys
from setuptools import setup, find_packages
if sys.version_info < (2, 7, 0):
print("Error: signac requires python version >= 2.7.x.")
sys.exit(1)
setup(
name='signac',
version='0.6.2',
packages=find_packages(),
zip_safe=True,
author='Carl Simon Adorf',
author_email='csadorf@umich.edu',
description="Simple data management framework.",
keywords='simulation database index collaboration workflow',
url="https://bitbucket.org/glotzer/signac",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Topic :: Scientific/Engineering :: Physics",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
],
extras_require={
'db': ['pymongo>=3.0'],
'mpi': ['mpi4py'],
'gui': ['PySide'],
},
entry_points={
'console_scripts': [
'signac = signac.__main__:main',
'signac-gui = signac.gui:main',
],
},
)
| Add all supported python versions to classifiers. | Add all supported python versions to classifiers.
| Python | bsd-3-clause | csadorf/signac,csadorf/signac | ---
+++
@@ -22,6 +22,10 @@
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Topic :: Scientific/Engineering :: Physics",
+ "Programming Language :: Python :: 2.7",
+ "Programming Language :: Python :: 3.3",
+ "Programming Language :: Python :: 3.4",
+ "Programming Language :: Python :: 3.5",
],
extras_require={ |
4c12f68e5d86acb4152acf5ace6a02b6968db925 | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(name='icalendar',
version='0.10',
description='iCalendar support module',
package_dir = {'': 'src'},
packages=['icalendar'],
)
| #!/usr/bin/env python
from distutils.core import setup
f = open('version.txt', 'r')
version = f.read().strip()
f.close()
setup(name='icalendar',
version=version,
description='iCalendar support module',
package_dir = {'': 'src'},
packages=['icalendar'],
)
| Tweak so that version information is picked up from version.txt. | Tweak so that version information is picked up from version.txt.
| Python | bsd-2-clause | nylas/icalendar,geier/icalendar,untitaker/icalendar | ---
+++
@@ -2,8 +2,12 @@
from distutils.core import setup
+f = open('version.txt', 'r')
+version = f.read().strip()
+f.close()
+
setup(name='icalendar',
- version='0.10',
+ version=version,
description='iCalendar support module',
package_dir = {'': 'src'},
packages=['icalendar'], |
2c7adc6fd0a53db44951eccb8f5db3b45e4a4653 | setup.py | setup.py | from setuptools import setup
setup(
name='jinjer',
version='0.1',
packages=['jinjer'],
package_dir={'': 'src'},
url='https://github.com/andrematheus/jinjer',
license='BSD',
author='André Roque Matheus',
author_email='amatheus@ligandoospontos.com.br',
description='Tool to render Jinja templates from command line',
requires=['docopt', 'jinja2', 'PyYaml'],
entry_points={
'console_scripts': [
'jinjer = jinjer.jinjer:main'
]
}
)
| from setuptools import setup
setup(
name='jinjer',
version='0.2',
packages=['jinjer'],
package_dir={'': 'src'},
url='https://github.com/andrematheus/jinjer',
license='BSD',
author='André Roque Matheus',
author_email='amatheus@ligandoospontos.com.br',
description='Tool to render Jinja templates from command line',
install_requires=['docopt', 'jinja2', 'PyYaml'],
entry_points={
'console_scripts': [
'jinjer = jinjer.jinjer:main'
]
}
)
| Correct requires to force installation. | Correct requires to force installation.
| Python | mit | andrematheus/jinjer | ---
+++
@@ -2,7 +2,7 @@
setup(
name='jinjer',
- version='0.1',
+ version='0.2',
packages=['jinjer'],
package_dir={'': 'src'},
url='https://github.com/andrematheus/jinjer',
@@ -10,7 +10,7 @@
author='André Roque Matheus',
author_email='amatheus@ligandoospontos.com.br',
description='Tool to render Jinja templates from command line',
- requires=['docopt', 'jinja2', 'PyYaml'],
+ install_requires=['docopt', 'jinja2', 'PyYaml'],
entry_points={
'console_scripts': [
'jinjer = jinjer.jinjer:main' |
941d71ce0c7e61dc461382c3a4972aaa169e9db9 | setup.py | setup.py | from setuptools import setup, find_packages
setup(name='pygments-hackasm-lexer',
version='0.1',
description='Pygments lexer for the Nand2Tetris Hack Assembler',
packages = setuptools.find_packages(),
url='https://github.com/cprieto/pygments_hack_asm',
author='Cristian Prieto',
author_email='me@cprieto.com',
license='MIT',
install_requires = ['pygments'],
keywords = [
'syntax highlighting',
'pygments',
'lexer',
'hack',
'assembler',
'nand2tetris'],
classifiers =[
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Utilities',
'License :: OSI Approved :: MIT License',
'Environment :: Plugins'])
| from setuptools import setup, find_packages
setup(name='pygments-hackasm-lexer',
version='0.1',
description='Pygments lexer for the Nand2Tetris Hack Assembler',
packages = setuptools.find_packages(),
url='https://github.com/cprieto/pygments_hack_asm',
author='Cristian Prieto',
author_email='me@cprieto.com',
license='MIT',
install_requires = ['pygments'],
keywords = [
'syntax highlighting',
'pygments',
'lexer',
'hack',
'assembler',
'nand2tetris'],
classifiers =[
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Utilities',
'License :: OSI Approved :: MIT License',
'Environment :: Plugins'],
entry_points = {
'pygments.lexers': [
'hack_asm=hackasmlexer:HackAsmLexer']
})
| Fix issue with extension point | Fix issue with extension point
| Python | mit | cprieto/pygments_hack_asm | ---
+++
@@ -24,5 +24,8 @@
'Programming Language :: Python :: 3',
'Topic :: Utilities',
'License :: OSI Approved :: MIT License',
- 'Environment :: Plugins'])
-
+ 'Environment :: Plugins'],
+ entry_points = {
+ 'pygments.lexers': [
+ 'hack_asm=hackasmlexer:HackAsmLexer']
+ }) |
4df3209e4b0eb376f9eb1143717fb60b6d699182 | setup.py | setup.py | from distutils.core import setup
setup(name="cf_app_utils",
version="1.0",
packages=['cf_app_utils'])
| from distutils.core import setup
setup(name="cf_app_utils",
version="0.1",
packages=['cf_app_utils'])
| Decrease version number to reflect project nascency | Decrease version number to reflect project nascency
| Python | bsd-2-clause | wileykestner/cf_app_utils_python | ---
+++
@@ -1,6 +1,7 @@
from distutils.core import setup
setup(name="cf_app_utils",
- version="1.0",
+ version="0.1",
packages=['cf_app_utils'])
+ |
c9ae9dc6766e94d319b5a8da16a9ed44465519eb | setup.py | setup.py | from distutils.core import setup
setup(
name = "brabeion",
version = "0.1.dev",
author = "Eldarion",
author_email = "development@eldarion.com",
description = "a reusable django badges application",
long_description = open("README.rst").read(),
license = "BSD",
url = "http://github.com/eldarion/brabeion",
packages = [
"brabeion",
],
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Framework :: Django",
]
)
| from distutils.core import setup
setup(
name = "brabeion",
version = "0.1.dev",
author = "Eldarion",
author_email = "development@eldarion.com",
description = "a reusable Django badges application",
long_description = open("README.rst").read(),
license = "BSD",
url = "http://github.com/eldarion/brabeion",
packages = [
"brabeion",
],
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Framework :: Django",
]
)
| Correct the capitalization of Django. | Correct the capitalization of Django.
| Python | bsd-3-clause | kinsights/brabeion | ---
+++
@@ -6,7 +6,7 @@
version = "0.1.dev",
author = "Eldarion",
author_email = "development@eldarion.com",
- description = "a reusable django badges application",
+ description = "a reusable Django badges application",
long_description = open("README.rst").read(),
license = "BSD",
url = "http://github.com/eldarion/brabeion", |
fe7924717151d4f85ff9fa28dea44254eb9eec70 | setup.py | setup.py | # -*- coding: utf-8 -*-
# ###
# Copyright (c) 2015, Rice University
# This software is subject to the provisions of the GNU Affero General
# Public License version 3 (AGPLv3).
# See LICENCE.txt for details.
# ###
import sys
from setuptools import setup, find_packages
install_requires = (
'psycopg2>=2.5',
)
tests_require = [
]
if sys.version_info.major < 3:
tests_require.append('mock')
LONG_DESC = '\n\n~~~~\n\n'.join([open('README.rst').read(),
open('CHANGELOG.rst').read()])
setup(
name='db-migrator',
version='1.0.0',
author='Connexions',
author_email='info@cnx.org',
url='https://github.com/karenc/db-migrator',
license='AGPL, see also LICENSE.txt',
description='Python package to migrate postgresql database',
long_description=LONG_DESC,
packages=find_packages(),
install_requires=install_requires,
tests_require=tests_require,
test_suite='dbmigrator.tests',
include_package_data=True,
entry_points={
'console_scripts': [
'dbmigrator = dbmigrator.cli:main',
],
},
)
| # -*- coding: utf-8 -*-
# ###
# Copyright (c) 2015, Rice University
# This software is subject to the provisions of the GNU Affero General
# Public License version 3 (AGPLv3).
# See LICENCE.txt for details.
# ###
import sys
from setuptools import setup, find_packages
install_requires = (
'psycopg2>=2.7',
)
tests_require = [
]
if sys.version_info.major < 3:
tests_require.append('mock')
LONG_DESC = '\n\n~~~~\n\n'.join([open('README.rst').read(),
open('CHANGELOG.rst').read()])
setup(
name='db-migrator',
version='1.0.0',
author='Connexions',
author_email='info@cnx.org',
url='https://github.com/karenc/db-migrator',
license='AGPL, see also LICENSE.txt',
description='Python package to migrate postgresql database',
long_description=LONG_DESC,
packages=find_packages(),
install_requires=install_requires,
tests_require=tests_require,
test_suite='dbmigrator.tests',
include_package_data=True,
entry_points={
'console_scripts': [
'dbmigrator = dbmigrator.cli:main',
],
},
)
| Update minimum version of psycopg2 required | Update minimum version of psycopg2 required
For the `super_user` context manager, we are doing something like:
```
db_conn = psycopg2.connect('user=tester dbname=testing', user='postgres')
```
This was not supported by psycopg2 < 2.7:
```
Traceback (most recent call last):
File \"/var/cnx/venvs/publishing/bin/dbmigrator\", line 11, in <module>
sys.exit(main())
File \"/var/cnx/venvs/publishing/local/lib/python2.7/site-packages/dbmigrator/cli.py\", line 104, in main
return args['cmmd'](**args)
File \"/var/cnx/venvs/publishing/local/lib/python2.7/site-packages/dbmigrator/utils.py\", line 145, in wrapper
return func(cursor, *args, **kwargs)
File \"/var/cnx/venvs/publishing/local/lib/python2.7/site-packages/dbmigrator/commands/migrate.py\", line 32, in cli_command
run_deferred)
File \"/var/cnx/venvs/publishing/local/lib/python2.7/site-packages/dbmigrator/utils.py\", line 227, in compare_schema
callback(*args, **kwargs)
File \"/var/cnx/venvs/publishing/local/lib/python2.7/site-packages/dbmigrator/utils.py\", line 257, in run_migration
migration.up(cursor)
File \"../../var/cnx/venvs/publishing/src/cnx-db/cnxdb/migrations/20170912134157_shred-colxml-uuids.py\", line 19, in up
with super_user() as super_cursor:
File \"/usr/lib/python2.7/contextlib.py\", line 17, in __enter__
return self.gen.next()
File \"/var/cnx/venvs/publishing/local/lib/python2.7/site-packages/dbmigrator/utils.py\", line 57, in super_user
user=super_user) as db_conn:
File \"/var/cnx/venvs/publishing/local/lib/python2.7/site-packages/psycopg2/__init__.py\", line 155, in connect
% items[0][0])
TypeError: 'user' is an invalid keyword argument when the dsn is specified
```
| Python | agpl-3.0 | karenc/db-migrator | ---
+++
@@ -10,7 +10,7 @@
from setuptools import setup, find_packages
install_requires = (
- 'psycopg2>=2.5',
+ 'psycopg2>=2.7',
)
tests_require = [ |
03d321f5700f2cd3f02de8aa2b601fa14d3de144 | setup.py | setup.py | #!/usr/bin/python
# from setuptools
# import setup
import os
__author__ = "Andre Christoga"
input = raw_input("> (eg plus, minus, divide...)")
if input == "plus":
os.system("pymain/plus.py")
if input == "minus":
os.system("pymain/minus.py")
if input == "multi":
os.system("pymain/multi.py")
if input == "divide":
os.system("pymain/divide.py")
if input == "modulos":
os.system("pymain/modulos.py")
else :
print "The script does not exists"
# setup(
# name="PyMaIn",
# version="1.0.0",
# author="Coding Smart School",
# author_email="codingsmartschool@gmail.com",
# url="https://github.com/codingsmartschool/pymain",
# description="Python Math Input",
# long_description=("PyMaIn is a python program that takes maths number"
# " and give user the answer."),
# classifiers=[
# 'Development Status :: 4 - Beta',
# 'Programming Language :: Python',
# ],
# license="MIT",
# packages=['pymain'],
# ) | #!/usr/bin/python
# from setuptools
# import setup
import os
__author__ = "Andre Christoga"
input = raw_input("> (eg plus, minus, divide...)")
if input == "plus":
os.system("pymain/plus.py")
if input == "minus":
os.system("pymain/minus.py")
if input == "multi":
os.system("pymain/multi.py")
if input == "divide":
os.system("pymain/divide.py")
if input == "modulos":
os.system("pymain/modulos.py")
# setup(
# name="PyMaIn",
# version="1.0.0",
# author="Coding Smart School",
# author_email="codingsmartschool@gmail.com",
# url="https://github.com/codingsmartschool/pymain",
# description="Python Math Input",
# long_description=("PyMaIn is a python program that takes maths number"
# " and give user the answer."),
# classifiers=[
# 'Development Status :: 4 - Beta',
# 'Programming Language :: Python',
# ],
# license="MIT",
# packages=['pymain'],
# ) | Remove not found script message | Remove not found script message
| Python | mit | codingsmartschool/PyMaIn | ---
+++
@@ -16,8 +16,6 @@
os.system("pymain/divide.py")
if input == "modulos":
os.system("pymain/modulos.py")
-else :
- print "The script does not exists"
# setup(
# name="PyMaIn", |
d265ec5127a8ab51b1812786f4e1eef79ef2a9a3 | setup.py | setup.py | #/usr/bin/env python
import os
from setuptools import setup, find_packages
ROOT_DIR = os.path.dirname(__file__)
SOURCE_DIR = os.path.join(ROOT_DIR)
version = '2.6.dev0'
setup(
name="django-photologue",
version=version,
description="Powerful image management for the Django web framework.",
author="Justin Driscoll, Marcos Daniel Petry, Richard Barran",
author_email="justin@driscolldev.com, marcospetry@gmail.com",
url="https://github.com/jdriscoll/django-photologue",
packages=find_packages(),
package_data={
'photologue': [
'res/*.jpg',
'locale/*/LC_MESSAGES/*',
'templates/photologue/*.html',
'templates/photologue/tags/*.html',
]
},
zip_safe=False,
classifiers=['Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Utilities'],
install_requires=['Django>=1.3', # Change to class-based views means 1.3 minimum.
'South>=0.7.5', # Might work with earlier versions, but not tested.
'Pillow>=1.7.8', # Might work with earlier versions, but not tested.
],
)
| #/usr/bin/env python
import os
from setuptools import setup, find_packages
ROOT_DIR = os.path.dirname(__file__)
SOURCE_DIR = os.path.join(ROOT_DIR)
version = '2.6.dev0'
setup(
name="django-photologue",
version=version,
description="Powerful image management for the Django web framework.",
author="Justin Driscoll, Marcos Daniel Petry, Richard Barran",
author_email="justin@driscolldev.com, marcospetry@gmail.com",
url="https://github.com/jdriscoll/django-photologue",
packages=find_packages(),
package_data={
'photologue': [
'res/*.jpg',
'locale/*/LC_MESSAGES/*',
'templates/photologue/*.html',
'templates/photologue/tags/*.html',
]
},
zip_safe=False,
classifiers=['Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Utilities'],
install_requires=['Django>=1.3', # Change to class-based views means 1.3 minimum.
'South>=0.7.5', # Might work with earlier versions, but not tested.
'Pillow>=2.0', # Might work with earlier versions, but not tested.
],
)
| Change manage.py to require Pillow 2.0. This is to avoid PIL import errors for Mac users | Change manage.py to require Pillow 2.0. This is to avoid PIL import errors for Mac users
| Python | bsd-3-clause | rmaceissoft/django-photologue,jlemaes/django-photologue,rmaceissoft/django-photologue,seedwithroot/django-photologue-clone,rmaceissoft/django-photologue,RossLYoung/django-photologue,MathieuDuponchelle/my_patched_photologue,seedwithroot/django-photologue-clone,jlemaes/django-photologue,jlemaes/django-photologue,MathieuDuponchelle/my_patched_photologue,RossLYoung/django-photologue,RossLYoung/django-photologue | ---
+++
@@ -34,6 +34,6 @@
'Topic :: Utilities'],
install_requires=['Django>=1.3', # Change to class-based views means 1.3 minimum.
'South>=0.7.5', # Might work with earlier versions, but not tested.
- 'Pillow>=1.7.8', # Might work with earlier versions, but not tested.
+ 'Pillow>=2.0', # Might work with earlier versions, but not tested.
],
) |
845eb9209ebaf7f7acb9e748a94650ec74935ca2 | setup.py | setup.py | from setuptools import setup, find_packages
import sys, os
version = '0.5.2'
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
description = f.read()
setup(name='ouimeaux',
version=version,
description="Python API to Belkin WeMo devices",
long_description=description,
classifiers=[
"License :: OSI Approved :: BSD License",
"Topic :: Home Automation",
"Programming Language :: Python"
],
keywords='belkin wemo soap api homeautomation control',
author='Ian McCracken',
author_email='ian.mccracken@gmail.com',
url='http://github.com/iancmcc/ouimeaux',
license='BSD',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
include_package_data=True,
zip_safe=False,
dependency_links = [
'https://github.com/downloads/surfly/gevent/gevent-1.0rc2.tar.gz#egg=gevent-1.0.rc2'
],
install_requires=[
'gevent >= 1.0rc2',
'requests',
'pyyaml'
],
entry_points={
'console_scripts': [
'wemo = ouimeaux.cli:wemo'
]
},
)
| from setuptools import setup, find_packages
import sys, os
version = '0.6'
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
description = f.read()
setup(name='ouimeaux',
version=version,
description="Python API to Belkin WeMo devices",
long_description=description,
classifiers=[
"License :: OSI Approved :: BSD License",
"Topic :: Home Automation",
"Programming Language :: Python"
],
keywords='belkin wemo soap api homeautomation control',
author='Ian McCracken',
author_email='ian.mccracken@gmail.com',
url='http://github.com/iancmcc/ouimeaux',
license='BSD',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
include_package_data=True,
zip_safe=False,
install_requires=[
'gevent >= 1.0',
'requests',
'pyyaml'
],
entry_points={
'console_scripts': [
'wemo = ouimeaux.cli:wemo'
]
},
)
| Update gevent dependency; bump version number | Update gevent dependency; bump version number
| Python | bsd-3-clause | fujita-shintaro/ouimeaux,tomjmul/wemo,drock371/ouimeaux,sstangle73/ouimeaux,aktur/ouimeaux,sstangle73/ouimeaux,rgardner/ouimeaux,m-kiuchi/ouimeaux,tomjmul/wemo,fujita-shintaro/ouimeaux,tomjmul/wemo,rgardner/ouimeaux,bennytheshap/ouimeaux,m-kiuchi/ouimeaux,fritz-fritz/ouimeaux,sstangle73/ouimeaux,bennytheshap/ouimeaux,iancmcc/ouimeaux,aktur/ouimeaux,iancmcc/ouimeaux,fujita-shintaro/ouimeaux,aktur/ouimeaux,drock371/ouimeaux,bennytheshap/ouimeaux,fritz-fritz/ouimeaux,drock371/ouimeaux,m-kiuchi/ouimeaux,iancmcc/ouimeaux,rgardner/ouimeaux,fritz-fritz/ouimeaux | ---
+++
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
import sys, os
-version = '0.5.2'
+version = '0.6'
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
description = f.read()
@@ -23,11 +23,8 @@
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
include_package_data=True,
zip_safe=False,
- dependency_links = [
- 'https://github.com/downloads/surfly/gevent/gevent-1.0rc2.tar.gz#egg=gevent-1.0.rc2'
- ],
install_requires=[
- 'gevent >= 1.0rc2',
+ 'gevent >= 1.0',
'requests',
'pyyaml'
], |
0163e8821288db826b595051a6312b19c66e05f0 | ideascaly/utils.py | ideascaly/utils.py | # IdeaScaly
# Copyright 2015 Jorge Saldivar
# See LICENSE for details.
import six
import dateutil.parser
def parse_datetime(str_date):
try:
date_is = dateutil.parser.parse(str_date)
return date_is
except:
return None
def parse_html_value(html):
return html[html.find('>')+1:html.rfind('<')]
def parse_a_href(atag):
start = atag.find('"') + 1
end = atag.find('"', start)
return atag[start:end]
def convert_to_utf8_str(arg):
# written by Michael Norton (http://docondev.blogspot.com/)
if isinstance(arg, six.text_type):
arg = arg.encode('utf-8')
elif not isinstance(arg, bytes):
arg = six.text_type(arg).encode('utf-8')
return arg
def import_simplejson():
try:
import simplejson as json
except ImportError:
try:
import json # Python 2.6+
except ImportError:
raise ImportError("Can't load a json library")
return json | # IdeaScaly
# Copyright 2015 Jorge Saldivar
# See LICENSE for details.
import six
import dateutil.parser
def parse_datetime(str_date):
try:
date_is = dateutil.parser.parse(str_date)
return date_is
except:
return None
def parse_html_value(html):
return html[html.find('>')+1:html.rfind('<')]
def parse_a_href(atag):
start = atag.find('"') + 1
end = atag.find('"', start)
return atag[start:end]
def convert_to_utf8_str(arg):
# written by Michael Norton (http://docondev.blogspot.com/)
if isinstance(arg, bytes):
arg = arg.decode('ascii')
if isinstance(arg, six.text_type):
arg = arg.encode('utf-8')
elif not isinstance(arg, bytes):
arg = six.text_type(arg).encode('utf-8')
return arg
def import_simplejson():
try:
import simplejson as json
except ImportError:
try:
import json # Python 2.6+
except ImportError:
raise ImportError("Can't load a json library")
return json | Add a conditional to check whther 'arg' is a byte | Add a conditional to check whther 'arg' is a byte
| Python | mit | joausaga/ideascaly | ---
+++
@@ -25,6 +25,8 @@
def convert_to_utf8_str(arg):
# written by Michael Norton (http://docondev.blogspot.com/)
+ if isinstance(arg, bytes):
+ arg = arg.decode('ascii')
if isinstance(arg, six.text_type):
arg = arg.encode('utf-8')
elif not isinstance(arg, bytes): |
abd5c75dbe8eab93504888c2483f63e77e72ffb2 | macroeco/misc/__init__.py | macroeco/misc/__init__.py | """
===============================
Misc (:mod:`macroeco.misc`)
===============================
This module contains miscellaneous functions that support the functions of
other modules of macroeco.
Support Functions
=================
.. autosummary::
:toctree: generated/
setup_log
log_start_end
inherit_docstring_from
doc_sub
"""
"""
Data Formatting Functions
=========================
.. autosummary::
:toctree: generated/
data_read_write
format_dense
"""
from .misc import (log_start_end, _thread_excepthook,
inherit_docstring_from, doc_sub, check_parameter_file)
from .rcparams import ggplot_rc
from .format_data import (data_read_write, format_dense)
_thread_excepthook() # Make desktop app catch and log sys except from thread
| """
===============================
Misc (:mod:`macroeco.misc`)
===============================
This module contains miscellaneous functions that support the functions of
other modules of macroeco.
Support Functions
=================
.. autosummary::
:toctree: generated/
log_start_end
inherit_docstring_from
doc_sub
check_parameter_file
"""
"""
Data Formatting Functions
=========================
.. autosummary::
:toctree: generated/
data_read_write
format_dense
"""
from .misc import (log_start_end, _thread_excepthook,
inherit_docstring_from, doc_sub, check_parameter_file)
from .rcparams import ggplot_rc
from .format_data import (data_read_write, format_dense)
_thread_excepthook() # Make desktop app catch and log sys except from thread
| Remove setup_log function from misc init (no longer present) | Remove setup_log function from misc init (no longer present)
| Python | bsd-2-clause | jkitzes/macroeco | ---
+++
@@ -12,10 +12,10 @@
.. autosummary::
:toctree: generated/
- setup_log
log_start_end
inherit_docstring_from
doc_sub
+ check_parameter_file
"""
""" |
edb73a4d8bba1c1265bfc00e5a765ff47c120e02 | plasma/test/__init__.py | plasma/test/__init__.py | # Copyright (c) 2007-2009 The Plasma Project.
# See LICENSE.txt for details.
| # Copyright (c) 2007-2009 The Plasma Project.
# See LICENSE.txt for details.
import unittest
def failUnlessIdentical(self, first, second, msg=None):
"""
Fail the test if C{first} is not C{second}. This is an
obect-identity-equality test, not an object equality (i.e. C{__eq__}) test.
@param msg: if msg is None, then the failure message will be
'%r is not %r' % (first, second)
"""
if first is not second:
raise AssertionError(msg or '%r is not %r' % (first, second))
return first
def failIfIdentical(self, first, second, msg=None):
"""
Fail the test if C{first} is C{second}. This is an
object-identity-equality test, not an object equality
(i.e. C{__eq__}) test.
@param msg: if msg is None, then the failure message will be
'%r is %r' % (first, second)
"""
if first is second:
raise AssertionError(msg or '%r is %r' % (first, second))
return first
if not hasattr(unittest.TestCase, 'failUnlessIdentical'):
unittest.TestCase.failUnlessIdentical = failUnlessIdentical
if not hasattr(unittest.TestCase, 'failIfIdentical'):
unittest.TestCase.failIfIdentical = failIfIdentical
if not hasattr(unittest.TestCase, 'assertIdentical'):
unittest.TestCase.assertIdentical = unittest.TestCase.failUnlessIdentical
if not hasattr(unittest.TestCase, 'assertNotIdentical'):
unittest.TestCase.assertNotIdentical = unittest.TestCase.failIfIdentical
| Add assertIdentical support from twisted.trial | Add assertIdentical support from twisted.trial
| Python | mit | hydralabs/plasma,hydralabs/plasma | ---
+++
@@ -1,2 +1,45 @@
# Copyright (c) 2007-2009 The Plasma Project.
# See LICENSE.txt for details.
+
+import unittest
+
+
+def failUnlessIdentical(self, first, second, msg=None):
+ """
+ Fail the test if C{first} is not C{second}. This is an
+ obect-identity-equality test, not an object equality (i.e. C{__eq__}) test.
+
+ @param msg: if msg is None, then the failure message will be
+ '%r is not %r' % (first, second)
+ """
+ if first is not second:
+ raise AssertionError(msg or '%r is not %r' % (first, second))
+
+ return first
+
+def failIfIdentical(self, first, second, msg=None):
+ """
+ Fail the test if C{first} is C{second}. This is an
+ object-identity-equality test, not an object equality
+ (i.e. C{__eq__}) test.
+
+ @param msg: if msg is None, then the failure message will be
+ '%r is %r' % (first, second)
+ """
+ if first is second:
+ raise AssertionError(msg or '%r is %r' % (first, second))
+
+ return first
+
+
+if not hasattr(unittest.TestCase, 'failUnlessIdentical'):
+ unittest.TestCase.failUnlessIdentical = failUnlessIdentical
+
+if not hasattr(unittest.TestCase, 'failIfIdentical'):
+ unittest.TestCase.failIfIdentical = failIfIdentical
+
+if not hasattr(unittest.TestCase, 'assertIdentical'):
+ unittest.TestCase.assertIdentical = unittest.TestCase.failUnlessIdentical
+
+if not hasattr(unittest.TestCase, 'assertNotIdentical'):
+ unittest.TestCase.assertNotIdentical = unittest.TestCase.failIfIdentical |
5f5530205b54ca7929376c3c8e8d2c1fd68378a4 | rollbar/contrib/asgi/__init__.py | rollbar/contrib/asgi/__init__.py | import rollbar
class ASGIMiddleware:
def __init__(self, app):
self.app = app
async def __call__(self, scope, receive, send):
try:
await self.app(scope, receive, send)
except Exception:
rollbar.report_exc_info()
raise
def _hook(request, data):
data["framework"] = "asgi"
rollbar.BASE_DATA_HOOK = _hook
| import rollbar
try:
from starlette.types import ASGIApp, Scope, Receive, Send
except ImportError:
STARLETTE_INSTALLED = False
else:
STARLETTE_INSTALLED = True
if STARLETTE_INSTALLED is True:
class ASGIMiddleware:
def __init__(self, app: ASGIApp) -> None:
self.app = app
async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
try:
await self.app(scope, receive, send)
except Exception:
rollbar.report_exc_info()
raise
else:
class ASGIMiddleware:
def __init__(self, app):
self.app = app
async def __call__(self, scope, receive, send):
try:
await self.app(scope, receive, send)
except Exception:
rollbar.report_exc_info()
raise
def _hook(request, data):
data["framework"] = "asgi"
rollbar.BASE_DATA_HOOK = _hook
| Add typing support for Starlette-based apps | Add typing support for Starlette-based apps
| Python | mit | rollbar/pyrollbar | ---
+++
@@ -1,16 +1,35 @@
import rollbar
+try:
+ from starlette.types import ASGIApp, Scope, Receive, Send
+except ImportError:
+ STARLETTE_INSTALLED = False
+else:
+ STARLETTE_INSTALLED = True
-class ASGIMiddleware:
- def __init__(self, app):
- self.app = app
- async def __call__(self, scope, receive, send):
- try:
- await self.app(scope, receive, send)
- except Exception:
- rollbar.report_exc_info()
- raise
+if STARLETTE_INSTALLED is True:
+ class ASGIMiddleware:
+ def __init__(self, app: ASGIApp) -> None:
+ self.app = app
+
+ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
+ try:
+ await self.app(scope, receive, send)
+ except Exception:
+ rollbar.report_exc_info()
+ raise
+else:
+ class ASGIMiddleware:
+ def __init__(self, app):
+ self.app = app
+
+ async def __call__(self, scope, receive, send):
+ try:
+ await self.app(scope, receive, send)
+ except Exception:
+ rollbar.report_exc_info()
+ raise
def _hook(request, data): |
23cc21bd441ac0c058d9df43276085badb27d905 | srrun.py | srrun.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import copy
import os
import platform
import subprocess
import sys
mypath = os.path.abspath(__file__)
mydir = os.path.split(mypath)[0]
if platform.system().lower() == 'windows':
srpython = sys.executable
else:
srhome = os.path.join(mydir, '..')
srhome = os.path.abspath(srhome)
srbin = os.path.join(srhome, 'bin')
srpython = os.path.join(srbin, 'python')
srpypath = [mydir, os.path.join(mydir, 'wpr')]
env = copy.copy(os.environ)
env['PYTHONPATH'] = ':'.join(srpypath)
# Set a sane umask for all children
os.umask(022)
sys.exit(subprocess.call([srpython] + sys.argv[1:], env=env))
| #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import copy
import os
import platform
import subprocess
import sys
mypath = os.path.abspath(__file__)
mydir = os.path.split(mypath)[0]
if platform.system().lower() == 'windows':
srpython = sys.executable
else:
srhome = os.path.join(mydir, '..')
srhome = os.path.abspath(srhome)
srbin = os.path.join(srhome, 'bin')
srpython = os.path.join(srbin, 'python')
srpypath = [mydir, os.path.join(mydir, 'wpr')]
env = copy.copy(os.environ)
env['PYTHONPATH'] = os.pathsep.join(srpypath)
# Set a sane umask for all children
os.umask(022)
sys.exit(subprocess.call([srpython] + sys.argv[1:], env=env))
| Use the appropriate path separator | Use the appropriate path separator
| Python | mpl-2.0 | mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge | ---
+++
@@ -21,7 +21,7 @@
srpypath = [mydir, os.path.join(mydir, 'wpr')]
env = copy.copy(os.environ)
-env['PYTHONPATH'] = ':'.join(srpypath)
+env['PYTHONPATH'] = os.pathsep.join(srpypath)
# Set a sane umask for all children
os.umask(022) |
89720c6083312b9dbfdd7aa6ff19681c3363526d | core/exceptions.py | core/exceptions.py | import sublime
from ..common import util
MYPY = False
if MYPY:
from typing import Sequence
class GitSavvyError(Exception):
def __init__(self, msg, *args, cmd=None, stdout="", stderr="", **kwargs):
# type: (str, object, Sequence[str], str, str, object) -> None
super(GitSavvyError, self).__init__(msg, *args)
self.message = msg
self.cmd = cmd
self.stdout = stdout
self.stderr = stderr
if msg:
if kwargs.get('show_panel', True):
util.log.display_panel(sublime.active_window(), msg)
util.debug.log_error(msg)
class FailedGithubRequest(GitSavvyError):
pass
class FailedGitLabRequest(GitSavvyError):
pass
| import sublime
from ..common import util
MYPY = False
if MYPY:
from typing import Sequence
class GitSavvyError(Exception):
def __init__(self, msg, *args, cmd=None, stdout="", stderr="", show_panel=True, **kwargs):
# type: (str, object, Sequence[str], str, str, bool, object) -> None
super(GitSavvyError, self).__init__(msg, *args)
self.message = msg
self.cmd = cmd
self.stdout = stdout
self.stderr = stderr
if msg:
if show_panel:
util.log.display_panel(sublime.active_window(), msg)
util.debug.log_error(msg)
class FailedGithubRequest(GitSavvyError):
pass
class FailedGitLabRequest(GitSavvyError):
pass
| Make `show_panel` a normal argument to `GitSavvyError` | Make `show_panel` a normal argument to `GitSavvyError`
| Python | mit | divmain/GitSavvy,divmain/GitSavvy,divmain/GitSavvy | ---
+++
@@ -8,15 +8,15 @@
class GitSavvyError(Exception):
- def __init__(self, msg, *args, cmd=None, stdout="", stderr="", **kwargs):
- # type: (str, object, Sequence[str], str, str, object) -> None
+ def __init__(self, msg, *args, cmd=None, stdout="", stderr="", show_panel=True, **kwargs):
+ # type: (str, object, Sequence[str], str, str, bool, object) -> None
super(GitSavvyError, self).__init__(msg, *args)
self.message = msg
self.cmd = cmd
self.stdout = stdout
self.stderr = stderr
if msg:
- if kwargs.get('show_panel', True):
+ if show_panel:
util.log.display_panel(sublime.active_window(), msg)
util.debug.log_error(msg)
|
971b36aedd700b23d791b72f60a9a534cc1be0ec | src/SALib/test_functions/Ishigami.py | src/SALib/test_functions/Ishigami.py | from __future__ import division
import math
import numpy as np
# Non-monotonic Ishigami Function (3 parameters)
# Using Saltelli sampling with a sample size of ~1000
# the expected first-order indices would be:
# x1: 0.3139
# x2: 0.4424
# x3: 0.0
def evaluate(values):
Y = np.zeros([values.shape[0]])
A = 7
B = 0.1
for i, X in enumerate(values):
Y[i] = math.sin(X[0]) + A * math.pow(math.sin(X[1]), 2) + \
B * math.pow(X[2], 4) * math.sin(X[0])
return Y
| from __future__ import division
import numpy as np
# Non-monotonic Ishigami Function (3 parameters)
# Using Saltelli sampling with a sample size of ~1000
# the expected first-order indices would be:
# x1: 0.3139
# x2: 0.4424
# x3: 0.0
def evaluate(values):
Y = np.zeros(values.shape[0])
A = 7
B = 0.1
# X = values
# Y = np.sin(X[:, 0]) + A * np.power(np.sin(X[:, 1]), 2) + \
# B * np.power(X[:, 2], 4) * np.sin(X[:, 0])
for i, X in enumerate(values):
Y[i] = np.sin(X[0]) + A * np.power(np.sin(X[1]), 2) + \
B * np.power(X[2], 4) * np.sin(X[0])
return Y
| Use numpy functions to allow future vectorization | Use numpy functions to allow future vectorization
| Python | mit | SALib/SALib,jdherman/SALib,jdherman/SALib | ---
+++
@@ -1,6 +1,4 @@
from __future__ import division
-
-import math
import numpy as np
@@ -12,12 +10,15 @@
# x2: 0.4424
# x3: 0.0
def evaluate(values):
- Y = np.zeros([values.shape[0]])
+ Y = np.zeros(values.shape[0])
A = 7
B = 0.1
+ # X = values
+ # Y = np.sin(X[:, 0]) + A * np.power(np.sin(X[:, 1]), 2) + \
+ # B * np.power(X[:, 2], 4) * np.sin(X[:, 0])
for i, X in enumerate(values):
- Y[i] = math.sin(X[0]) + A * math.pow(math.sin(X[1]), 2) + \
- B * math.pow(X[2], 4) * math.sin(X[0])
+ Y[i] = np.sin(X[0]) + A * np.power(np.sin(X[1]), 2) + \
+ B * np.power(X[2], 4) * np.sin(X[0])
return Y |
504764d36344921b1c765f6ef19b21bbe0a29653 | cpnest/__init__.py | cpnest/__init__.py | import logging
from .logger import CPNestLogger
from .cpnest import CPNest
# Get the version number from git tag
from importlib.metadata import version, PackageNotFoundError
try:
__version__ = version(__name__)
except PackageNotFoundError:
# package is not installed
__version__ = "unknown"
logging.setLoggerClass(CPNestLogger)
__all__ = ['model',
'NestedSampling',
'parameter',
'sampler',
'cpnest',
'nest2pos',
'proposal',
'plot',
'logger']
| import logging
from .logger import CPNestLogger
from .cpnest import CPNest
# Get the version number from git tag
from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
# package is not installed
__version__ = "dev"
logging.setLoggerClass(CPNestLogger)
__all__ = ['model',
'NestedSampling',
'parameter',
'sampler',
'cpnest',
'nest2pos',
'proposal',
'plot',
'logger']
| Revert "Get version using importlib" | Revert "Get version using importlib"
This reverts commit 5df63fc784121f113c14195c5ae63a6591e92ae6.
| Python | mit | johnveitch/cpnest | ---
+++
@@ -3,13 +3,12 @@
from .cpnest import CPNest
# Get the version number from git tag
-from importlib.metadata import version, PackageNotFoundError
-
+from pkg_resources import get_distribution, DistributionNotFound
try:
- __version__ = version(__name__)
-except PackageNotFoundError:
+ __version__ = get_distribution(__name__).version
+except DistributionNotFound:
# package is not installed
- __version__ = "unknown"
+ __version__ = "dev"
logging.setLoggerClass(CPNestLogger)
|
fa07eded66aa0d0e8d1eeb127e9d29a3df971cbc | poradnia/cases/admin.py | poradnia/cases/admin.py | from django.utils.translation import ugettext as _
from django.contrib import admin
from guardian.admin import GuardedModelAdmin
from records.models import Record
from .models import Case, PermissionGroup
class RecordInline(admin.StackedInline):
'''
Stacked Inline View for Record
'''
model = Record
@admin.register(Case)
class CaseAdmin(GuardedModelAdmin):
inlines = [RecordInline]
list_display = ['name', 'client']
@admin.register(PermissionGroup)
class PermissionGroupAdmin(admin.ModelAdmin):
'''
Admin View for PermissionGroup
'''
list_display = ['name', 'get_permissions']
select_related = ['permissions']
def get_permissions(self, obj):
return ", ".join([_(x.name) for x in obj.permissions.all()])
| from django.utils.translation import ugettext as _
from django.contrib import admin
from guardian.admin import GuardedModelAdmin
from records.models import Record
from .models import Case, PermissionGroup
class RecordInline(admin.StackedInline):
'''
Stacked Inline View for Record
'''
model = Record
@admin.register(Case)
class CaseAdmin(GuardedModelAdmin):
inlines = [RecordInline]
list_display = ['name', 'client']
list_filter = ['tags', ]
@admin.register(PermissionGroup)
class PermissionGroupAdmin(admin.ModelAdmin):
'''
Admin View for PermissionGroup
'''
list_display = ['name', 'get_permissions']
select_related = ['permissions']
def get_permissions(self, obj):
return ", ".join([_(x.name) for x in obj.permissions.all()])
| Add filter by tags in CaseAdmin | Add filter by tags in CaseAdmin
| Python | mit | watchdogpolska/poradnia,watchdogpolska/poradnia,watchdogpolska/poradnia.siecobywatelska.pl,rwakulszowa/poradnia,watchdogpolska/poradnia.siecobywatelska.pl,rwakulszowa/poradnia,watchdogpolska/poradnia,watchdogpolska/poradnia,rwakulszowa/poradnia,rwakulszowa/poradnia,watchdogpolska/poradnia.siecobywatelska.pl | ---
+++
@@ -16,6 +16,7 @@
class CaseAdmin(GuardedModelAdmin):
inlines = [RecordInline]
list_display = ['name', 'client']
+ list_filter = ['tags', ]
@admin.register(PermissionGroup) |
b1a21354735e3e4b58cf63c3fc81b6e8e2ee5ed7 | concourse/scripts/builds/GpBuild.py | concourse/scripts/builds/GpBuild.py | import os
import subprocess
import sys
from GpdbBuildBase import GpdbBuildBase
class GpBuild(GpdbBuildBase):
def __init__(self, mode):
self.mode = 'on' if mode == 'orca' else 'off'
def configure(self):
return subprocess.call(["./configure",
"--enable-mapreduce",
"--with-perl",
"--with-libxml",
"--with-python",
"--disable-gpcloud",
"--prefix=/usr/local/gpdb"], cwd="gpdb_src")
def icg(self):
status = subprocess.call(
"printf '\nLD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib\nexport \
LD_LIBRARY_PATH' >> /usr/local/gpdb/greenplum_path.sh", shell=True)
if status:
return status
status = subprocess.call([
"runuser gpadmin -c \"source /usr/local/gpdb/greenplum_path.sh \
&& make create-demo-cluster DEFAULT_QD_MAX_CONNECT=150\""], cwd="gpdb_src/gpAux/gpdemo", shell=True)
if status:
return status
return subprocess.call([
"runuser gpadmin -c \"source /usr/local/gpdb/greenplum_path.sh \
&& source gpAux/gpdemo/gpdemo-env.sh && PGOPTIONS='-c optimizer={0}' \
make -C src/test installcheck-good\"".format(self.mode)], cwd="gpdb_src", shell=True)
| import os
import subprocess
import sys
from GpdbBuildBase import GpdbBuildBase
class GpBuild(GpdbBuildBase):
def __init__(self, mode):
self.mode = 'on' if mode == 'orca' else 'off'
def configure(self):
return subprocess.call(["./configure",
"--enable-mapreduce",
"--with-perl",
"--with-libxml",
"--with-python",
"--disable-gpcloud",
"--disable-pxf",
"--prefix=/usr/local/gpdb"], cwd="gpdb_src")
def icg(self):
status = subprocess.call(
"printf '\nLD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib\nexport \
LD_LIBRARY_PATH' >> /usr/local/gpdb/greenplum_path.sh", shell=True)
if status:
return status
status = subprocess.call([
"runuser gpadmin -c \"source /usr/local/gpdb/greenplum_path.sh \
&& make create-demo-cluster DEFAULT_QD_MAX_CONNECT=150\""], cwd="gpdb_src/gpAux/gpdemo", shell=True)
if status:
return status
return subprocess.call([
"runuser gpadmin -c \"source /usr/local/gpdb/greenplum_path.sh \
&& source gpAux/gpdemo/gpdemo-env.sh && PGOPTIONS='-c optimizer={0}' \
make -C src/test installcheck-good\"".format(self.mode)], cwd="gpdb_src", shell=True)
| Disable PXF in ORCA CI | Disable PXF in ORCA CI
| Python | apache-2.0 | greenplum-db/gpdb,xinzweb/gpdb,adam8157/gpdb,adam8157/gpdb,greenplum-db/gpdb,lisakowen/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,lisakowen/gpdb,lisakowen/gpdb,Chibin/gpdb,lisakowen/gpdb,Chibin/gpdb,adam8157/gpdb,Chibin/gpdb,Chibin/gpdb,xinzweb/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,edespino/gpdb,janebeckman/gpdb,janebeckman/gpdb,greenplum-db/gpdb,xinzweb/gpdb,xinzweb/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,xinzweb/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,Chibin/gpdb,janebeckman/gpdb,Chibin/gpdb,edespino/gpdb,xinzweb/gpdb,Chibin/gpdb,adam8157/gpdb,janebeckman/gpdb,Chibin/gpdb,edespino/gpdb,lisakowen/gpdb,edespino/gpdb,50wu/gpdb,janebeckman/gpdb,yuanzhao/gpdb,adam8157/gpdb,janebeckman/gpdb,ashwinstar/gpdb,adam8157/gpdb,greenplum-db/gpdb,janebeckman/gpdb,adam8157/gpdb,ashwinstar/gpdb,lisakowen/gpdb,edespino/gpdb,50wu/gpdb,adam8157/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,yuanzhao/gpdb,ashwinstar/gpdb,lisakowen/gpdb,yuanzhao/gpdb,ashwinstar/gpdb,janebeckman/gpdb,janebeckman/gpdb,edespino/gpdb,greenplum-db/gpdb,edespino/gpdb,jmcatamney/gpdb,yuanzhao/gpdb,Chibin/gpdb,50wu/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,yuanzhao/gpdb,ashwinstar/gpdb,xinzweb/gpdb,50wu/gpdb,jmcatamney/gpdb,janebeckman/gpdb,50wu/gpdb,xinzweb/gpdb,jmcatamney/gpdb,yuanzhao/gpdb,edespino/gpdb,edespino/gpdb,50wu/gpdb,lisakowen/gpdb,50wu/gpdb,yuanzhao/gpdb,edespino/gpdb,50wu/gpdb,Chibin/gpdb,yuanzhao/gpdb | ---
+++
@@ -14,6 +14,7 @@
"--with-libxml",
"--with-python",
"--disable-gpcloud",
+ "--disable-pxf",
"--prefix=/usr/local/gpdb"], cwd="gpdb_src")
def icg(self): |
c3876cd1ad2c73fa4278469b75c6d42b89fac8ea | Friends-By-Age.py | Friends-By-Age.py | from pyspark import SparkConf, SparkContext
import collections
conf = SparkConf().setMaster("local").setAppName("FriendsByAge")
sc = SparkContext(conf = conf)
def parseLine(line):
fields = line.split(',')
age = int(fields[2])
numFriends = int(fields[3])
return (age, numFriends)
lines = sc.textFile("fakefriends.csv")
rdd = lines.map(parseLine)
totalsByAge = rdd.mapValues(lambda x: (x, 1)).reduceByKey(lambda x, y: (x[0] + y[0], x[1] + y[1]))
averagesByAge = totalsByAge.mapValues(lambda x: x[0] / x[1])
results = averagesByAge.collect()
for result in results:
print result
| from pyspark import SparkConf, SparkContext
import collections
conf = SparkConf().setMaster("local").setAppName("FriendsByAge")
sc = SparkContext(conf = conf)
def parseLine(line):
fields = line.split(',')
age = int(fields[2])
numFriends = int(fields[3])
return (age, numFriends)
lines = sc.textFile("fakefriends.csv")
rdd = lines.map(parseLine)
totalsByAge = rdd.mapValues(lambda x: (x, 1)).reduceByKey(lambda x, y: (x[0] + y[0], x[1] + y[1]))
averagesByAge = totalsByAge.mapValues(lambda x: x[0] / x[1])
results = averagesByAge.collect()
sortedResults = collections.OrderedDict(sorted(results, key=lambda t: t[1]))
for result in sortedResults.iteritems():
print result
| Sort the resulted list of items | Sort the resulted list of items
| Python | mit | tonirilix/apache-spark-hands-on | ---
+++
@@ -16,5 +16,7 @@
averagesByAge = totalsByAge.mapValues(lambda x: x[0] / x[1])
results = averagesByAge.collect()
-for result in results:
+sortedResults = collections.OrderedDict(sorted(results, key=lambda t: t[1]))
+
+for result in sortedResults.iteritems():
print result |
2490cf79226c1d2729d97afb73d426ab1b5d515e | butter/__init__.py | butter/__init__.py | #!/usr/bin/env python
"""Butter: library to give python access to linux's more lower level features"""
__author__ = "Da_Blitz"
__version__ = "0.2"
__email__ = "code@pocketnix.org"
__license__ = "BSD (3 Clause)"
__url__ = "http://code.pocketnix.org/butter"
| #!/usr/bin/env python
"""Butter: library to give python access to linux's more lower level features"""
__author__ = "Da_Blitz"
__version__ = "0.3"
__email__ = "code@pocketnix.org"
__license__ = "BSD (3 Clause)"
__url__ = "http://code.pocketnix.org/butter"
| Tag version 0.3 for impeding release | Tag version 0.3 for impeding release
| Python | bsd-3-clause | dasSOZO/python-butter,wdv4758h/butter | ---
+++
@@ -2,7 +2,7 @@
"""Butter: library to give python access to linux's more lower level features"""
__author__ = "Da_Blitz"
-__version__ = "0.2"
+__version__ = "0.3"
__email__ = "code@pocketnix.org"
__license__ = "BSD (3 Clause)"
__url__ = "http://code.pocketnix.org/butter" |
3dbca57a197bcf3161939a748b3ced181e7a49e4 | carafe/response.py | carafe/response.py | """Extension of flask.Response.
"""
from flask import Response as ResponseBase, json, current_app, request
class Response(ResponseBase):
"""Extend flask.Response with support for list/dict conversion to JSON."""
def __init__(self, content=None, *args, **kargs):
if isinstance(content, (list, dict)):
kargs['mimetype'] = 'application/json'
content = to_json(content)
super(Response, self).__init__(content, *args, **kargs)
@classmethod
def force_type(cls, response, environ=None):
"""Override with support for list/dict."""
if isinstance(response, (list, dict)):
return cls(response)
else:
return super(Response, cls).force_type(response, environ)
def to_json(content):
"""Converts content to json while respecting config options."""
indent = None
if (current_app.config['JSONIFY_PRETTYPRINT_REGULAR']
and not request.is_xhr):
indent = 2
return json.dumps(content, indent=indent)
| """Extension of flask.Response.
"""
from flask import Response as ResponseBase, json, current_app, request
class Response(ResponseBase):
"""Extend flask.Response with support for list/dict conversion to JSON."""
def __init__(self, content=None, *args, **kargs):
if isinstance(content, (list, dict)):
kargs['mimetype'] = 'application/json'
content = to_json(content)
super(Response, self).__init__(content, *args, **kargs)
@classmethod
def force_type(cls, response, environ=None):
"""Override with support for list/dict."""
if isinstance(response, (list, dict)):
return cls(response)
else:
return super(Response, cls).force_type(response, environ)
def to_json(content):
"""Converts content to json while respecting config options."""
indent = None
separators = (',', ':')
if (current_app.config['JSONIFY_PRETTYPRINT_REGULAR']
and not request.is_xhr):
indent = 2
separators = (', ', ': ')
return (json.dumps(content, indent=indent, separators=separators), '\n')
| Add explicit JSON separators and append newline to end of JSON string. | Add explicit JSON separators and append newline to end of JSON string.
| Python | mit | dgilland/carafe | ---
+++
@@ -25,7 +25,11 @@
def to_json(content):
"""Converts content to json while respecting config options."""
indent = None
+ separators = (',', ':')
+
if (current_app.config['JSONIFY_PRETTYPRINT_REGULAR']
and not request.is_xhr):
indent = 2
- return json.dumps(content, indent=indent)
+ separators = (', ', ': ')
+
+ return (json.dumps(content, indent=indent, separators=separators), '\n') |
d9fc83ec526df1bf732d8f65f445f48f1b764dfe | selvbetjening/api/rest/models.py | selvbetjening/api/rest/models.py |
from tastypie.authentication import Authentication
from tastypie.resources import ModelResource
from provider.oauth2.models import AccessToken
from selvbetjening.core.members.models import SUser
class OAuth2Authentication(Authentication):
def is_authenticated(self, request, **kwargs):
access_key = request.REQUEST.get('access_key', None)
if not access_key:
auth_header_value = request.META.get('HTTP_AUTHORIZATION', None)
if auth_header_value:
access_key = auth_header_value.split(' ')[1]
if not access_key:
return False
try:
token = AccessToken.objects.get_token(access_key)
except AccessToken.DoesNotExist:
return False
request.user = token.user
return True
class AuthenticatedUserResource(ModelResource):
class Meta:
queryset = SUser.objects.all()
resource_name = 'authenticated_user'
allowed_methods = ['get']
excludes = ['password']
authentication = OAuth2Authentication()
def get_object_list(self, request):
return super(AuthenticatedUserResource, self).get_object_list(request).filter(pk=1)
|
from tastypie.authentication import Authentication
from tastypie.resources import ModelResource
from provider.oauth2.models import AccessToken
from selvbetjening.core.members.models import SUser
class OAuth2Authentication(Authentication):
def is_authenticated(self, request, **kwargs):
access_key = request.REQUEST.get('access_key', None)
if not access_key:
auth_header_value = request.META.get('HTTP_AUTHORIZATION', None)
if auth_header_value:
access_key = auth_header_value.split(' ')[1]
if not access_key:
return False
try:
token = AccessToken.objects.get_token(access_key)
except AccessToken.DoesNotExist:
return False
request.user = token.user
return True
class AuthenticatedUserResource(ModelResource):
class Meta:
queryset = SUser.objects.all()
resource_name = 'authenticated_user'
allowed_methods = ['get']
excludes = ['password']
authentication = OAuth2Authentication()
def get_object_list(self, request):
return super(AuthenticatedUserResource, self).get_object_list(request).filter(pk=request.user.pk)
| Fix mistake returning the wrong authenticated user | Fix mistake returning the wrong authenticated user
| Python | mit | animekita/selvbetjening,animekita/selvbetjening,animekita/selvbetjening,animekita/selvbetjening | ---
+++
@@ -41,4 +41,4 @@
authentication = OAuth2Authentication()
def get_object_list(self, request):
- return super(AuthenticatedUserResource, self).get_object_list(request).filter(pk=1)
+ return super(AuthenticatedUserResource, self).get_object_list(request).filter(pk=request.user.pk) |
d221b364b012d25bb1ff3125f4f9e36864db7995 | assignment_dashboard/config.py | assignment_dashboard/config.py | import os
class BaseConfig(object):
DEBUG_TB_INTERCEPT_REDIRECTS = False
SECRET_KEY = os.environ.get('SECRET_KEY', 'change me in production')
db_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../data/database.db'))
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', 'sqlite:///' + db_path)
SQLALCHEMY_ECHO = True if os.environ.get('SQLALCHEMY_ECHO') else False
SQLALCHEMY_TRACK_MODIFICATIONS = False
TZ = os.environ.get('TZ', 'US/Eastern')
if 'GITHUB_CLIENT_ID' in os.environ:
REQUIRE_LOGIN = True
GITHUB_CLIENT_ID = os.environ['GITHUB_CLIENT_ID']
GITHUB_CLIENT_SECRET = os.environ['GITHUB_CLIENT_SECRET']
else:
REQUIRE_LOGIN = False
if 'REDIS_HOST' in os.environ:
REDIS_HOST = os.environ.get('REDIS_HOST')
| import os
class BaseConfig(object):
DEBUG_TB_INTERCEPT_REDIRECTS = False
SECRET_KEY = os.environ.get('SECRET_KEY', 'change me in production')
db_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../data/database.db'))
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', 'sqlite:///' + db_path)
SQLALCHEMY_ECHO = True if os.environ.get('SQLALCHEMY_ECHO') else False
SQLALCHEMY_TRACK_MODIFICATIONS = False
TZ = os.environ.get('TZ', 'US/Eastern')
if 'GITHUB_CLIENT_ID' in os.environ:
REQUIRE_LOGIN = True
GITHUB_CLIENT_ID = os.environ['GITHUB_CLIENT_ID']
GITHUB_CLIENT_SECRET = os.environ['GITHUB_CLIENT_SECRET']
else:
REQUIRE_LOGIN = False
if 'REDIS_HOST' in os.environ:
REDIS_HOST = os.environ['REDIS_HOST']
| Change environ.get → environ[] in scope of `if` | Change environ.get → environ[] in scope of `if`
| Python | mit | olin-computing/assignment-dashboard,osteele/assignment-dashboard,olin-computing/assignment-dashboard,olin-computing/assignment-dashboard,osteele/assignment-dashboard | ---
+++
@@ -21,4 +21,4 @@
REQUIRE_LOGIN = False
if 'REDIS_HOST' in os.environ:
- REDIS_HOST = os.environ.get('REDIS_HOST')
+ REDIS_HOST = os.environ['REDIS_HOST'] |
205ce071b4376872afd3d58c815a2c6804741627 | names.py | names.py | import re
# A regular expression is a string like what you see below between the quote
# marks, and the ``re`` module interprets it as a pattern. Each regular
# expression describes a small program that takes another string as input and
# returns information about that string. See
# http://docs.python.org/library/re.html. The ``re`` module provides the
# ``compile`` function, which prepares regex patterns for use in searching input
# strings.
#
# We put an ``r`` before the string so that Python doesn't interpret the
# backslashes before the ``re`` module gets to see them. (E.g., ``\n`` means a
# newline character, so ``\n`` is a single character, not two as they appear in
# the source code.)
#
# The Unicode flag lets us handle words with accented characters.
FIRST_LAST = re.compile(r"(\w*)\s+((?:\w|\s|['-]){2,})", flags=re.UNICODE)
def split_name(name):
'''Return ("First", "Last") tuple from a string like "First Last".
``name`` is a string. This function returns a tuple of strings. When a
non-matching string is encoutered, we return ``None``.
'''
match = FIRST_LAST.search(name)
return None if match is None else (match.group(1), match.group(2))
| import re
# A regular expression is a string like what you see below between the quote
# marks, and the ``re`` module interprets it as a pattern. Each regular
# expression describes a small program that takes another string as input and
# returns information about that string. See
# http://docs.python.org/library/re.html. The ``re`` module provides the
# ``compile`` function, which prepares regex patterns for use in searching input
# strings.
#
# We put an ``r`` before the string so that Python doesn't interpret the
# backslashes before the ``re`` module gets to see them. (E.g., ``\n`` means a
# newline character, so ``\n`` is a single character, not two as they appear in
# the source code.)
#
# The Unicode flag lets us handle words with accented characters.
FIRST_LAST = re.compile(r"(\w*)\s+((?:\w|\s|['-]){2,})", flags=re.UNICODE)
def split_name(name):
'''Return ("First", "Last") tuple from a string like "First Last".
``name`` is a string. This function returns a tuple of strings. When a
non-matching string is encoutered, we return ``None``.
'''
match = FIRST_LAST.search(name)
if match is None:
return None
return match.group(1), match.group(2)
| Use PEP8 style for conditionals | Use PEP8 style for conditionals
| Python | unlicense | wkschwartz/first-last | ---
+++
@@ -25,4 +25,6 @@
non-matching string is encoutered, we return ``None``.
'''
match = FIRST_LAST.search(name)
- return None if match is None else (match.group(1), match.group(2))
+ if match is None:
+ return None
+ return match.group(1), match.group(2) |
4653b9f493d28a6beb88a97d3d396ec1c9288f53 | Sketches/JT/Jam/library/trunk/Kamaelia/Apps/Jam/Audio/Mixer.py | Sketches/JT/Jam/library/trunk/Kamaelia/Apps/Jam/Audio/Mixer.py | import numpy
import Axon
class MonoMixer(Axon.AdaptiveCommsComponent.AdaptiveCommsComponent):
channels = 8
bufferSize = 1024
def __init__(self, **argd):
super(MonoMixer, self).__init__(**argd)
for i in range(self.channels):
self.addInbox("in%i" % i)
def main(self):
while 1:
output = numpy.zeros(self.bufferSize)
for i in range(self.channels):
if self.dataReady("in%i" % i):
output += self.recv("in%i" % i)
output /= self.channels
self.send(output, "outbox")
if not self.anyReady():
self.pause()
yield 1
| import numpy
import Axon
import time
from Axon.SchedulingComponent import SchedulingAdaptiveCommsComponent
class MonoMixer(SchedulingAdaptiveCommsComponent):
channels = 8
bufferSize = 1024
sampleRate = 44100
def __init__(self, **argd):
super(MonoMixer, self).__init__(**argd)
for i in range(self.channels):
self.addInbox("in%i" % i)
self.period = float(self.bufferSize)/self.sampleRate
self.lastSendTime = time.time()
self.scheduleAbs("Send", self.lastSendTime + self.period)
def main(self):
while 1:
if self.dataReady("event"):
output = numpy.zeros(self.bufferSize)
self.recv("event")
for i in range(self.channels):
if self.dataReady("in%i" % i):
data = self.recv("in%i" % i)
if data != None:
output += data
output /= self.channels
self.send(output, "outbox")
self.lastSendTime += self.period
self.scheduleAbs("Send", self.lastSendTime + self.period)
else:
self.pause()
| Change the mixer to be a scheduled component, and stop it from sending unnecessary messages when it has only received data from a few of it's inputs. | Change the mixer to be a scheduled component, and stop it from sending unnecessary messages when it has only received data from a few of it's inputs.
| Python | apache-2.0 | sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia | ---
+++
@@ -1,24 +1,35 @@
import numpy
import Axon
+import time
+from Axon.SchedulingComponent import SchedulingAdaptiveCommsComponent
-class MonoMixer(Axon.AdaptiveCommsComponent.AdaptiveCommsComponent):
+class MonoMixer(SchedulingAdaptiveCommsComponent):
channels = 8
bufferSize = 1024
+ sampleRate = 44100
def __init__(self, **argd):
super(MonoMixer, self).__init__(**argd)
for i in range(self.channels):
self.addInbox("in%i" % i)
+ self.period = float(self.bufferSize)/self.sampleRate
+ self.lastSendTime = time.time()
+ self.scheduleAbs("Send", self.lastSendTime + self.period)
+
def main(self):
while 1:
- output = numpy.zeros(self.bufferSize)
- for i in range(self.channels):
- if self.dataReady("in%i" % i):
- output += self.recv("in%i" % i)
- output /= self.channels
- self.send(output, "outbox")
- if not self.anyReady():
+ if self.dataReady("event"):
+ output = numpy.zeros(self.bufferSize)
+ self.recv("event")
+ for i in range(self.channels):
+ if self.dataReady("in%i" % i):
+ data = self.recv("in%i" % i)
+ if data != None:
+ output += data
+ output /= self.channels
+ self.send(output, "outbox")
+ self.lastSendTime += self.period
+ self.scheduleAbs("Send", self.lastSendTime + self.period)
+ else:
self.pause()
- yield 1
- |
c81a5e42bdbbeda58e661667b0613e8e5f8d41c6 | softwareindex/handlers/coreapi.py | softwareindex/handlers/coreapi.py | # This is a software index handler that gives a score based on the
# number of mentions in open access articles. It uses the CORE
# aggregator (http://core.ac.uk/) to search the full text of indexed
# articles.
#
# Inputs:
# - identifier (String)
#
# Outputs:
# - score (Number)
# - description (String)
import requests, urllib
SEARCH_URL = 'http://core.kmi.open.ac.uk/api/search/'
API_KEY = 'FILL THIS IN'
class core_handler:
def get_score(self, identifier, **kwargs):
"""Return the number of mentions in CORE and a descriptor, as a tuple.
Needs an API key, which can be obtained here: http://core.ac.uk/api-keys/register"""
params = {
'api_key': API_KEY,
'format': 'json',
}
params.update(kwargs)
response = requests.get(SEARCH_URL + urllib.quote_plus(identifier), params=params)
response.raise_for_status()
results = response.json()
score = results['ListRecords'][0]['total_hits']
return score
def get_description(self):
return 'mentions in Open Access articles (via http://core.ac.uk/)'
| # This is a software index handler that gives a score based on the
# number of mentions in open access articles. It uses the CORE
# aggregator (http://core.ac.uk/) to search the full text of indexed
# articles.
#
# Inputs:
# - identifier (String)
#
# Outputs:
# - score (Number)
# - description (String)
import requests, urllib
SEARCH_URL = 'http://core.kmi.open.ac.uk/api/search/'
API_KEY = 'FILL THIS IN'
class core_handler:
def get_score(self, software_identifier, **kwargs):
"""Return the number of mentions in CORE and a descriptor, as a tuple.
Needs an API key, which can be obtained here: http://core.ac.uk/api-keys/register"""
if isinstance(software_identifier, basestring):
params = {
'api_key': API_KEY,
'format': 'json',
}
params.update(kwargs)
response = requests.get(SEARCH_URL + urllib.quote_plus(software_identifiern), params=params)
response.raise_for_status()
results = response.json()
score = results['ListRecords'][0]['total_hits']
return score
else:
return -1
def get_description(self):
return 'mentions in Open Access articles (via http://core.ac.uk/)'
| Enforce type of identifier parameter. | Enforce type of identifier parameter.
| Python | bsd-3-clause | softwaresaved/softwareindex,softwaresaved/softwareindex | ---
+++
@@ -17,24 +17,26 @@
class core_handler:
- def get_score(self, identifier, **kwargs):
+ def get_score(self, software_identifier, **kwargs):
"""Return the number of mentions in CORE and a descriptor, as a tuple.
Needs an API key, which can be obtained here: http://core.ac.uk/api-keys/register"""
+ if isinstance(software_identifier, basestring):
+ params = {
+ 'api_key': API_KEY,
+ 'format': 'json',
+ }
+ params.update(kwargs)
- params = {
- 'api_key': API_KEY,
- 'format': 'json',
- }
- params.update(kwargs)
+ response = requests.get(SEARCH_URL + urllib.quote_plus(software_identifiern), params=params)
+ response.raise_for_status()
- response = requests.get(SEARCH_URL + urllib.quote_plus(identifier), params=params)
- response.raise_for_status()
+ results = response.json()
+ score = results['ListRecords'][0]['total_hits']
- results = response.json()
- score = results['ListRecords'][0]['total_hits']
-
- return score
+ return score
+ else:
+ return -1
def get_description(self):
return 'mentions in Open Access articles (via http://core.ac.uk/)' |
178bf48c01b61c6db15dc03020687c50962dafa8 | bin/get_value_stream_status.py | bin/get_value_stream_status.py | #!/usr/bin/env python
# This script uses the built-in Python module to check whether a given
# pipeline is passing, failing, or blocked. To check for a blocked
# pipeline, it looks through all upstream pipelines for any that are
# failing or paused.
from __future__ import print_function
import json
import gocd_parser.stream_status
from gocd_parser.retriever import server
from gocd_parser import gocd_argparse, gocd_logger
logger = gocd_logger.get()
arg_parser = gocd_argparse.get()
arg_parser.add_argument(
'-n', '--pipeline_name',
required=True,
help='The name of the pipeline to check',
)
args = arg_parser.parse_args()
go_server = server.Server(args.go_url, args.go_user, args.go_password)
# Retrieve the graph of the value stream
status = gocd_parser.stream_status.StreamStatus(go_server, args.pipeline_name)
# Send its blocker info to stdout
print( json.dumps( status.dump(), sort_keys=True, indent=2))
| #!/usr/bin/env python
# This script uses the built-in Python module to check whether a given
# pipeline is passing, failing, or blocked. To check for a blocked
# pipeline, it looks through all upstream pipelines for any that are
# failing or paused.
from __future__ import print_function
import json
import gocd_parser.stream_status
from gocd_parser.retriever import server
from gocd_parser import gocd_argparse, gocd_logger
# uncomment to set a default "INFO" logger
#logger = gocd_logger.get()
arg_parser = gocd_argparse.get()
arg_parser.add_argument(
'-n', '--pipeline_name',
required=True,
help='The name of the pipeline to check',
)
args = arg_parser.parse_args()
go_server = server.Server(args.go_url, args.go_user, args.go_password)
# Retrieve the graph of the value stream
status = gocd_parser.stream_status.StreamStatus(go_server, args.pipeline_name)
# Send its blocker info to stdout
print( json.dumps( status.dump(), sort_keys=True, indent=2))
| Make the get_status script quieter | Make the get_status script quieter
| Python | mit | greenmoss/gocd-parser | ---
+++
@@ -11,7 +11,8 @@
from gocd_parser.retriever import server
from gocd_parser import gocd_argparse, gocd_logger
-logger = gocd_logger.get()
+# uncomment to set a default "INFO" logger
+#logger = gocd_logger.get()
arg_parser = gocd_argparse.get()
arg_parser.add_argument( |
5386edbd7c88a1f53c88869abbf63c00ce212352 | pyaxiom/netcdf/utils.py | pyaxiom/netcdf/utils.py | #!python
# coding=utf-8
def cf_safe_name(name):
import re
if isinstance(name, str):
if re.match('^[0-9_]', name):
# Add a letter to the front
name = "v_{}".format(name)
return re.sub(r'[^_a-zA-Z0-9]', "_", name)
| #!python
# coding=utf-8
def isstr(s):
try:
return isinstance(s, basestring)
except NameError:
return isinstance(s, str)
def cf_safe_name(name):
import re
if isstr(name):
if re.match('^[0-9_]', name):
# Add a letter to the front
name = "v_{}".format(name)
return re.sub(r'[^_a-zA-Z0-9]', "_", name)
| Fix cf_safe_name for python 2.7 | Fix cf_safe_name for python 2.7
| Python | mit | axiom-data-science/pyaxiom,axiom-data-science/pyaxiom | ---
+++
@@ -2,9 +2,16 @@
# coding=utf-8
+def isstr(s):
+ try:
+ return isinstance(s, basestring)
+ except NameError:
+ return isinstance(s, str)
+
+
def cf_safe_name(name):
import re
- if isinstance(name, str):
+ if isstr(name):
if re.match('^[0-9_]', name):
# Add a letter to the front
name = "v_{}".format(name) |
c2b3173a1246538d0b11a89a696288e41993eb5a | paws/conf.py | paws/conf.py | import os
class env(object):
def __init__(self, default=None):
self.name = None
self.default = default
def __get__(self, obj, cls=None):
if cls:
return os.environ.get(self.name.upper(), self.default)
class MetaConfig(type):
'''Quickly tell the env attrs their names.'''
def __new__(mcs, name, bases, attrs):
for name, attr in attrs.items():
if isinstance(attr, env):
env.name = name
return super(MetaConfig, mcs).__new__(mcs, name, bases, attrs)
class Conf(dict):
'''
Handy wrapper and placeholder of config values.
'''
__metaclass__ = MetaConfig
def __getattr__(self, key):
return os.environ[key]
| import os
class env(object):
def __init__(self, default=None):
self.name = None
self.default = default
def __get__(self, obj, cls=None):
if not obj:
return self
return os.environ.get(self.name.upper(), self.default)
class MetaConfig(type):
'''Quickly tell the env attrs their names.'''
def __new__(mcs, name, bases, attrs):
for name, attr in attrs.items():
if isinstance(attr, env):
attr.name = name
return super(MetaConfig, mcs).__new__(mcs, name, bases, attrs)
class Conf(dict):
'''
Handy wrapper and placeholder of config values.
'''
__metaclass__ = MetaConfig
def __getattr__(self, key):
return os.environ[key]
| Fix detecting class access of descriptor. Set name on attr, not env class! | Fix detecting class access of descriptor. Set name on attr, not env class!
| Python | bsd-3-clause | funkybob/paws | ---
+++
@@ -7,8 +7,9 @@
self.default = default
def __get__(self, obj, cls=None):
- if cls:
- return os.environ.get(self.name.upper(), self.default)
+ if not obj:
+ return self
+ return os.environ.get(self.name.upper(), self.default)
class MetaConfig(type):
@@ -16,7 +17,7 @@
def __new__(mcs, name, bases, attrs):
for name, attr in attrs.items():
if isinstance(attr, env):
- env.name = name
+ attr.name = name
return super(MetaConfig, mcs).__new__(mcs, name, bases, attrs)
|
8c8fbb8c3cf53ce0b193926fc89e426fb360eb81 | database_import.py | database_import.py | import sys
import csv
from sqlalchemy.exc import IntegrityError
from openledger.models import db, Image
filename = sys.argv[1]
fields = ('ImageID', 'Subset', 'OriginalURL', 'OriginalLandingURL', 'License',
'AuthorProfileURL', 'Author', 'Title')
with open(filename) as csvfile:
db.create_all()
reader = csv.DictReader(csvfile)
for row in reader:
image = Image()
image.google_imageid = row['ImageID']
image.image_url = row['OriginalURL']
image.original_landing_url = row['OriginalLandingURL']
image.license_url = row['License']
image.author_url = row['AuthorProfileURL']
image.author = row['Author']
image.title = row['Title']
db.session.add(image)
try:
db.session.commit()
print("Adding image ", row['ImageID'])
except IntegrityError:
db.session.rollback()
| import csv
import argparse
from sqlalchemy.exc import IntegrityError
from openledger.models import db, Image
def import_from_open_images(filename):
fields = ('ImageID', 'Subset', 'OriginalURL', 'OriginalLandingURL', 'License',
'AuthorProfileURL', 'Author', 'Title')
with open(filename) as csvfile:
db.create_all()
reader = csv.DictReader(csvfile)
for row in reader:
image = Image()
image.google_imageid = row['ImageID']
image.image_url = row['OriginalURL']
image.original_landing_url = row['OriginalLandingURL']
image.license_url = row['License']
image.author_url = row['AuthorProfileURL']
image.author = row['Author']
image.title = row['Title']
db.session.add(image)
try:
db.session.commit()
print("Adding image ", row['ImageID'])
except IntegrityError:
db.session.rollback()
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--open-images-path",
dest="openimages_path",
help="The location of the Google Open Images csv file")
parser.add_argument("--flickr-100m-path",
dest="flickr100m_path",
help="The location of the Flickr 100M tsv directory")
args = parser.parse_args()
if args.openimages_path:
import_from_open_images(args.openimages_path)
| Tidy up database import to take arguments for multiple sources | Tidy up database import to take arguments for multiple sources
| Python | mit | creativecommons/open-ledger,creativecommons/open-ledger,creativecommons/open-ledger | ---
+++
@@ -1,29 +1,42 @@
-import sys
import csv
+import argparse
+
from sqlalchemy.exc import IntegrityError
from openledger.models import db, Image
-filename = sys.argv[1]
-fields = ('ImageID', 'Subset', 'OriginalURL', 'OriginalLandingURL', 'License',
- 'AuthorProfileURL', 'Author', 'Title')
+def import_from_open_images(filename):
+ fields = ('ImageID', 'Subset', 'OriginalURL', 'OriginalLandingURL', 'License',
+ 'AuthorProfileURL', 'Author', 'Title')
-with open(filename) as csvfile:
- db.create_all()
- reader = csv.DictReader(csvfile)
- for row in reader:
- image = Image()
- image.google_imageid = row['ImageID']
- image.image_url = row['OriginalURL']
- image.original_landing_url = row['OriginalLandingURL']
- image.license_url = row['License']
- image.author_url = row['AuthorProfileURL']
- image.author = row['Author']
- image.title = row['Title']
- db.session.add(image)
- try:
- db.session.commit()
- print("Adding image ", row['ImageID'])
- except IntegrityError:
- db.session.rollback()
+ with open(filename) as csvfile:
+ db.create_all()
+ reader = csv.DictReader(csvfile)
+ for row in reader:
+ image = Image()
+ image.google_imageid = row['ImageID']
+ image.image_url = row['OriginalURL']
+ image.original_landing_url = row['OriginalLandingURL']
+ image.license_url = row['License']
+ image.author_url = row['AuthorProfileURL']
+ image.author = row['Author']
+ image.title = row['Title']
+ db.session.add(image)
+ try:
+ db.session.commit()
+ print("Adding image ", row['ImageID'])
+ except IntegrityError:
+ db.session.rollback()
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--open-images-path",
+ dest="openimages_path",
+ help="The location of the Google Open Images csv file")
+ parser.add_argument("--flickr-100m-path",
+ dest="flickr100m_path",
+ help="The location of the Flickr 100M tsv directory")
+ args = parser.parse_args()
+ if args.openimages_path:
+ import_from_open_images(args.openimages_path) |
3b215b5c6fea45f11f3e1969e6626b175a5b9b6a | medical_medication_us/models/medical_medicament.py | medical_medication_us/models/medical_medicament.py | # -*- coding: utf-8 -*-
# © 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import fields, models
class MedicalMedicament(models.Model):
_inherit = 'medical.medicament'
ndc = fields.Char(
string='NDC',
help='National Drug Code for medication'
)
control_code = fields.Selection([
('c1', 'C1'),
('c2', 'C2'),
('c3', 'C3'),
('c4', 'C4'),
('c5', 'C5'),
],
help='Federal drug scheduling code',
)
| # -*- coding: utf-8 -*-
# © 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import fields, models
class MedicalMedicament(models.Model):
_inherit = 'medical.medicament'
ndc = fields.Char(
string='NDC',
help='National Drug Code for medication'
)
gpi = fields.Integer(
string='GPI',
help='Generic Product Identifier',
)
gcn = fields.Integer(
string='GCN',
help='Generic Code Number',
)
control_code = fields.Selection([
('c1', 'C1'),
('c2', 'C2'),
('c3', 'C3'),
('c4', 'C4'),
('c5', 'C5'),
],
help='Federal drug scheduling code',
)
| Add gpi and gcn to medicament in medical_medication_us | Add gpi and gcn to medicament in medical_medication_us
| Python | agpl-3.0 | laslabs/vertical-medical,laslabs/vertical-medical | ---
+++
@@ -11,6 +11,14 @@
string='NDC',
help='National Drug Code for medication'
)
+ gpi = fields.Integer(
+ string='GPI',
+ help='Generic Product Identifier',
+ )
+ gcn = fields.Integer(
+ string='GCN',
+ help='Generic Code Number',
+ )
control_code = fields.Selection([
('c1', 'C1'),
('c2', 'C2'), |
eb8218de72d1789b9e054e2ee76c51558cc1a653 | django_fake_model/case_extension.py | django_fake_model/case_extension.py | from __future__ import unicode_literals
from django.test import SimpleTestCase
class CaseExtension(SimpleTestCase):
_models = tuple()
@classmethod
def append_model(cls, model):
cls._models += (model, )
def _pre_setup(self):
super(CaseExtension, self)._pre_setup()
self._map_models('create_table')
def _post_teardown(self):
self._map_models('delete_table')
super(CaseExtension, self)._post_teardown()
def _map_models(self, method_name):
for model in self._models:
try:
getattr(model, method_name)()
except AttributeError:
raise TypeError("{0} doesn't support table method {1}".format(model, method_name))
| from __future__ import unicode_literals
from django.test import SimpleTestCase
class CaseExtension(SimpleTestCase):
_models = tuple()
@classmethod
def append_model(cls, model):
cls._models += (model, )
def _pre_setup(self):
super(CaseExtension, self)._pre_setup()
self._map_models('create_table')
def _post_teardown(self):
# If we don't remove them in reverse order, then if we created table A
# after table B and it has a foreignkey to table B, then trying to
# remove B first will fail on some configurations, as documented
# in issue #1
self._map_models('delete_table', reverse=True)
super(CaseExtension, self)._post_teardown()
def _map_models(self, method_name, reverse=False):
for model in (reversed(self._models) if reverse else self._models):
try:
getattr(model, method_name)()
except AttributeError:
raise TypeError("{0} doesn't support table method {1}".format(model, method_name))
| Fix ordering of deletions on MySQL | Fix ordering of deletions on MySQL
| Python | bsd-3-clause | erm0l0v/django-fake-model | ---
+++
@@ -15,11 +15,15 @@
self._map_models('create_table')
def _post_teardown(self):
- self._map_models('delete_table')
+ # If we don't remove them in reverse order, then if we created table A
+ # after table B and it has a foreignkey to table B, then trying to
+ # remove B first will fail on some configurations, as documented
+ # in issue #1
+ self._map_models('delete_table', reverse=True)
super(CaseExtension, self)._post_teardown()
- def _map_models(self, method_name):
- for model in self._models:
+ def _map_models(self, method_name, reverse=False):
+ for model in (reversed(self._models) if reverse else self._models):
try:
getattr(model, method_name)()
except AttributeError: |
22225a8d8c020f49bd781f94eb3e47947f672993 | qr_code/qrcode_image.py | qr_code/qrcode_image.py | """
Import the required subclasses of :class:`~qrcode.image.base.BaseImage` from the qrcode library with a fallback to SVG
format when the Pillow library is not available.
"""
import logging
from qrcode.image.svg import SvgPathImage as _SvgPathImage
logger = logging.getLogger(__name__)
try:
from qrcode.image.pil import PilImage as _PilImageOrFallback
except ImportError:
logger.info("Pillow is not installed. No support available for PNG format.")
from qrcode.image.svg import SvgPathImage as _PilImageOrFallback
SVG_FORMAT_NAME = 'svg'
PNG_FORMAT_NAME = 'png'
SvgPathImage = _SvgPathImage
PilImageOrFallback = _PilImageOrFallback
def has_png_support():
return PilImageOrFallback is not SvgPathImage
def get_supported_image_format(image_format):
image_format = image_format.lower()
if image_format not in [SVG_FORMAT_NAME, PNG_FORMAT_NAME]:
logger.warning('Unknown image format: %s' % image_format)
image_format = SVG_FORMAT_NAME
elif image_format == PNG_FORMAT_NAME and not has_png_support():
logger.warning("No support available for PNG format, SVG will be used instead. Please install Pillow for PNG support.")
image_format = SVG_FORMAT_NAME
return image_format
| """
Import the required subclasses of :class:`~qrcode.image.base.BaseImage` from the qrcode library with a fallback to SVG
format when the Pillow library is not available.
"""
import logging
from qrcode.image.svg import SvgPathImage as _SvgPathImage
logger = logging.getLogger('django')
try:
from qrcode.image.pil import PilImage as _PilImageOrFallback
except ImportError:
logger.info("Pillow is not installed. No support available for PNG format.")
from qrcode.image.svg import SvgPathImage as _PilImageOrFallback
SVG_FORMAT_NAME = 'svg'
PNG_FORMAT_NAME = 'png'
SvgPathImage = _SvgPathImage
PilImageOrFallback = _PilImageOrFallback
def has_png_support():
return PilImageOrFallback is not SvgPathImage
def get_supported_image_format(image_format):
image_format = image_format.lower()
if image_format not in [SVG_FORMAT_NAME, PNG_FORMAT_NAME]:
logger.warning('Unknown image format: %s' % image_format)
image_format = SVG_FORMAT_NAME
elif image_format == PNG_FORMAT_NAME and not has_png_support():
logger.warning("No support available for PNG format, SVG will be used instead. Please install Pillow for PNG support.")
image_format = SVG_FORMAT_NAME
return image_format
| Use default 'django' logger to facilitate logging configuration (default config enabled console output). | Use default 'django' logger to facilitate logging configuration (default config enabled console output).
| Python | bsd-3-clause | dprog-philippe-docourt/django-qr-code,dprog-philippe-docourt/django-qr-code,dprog-philippe-docourt/django-qr-code | ---
+++
@@ -4,10 +4,9 @@
"""
import logging
from qrcode.image.svg import SvgPathImage as _SvgPathImage
-logger = logging.getLogger(__name__)
+logger = logging.getLogger('django')
try:
from qrcode.image.pil import PilImage as _PilImageOrFallback
-
except ImportError:
logger.info("Pillow is not installed. No support available for PNG format.")
from qrcode.image.svg import SvgPathImage as _PilImageOrFallback |
122bac32131b90b46673c6895dada3f01018f52b | setup.py | setup.py | import os.path as op
import re
from setuptools import setup
def read(name, only_open=False):
f = open(op.join(op.dirname(__file__), name))
return f if only_open else f.read()
ext_version = None
with read('flask_json.py', only_open=True) as f:
for line in f:
if line.startswith('__version__'):
ext_version, = re.findall(r"__version__\W*=\W*'([^']+)'", line)
break
setup(
name='Flask-JSON',
version=ext_version,
url='https://github.com/skozlovf/flask-json',
license='BSD',
author='Sergey Kozlov',
author_email='skozlovf@gmail.com',
description='Better JSON support for Flask',
long_description=read('README.rst'),
py_modules=['flask_json'],
zip_safe=False,
include_package_data=True,
platforms='any',
install_requires=['Flask>=0.10'],
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 :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules'
],
test_suite='nose.collector'
)
| import os.path as op
import re
from setuptools import setup
def read(name, only_open=False):
f = open(op.join(op.dirname(__file__), name))
return f if only_open else f.read()
ext_version = None
with read('flask_json.py', only_open=True) as f:
for line in f:
if line.startswith('__version__'):
ext_version, = re.findall(r"__version__\W*=\W*'([^']+)'", line)
break
setup(
name='Flask-JSON',
version=ext_version,
url='https://github.com/skozlovf/flask-json',
license='BSD',
author='Sergey Kozlov',
author_email='skozlovf@gmail.com',
description='Better JSON support for Flask',
long_description=read('README.rst'),
py_modules=['flask_json'],
zip_safe=False,
include_package_data=True,
platforms='any',
install_requires=['Flask>=0.10'],
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 :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules'
],
tests_require=['nose>=1.0'],
test_suite='nose.collector'
)
| Add 'nose' to required packages for testing. | Add 'nose' to required packages for testing.
| Python | bsd-3-clause | craig552uk/flask-json | ---
+++
@@ -40,5 +40,6 @@
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules'
],
+ tests_require=['nose>=1.0'],
test_suite='nose.collector'
) |
d8c9b0dc3e26aeed4e5ea0e33ed5db20385520d8 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='panoptescli',
version='1.1.1',
url='https://github.com/zooniverse/panoptes-cli',
author='Adam McMaster',
author_email='adam@zooniverse.org',
description=(
'A command-line client for Panoptes, the API behind the Zooniverse'
),
packages=find_packages(),
include_package_data=True,
install_requires=[
'Click>=6.7,<7.1',
'PyYAML>=5.1,<5.2',
'panoptes-client>=1.0,<2.0',
'humanize>=0.5.1,<0.6',
'pathvalidate>=0.29.0,<0.30',
],
entry_points='''
[console_scripts]
panoptes=panoptes_cli.scripts.panoptes:cli
''',
)
| from setuptools import setup, find_packages
setup(
name='panoptescli',
version='1.1.1',
url='https://github.com/zooniverse/panoptes-cli',
author='Adam McMaster',
author_email='adam@zooniverse.org',
description=(
'A command-line client for Panoptes, the API behind the Zooniverse'
),
packages=find_packages(),
include_package_data=True,
install_requires=[
'Click>=6.7,<7.1',
'PyYAML>=5.1,<5.3',
'panoptes-client>=1.0,<2.0',
'humanize>=0.5.1,<0.6',
'pathvalidate>=0.29.0,<0.30',
],
entry_points='''
[console_scripts]
panoptes=panoptes_cli.scripts.panoptes:cli
''',
)
| Update pyyaml requirement from <5.2,>=5.1 to >=5.1,<5.3 | Update pyyaml requirement from <5.2,>=5.1 to >=5.1,<5.3
Updates the requirements on [pyyaml](https://github.com/yaml/pyyaml) to permit the latest version.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/5.1...5.2)
Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com> | Python | apache-2.0 | zooniverse/panoptes-cli | ---
+++
@@ -13,7 +13,7 @@
include_package_data=True,
install_requires=[
'Click>=6.7,<7.1',
- 'PyYAML>=5.1,<5.2',
+ 'PyYAML>=5.1,<5.3',
'panoptes-client>=1.0,<2.0',
'humanize>=0.5.1,<0.6',
'pathvalidate>=0.29.0,<0.30', |
e63ba7969fb697ee1c012f9d9f7708bf28adf9ef | setup.py | setup.py | from setuptools import find_packages, setup
import picklefield
with open('README.rst') as file_:
long_description = file_.read()
setup(
name='django-picklefield',
version=picklefield.__version__,
description='Pickled object field for Django',
long_description=long_description,
author='Simon Charette',
author_email='charette.s+django-picklefiel@gmail.com',
url='http://github.com/gintas/django-picklefield',
license='MIT',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords=['django pickle model field'],
packages=find_packages(exclude=['tests', 'tests.*']),
python_requires='>=3',
install_requires=['Django>=2.2'],
extras_require={
'tests': ['tox'],
},
)
| from setuptools import find_packages, setup
import picklefield
with open('README.rst') as file_:
long_description = file_.read()
setup(
name='django-picklefield',
version=picklefield.__version__,
description='Pickled object field for Django',
long_description=long_description,
author='Simon Charette',
author_email='charette.s+django-picklefiel@gmail.com',
url='http://github.com/gintas/django-picklefield',
license='MIT',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords=['django pickle model field'],
packages=find_packages(exclude=['tests', 'tests.*']),
python_requires='>=3',
install_requires=['Django>=3.2'],
extras_require={
'tests': ['tox'],
},
)
| Adjust package metadata to reflect support for Django 3.2+. | Adjust package metadata to reflect support for Django 3.2+.
| Python | mit | gintas/django-picklefield | ---
+++
@@ -18,15 +18,14 @@
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
- 'Framework :: Django :: 2.2',
- 'Framework :: Django :: 3.0',
+ 'Framework :: Django :: 3.2',
+ 'Framework :: Django :: 4.0',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
@@ -36,7 +35,7 @@
keywords=['django pickle model field'],
packages=find_packages(exclude=['tests', 'tests.*']),
python_requires='>=3',
- install_requires=['Django>=2.2'],
+ install_requires=['Django>=3.2'],
extras_require={
'tests': ['tox'],
}, |
5dd17c7a9852bc5318b8793c01eb6aab4816490d | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='panoptescli',
version='1.1.1',
url='https://github.com/zooniverse/panoptes-cli',
author='Adam McMaster',
author_email='adam@zooniverse.org',
description=(
'A command-line client for Panoptes, the API behind the Zooniverse'
),
packages=find_packages(),
include_package_data=True,
install_requires=[
'Click>=6.7,<7.1',
'PyYAML>=5.1,<5.4',
'panoptes-client>=1.0,<2.0',
'humanize>=0.5.1,<0.6',
'pathvalidate>=0.29.0,<0.30',
],
entry_points='''
[console_scripts]
panoptes=panoptes_cli.scripts.panoptes:cli
''',
)
| from setuptools import setup, find_packages
setup(
name='panoptescli',
version='1.1.1',
url='https://github.com/zooniverse/panoptes-cli',
author='Adam McMaster',
author_email='adam@zooniverse.org',
description=(
'A command-line client for Panoptes, the API behind the Zooniverse'
),
packages=find_packages(),
include_package_data=True,
install_requires=[
'Click>=6.7,<7.1',
'PyYAML>=5.1,<5.4',
'panoptes-client>=1.0,<2.0',
'humanize>=0.5.1,<1.1',
'pathvalidate>=0.29.0,<0.30',
],
entry_points='''
[console_scripts]
panoptes=panoptes_cli.scripts.panoptes:cli
''',
)
| Update humanize requirement from <0.6,>=0.5.1 to >=0.5.1,<1.1 | Update humanize requirement from <0.6,>=0.5.1 to >=0.5.1,<1.1
Updates the requirements on [humanize](https://github.com/jmoiron/humanize) to permit the latest version.
- [Release notes](https://github.com/jmoiron/humanize/releases)
- [Commits](https://github.com/jmoiron/humanize/compare/0.5.1...1.0.0)
Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com> | Python | apache-2.0 | zooniverse/panoptes-cli | ---
+++
@@ -15,7 +15,7 @@
'Click>=6.7,<7.1',
'PyYAML>=5.1,<5.4',
'panoptes-client>=1.0,<2.0',
- 'humanize>=0.5.1,<0.6',
+ 'humanize>=0.5.1,<1.1',
'pathvalidate>=0.29.0,<0.30',
],
entry_points=''' |
f53071faad4abb4f935425aa9b56c6dcae51abd4 | nodeconductor/server/test_runner.py | nodeconductor/server/test_runner.py | # This file mainly exists to allow python setup.py test to work.
import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'nodeconductor.server.test_settings'
test_dir = os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), '..'))
sys.path.insert(0, test_dir)
import django
from django.conf import settings
from django.test.utils import get_runner
django.setup()
def run_tests():
test_runner_class = get_runner(settings)
try:
import xmlrunner
class XMLTestRunner(test_runner_class):
def run_suite(self, suite, **kwargs):
verbosity = getattr(settings, 'TEST_OUTPUT_VERBOSE', 1)
if isinstance(verbosity, bool):
verbosity = (1, 2)[verbosity]
descriptions = getattr(settings, 'TEST_OUTPUT_DESCRIPTIONS', False)
output = getattr(settings, 'TEST_OUTPUT_DIR', '.')
return xmlrunner.XMLTestRunner(
verbosity=verbosity,
descriptions=descriptions,
output=output
).run(suite)
test_runner_class = XMLTestRunner
except ImportError:
print "Not generating XML reports, run 'pip install unittest-xml-reporting' to enable XML report generation"
test_runner = test_runner_class(verbosity=1, interactive=True)
failures = test_runner.run_tests([])
sys.exit(bool(failures))
if __name__ == '__main__':
run_tests()
| # This file mainly exists to allow python setup.py test to work.
import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'nodeconductor.server.test_settings'
test_dir = os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), '..'))
sys.path.insert(0, test_dir)
import django
from django.conf import settings
from django.test.utils import get_runner
def run_tests():
test_runner_class = get_runner(settings)
try:
import xmlrunner
class XMLTestRunner(test_runner_class):
def run_suite(self, suite, **kwargs):
verbosity = getattr(settings, 'TEST_OUTPUT_VERBOSE', 1)
if isinstance(verbosity, bool):
verbosity = (1, 2)[verbosity]
descriptions = getattr(settings, 'TEST_OUTPUT_DESCRIPTIONS', False)
output = getattr(settings, 'TEST_OUTPUT_DIR', '.')
return xmlrunner.XMLTestRunner(
verbosity=verbosity,
descriptions=descriptions,
output=output
).run(suite)
test_runner_class = XMLTestRunner
except ImportError:
print "Not generating XML reports, run 'pip install unittest-xml-reporting' to enable XML report generation"
test_runner = test_runner_class(verbosity=1, interactive=True)
failures = test_runner.run_tests([])
sys.exit(bool(failures))
if __name__ == '__main__':
django.setup()
run_tests()
| Move django initialization closer to execution | Move django initialization closer to execution
| Python | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | ---
+++
@@ -9,8 +9,6 @@
import django
from django.conf import settings
from django.test.utils import get_runner
-
-django.setup()
def run_tests():
@@ -43,4 +41,5 @@
if __name__ == '__main__':
+ django.setup()
run_tests() |
3088096b4a0289939c93f6dcffb3e893e30ca23c | chaser/__init__.py | chaser/__init__.py | __version__ = "0.5"
import argparse
from chaser import chaser
def main():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
parser_g = subparsers.add_parser('get')
parser_g.add_argument('package')
parser_g.set_defaults(func=chaser.get_source_files)
parser_i = subparsers.add_parser('install')
parser_i.add_argument('package')
parser_i.set_defaults(func=chaser.install)
parser_l = subparsers.add_parser('listupdates')
parser_l.set_defaults(func=chaser.list_updates)
parser_u = subparsers.add_parser('update')
parser_u.set_defaults(func=chaser.update)
parser_s = subparsers.add_parser('search')
parser_s.add_argument('query')
parser_s.set_defaults(func=chaser.search)
parser_n = subparsers.add_parser('info')
parser_n.add_argument('package')
parser_n.set_defaults(func=chaser.info)
args = parser.parse_args()
try:
args.func(args)
except AttributeError:
print("No operation specified")
| __version__ = "0.6"
import argparse
from chaser import chaser
def main():
parser = argparse.ArgumentParser(
description="Next-generation community package management for Chakra."
)
subparsers = parser.add_subparsers()
parser.add_argument('-v', '--version',
help="show version information and exit",
action='version', version='Chaser {v}'.format(v=__version__)
)
parser_g = subparsers.add_parser('get', help="download source files here")
parser_g.add_argument('package')
parser_g.set_defaults(func=chaser.get_source_files)
parser_i = subparsers.add_parser('install', help="install a package from the CCR")
parser_i.add_argument('package')
parser_i.set_defaults(func=chaser.install)
parser_l = subparsers.add_parser('listupdates', help="list available updates")
parser_l.set_defaults(func=chaser.list_updates)
parser_u = subparsers.add_parser('update', help="search for and install updates for CCR packages")
parser_u.set_defaults(func=chaser.update)
parser_s = subparsers.add_parser('search', help="search CCR packages")
parser_s.add_argument('query')
parser_s.set_defaults(func=chaser.search)
parser_n = subparsers.add_parser('info', help="display package information")
parser_n.add_argument('package')
parser_n.set_defaults(func=chaser.info)
args = parser.parse_args()
try:
args.func(args)
except AttributeError:
parser.print_usage()
| Add help info and version flag, bump to 0.6 | Add help info and version flag, bump to 0.6
| Python | bsd-3-clause | rshipp/chaser,rshipp/chaser | ---
+++
@@ -1,32 +1,39 @@
-__version__ = "0.5"
+__version__ = "0.6"
import argparse
from chaser import chaser
def main():
- parser = argparse.ArgumentParser()
+ parser = argparse.ArgumentParser(
+ description="Next-generation community package management for Chakra."
+ )
subparsers = parser.add_subparsers()
- parser_g = subparsers.add_parser('get')
+ parser.add_argument('-v', '--version',
+ help="show version information and exit",
+ action='version', version='Chaser {v}'.format(v=__version__)
+ )
+
+ parser_g = subparsers.add_parser('get', help="download source files here")
parser_g.add_argument('package')
parser_g.set_defaults(func=chaser.get_source_files)
- parser_i = subparsers.add_parser('install')
+ parser_i = subparsers.add_parser('install', help="install a package from the CCR")
parser_i.add_argument('package')
parser_i.set_defaults(func=chaser.install)
- parser_l = subparsers.add_parser('listupdates')
+ parser_l = subparsers.add_parser('listupdates', help="list available updates")
parser_l.set_defaults(func=chaser.list_updates)
- parser_u = subparsers.add_parser('update')
+ parser_u = subparsers.add_parser('update', help="search for and install updates for CCR packages")
parser_u.set_defaults(func=chaser.update)
- parser_s = subparsers.add_parser('search')
+ parser_s = subparsers.add_parser('search', help="search CCR packages")
parser_s.add_argument('query')
parser_s.set_defaults(func=chaser.search)
- parser_n = subparsers.add_parser('info')
+ parser_n = subparsers.add_parser('info', help="display package information")
parser_n.add_argument('package')
parser_n.set_defaults(func=chaser.info)
@@ -34,4 +41,4 @@
try:
args.func(args)
except AttributeError:
- print("No operation specified")
+ parser.print_usage() |
9bda75b5200790bb2c68e256207d8fc5d45a76c6 | setup.py | setup.py | from setuptools import setup
from setuptools import find_packages
__author__ = 'Ryan McGrath <ryan@venodesigns.net>'
__version__ = '2.5.5'
setup(
# Basic package information.
name='twython',
version=__version__,
packages=find_packages(),
# Packaging options.
include_package_data=True,
# Package dependencies.
install_requires=['simplejson', 'requests==1.1.0', 'requests_oauthlib==0.3.0'],
# Metadata for PyPI.
author='Ryan McGrath',
author_email='ryan@venodesigns.net',
license='MIT License',
url='http://github.com/ryanmcgrath/twython/tree/master',
keywords='twitter search api tweet twython',
description='An easy (and up to date) way to access Twitter data with Python.',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Communications :: Chat',
'Topic :: Internet'
]
)
| from setuptools import setup
from setuptools import find_packages
__author__ = 'Ryan McGrath <ryan@venodesigns.net>'
__version__ = '2.5.5'
setup(
# Basic package information.
name='twython',
version=__version__,
packages=find_packages(),
# Packaging options.
include_package_data=True,
# Package dependencies.
install_requires=['simplejson', 'requests>=1.0.0, <2.0.0', 'requests_oauthlib==0.3.0'],
# Metadata for PyPI.
author='Ryan McGrath',
author_email='ryan@venodesigns.net',
license='MIT License',
url='http://github.com/ryanmcgrath/twython/tree/master',
keywords='twitter search api tweet twython',
description='An easy (and up to date) way to access Twitter data with Python.',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Communications :: Chat',
'Topic :: Internet'
]
)
| Allow versions of requests between 1.0.0 and 2.0.0 | Allow versions of requests between 1.0.0 and 2.0.0
Requests is semantically versioned, so minor version changes are expected to be compatible.
| Python | mit | Oire/twython,joebos/twython,akarambir/twython,Fueled/twython,fibears/twython,ryanmcgrath/twython,vivek8943/twython,Hasimir/twython,Devyani-Divs/twython,ping/twython | ---
+++
@@ -14,7 +14,7 @@
include_package_data=True,
# Package dependencies.
- install_requires=['simplejson', 'requests==1.1.0', 'requests_oauthlib==0.3.0'],
+ install_requires=['simplejson', 'requests>=1.0.0, <2.0.0', 'requests_oauthlib==0.3.0'],
# Metadata for PyPI.
author='Ryan McGrath', |
8763c5aadc1a67382685a819cd7278dcf52e3513 | setup.py | setup.py | from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
version = '0.1'
setup(name='zrunner',
version=version,
description="Utilities for running and benchmarking Zonation",
long_description="""\
""",
classifiers=[],
keywords='zonation test cbig',
author='Joona Lehtom\xc3\xa4ki',
author_email='joona.lehtomaki@gmail.com',
url='',
license='MIT',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
include_package_data=True,
zip_safe=False,
install_requires=[
"pyyaml"
],
entry_points={'console_scripts': [
'zrunner = zrunner.runner:main',
'zreader = zrunner.reader:main'
]
},
)
| from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
version = '0.1'
setup(name='zrunner',
version=version,
description="Utilities for running and benchmarking Zonation",
long_description="""\
""",
classifiers=[],
keywords='zonation test cbig',
author='Joona Lehtom\xc3\xa4ki',
author_email='joona.lehtomaki@gmail.com',
url='',
license='MIT',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
include_package_data=True,
zip_safe=False,
install_requires=[
"pyyaml"
],
dependency_links = ['https://github.com/jlehtoma/slackpy/tarball/master#egg=slackpy-0.1.4'],
entry_points={'console_scripts': [
'zrunner = zrunner.runner:main',
'zreader = zrunner.reader:main'
]
},
)
| Add forked slackpy as a dependency | Add forked slackpy as a dependency
| Python | mit | cbig/ztools,cbig/zrunner | ---
+++
@@ -21,6 +21,7 @@
install_requires=[
"pyyaml"
],
+ dependency_links = ['https://github.com/jlehtoma/slackpy/tarball/master#egg=slackpy-0.1.4'],
entry_points={'console_scripts': [
'zrunner = zrunner.runner:main',
'zreader = zrunner.reader:main' |
c010c5cc0c3de0a8147e4e50e8d67769ab399770 | django/__init__.py | django/__init__.py | VERSION = (1, 0, 'post-release-SVN')
def get_version():
"Returns the version as a human-format string."
v = '.'.join([str(i) for i in VERSION[:-1]])
if VERSION[-1]:
from django.utils.version import get_svn_revision
v = '%s-%s-%s' % (v, VERSION[-1], get_svn_revision())
return v
| VERSION = (1, 1, 0, 'alpha', 0)
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
if VERSION[3:] == ('alpha', 0):
version = '%s pre-alpha' % version
else:
version = '%s %s' % (version, VERSION[3])
if VERSION[3] != 'final':
version = '%s %s' % (version, VERSION[4])
from django.utils.version import get_svn_revision
svn_rev = get_svn_revision()
if svn_rev != u'SVN-unknown':
version = "%s %s" % (version, svn_rev)
return version
| Update django.VERSION in trunk per previous discussion | Update django.VERSION in trunk per previous discussion
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9103 bcc190cf-cafb-0310-a4f2-bffc1f526a37
--HG--
extra : convert_revision : 3c1e3bd735d17d3eb58195c0362d505521706fcc
| Python | bsd-3-clause | adieu/django-nonrel,adieu/django-nonrel,heracek/django-nonrel,heracek/django-nonrel,heracek/django-nonrel,adieu/django-nonrel | ---
+++
@@ -1,9 +1,17 @@
-VERSION = (1, 0, 'post-release-SVN')
+VERSION = (1, 1, 0, 'alpha', 0)
def get_version():
- "Returns the version as a human-format string."
- v = '.'.join([str(i) for i in VERSION[:-1]])
- if VERSION[-1]:
- from django.utils.version import get_svn_revision
- v = '%s-%s-%s' % (v, VERSION[-1], get_svn_revision())
- return v
+ version = '%s.%s' % (VERSION[0], VERSION[1])
+ if VERSION[2]:
+ version = '%s.%s' % (version, VERSION[2])
+ if VERSION[3:] == ('alpha', 0):
+ version = '%s pre-alpha' % version
+ else:
+ version = '%s %s' % (version, VERSION[3])
+ if VERSION[3] != 'final':
+ version = '%s %s' % (version, VERSION[4])
+ from django.utils.version import get_svn_revision
+ svn_rev = get_svn_revision()
+ if svn_rev != u'SVN-unknown':
+ version = "%s %s" % (version, svn_rev)
+ return version |
56e665946d6ba275dbfad45f8e11c796ee1cd257 | setup.py | setup.py | # Copyright 2011-2012 Michael Garski (mgarski@mac.com)
#
# 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.
from setuptools import setup
setup(
name='stellr',
version='0.3.2',
description='Solr client library for gevent utilizing urllib3 and ZeroMQ.',
author='Michael Garski',
author_email='mgarski@mac.com',
#TODO: is 'depends' valid? seeing warnings that it is not
install_requires=['urllib3>=1.1',
'gevent>=0.13.6',
'gevent_zeromq>=0.2.2',
'pyzmq>=2.0.10.1',
'simplejson>=2.1.6'],
url='https://github.com/mgarski/stellr',
packages=['stellr']
) | # Copyright 2011-2012 Michael Garski (mgarski@mac.com)
#
# 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.
from setuptools import setup
setup(
name='stellr',
version='0.3.2',
description='Solr client library for gevent utilizing urllib3 and ZeroMQ.',
author='Michael Garski',
author_email='mgarski@mac.com',
install_requires=['urllib3>=1.1',
'gevent>=0.13.6',
'gevent_zeromq>=0.2.2',
'pyzmq>=2.0.10.1',
'simplejson>=2.1.6'],
url='https://github.com/mgarski/stellr',
packages=['stellr']
) | Remove old comment that no longer applies | Remove old comment that no longer applies
| Python | apache-2.0 | mgarski/stellr,mgarski/stellr | ---
+++
@@ -20,7 +20,6 @@
description='Solr client library for gevent utilizing urllib3 and ZeroMQ.',
author='Michael Garski',
author_email='mgarski@mac.com',
- #TODO: is 'depends' valid? seeing warnings that it is not
install_requires=['urllib3>=1.1',
'gevent>=0.13.6',
'gevent_zeromq>=0.2.2', |
00e9ee41b65adc077aae0eedc0ed453fdd9bdc75 | setup.py | setup.py | from setuptools import setup, find_packages
setup(name='DStarSniffer',
version='pre-1.0',
description='DStar repeater controller sniffer',
url='http://github.com/elielsardanons/dstar-sniffer',
author='Eliel Sardanons LU1ALY',
author_email='eliel@eliel.com.ar',
license='MIT',
packages=find_packages(),
keywords='hamradio dstar aprs icom kenwood d74',
install_requires=[
'aprslib',
'jinja2',
],
include_package_data=True,
package_data={'/' : ['dstar_sniffer/config/*.conf',]},
data_files=[
('/etc/dstar_sniffer', [ 'dstar_sniffer/config/dstar_sniffer.conf', 'dstar_sniffer/config/logging.conf' ])
],
entry_points={
'console_scripts': [
'dstar_sniffer=dstar_sniffer.dstar_sniffer:main',
],
}
)
| from setuptools import setup, find_packages
setup(name='DStarSniffer',
version='pre-1.0',
description='DStar repeater controller sniffer',
url='http://github.com/elielsardanons/dstar-sniffer',
author='Eliel Sardanons LU1ALY',
author_email='eliel@eliel.com.ar',
license='MIT',
packages=find_packages(),
keywords='hamradio dstar aprs icom kenwood d74',
install_requires=[
'aprslib',
'jinja2',
],
include_package_data=True,
package_data={'/' : ['dstar_sniffer/config/*.conf',]},
data_files=[
('/etc/dstar_sniffer',
[
'dstar_sniffer/config/dstar_sniffer.conf',
'dstar_sniffer/config/logging.conf',
'dstar_sniffer/config/last_heard.html',
])
],
entry_points={
'console_scripts': [
'dstar_sniffer=dstar_sniffer.dstar_sniffer:main',
],
}
)
| Include more files inside the package. | Include more files inside the package.
| Python | mit | elielsardanons/dstar_sniffer,elielsardanons/dstar_sniffer | ---
+++
@@ -16,7 +16,12 @@
include_package_data=True,
package_data={'/' : ['dstar_sniffer/config/*.conf',]},
data_files=[
- ('/etc/dstar_sniffer', [ 'dstar_sniffer/config/dstar_sniffer.conf', 'dstar_sniffer/config/logging.conf' ])
+ ('/etc/dstar_sniffer',
+ [
+ 'dstar_sniffer/config/dstar_sniffer.conf',
+ 'dstar_sniffer/config/logging.conf',
+ 'dstar_sniffer/config/last_heard.html',
+ ])
],
entry_points={
'console_scripts': [ |
4c96280421d93a3fa851a7baa7ddb94c388c6d25 | cryptography/hazmat/bindings/openssl/dsa.py | cryptography/hazmat/bindings/openssl/dsa.py | # 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.
INCLUDES = """
#include <openssl/dsa.h>
"""
TYPES = """
typedef struct dsa_st {
// prime number (public)
BIGNUM *p;
// 160-bit subprime, q | p-1 (public)
BIGNUM *q;
// generator of subgroup (public)
BIGNUM *g;
// private key x
BIGNUM *priv_key;
// public key y = g^x
BIGNUM *pub_key;
...;
} DSA;
"""
FUNCTIONS = """
DSA *DSA_generate_parameters(int, unsigned char *, int, int *, unsigned long *,
void (*)(int, int, void *), void *);
int DSA_generate_key(DSA *);
void DSA_free(DSA *);
"""
MACROS = """
"""
CUSTOMIZATIONS = """
"""
CONDITIONAL_NAMES = {}
| # 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.
INCLUDES = """
#include <openssl/dsa.h>
"""
TYPES = """
typedef struct dsa_st {
// prime number (public)
BIGNUM *p;
// 160-bit subprime, q | p-1 (public)
BIGNUM *q;
// generator of subgroup (public)
BIGNUM *g;
// private key x
BIGNUM *priv_key;
// public key y = g^x
BIGNUM *pub_key;
...;
} DSA;
"""
FUNCTIONS = """
DSA *DSA_generate_parameters(int, unsigned char *, int, int *, unsigned long *,
void (*)(int, int, void *), void *);
int DSA_generate_key(DSA *);
void DSA_free(DSA *);
"""
MACROS = """
int DSA_generate_parameters_ex(DSA *, int, unsigned char *, int,
int *, unsigned long *, BN_GENCB *);
"""
CUSTOMIZATIONS = """
"""
CONDITIONAL_NAMES = {}
| Add binding for the DSA parameters generation function | Add binding for the DSA parameters generation function
| Python | bsd-3-clause | Hasimir/cryptography,sholsapp/cryptography,dstufft/cryptography,Hasimir/cryptography,bwhmather/cryptography,sholsapp/cryptography,Lukasa/cryptography,bwhmather/cryptography,skeuomorf/cryptography,kimvais/cryptography,Lukasa/cryptography,bwhmather/cryptography,Hasimir/cryptography,Ayrx/cryptography,dstufft/cryptography,Hasimir/cryptography,kimvais/cryptography,kimvais/cryptography,Ayrx/cryptography,Ayrx/cryptography,kimvais/cryptography,dstufft/cryptography,skeuomorf/cryptography,bwhmather/cryptography,skeuomorf/cryptography,sholsapp/cryptography,dstufft/cryptography,Lukasa/cryptography,Ayrx/cryptography,dstufft/cryptography,skeuomorf/cryptography,sholsapp/cryptography | ---
+++
@@ -39,6 +39,8 @@
"""
MACROS = """
+int DSA_generate_parameters_ex(DSA *, int, unsigned char *, int,
+ int *, unsigned long *, BN_GENCB *);
"""
CUSTOMIZATIONS = """ |
5439552e2e2ba0e5333b86ae23eece9edde43185 | src/syntax/syntactic_simplifier.py | src/syntax/syntactic_simplifier.py | __author__ = 's7a'
# All imports
from parser import Parser
from breaker import Breaker
import re
# The Syntactic simplification class
class SyntacticSimplifier:
# Constructor for the Syntactic Simplifier
def __init__(self):
self.parser = Parser()
self.breaker = Breaker()
# Simplify content
def simplify(self, content, plot_tree=False):
results = []
sentences = re.split('\.|!|\?', content)
for sentence in sentences:
parse_trees = self.parser.parse(sentence, plot_tree)
for parse_tree in parse_trees:
broken_string = self.breaker.break_tree(parse_tree)
results.append({
"tree": str(parse_tree),
"broken_string": broken_string
})
return results | __author__ = 's7a'
# All imports
from parser import Parser
from breaker import Breaker
import re
# The Syntactic simplification class
class SyntacticSimplifier:
# Constructor for the Syntactic Simplifier
def __init__(self):
self.parser = Parser()
self.breaker = Breaker()
# Simplify content
def simplify(self, content, plot_tree=False):
results = []
sentences = re.split('\.|!|\?', content)
for sentence in sentences:
sentence += "."
if sentence == ".":
continue
parse_trees = self.parser.parse(sentence, plot_tree)
for parse_tree in parse_trees:
broken_string = self.breaker.break_tree(parse_tree)
results.append({
"tree": str(parse_tree),
"broken_string": broken_string
})
return results | Add a trailing separator to all sents | Add a trailing separator to all sents
| Python | mit | Somsubhra/Simplify,Somsubhra/Simplify,Somsubhra/Simplify | ---
+++
@@ -21,6 +21,12 @@
sentences = re.split('\.|!|\?', content)
for sentence in sentences:
+
+ sentence += "."
+
+ if sentence == ".":
+ continue
+
parse_trees = self.parser.parse(sentence, plot_tree)
for parse_tree in parse_trees: |
dfe021b8833fabe9e81df2cd90889fb2ba52e2aa | setup.py | setup.py | import sys
from setuptools import setup, find_packages
peavy = __import__('peavy')
setup(
author = 'Fairview Computing LLC',
author_email = 'john@fairviewcomputing.com',
classifiers = [
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: System :: Logging',
],
description = peavy.__doc__,
download_url='http://github.com/fairview/django-peavy/downloads',
install_requires = [
'Django>=1.3',
'South>=0.7.2'
],
license = "MIT License",
name = 'django-peavy',
packages = find_packages(),
package_data = {
'peavy': [
'README.rst',
'LICENSE.txt',
'templates/*/*.html',
'static/*/*/*',
],
},
url = 'http://github.com/fairview/django-peavy',
version = peavy.get_version(),
zip_safe = True,
)
| import sys
from setuptools import setup, find_packages
peavy = __import__('peavy')
with open('README.rst') as file:
long_description = file.read()
setup(
author = 'Fairview Computing LLC',
author_email = 'john@fairviewcomputing.com',
classifiers = [
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: System :: Logging',
],
description = peavy.__doc__,
long_description=long_description,
download_url='http://github.com/fairview/django-peavy/downloads',
install_requires = [
'Django>=1.3',
'South>=0.7.2'
],
license = "MIT License",
name = 'django-peavy',
packages = find_packages(),
package_data = {
'peavy': [
'README.rst',
'LICENSE.txt',
'templates/*/*.html',
'static/*/*/*',
],
},
url = 'http://github.com/fairview/django-peavy',
version = peavy.get_version(),
zip_safe = True,
)
| Add README as long description. | Add README as long description.
| Python | mit | fairview/django-peavy | ---
+++
@@ -2,6 +2,10 @@
from setuptools import setup, find_packages
peavy = __import__('peavy')
+
+with open('README.rst') as file:
+ long_description = file.read()
+
setup(
author = 'Fairview Computing LLC',
author_email = 'john@fairviewcomputing.com',
@@ -16,6 +20,7 @@
'Topic :: System :: Logging',
],
description = peavy.__doc__,
+ long_description=long_description,
download_url='http://github.com/fairview/django-peavy/downloads',
install_requires = [
'Django>=1.3', |
46f4be2da3182c9848636e3de18816d5d7bee319 | setup.py | setup.py | import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.md')) 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-etesync-journal',
version='0.1.0',
packages=find_packages(),
include_package_data=True,
license='GPLv3',
description='The server side implementation of the EteSync protocol.',
long_description=README,
url='https://www.etesync.com/',
author='EteSync',
author_email='contact.journal@etesync.com',
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: GPLv3',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)
| import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.md')) 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-etesync-journal',
version='0.1.0',
packages=find_packages(),
include_package_data=True,
license='AGPLv3',
description='The server side implementation of the EteSync protocol.',
long_description=README,
url='https://www.etesync.com/',
author='EteSync',
author_email='contact.journal@etesync.com',
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: AGPLv3',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)
| Update package according to licence change. | Update package according to licence change.
| Python | agpl-3.0 | etesync/journal-manager | ---
+++
@@ -12,7 +12,7 @@
version='0.1.0',
packages=find_packages(),
include_package_data=True,
- license='GPLv3',
+ license='AGPLv3',
description='The server side implementation of the EteSync protocol.',
long_description=README,
url='https://www.etesync.com/',
@@ -22,7 +22,7 @@
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
- 'License :: OSI Approved :: GPLv3',
+ 'License :: OSI Approved :: AGPLv3',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3', |
6016b6531822615f7c697b0ac380150662d41ba0 | setup.py | setup.py | import os
import sys
from setuptools import setup, find_packages, Command
SEP='<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>'
class Doctest(Command):
if sys.argv[-1] == 'test':
print(SEP)
print("Running docs make and make doctest")
os.system("make doctest -C docs/")
print(SEP)
class Pep8Test(Command):
if sys.argv[-1] == 'test':
print("Running pep8 under source code folder")
os.system("python setup.py pep8 --exclude '.eggs*'")
print(SEP)
setup(name='Kytos OpenFlow Parser library',
version='0.1',
description='Library to parse and generate OpenFlow messages',
url='http://github.com/kytos/python-openflow',
author='Kytos Team',
author_email='of-ng-dev@ncc.unesp.br',
license='MIT',
test_suite='tests',
packages=find_packages(exclude=["tests", "*v0x02*"]),
setup_requires=['setuptools-pep8'],
cmdclass={
'doctests': Doctest
},
zip_safe=False)
| import os
import sys
from setuptools import setup, find_packages, Command
class Doctest(Command):
if sys.argv[-1] == 'test':
print("Running docs make and make doctest")
os.system("make doctest -C docs/")
class Pep8Test(Command):
if sys.argv[-1] == 'test':
print("Running pep8 under source code folder")
os.system("python3 setup.py pep8 --exclude '.eggs*'")
setup(name='Kytos OpenFlow Parser library',
version='0.1',
description='Library to parse and generate OpenFlow messages',
url='http://github.com/kytos/python-openflow',
author='Kytos Team',
author_email='of-ng-dev@ncc.unesp.br',
license='MIT',
test_suite='tests',
packages=find_packages(exclude=["tests", "*v0x02*"]),
setup_requires=['setuptools-pep8'],
cmdclass={
'doctests': Doctest
},
zip_safe=False)
| Enforce python3 on pep8 test (and remove print markers) | Enforce python3 on pep8 test (and remove print markers)
| Python | mit | cemsbr/python-openflow,kytos/python-openflow | ---
+++
@@ -2,22 +2,17 @@
import sys
from setuptools import setup, find_packages, Command
-SEP='<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>'
-
class Doctest(Command):
if sys.argv[-1] == 'test':
- print(SEP)
print("Running docs make and make doctest")
os.system("make doctest -C docs/")
- print(SEP)
class Pep8Test(Command):
if sys.argv[-1] == 'test':
print("Running pep8 under source code folder")
- os.system("python setup.py pep8 --exclude '.eggs*'")
- print(SEP)
+ os.system("python3 setup.py pep8 --exclude '.eggs*'")
setup(name='Kytos OpenFlow Parser library',
version='0.1', |
8af1c868b18aa7540e5a114a0a42617917bd8f88 | setup.py | setup.py | import sys
import os
from setuptools import setup
long_description = open('README.rst').read()
classifiers = [
'Development Status :: 4 - Beta',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
]
setup_kwargs = dict(
name='powershift-cli',
version='1.0.4',
description='Pluggable command line client for OpenShift.',
long_description=long_description,
url='https://github.com/getwarped/powershift-cli',
author='Graham Dumpleton',
author_email='Graham.Dumpleton@gmail.com',
license='BSD',
classifiers=classifiers,
keywords='openshift kubernetes',
packages=['powershift', 'powershift.cli'],
package_dir={'powershift': 'src/powershift'},
package_data={'powershift.cli': ['completion-bash.sh']},
entry_points = {'console_scripts':['powershift = powershift.cli:main']},
install_requires=['click'],
)
setup(**setup_kwargs)
| import sys
import os
from setuptools import setup
long_description = open('README.rst').read()
classifiers = [
'Development Status :: 4 - Beta',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
]
setup_kwargs = dict(
name='powershift-cli',
version='1.0.5',
description='Pluggable command line client for OpenShift.',
long_description=long_description,
url='https://github.com/getwarped/powershift-cli',
author='Graham Dumpleton',
author_email='Graham.Dumpleton@gmail.com',
license='BSD',
classifiers=classifiers,
keywords='openshift kubernetes',
packages=['powershift', 'powershift.cli'],
package_dir={'powershift': 'src/powershift'},
package_data={'powershift.cli': ['completion-bash.sh']},
entry_points = {'console_scripts':['powershift = powershift.cli:main']},
install_requires=['click'],
)
setup(**setup_kwargs)
| Increment version to 1.0.5. Resync code base after machine crash. | Increment version to 1.0.5. Resync code base after machine crash.
| Python | bsd-2-clause | getwarped/powershift-cli,getwarped/powershift-cli | ---
+++
@@ -19,7 +19,7 @@
setup_kwargs = dict(
name='powershift-cli',
- version='1.0.4',
+ version='1.0.5',
description='Pluggable command line client for OpenShift.',
long_description=long_description,
url='https://github.com/getwarped/powershift-cli', |
3080c44c23adcb3a09fb94343da872b8b26ce9fc | tests/conftest.py | tests/conftest.py | """Configuration for test environment"""
import sys
from .fixtures import *
collect_ignore = []
if sys.version_info < (3, 5):
collect_ignore.append("test_async.py")
if sys.version_info < (3, 4):
collect_ignore.append("test_coroutines.py")
| """Configuration for test environment"""
import sys
from .fixtures import *
| Remove no longer necessary test ignore logic | Remove no longer necessary test ignore logic
| Python | mit | timothycrosley/hug,timothycrosley/hug,timothycrosley/hug | ---
+++
@@ -2,11 +2,3 @@
import sys
from .fixtures import *
-
-collect_ignore = []
-
-if sys.version_info < (3, 5):
- collect_ignore.append("test_async.py")
-
-if sys.version_info < (3, 4):
- collect_ignore.append("test_coroutines.py") |
4b3a12b39fc4fa7599f9d09ecd6d785a4ffc089d | setup.py | setup.py | from setuptools import setup
setup(name='chrome_remote_shell',
version='0.1',
description='Client for remote debugging Google Chrome',
url='https://github.com/tempelkim/chrome-remote-shell',
author='Boris Kimmina',
author_email='kim@kimmina.net',
license='MIT',
packages=['chromeremote'],
install_requires=[
'websocket-client',
],
zip_safe=False)
| from setuptools import setup
setup(
name='chrome_remote_shell',
version='0.1',
description='Client for remote debugging Google Chrome',
url='https://github.com/tempelkim/chrome-remote-shell',
author='Boris Kimmina',
author_email='kim@kimmina.net',
license='MIT',
packages=['chromeremote'],
package_data={'': ['*.gz']},
install_requires=[
'websocket-client',
],
zip_safe=False,
)
| Include chrome profile in package | Include chrome profile in package
| Python | mit | tempelkim/chrome-remote-shell | ---
+++
@@ -1,14 +1,17 @@
from setuptools import setup
-setup(name='chrome_remote_shell',
- version='0.1',
- description='Client for remote debugging Google Chrome',
- url='https://github.com/tempelkim/chrome-remote-shell',
- author='Boris Kimmina',
- author_email='kim@kimmina.net',
- license='MIT',
- packages=['chromeremote'],
- install_requires=[
- 'websocket-client',
- ],
- zip_safe=False)
+setup(
+ name='chrome_remote_shell',
+ version='0.1',
+ description='Client for remote debugging Google Chrome',
+ url='https://github.com/tempelkim/chrome-remote-shell',
+ author='Boris Kimmina',
+ author_email='kim@kimmina.net',
+ license='MIT',
+ packages=['chromeremote'],
+ package_data={'': ['*.gz']},
+ install_requires=[
+ 'websocket-client',
+ ],
+ zip_safe=False,
+) |
d4f67c1b92beaee46b38c2e5198d87076c157555 | setup.py | setup.py | """Install Wallace as a command line utility."""
from setuptools import setup
from wallace.version import __version__
setup_args = dict(
name='wallace',
version=__version__,
description='A platform for experimental evolution',
url='http://github.com/suchow/Wallace',
author='Berkeley CoCoSci',
author_email='wallace@cocosci.berkeley.edu',
license='MIT',
packages=['wallace'],
zip_safe=False,
entry_points={
'console_scripts': [
'wallace = wallace.command_line:wallace',
],
}
)
# Read in requirements.txt for dependencies.
setup_args['install_requires'] = install_requires = []
setup_args['dependency_links'] = dependency_links = []
with open('requirements.txt') as f:
for line in f.readlines():
req = line.strip()
if not req or req.startswith('#'):
continue
if req.startswith('-e '):
dependency_links.append(req[3:])
else:
install_requires.append(req)
setup(**setup_args)
| """Install Wallace as a command line utility."""
from setuptools import setup
setup_args = dict(
name='wallace',
version="0.7.0",
description='A platform for experimental evolution',
url='http://github.com/suchow/Wallace',
author='Berkeley CoCoSci',
author_email='wallace@cocosci.berkeley.edu',
license='MIT',
packages=['wallace'],
zip_safe=False,
entry_points={
'console_scripts': [
'wallace = wallace.command_line:wallace',
],
}
)
# Read in requirements.txt for dependencies.
setup_args['install_requires'] = install_requires = []
setup_args['dependency_links'] = dependency_links = []
with open('requirements.txt') as f:
for line in f.readlines():
req = line.strip()
if not req or req.startswith('#'):
continue
if req.startswith('-e '):
dependency_links.append(req[3:])
else:
install_requires.append(req)
setup(**setup_args)
| Fix a bug with Heroku | Fix a bug with Heroku
This is a temporary fix for an issue we were seeing with Heroku. When
you install Wallace using setuptools, it imports the version number
from inside the Wallace codebase. That triggers Wallace’s init file,
which imports the database, whose initialization depends on
SQL-Alchemy. That causes an error because sqlalchemy can’t be found.
For now, let’s avoid the morass.
| Python | mit | suchow/Wallace,suchow/Wallace,Dallinger/Dallinger,jcpeterson/Dallinger,jcpeterson/Dallinger,Dallinger/Dallinger,Dallinger/Dallinger,berkeley-cocosci/Wallace,Dallinger/Dallinger,jcpeterson/Dallinger,berkeley-cocosci/Wallace,berkeley-cocosci/Wallace,jcpeterson/Dallinger,suchow/Wallace,Dallinger/Dallinger,jcpeterson/Dallinger | ---
+++
@@ -1,11 +1,10 @@
"""Install Wallace as a command line utility."""
from setuptools import setup
-from wallace.version import __version__
setup_args = dict(
name='wallace',
- version=__version__,
+ version="0.7.0",
description='A platform for experimental evolution',
url='http://github.com/suchow/Wallace',
author='Berkeley CoCoSci', |
595ef34520ffd0ec9bcc0031f34dce3e68922cf7 | setup.py | setup.py | from setuptools import setup, find_namespace_packages
setup(
name="pptrees",
version="1.2.5",
description="Parallel Prefix tree generation library",
url="https://github.com/tdene/synth_opt_adders",
author="tdene",
author_email="teodord.ene@gmail.com",
license="Apache 2.0",
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: System :: Hardware",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
],
keywords=["hardware adders prefix"],
package_dir={"": "src"},
packages=find_namespace_packages(where="src"),
package_data={"pptrees": ["mappings/*.v"]},
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
python_requires=">=3.7.*",
install_requires=["networkx", "pydot", "graphviz", "Pillow"],
)
| from setuptools import setup, find_namespace_packages
setup(
name="pptrees",
version="1.2.5",
description="Parallel Prefix tree generation library",
url="https://github.com/tdene/synth_opt_adders",
author="tdene",
author_email="teodord.ene@gmail.com",
license="Apache 2.0",
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: System :: Hardware",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
],
keywords=["hardware adders prefix"],
package_dir={"": "src"},
packages=find_namespace_packages(where="src"),
package_data={"pptrees": ["mappings/*.v"]},
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
python_requires=">=3.6.*",
install_requires=["networkx", "pydot", "graphviz", "Pillow"],
)
| Change requirement to Python 3.6 | Change requirement to Python 3.6
Signed-off-by: Teodor-Dumitru Ene <2853baffc346a14b7885b2637a7ab7a41c2198d9@gmail.com>
| Python | apache-2.0 | tdene/synth_opt_adders | ---
+++
@@ -20,6 +20,6 @@
package_data={"pptrees": ["mappings/*.v"]},
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
- python_requires=">=3.7.*",
+ python_requires=">=3.6.*",
install_requires=["networkx", "pydot", "graphviz", "Pillow"],
) |
9b2ec353086789e5794e98db41fd2fa3b2139956 | setup.py | setup.py | # -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='mozbase',
version='0.3.0beta',
packages=['mozbase'],
test_suite='tests',
install_requires=[
'SQLAlchemy==0.8.1',
'voluptuous==0.7.3',
'dogpile.cache==0.4.3'],
author='Bastien GANDOUET',
author_email="bastien@mozaiqu.es"
)
| # -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='mozbase',
version='0.3.0beta',
packages=['mozbase'],
test_suite='tests',
install_requires=[
'SQLAlchemy==0.8.1',
'voluptuous==0.7.2',
'dogpile.cache==0.4.3'],
author='Bastien GANDOUET',
author_email="bastien@mozaiqu.es"
)
| Fix install requirements (again ...) | Fix install requirements (again ...)
| Python | mit | ouihelp/yesaide,mozaiques/zombase | ---
+++
@@ -8,7 +8,7 @@
test_suite='tests',
install_requires=[
'SQLAlchemy==0.8.1',
- 'voluptuous==0.7.3',
+ 'voluptuous==0.7.2',
'dogpile.cache==0.4.3'],
author='Bastien GANDOUET',
author_email="bastien@mozaiqu.es" |
c192977009c248473300b6dc5758e71ed47d73ca | setup.py | setup.py | from setuptools import setup
from setuptools import find_packages
setup(name='timesynth',
version='0.2.4',
description='Library for creating synthetic time series',
url='https://github.com/TimeSynth/TimeSynth',
author='Abhishek Malali, Reinier Maat, Pavlos Protopapas',
author_email='anon@anon.com',
license='MIT',
include_package_data=True,
packages=find_packages(),
install_requires=['numpy', 'scipy', 'sympy', 'symengine==0.4', 'jitcdde==1.4', 'jitcxde_common==1.4.1'],
tests_require=['pytest'],
setup_requires=["pytest-runner"])
| from setuptools import setup
from setuptools import find_packages
setup(name='timesynth',
version='0.2.4',
description='Library for creating synthetic time series',
url='https://github.com/TimeSynth/TimeSynth',
author='Abhishek Malali, Reinier Maat, Pavlos Protopapas',
author_email='anon@anon.com',
license='MIT',
include_package_data=True,
packages=find_packages(),
install_requires=['numpy', 'scipy', 'sympy', 'symengine>=0.4', 'jitcdde==1.4', 'jitcxde_common==1.4.1'],
tests_require=['pytest'],
setup_requires=["pytest-runner"])
| Change symengine requirement to >= instead of == | Change symengine requirement to >= instead of == | Python | mit | TimeSynth/TimeSynth | ---
+++
@@ -10,6 +10,6 @@
license='MIT',
include_package_data=True,
packages=find_packages(),
- install_requires=['numpy', 'scipy', 'sympy', 'symengine==0.4', 'jitcdde==1.4', 'jitcxde_common==1.4.1'],
+ install_requires=['numpy', 'scipy', 'sympy', 'symengine>=0.4', 'jitcdde==1.4', 'jitcxde_common==1.4.1'],
tests_require=['pytest'],
setup_requires=["pytest-runner"]) |
36429980886a280f0781d9071752fbd9aad2c5a2 | setup.py | setup.py | import os
from setuptools import setup, find_packages
def read(filename):
return open(os.path.join(os.path.dirname(__file__), filename)).read()
setup(
name='gears-handlebars',
version='0.1.2',
url='https://github.com/gears/gears-handlebars',
license='ISC',
author='Mike Yumatov',
author_email='mike@yumatov.org',
description='Handlebars compiler for Gears',
long_description=read('README.rst'),
packages=find_packages(),
include_package_data=True,
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.5',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
],
)
| import os
from setuptools import setup, find_packages
def read(filename):
return open(os.path.join(os.path.dirname(__file__), filename)).read()
setup(
name='gears-handlebars',
version='0.1.2',
url='https://github.com/gears/gears-handlebars',
license='ISC',
author='Mike Yumatov',
author_email='mike@yumatov.org',
description='Handlebars compiler for Gears',
long_description=read('README.rst'),
packages=find_packages(),
include_package_data=True,
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
],
)
| Remove Python 2.5 from package classifiers | Remove Python 2.5 from package classifiers
| Python | isc | gears/gears-handlebars,gears/gears-handlebars | ---
+++
@@ -23,7 +23,6 @@
'License :: OSI Approved :: ISC License (ISCL)',
'Operating System :: OS Independent',
'Programming Language :: Python',
- 'Programming Language :: Python :: 2.5',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
], |
4dd63d8e76c65d2899e8a4f869e8c138d3493ada | setup.py | setup.py | import os
from setuptools import setup, find_packages
from hamcrest import __version__
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = 'PyHamcrest',
version = __version__,
author = 'Jon Reid',
author_email = 'jon.reid@mac.com',
description = 'Hamcrest framework for matcher objects',
license = 'New BSD',
platforms=['All'],
keywords = 'hamcrest matchers pyunit unit test testing unittest unittesting',
url = 'http://code.google.com/p/hamcrest/',
download_url = 'http://pypi.python.org/packages/source/P/PyHamcrest/PyHamcrest-%s.tar.gz' % __version__,
packages = find_packages(),
test_suite = 'hamcrest-unit-test.alltests',
provides = ['hamcrest'],
long_description=read('README.md'),
classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.6',
'Topic :: Software Development',
'Topic :: Software Development :: Quality Assurance',
'Topic :: Software Development :: Testing',
],
)
| import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
import re
matched = re.match('__version__.*', read(os.path.join('hamcrest', '__init__.py')))
if matched:
exec(matched.group())
setup(
name = 'PyHamcrest',
version = __version__,
author = 'Jon Reid',
author_email = 'jon.reid@mac.com',
description = 'Hamcrest framework for matcher objects',
license = 'New BSD',
platforms=['All'],
keywords = 'hamcrest matchers pyunit unit test testing unittest unittesting',
url = 'http://code.google.com/p/hamcrest/',
download_url = 'http://pypi.python.org/packages/source/P/PyHamcrest/PyHamcrest-%s.tar.gz' % __version__,
packages = find_packages(),
test_suite = 'hamcrest-unit-test.alltests',
provides = ['hamcrest'],
long_description=read('README.md'),
classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.6',
'Topic :: Software Development',
'Topic :: Software Development :: Quality Assurance',
'Topic :: Software Development :: Testing',
],
use_2to3 = True,
)
| Support python 3 installtion; need distribute | Support python 3 installtion; need distribute
| Python | bsd-3-clause | msabramo/PyHamcrest,nitishr/PyHamcrest,msabramo/PyHamcrest,nitishr/PyHamcrest | ---
+++
@@ -1,9 +1,13 @@
import os
from setuptools import setup, find_packages
-from hamcrest import __version__
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
+
+import re
+matched = re.match('__version__.*', read(os.path.join('hamcrest', '__init__.py')))
+if matched:
+ exec(matched.group())
setup(
name = 'PyHamcrest',
@@ -32,4 +36,5 @@
'Topic :: Software Development :: Quality Assurance',
'Topic :: Software Development :: Testing',
],
+ use_2to3 = True,
) |
3a328071535bc37bdd646403d663dd2a2a06c9af | setup.py | setup.py | import sys
if sys.version_info < (2,7,0):
print("Error: signac requires python version >= 2.7.x.")
sys.exit(1)
from setuptools import setup, find_packages
setup(
name='signac',
version='0.2.8',
packages=find_packages(),
zip_safe=True,
author='Carl Simon Adorf',
author_email='csadorf@umich.edu',
description="Computational Database.",
keywords='simulation tools mc md monte-carlo mongodb '
'jobmanagement materials database',
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Topic :: Scientific/Engineering :: Physics",
],
extras_require={
'db': ['pymongo>=3.0'],
'mpi': ['mpi4py'],
'conversion': ['networkx>=1.1.0'],
'gui': ['PySide'],
},
entry_points={
'console_scripts': [
'signac = signac.__main__:main',
'signac-gui = signac.gui:main',
],
},
)
| import sys
from setuptools import setup, find_packages
if sys.version_info < (2, 7, 0):
print("Error: signac requires python version >= 2.7.x.")
sys.exit(1)
setup(
name='signac',
version='0.2.8',
packages=find_packages(),
zip_safe=True,
author='Carl Simon Adorf',
author_email='csadorf@umich.edu',
description="Simple data management framework.",
keywords='simulation database index collaboration workflow',
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Topic :: Scientific/Engineering :: Physics",
],
extras_require={
'db': ['pymongo>=3.0'],
'mpi': ['mpi4py'],
'conversion': ['networkx>=1.1.0'],
'gui': ['PySide'],
},
entry_points={
'console_scripts': [
'signac = signac.__main__:main',
'signac-gui = signac.gui:main',
],
},
)
| Adjust OSI classifers, description and keywords. | Adjust OSI classifers, description and keywords.
- Upgrade OSI develoment status to '4 - beta'.
- Change intended audience to 'Science/Research'.
- Update description.
- Update keywords.
| Python | bsd-3-clause | csadorf/signac,csadorf/signac | ---
+++
@@ -1,10 +1,9 @@
import sys
+from setuptools import setup, find_packages
-if sys.version_info < (2,7,0):
+if sys.version_info < (2, 7, 0):
print("Error: signac requires python version >= 2.7.x.")
sys.exit(1)
-
-from setuptools import setup, find_packages
setup(
name='signac',
@@ -14,13 +13,12 @@
author='Carl Simon Adorf',
author_email='csadorf@umich.edu',
- description="Computational Database.",
- keywords='simulation tools mc md monte-carlo mongodb '
- 'jobmanagement materials database',
+ description="Simple data management framework.",
+ keywords='simulation database index collaboration workflow',
classifiers=[
- "Development Status :: 3 - Alpha",
- "Intended Audience :: Developers",
+ "Development Status :: 4 - Beta",
+ "Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Topic :: Scientific/Engineering :: Physics",
], |
9c6f27465fea5303ee167d7da5e648ef9f0c0e47 | setup.py | setup.py | from distutils.core import setup
import os
# Load version string
_verfile = os.path.join(os.path.dirname(__file__), 'openslide', '_version.py')
exec open(_verfile)
setup(
name = 'openslide-python',
version = __version__,
packages = [
'openslide',
],
author = 'OpenSlide project',
author_email = 'openslide-users@lists.andrew.cmu.edu',
description = 'Python bindings for OpenSlide library',
license = 'GNU Lesser General Public License, version 2.1',
keywords = 'openslide whole-slide image library',
url = 'http://openslide.org/',
)
| from distutils.core import setup
import os
# Load version string
_verfile = os.path.join(os.path.dirname(__file__), 'openslide', '_version.py')
exec open(_verfile)
setup(
name = 'openslide-python',
version = __version__,
packages = [
'openslide',
],
maintainer = 'OpenSlide project',
maintainer_email = 'openslide-users@lists.andrew.cmu.edu',
description = 'Python bindings for OpenSlide library',
license = 'GNU Lesser General Public License, version 2.1',
keywords = 'openslide whole-slide image library',
url = 'http://openslide.org/',
)
| Use package maintainer rather than author | Use package maintainer rather than author
| Python | lgpl-2.1 | openslide/openslide-python,openslide/openslide-python | ---
+++
@@ -11,8 +11,8 @@
packages = [
'openslide',
],
- author = 'OpenSlide project',
- author_email = 'openslide-users@lists.andrew.cmu.edu',
+ maintainer = 'OpenSlide project',
+ maintainer_email = 'openslide-users@lists.andrew.cmu.edu',
description = 'Python bindings for OpenSlide library',
license = 'GNU Lesser General Public License, version 2.1',
keywords = 'openslide whole-slide image library', |
e19487f21d2de5edeaa2edbb295c43d140797310 | tapioca_harvest/tapioca_harvest.py | tapioca_harvest/tapioca_harvest.py | # coding: utf-8
from tapioca import (
TapiocaAdapter, generate_wrapper_from_adapter, JSONAdapterMixin)
from requests.auth import HTTPBasicAuth
from .resource_mapping import RESOURCE_MAPPING
class HarvestClientAdapter(JSONAdapterMixin, TapiocaAdapter):
resource_mapping = RESOURCE_MAPPING
api_root = 'https://api.harvestapp.com/v2/'
def get_request_kwargs(self, api_params, *args, **kwargs):
params = super(HarvestClientAdapter, self).get_request_kwargs(
api_params, *args, **kwargs)
headers = {
'Authorization': 'Bearer %s' % params.get('token', ''),
'Harvest-Account-Id': params.get('account_id', ''),
'User-Agent': params.get('user_agent', '')
}
params['headers'] = params.get('headers', headers)
params['headers']['Accept'] = 'application/json'
return params
def get_iterator_list(self, response_data):
return response_data
def get_iterator_next_request_kwargs(self, iterator_request_kwargs,
response_data, response):
pass
def response_to_native(self, response):
if response.content.strip():
return super(HarvestClientAdapter, self).response_to_native(response)
Harvest = generate_wrapper_from_adapter(HarvestClientAdapter)
| # coding: utf-8
from tapioca import (
TapiocaAdapter, generate_wrapper_from_adapter, JSONAdapterMixin)
from requests.auth import HTTPBasicAuth
from .resource_mapping import RESOURCE_MAPPING
class HarvestClientAdapter(JSONAdapterMixin, TapiocaAdapter):
resource_mapping = RESOURCE_MAPPING
api_root = 'https://api.harvestapp.com/v2/'
def get_request_kwargs(self, api_params, *args, **kwargs):
params = super(HarvestClientAdapter, self).get_request_kwargs(
api_params, *args, **kwargs)
params.setdefault('headers', {}).update({
'Authorization': 'Bearer %s' % api_params.get('token', ''),
'Harvest-Account-Id': api_params.get('account_id', ''),
'User-Agent': api_params.get('user_agent', '')
})
return params
def get_iterator_list(self, response_data):
return response_data
def get_iterator_next_request_kwargs(self, iterator_request_kwargs,
response_data, response):
pass
def response_to_native(self, response):
if response.content.strip():
return super(HarvestClientAdapter, self).response_to_native(response)
Harvest = generate_wrapper_from_adapter(HarvestClientAdapter)
| Correct header params on adapter | Correct header params on adapter
| Python | mit | vintasoftware/tapioca-harvest | ---
+++
@@ -17,14 +17,11 @@
params = super(HarvestClientAdapter, self).get_request_kwargs(
api_params, *args, **kwargs)
- headers = {
- 'Authorization': 'Bearer %s' % params.get('token', ''),
- 'Harvest-Account-Id': params.get('account_id', ''),
- 'User-Agent': params.get('user_agent', '')
- }
-
- params['headers'] = params.get('headers', headers)
- params['headers']['Accept'] = 'application/json'
+ params.setdefault('headers', {}).update({
+ 'Authorization': 'Bearer %s' % api_params.get('token', ''),
+ 'Harvest-Account-Id': api_params.get('account_id', ''),
+ 'User-Agent': api_params.get('user_agent', '')
+ })
return params
|
bc0aa4d8793857e2c7b43a6cbba6c1c89f3adead | backend/web/test_settings.py | backend/web/test_settings.py | import tempfile
from .settings import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
}
DATA_DIR = tempfile.mkdtemp()
CACHE_DIR = str(Path(DATA_DIR) / 'cache')
THUMBNAIL_ROOT = str(Path(CACHE_DIR) / 'thumbnails')
| import tempfile
from .settings import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
}
DATA_DIR = tempfile.mkdtemp()
CACHE_DIR = str(Path(DATA_DIR) / 'cache')
PHOTO_RAW_PROCESSED_DIR = str(Path(DATA_DIR) / 'raw-photos-processed')
THUMBNAIL_ROOT = str(Path(CACHE_DIR) / 'thumbnails') | Test settings to include PHOTO_RAW_PROCESSED_DIR | Test settings to include PHOTO_RAW_PROCESSED_DIR
| Python | agpl-3.0 | damianmoore/photo-manager,damianmoore/photo-manager,damianmoore/photo-manager,damianmoore/photo-manager | ---
+++
@@ -12,4 +12,5 @@
DATA_DIR = tempfile.mkdtemp()
CACHE_DIR = str(Path(DATA_DIR) / 'cache')
+PHOTO_RAW_PROCESSED_DIR = str(Path(DATA_DIR) / 'raw-photos-processed')
THUMBNAIL_ROOT = str(Path(CACHE_DIR) / 'thumbnails') |
94ad4814f6e372374398a93db8a32ffd980a76d6 | battle-bots/markus_brains.py | battle-bots/markus_brains.py | class WanderBrain(CritterBrain):
def on_collision(self,dir,other,senses):
pass
def on_attack(self,dir,attacker,senses):
pass
def on_tick(self,senses):
self.body.turn(uniform(-0.1,+0.1)*randrange(1,4))
Brains.register(WanderBrain)
class ZigBrain(CritterBrain):
def on_collision(self,dir,other,senses):
pass
def on_attack(self,dir,attacker,senses):
pass
def on_tick(self,senses):
if randrange(1,10) == 1:
self.body.turn(uniform(-1,1))
else:
self.body.heading *= 1.1
Brains.register(ZigBrain)
| class WanderBrain(CritterBrain):
def on_collision(self,dir,other,senses):
pass
def on_attack(self,dir,attacker,senses):
pass
def on_tick(self,senses):
self.body.turn(uniform(-0.1,+0.1)*randrange(1,4))
Brains.register(WanderBrain)
class ZigBrain(CritterBrain):
def on_collision(self,dir,other,senses):
pass
def on_attack(self,dir,attacker,senses):
pass
def on_tick(self,senses):
if randrange(1,10) == 1:
self.body.turn(uniform(-1,1))
else:
self.body.heading *= 1.01
Brains.register(ZigBrain)
| Reduce speed of ZigBrain accelleration & test github web interface | Reduce speed of ZigBrain accelleration & test github web interface | Python | bsd-2-clause | FGCSchool-Math-Club/fgcs-math-club-2014 | ---
+++
@@ -17,6 +17,6 @@
if randrange(1,10) == 1:
self.body.turn(uniform(-1,1))
else:
- self.body.heading *= 1.1
+ self.body.heading *= 1.01
Brains.register(ZigBrain) |
608a1b4c546fba8f79a30b0ed8d0629aa97d1489 | test/features/test_create_pages.py | test/features/test_create_pages.py | from hamcrest import *
from test.features import BrowserTest
class test_create_pages(BrowserTest):
def test_about_page(self):
self.browser.visit("http://0.0.0.0:8000/high-volume-services/by-transactions-per-year/descending.html")
assert_that(self.browser.find_by_css('h1').text, is_('High-volume services'))
def test_all_services(self):
self.browser.visit("http://0.0.0.0:8000/all-services.html")
assert_that(self.browser.find_by_css('h1').text, is_("All Services"))
assert_that(self.browser.find_by_css('#navigation .current').text, is_("All services"))
| from hamcrest import *
from nose.tools import nottest
from test.features import BrowserTest
class test_create_pages(BrowserTest):
def test_about_page(self):
self.browser.visit("http://0.0.0.0:8000/high-volume-services/by-transactions-per-year/descending")
assert_that(self.browser.find_by_css('h1').text, is_('High-volume services'))
@nottest
def test_all_services(self):
self.browser.visit("http://0.0.0.0:8000/all-services")
assert_that(self.browser.find_by_css('h1').text, is_("All Services"))
assert_that(self.browser.find_by_css('#navigation .current').text, is_("All services"))
| Disable test for html not generated by this branch | Disable test for html not generated by this branch
(Also remove .html from urls)
| Python | mit | gds-attic/transactions-explorer,alphagov/transactions-explorer,gds-attic/transactions-explorer,gds-attic/transactions-explorer,alphagov/transactions-explorer,alphagov/transactions-explorer,alphagov/transactions-explorer,gds-attic/transactions-explorer,alphagov/transactions-explorer,gds-attic/transactions-explorer | ---
+++
@@ -1,4 +1,5 @@
from hamcrest import *
+from nose.tools import nottest
from test.features import BrowserTest
@@ -6,11 +7,12 @@
class test_create_pages(BrowserTest):
def test_about_page(self):
- self.browser.visit("http://0.0.0.0:8000/high-volume-services/by-transactions-per-year/descending.html")
+ self.browser.visit("http://0.0.0.0:8000/high-volume-services/by-transactions-per-year/descending")
assert_that(self.browser.find_by_css('h1').text, is_('High-volume services'))
+ @nottest
def test_all_services(self):
- self.browser.visit("http://0.0.0.0:8000/all-services.html")
+ self.browser.visit("http://0.0.0.0:8000/all-services")
assert_that(self.browser.find_by_css('h1').text, is_("All Services"))
assert_that(self.browser.find_by_css('#navigation .current').text, is_("All services"))
|
8a2371a74c27de5e74796d3544670dcc066ce04a | sasview/__init__.py | sasview/__init__.py | __version__ = "4.0b1"
__build__ = "GIT_COMMIT"
try:
import logging
import subprocess
import os
import platform
FNULL = open(os.devnull, 'w')
if platform.system() == "Windows":
args = ['git', 'describe', '--tags']
else:
args = ['git describe --tags']
git_revision = subprocess.check_output(args,
#git_revision = subprocess.check_output(['pwd'],
stderr=FNULL,
shell=True)
__build__ = str(git_revision).strip()
except subprocess.CalledProcessError as cpe:
logging.warning("Error while determining build number\n Using command:\n %s \n Output:\n %s"% (cpe.cmd,cpe.output))
| __version__ = "4.0b1"
__build__ = "GIT_COMMIT"
try:
import logging
import subprocess
import os
import platform
FNULL = open(os.devnull, 'w')
if platform.system() == "Windows":
args = ['git', 'describe', '--tags']
else:
args = ['git describe --tags']
git_revision = subprocess.check_output(args,
stderr=FNULL,
shell=True)
__build__ = str(git_revision).strip()
except subprocess.CalledProcessError as cpe:
logging.warning("Error while determining build number\n Using command:\n %s \n Output:\n %s"% (cpe.cmd,cpe.output))
| Clean up un-needed commented line after jkrzywon fixed subprocess bad behaviour | Clean up un-needed commented line after jkrzywon fixed subprocess bad behaviour
| Python | bsd-3-clause | SasView/sasview,SasView/sasview,SasView/sasview,SasView/sasview,SasView/sasview,SasView/sasview | ---
+++
@@ -11,7 +11,6 @@
else:
args = ['git describe --tags']
git_revision = subprocess.check_output(args,
- #git_revision = subprocess.check_output(['pwd'],
stderr=FNULL,
shell=True)
__build__ = str(git_revision).strip() |
989efc46c1d39804ee5997d85455853db5965788 | ckanext/requestdata/controllers/request_data.py | ckanext/requestdata/controllers/request_data.py | from ckan.lib import base
from ckan.common import c, _
from ckan import logic
from ckanext.requestdata import emailer
from ckan.plugins import toolkit
import ckan.model as model
import ckan.plugins as p
import json
get_action = logic.get_action
NotFound = logic.NotFound
NotAuthorized = logic.NotAuthorized
ValidationError = logic.ValidationError
abort = base.abort
BaseController = base.BaseController
class RequestDataController(BaseController):
def send_request(self):
'''Send mail to resource owner.
:param data: Contact form data.
:type data: object
:rtype: json
'''
print "Entered"
context = {'model': model, 'session': model.Session,
'user': c.user, 'auth_user_obj': c.userobj}
try:
if p.toolkit.request.method == 'POST':
data = dict(toolkit.request.POST)
content = data["message_content"]
to = data['email_address']
mail_subject = "Request data"
get_action('requestdata_request_create')(context, data)
except NotAuthorized:
abort(403, _('Unauthorized to update this dataset.'))
except ValidationError:
error = {
'success': False,
'error': {
'message': 'An error occurred while requesting the data.'
}
}
return json.dumps(error)
response_message = emailer.send_email(content, to, mail_subject)
return json.dumps(response_message) | from ckan.lib import base
from ckan.common import c, _
from ckan import logic
from ckanext.requestdata import emailer
from ckan.plugins import toolkit
import ckan.model as model
import ckan.plugins as p
import json
get_action = logic.get_action
NotFound = logic.NotFound
NotAuthorized = logic.NotAuthorized
ValidationError = logic.ValidationError
abort = base.abort
BaseController = base.BaseController
class RequestDataController(BaseController):
def send_request(self):
'''Send mail to resource owner.
:param data: Contact form data.
:type data: object
:rtype: json
'''
print "Entered"
context = {'model': model, 'session': model.Session,
'user': c.user, 'auth_user_obj': c.userobj}
try:
if p.toolkit.request.method == 'POST':
data = dict(toolkit.request.POST)
content = data["message_content"]
to = data['email_address']
mail_subject = "Request data"
get_action('requestdata_request_create')(context, data)
except NotAuthorized:
abort(403, _('Unauthorized to update this dataset.'))
except ValidationError as e:
error = {
'success': False,
'error': {
'message': str(e)
}
}
return json.dumps(error)
response_message = emailer.send_email(content, to, mail_subject)
return json.dumps(response_message) | Return exception as error message | Return exception as error message
| Python | agpl-3.0 | ViderumGlobal/ckanext-requestdata,ViderumGlobal/ckanext-requestdata,ViderumGlobal/ckanext-requestdata,ViderumGlobal/ckanext-requestdata | ---
+++
@@ -38,11 +38,11 @@
get_action('requestdata_request_create')(context, data)
except NotAuthorized:
abort(403, _('Unauthorized to update this dataset.'))
- except ValidationError:
+ except ValidationError as e:
error = {
'success': False,
'error': {
- 'message': 'An error occurred while requesting the data.'
+ 'message': str(e)
}
}
|
a0d007d0135f74faa10c9df1cd29320e32d317b3 | codonpdx/insert.py | codonpdx/insert.py | #!/usr/bin/env python
import json
import sys
from db import dbManager
# insert an organism into a database table
def insert(args):
if hasattr(args, 'json'):
data = json.loads(args.json)
else:
data = json.load(args.infile)
with dbManager('config/db.cfg') as db:
for org in data:
db.insertOrganism(org, args.dbname, args.job)
return data
| #!/usr/bin/env python
import json
import sys
from db import dbManager
# insert an organism into a database table
def insert(args):
try:
data = json.loads(args.json)
except AttributeError:
data = json.load(args.infile)
with dbManager('config/db.cfg') as db:
for org in data:
db.insertOrganism(org, args.dbname, args.job)
return data
| Use exception block instead as exception was still being thrown. | Use exception block instead as exception was still being thrown.
| Python | apache-2.0 | PDX-Flamingo/codonpdx-python,PDX-Flamingo/codonpdx-python | ---
+++
@@ -7,9 +7,9 @@
# insert an organism into a database table
def insert(args):
- if hasattr(args, 'json'):
+ try:
data = json.loads(args.json)
- else:
+ except AttributeError:
data = json.load(args.infile)
with dbManager('config/db.cfg') as db:
for org in data: |
9567e79a5a5925b23a33c5216a9c13edf656151d | test/test_modes/test_backspace.py | test/test_modes/test_backspace.py | from pyqode.qt import QtCore
from pyqode.qt.QtTest import QTest
from pyqode.core.api import TextHelper
from pyqode.core import modes
from test.helpers import editor_open
def get_mode(editor):
return editor.modes.get(modes.SmartBackSpaceMode)
def test_enabled(editor):
mode = get_mode(editor)
assert mode.enabled
mode.enabled = False
mode.enabled = True
@editor_open(__file__)
def test_key_pressed(editor):
QTest.qWait(1000)
TextHelper(editor).goto_line(21, 4)
QTest.qWait(2000)
assert editor.textCursor().positionInBlock() == 4
QTest.keyPress(editor, QtCore.Qt.Key_Backspace)
QTest.qWait(2000)
assert editor.textCursor().positionInBlock() == 0
TextHelper(editor).goto_line(19, 5)
QTest.qWait(2000)
assert editor.textCursor().positionInBlock() == 5
QTest.keyPress(editor, QtCore.Qt.Key_Backspace)
QTest.qWait(2000)
assert editor.textCursor().positionInBlock() == 4
TextHelper(editor).goto_line(20, 0)
QTest.qWait(2000)
assert editor.textCursor().positionInBlock() == 0
QTest.keyPress(editor, QtCore.Qt.Key_Backspace)
QTest.qWait(2000)
assert editor.textCursor().positionInBlock() == 28
| from pyqode.qt import QtCore
from pyqode.qt.QtTest import QTest
from pyqode.core.api import TextHelper
from pyqode.core import modes
from test.helpers import editor_open
def get_mode(editor):
return editor.modes.get(modes.SmartBackSpaceMode)
def test_enabled(editor):
mode = get_mode(editor)
assert mode.enabled
mode.enabled = False
mode.enabled = True
@editor_open(__file__)
def test_key_pressed(editor):
QTest.qWait(1000)
TextHelper(editor).goto_line(21, 4)
# QTest.qWait(2000)
assert editor.textCursor().positionInBlock() == 4
QTest.keyPress(editor, QtCore.Qt.Key_Backspace)
| Reduce test backspace, we just need to ensure it really eats tab_len spaces | Reduce test backspace, we just need to ensure it really eats tab_len spaces
| Python | mit | pyQode/pyqode.core,pyQode/pyqode.core,zwadar/pyqode.core | ---
+++
@@ -20,21 +20,6 @@
def test_key_pressed(editor):
QTest.qWait(1000)
TextHelper(editor).goto_line(21, 4)
- QTest.qWait(2000)
+ # QTest.qWait(2000)
assert editor.textCursor().positionInBlock() == 4
QTest.keyPress(editor, QtCore.Qt.Key_Backspace)
- QTest.qWait(2000)
- assert editor.textCursor().positionInBlock() == 0
- TextHelper(editor).goto_line(19, 5)
- QTest.qWait(2000)
- assert editor.textCursor().positionInBlock() == 5
- QTest.keyPress(editor, QtCore.Qt.Key_Backspace)
- QTest.qWait(2000)
- assert editor.textCursor().positionInBlock() == 4
-
- TextHelper(editor).goto_line(20, 0)
- QTest.qWait(2000)
- assert editor.textCursor().positionInBlock() == 0
- QTest.keyPress(editor, QtCore.Qt.Key_Backspace)
- QTest.qWait(2000)
- assert editor.textCursor().positionInBlock() == 28 |
5f8242e8f414ab4460db116d0bb1fe3fb54a8794 | assisstant/main.py | assisstant/main.py | #!/usr/bin/python3
import sys
from PyQt5.QtWidgets import QApplication
from keyboard.ui.widgets import KeyboardWindow
if __name__ == '__main__':
app = QApplication([])
window = KeyboardWindow()
window.showMaximized()
sys.exit(app.exec())
| #!/usr/bin/env python3
import sys
from PyQt5.QtWidgets import QApplication
from keyboard.ui.widgets import KeyboardWindow
if __name__ == '__main__':
app = QApplication([])
window = KeyboardWindow()
window.showMaximized()
sys.exit(app.exec())
| Use the python in virtualenv instead of global one | Use the python in virtualenv instead of global one
| Python | apache-2.0 | brainbots/assistant | ---
+++
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
import sys
from PyQt5.QtWidgets import QApplication
from keyboard.ui.widgets import KeyboardWindow |
2f6b60bc6b54229525e399e4cfdee85b9581d32a | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name = "gerobak",
version = "0.1.0",
url = 'http://gerobak.dahsy.at/',
license = 'AGPL',
description = 'Gerobak - bukan apt-web kaleee!',
author = 'Fajran Iman Rusadi',
packages = find_packages('src'),
package_dir = {'': 'src'},
install_requires = ['setuptools', 'django-registration', 'simplejson'],
)
| from setuptools import setup, find_packages
setup(
name = "gerobak",
version = "0.1.0",
url = 'http://gerobak.dahsy.at/',
license = 'AGPL',
description = 'Gerobak - bukan apt-web kaleee!',
author = 'Fajran Iman Rusadi',
packages = find_packages('src'),
package_dir = {'': 'src'},
install_requires = ['setuptools', 'django-registration', 'simplejson',
'celery', 'ghettoq'],
)
| Add celery and ghettoq, getting started with asynchronous process. | Add celery and ghettoq, getting started with asynchronous process.
| Python | agpl-3.0 | fajran/gerobak,fajran/gerobak | ---
+++
@@ -9,6 +9,7 @@
author = 'Fajran Iman Rusadi',
packages = find_packages('src'),
package_dir = {'': 'src'},
- install_requires = ['setuptools', 'django-registration', 'simplejson'],
+ install_requires = ['setuptools', 'django-registration', 'simplejson',
+ 'celery', 'ghettoq'],
)
|
2618e62c210e2877600229301cf46428db04301d | tests/test_playalbum/test_query.py | tests/test_playalbum/test_query.py | #!/usr/bin/env python
# coding=utf-8
from __future__ import print_function, unicode_literals
import nose.tools as nose
from tests.utils import run_filter
def test_ignore_case():
"""should ignore case when querying albums"""
results = run_filter('playalbum', 'Please PLEASE me')
nose.assert_equal(results[0]['title'], 'Please Please Me')
def test_partial():
"""should match partial queries when querying albums"""
results = run_filter('playalbum', 'ease me')
nose.assert_equal(results[0]['title'], 'Please Please Me')
| #!/usr/bin/env python
# coding=utf-8
from __future__ import print_function, unicode_literals
import nose.tools as nose
from tests.utils import run_filter
def test_ignore_case():
"""should ignore case when querying albums"""
results = run_filter('playalbum', 'Please PLEASE me')
nose.assert_equal(results[0]['title'], 'Please Please Me')
def test_partial():
"""should match partial queries when querying albums"""
results = run_filter('playalbum', 'ease m')
nose.assert_equal(results[0]['title'], 'Please Please Me')
| Update test_partial test to be stringly a 'contains' test | Update test_partial test to be stringly a 'contains' test
The current test could inadvertently pass if the album name *ends with*
the query.
| Python | mit | caleb531/play-song,caleb531/play-song | ---
+++
@@ -16,5 +16,5 @@
def test_partial():
"""should match partial queries when querying albums"""
- results = run_filter('playalbum', 'ease me')
+ results = run_filter('playalbum', 'ease m')
nose.assert_equal(results[0]['title'], 'Please Please Me') |
d28c20cf334002cad05534fdd3d0604c521f59b7 | setup.py | setup.py | from setuptools import setup
setup(
name='aws-fuzzy-finder',
version='1.0.0',
url='https://github.com/pmazurek/aws-fuzzy-finder',
description='SSH into AWS instances using fuzzy search through tags.',
download_url='https://github.com/pmazurek/aws-fuzzy-finder/tarball/v1.0.0',
author='Piotr Mazurek, Daria Rudkiewicz',
keywords=['aws', 'ssh', 'fuzzy', 'ec2'],
packages=['aws_fuzzy_finder'],
package_data={'': [
'libs/fzf-0.17.0-linux_386',
'libs/fzf-0.17.0-linux_amd64',
'libs/fzf-0.17.0-darwin_386',
'libs/fzf-0.17.0-darwin_amd64',
]},
install_requires=[
'boto3==1.3.1',
'click==6.6',
'boto3-session-cache==1.0.2'
],
entry_points=dict(
console_scripts=[
'aws-fuzzy = aws_fuzzy_finder.main:entrypoint',
]
)
)
| from setuptools import setup
setup(
name='aws-fuzzy-finder',
version='1.0.0',
url='https://github.com/pmazurek/aws-fuzzy-finder',
description='SSH into AWS instances using fuzzy search through tags.',
download_url='https://github.com/pmazurek/aws-fuzzy-finder/tarball/v1.0.0',
author='Piotr Mazurek, Daria Rudkiewicz',
keywords=['aws', 'ssh', 'fuzzy', 'ec2'],
packages=['aws_fuzzy_finder'],
package_data={'': [
'libs/fzf-0.17.0-linux_386',
'libs/fzf-0.17.0-linux_amd64',
'libs/fzf-0.17.0-darwin_386',
'libs/fzf-0.17.0-darwin_amd64',
]},
install_requires=[
'boto3==1.3.1',
'click>=6.6',
'boto3-session-cache==1.0.2'
],
entry_points=dict(
console_scripts=[
'aws-fuzzy = aws_fuzzy_finder.main:entrypoint',
]
)
)
| Allow newer versions of click | Allow newer versions of click
| Python | mit | pmazurek/aws-fuzzy-finder | ---
+++
@@ -17,7 +17,7 @@
]},
install_requires=[
'boto3==1.3.1',
- 'click==6.6',
+ 'click>=6.6',
'boto3-session-cache==1.0.2'
],
entry_points=dict( |
1dc11a6959616dbb0ff2bd3266223d0584bfa704 | opps/core/tests/channel_models.py | opps/core/tests/channel_models.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.test import TestCase
from django.contrib.sites.models import Site
from opps.core.models.channel import Channel
class ChannelModelTest(TestCase):
def setUp(self):
self.site = Site.objects.filter(name=u'example.com').get()
self.channel = Channel.objects.create(name=u'Home', slug=u'home',
description=u'home page', site=self.site)
def test_check_home_channel(self):
"""
Check exist channel home, create on setup class
"""
home = Channel.objects.filter(slug=u'home').get()
self.assertTrue(home)
self.assertEqual(home, self.channel)
def test_not_is_published(self):
"""
is_published false on home channel
"""
home = Channel.objects.filter(slug=u'home').get()
self.assertFalse(home.is_published())
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.test import TestCase
from django.contrib.sites.models import Site
from opps.core.models.channel import Channel
class ChannelModelTest(TestCase):
def setUp(self):
self.site = Site.objects.filter(name=u'example.com').get()
self.channel = Channel.objects.create(name=u'Home', slug=u'home',
description=u'home page', site=self.site)
def test_check_create_home(self):
"""
Check exist channel home, create on setup class
"""
home = Channel.objects.filter(slug=u'home').get()
self.assertTrue(home)
self.assertEqual(home, self.channel)
def test_not_is_published(self):
"""
is_published false on home channel
"""
home = Channel.objects.filter(slug=u'home').get()
self.assertFalse(home.is_published())
| Rename test check channel home to check create home | Rename test check channel home to check create home
| Python | mit | YACOWS/opps,YACOWS/opps,williamroot/opps,jeanmask/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps,williamroot/opps,opps/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,opps/opps,williamroot/opps,opps/opps,opps/opps | ---
+++
@@ -14,7 +14,7 @@
self.channel = Channel.objects.create(name=u'Home', slug=u'home',
description=u'home page', site=self.site)
- def test_check_home_channel(self):
+ def test_check_create_home(self):
"""
Check exist channel home, create on setup class
""" |
eed4ea2d787cf4cf07ec9d5a95b27f2c352f271a | setup.py | setup.py | from setuptools import find_packages, setup
setup(
name='blocks.contrib',
namespace_packages=['blocks'],
install_requires=['blocks'],
packages=find_packages(exclude=['examples']),
zip_safe=False)
| from setuptools import find_packages, setup
setup(
name='blocks.contrib',
namespace_packages=['blocks'],
install_requires=['git+git://github.com/bartvm/blocks.git#egg=blocks'],
packages=find_packages(exclude=['examples']),
zip_safe=False)
| Add Git link instead of name | Add Git link instead of name
| Python | mit | vdumoulin/blocks-contrib | ---
+++
@@ -3,6 +3,6 @@
setup(
name='blocks.contrib',
namespace_packages=['blocks'],
- install_requires=['blocks'],
+ install_requires=['git+git://github.com/bartvm/blocks.git#egg=blocks'],
packages=find_packages(exclude=['examples']),
zip_safe=False) |
e3e2a6127c709982a716456206df08388b83c0b0 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
from pupa import __version__
long_description = ''
setup(name='pupa',
version=__version__,
packages=find_packages(),
author='James Turk',
author_email='jturk@sunlightfoundation.com',
license='BSD',
url='http://github.com/opencivicdata/pupa/',
description='scraping framework for muncipal data',
long_description=long_description,
platforms=['any'],
entry_points='''[console_scripts]
pupa = pupa.bin.cli:main''',
install_requires=[
'pymongo>=2.5',
'scrapelib>=0.8',
'validictory>=0.9',
]
)
| #!/usr/bin/env python
from setuptools import setup, find_packages
from pupa import __version__
long_description = ''
setup(name='pupa',
version=__version__,
packages=find_packages(),
author='James Turk',
author_email='jturk@sunlightfoundation.com',
license='BSD',
url='http://github.com/opencivicdata/pupa/',
description='scraping framework for muncipal data',
long_description=long_description,
platforms=['any'],
entry_points='''[console_scripts]
pupa = pupa.cli.__main__:main''',
install_requires=[
'pymongo>=2.5',
'scrapelib>=0.8',
'validictory>=0.9',
]
)
| Make is so that the pupa command can run | Make is so that the pupa command can run
| Python | bsd-3-clause | mileswwatkins/pupa,rshorey/pupa,influence-usa/pupa,datamade/pupa,datamade/pupa,influence-usa/pupa,opencivicdata/pupa,rshorey/pupa,mileswwatkins/pupa,opencivicdata/pupa | ---
+++
@@ -15,7 +15,7 @@
long_description=long_description,
platforms=['any'],
entry_points='''[console_scripts]
-pupa = pupa.bin.cli:main''',
+pupa = pupa.cli.__main__:main''',
install_requires=[
'pymongo>=2.5',
'scrapelib>=0.8', |
d7bdfebd137f92177976c13027ae0579bf61a71c | setup.py | setup.py | # coding: utf-8
from setuptools import setup
import os
version = __import__('timezone_utils').VERSION
setup(
name='django-timezone-utils',
version=version,
description='',
long_description=open(
os.path.join(
os.path.dirname(__file__),
"README.rst"
)
).read(),
author="Michael Barr",
author_email="micbarr+developer@gmail.com",
license="MIT",
packages=['timezone_utils'],
install_requires=[
'pytz',
'django>=1.4,<1.8'
],
zip_safe=False,
platforms='any',
include_package_data=True,
classifiers=[
'Development Status :: 4 - Beta',
'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.5',
'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',
'Topic :: Database',
'Topic :: Software Development :: Libraries',
],
url='http://github.com/michaeljohnbarr/django-timezone-utils/',
)
| # coding: utf-8
from setuptools import setup
import os
version = __import__('timezone_utils').VERSION
setup(
name='django-timezone-utils',
version=version,
description='',
long_description=open(
os.path.join(
os.path.dirname(__file__),
"README.rst"
)
).read(),
author="Michael Barr",
author_email="micbarr+developer@gmail.com",
license="MIT",
packages=['timezone_utils'],
install_requires=[
'pytz',
'django>=1.4,<1.8'
],
zip_safe=False,
platforms='any',
include_package_data=True,
classifiers=[
'Development Status :: 4 - Beta',
'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',
'Programming Language :: Python :: 3.4',
'Topic :: Database',
'Topic :: Software Development :: Libraries',
],
url='http://github.com/michaeljohnbarr/django-timezone-utils/',
)
| Remove Python 2.5 from trove classifiers | Remove Python 2.5 from trove classifiers
Despite the fact that Django 1.4 supports Python 2.5, we cannot test for it on Travis-CI. Will need to update the PyPi release to v0.4 to fix completely. | Python | mit | michaeljohnbarr/django-timezone-utils | ---
+++
@@ -35,7 +35,6 @@
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
- 'Programming Language :: Python :: 2.5',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3', |
aa9829567f65c36c5c7356aa5e7d6ac1762f62aa | setup.py | setup.py | #!/usr/bin/env python3
from setuptools import setup
setup(
name='todoman',
description='A simple CalDav-based todo manager.',
author='Hugo Osvaldo Barrera',
author_email='hugo@barrera.io',
url='https://git.barrera.io/hobarrera/todoman',
license='MIT',
packages=['todoman'],
entry_points={
'console_scripts': [
'todo = todoman.cli:run',
]
},
install_requires=[
'click',
'icalendar',
'urwid',
'pyxdg',
'atomicwrites',
# https://github.com/tehmaze/ansi/pull/7
'ansi>=0.1.3',
'parsedatetime',
'setuptools_scm',
],
use_scm_version={'version_scheme': 'post-release'},
setup_requires=['setuptools_scm'],
# TODO: classifiers
)
| #!/usr/bin/env python3
from setuptools import setup
setup(
name='todoman',
description='A simple CalDav-based todo manager.',
author='Hugo Osvaldo Barrera',
author_email='hugo@barrera.io',
url='https://gitlab.com/hobarrera/todoman',
license='MIT',
packages=['todoman'],
entry_points={
'console_scripts': [
'todo = todoman.cli:run',
]
},
install_requires=[
'click',
'icalendar',
'urwid',
'pyxdg',
'atomicwrites',
# https://github.com/tehmaze/ansi/pull/7
'ansi>=0.1.3',
'parsedatetime',
'setuptools_scm',
],
use_scm_version={'version_scheme': 'post-release'},
setup_requires=['setuptools_scm'],
# TODO: classifiers
)
| Update URL to current point to gitlab.com | Update URL to current point to gitlab.com
| Python | isc | AnubhaAgrawal/todoman,asalminen/todoman,hobarrera/todoman,pimutils/todoman,Sakshisaraswat/todoman,rimshaakhan/todoman | ---
+++
@@ -7,7 +7,7 @@
description='A simple CalDav-based todo manager.',
author='Hugo Osvaldo Barrera',
author_email='hugo@barrera.io',
- url='https://git.barrera.io/hobarrera/todoman',
+ url='https://gitlab.com/hobarrera/todoman',
license='MIT',
packages=['todoman'],
entry_points={ |
df90163e41633769c749401bfe175cc66da7eb27 | setup.py | setup.py | #!/usr/bin/env python3
from setuptools import setup, find_packages
setup(
name='ppp_nlp_ml_standalone',
version='0.1',
description='Compute triplets from a question, with an ML approach',
url='https://github.com/ProjetPP',
author='Quentin Cormier',
author_email='quentin.cormier@ens-lyon.fr',
license='MIT',
classifiers=[
'Environment :: No Input/Output (Daemon)',
'Development Status :: 1 - Planning',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
'Topic :: Software Development :: Libraries',
],
install_requires=[
'ppp_datamodel>=0.2',
'ppp_core>=0.2',
],
packages=[
'ppp_nlp_ml_standalone',
],
)
| #!/usr/bin/env python3
from setuptools import setup, find_packages
setup(
name='ppp_nlp_ml_standalone',
version='0.1',
description='Compute triplets from a question, with an ML approach',
url='https://github.com/ProjetPP',
author='Quentin Cormier',
author_email='quentin.cormier@ens-lyon.fr',
license='MIT',
classifiers=[
'Environment :: No Input/Output (Daemon)',
'Development Status :: 1 - Planning',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
'Topic :: Software Development :: Libraries',
],
install_requires=[
'ppp_datamodel>=0.5',
'ppp_core>=0.5',
],
packages=[
'ppp_nlp_ml_standalone',
],
)
| Bump version numbers of ppp_datamodel and ppp_core. | Bump version numbers of ppp_datamodel and ppp_core.
| Python | mit | ProjetPP/PPP-QuestionParsing-ML-Standalone,ProjetPP/PPP-QuestionParsing-ML-Standalone | ---
+++
@@ -24,8 +24,8 @@
'Topic :: Software Development :: Libraries',
],
install_requires=[
- 'ppp_datamodel>=0.2',
- 'ppp_core>=0.2',
+ 'ppp_datamodel>=0.5',
+ 'ppp_core>=0.5',
],
packages=[
'ppp_nlp_ml_standalone', |
47be6e5d55f3891d1051efd6c29559f569128c04 | setup.py | setup.py | from setuptools import setup
setup(
name='aws-helpers',
description='Set of AWS helper scripts',
url='https://github.com/otype/aws-helpers',
author='Hans-Gunther Schmidt',
author_email='hans@otype.de',
version='0.1',
install_requires=['awscli', 'boto'],
dependency_links=[
"git+https://github.com/makethunder/awsudo.git"
],
scripts=['src/aws-instances', 'src/aws-instances.py']
)
| from setuptools import setup
setup(
name='aws-helpers',
description='Set of AWS helper scripts',
url='https://github.com/otype/aws-helpers',
author='Hans-Gunther Schmidt',
author_email='hans@otype.de',
version='0.1',
install_requires=['awscli', 'boto'],
dependency_links=['https://github.com/makethunder/awsudo/tarball/master'],
scripts=['src/aws-instances', 'src/aws-instances.py']
)
| Use tarball download for github dependency | Use tarball download for github dependency
| Python | mit | otype/aws-helpers,otype/aws-helpers | ---
+++
@@ -7,8 +7,6 @@
author_email='hans@otype.de',
version='0.1',
install_requires=['awscli', 'boto'],
- dependency_links=[
- "git+https://github.com/makethunder/awsudo.git"
- ],
+ dependency_links=['https://github.com/makethunder/awsudo/tarball/master'],
scripts=['src/aws-instances', 'src/aws-instances.py']
) |
c133da4e7bd64143551e750762a3079b7761706e | setup.py | setup.py | import sys
from setuptools import setup
meta = dict(
name="stacklogger",
version="0.1.0",
description="A stack-aware logging extension",
author="Will Maier",
author_email="willmaier@ml1.net",
py_modules=["stacklogger"],
test_suite="tests.py",
install_requires=["setuptools"],
keywords="logging stack frame",
url="http://packages.python.org/stacklogger",
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python"
"Topic :: System :: Logging",
],
)
# Automatic conversion for Python 3 requires distribute.
if sys.version_info >= (3,):
meta.update(dict(
use_2to3=True,
))
setup(**meta)
| import sys
from setuptools import setup
meta = dict(
name="stacklogger",
version="0.1.0",
description="A stack-aware logging extension",
author="Will Maier",
author_email="willmaier@ml1.net",
py_modules=["stacklogger"],
test_suite="tests.py",
install_requires=["setuptools"],
keywords="logging stack frame",
url="http://packages.python.org/stacklogger",
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python"
"Topic :: System :: Logging",
],
)
# Automatic conversion for Python 3 requires distribute.
if False and sys.version_info >= (3,):
meta.update(dict(
use_2to3=True,
))
setup(**meta)
| Disable Python 3 conversion until it's been tested. | Disable Python 3 conversion until it's been tested.
| Python | isc | whilp/stacklogger | ---
+++
@@ -25,7 +25,7 @@
)
# Automatic conversion for Python 3 requires distribute.
-if sys.version_info >= (3,):
+if False and sys.version_info >= (3,):
meta.update(dict(
use_2to3=True,
)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.