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 |
|---|---|---|---|---|---|---|---|---|---|---|
392ef4148f477105610bb95d62e6f5685ed38501 | wsme/tg1.py | wsme/tg1.py | import cherrypy
import webob
from turbogears import expose
class Controller(object):
def __init__(self, wsroot):
self._wsroot = wsroot
@expose()
def default(self, *args, **kw):
req = webob.Request(cherrypy.request.wsgi_environ)
res = self._wsroot._handle_request(req)
cherrypy.response.header_list = res.headerlist
cherrypy.status = res.status
return res.body
def adapt(wsroot):
return Controller(wsroot)
| import cherrypy
import webob
from turbogears import expose
class Controller(object):
def __init__(self, wsroot):
self._wsroot = wsroot
@expose()
def default(self, *args, **kw):
req = webob.Request(cherrypy.request.wsgi_environ)
res = self._wsroot._handle_request(req)
cherrypy.response.header_list = res.headerlist
cherrypy.response.status = res.status
return res.body
def adapt(wsroot):
return Controller(wsroot)
| Fix response status code transmission in the TG1 adapter | Fix response status code transmission in the TG1 adapter
--HG--
extra : rebase_source : 99de2b9beb0ebb61fcd87291faede89e150454fe
| Python | mit | stackforge/wsme | ---
+++
@@ -13,7 +13,7 @@
req = webob.Request(cherrypy.request.wsgi_environ)
res = self._wsroot._handle_request(req)
cherrypy.response.header_list = res.headerlist
- cherrypy.status = res.status
+ cherrypy.response.status = res.status
return res.body
|
f7f1960176c32569397441229a0a3bcac926cd82 | go_contacts/backends/tests/test_riak.py | go_contacts/backends/tests/test_riak.py | """
Tests for riak contacts backend and collection.
"""
from twisted.trial.unittest import TestCase
from zope.interface.verify import verifyObject
from go_api.collections import ICollection
from go_contacts.backends.riak import (
RiakContactsBackend, RiakContactsCollection)
class TestRiakContactsBackend(TestCase):
def test_get_contacts_collection(self):
backend = RiakContactsBackend()
collection = backend.get_contact_collection("owner-1")
self.assertEqual(collection.owner_id, "owner-1")
self.assertTrue(isinstance(collection, RiakContactsCollection))
class TestRiakContactsCollection(TestCase):
def test_collection_provides_ICollection(self):
"""
The return value of .get_row_collection() is an object that provides
ICollection.
"""
collection = RiakContactsCollection("owner-1")
verifyObject(ICollection, collection)
def test_init(self):
collection = RiakContactsCollection("owner-1")
self.assertEqual(collection.owner_id, "owner-1")
| """
Tests for riak contacts backend and collection.
"""
from twisted.trial.unittest import TestCase
from zope.interface.verify import verifyObject
from go_api.collections import ICollection
from go_contacts.backends.riak import (
RiakContactsBackend, RiakContactsCollection)
class TestRiakContactsBackend(TestCase):
def test_get_contacts_collection(self):
backend = RiakContactsBackend()
collection = backend.get_contact_collection("owner-1")
self.assertEqual(collection.owner_id, "owner-1")
self.assertTrue(isinstance(collection, RiakContactsCollection))
class TestRiakContactsCollection(TestCase):
def test_collection_provides_ICollection(self):
"""
The return value of .get_row_collection() is an object that provides
ICollection.
"""
collection = RiakContactsCollection("owner-1")
verifyObject(ICollection, collection)
def test_init(self):
collection = RiakContactsCollection("owner-1")
self.assertEqual(collection.owner_id, "owner-1")
def test_get(self):
collection = RiakContactsCollection("owner-1")
self.assertEqual(collection.get("contact-1"), {})
| Add stubby test for getting a contact. | Add stubby test for getting a contact.
| Python | bsd-3-clause | praekelt/go-contacts-api,praekelt/go-contacts-api | ---
+++
@@ -31,3 +31,7 @@
def test_init(self):
collection = RiakContactsCollection("owner-1")
self.assertEqual(collection.owner_id, "owner-1")
+
+ def test_get(self):
+ collection = RiakContactsCollection("owner-1")
+ self.assertEqual(collection.get("contact-1"), {}) |
e98134e112482cd6f3f01148994b331c9cb6f6ba | tests/__init__.py | tests/__init__.py | # -*- coding: utf-8 -*-
from flask import Flask
from flask_split import split
from redis import Redis
class TestCase(object):
def setup_method(self, method):
self.redis = Redis()
self.redis.flushall()
self.app = Flask(__name__)
self.app.debug = True
self.app.secret_key = 'very secret'
self.app.register_blueprint(split)
self._ctx = self.make_test_request_context()
self._ctx.push()
self.client = self.app.test_client()
def teardown_method(self, method):
self._ctx.pop()
def make_test_request_context(self):
return self.app.test_request_context()
def assert_redirects(response, location):
"""
Checks if response is an HTTP redirect to the
given location.
:param response: Flask response
:param location: relative URL (i.e. without **http://localhost**)
"""
assert response.status_code in (301, 302)
assert response.location == 'http://localhost' + location
| # -*- coding: utf-8 -*-
from flask import Flask
from flask_split import split
from flask_split.core import _get_redis_connection
class TestCase(object):
def setup_method(self, method):
self.app = Flask(__name__)
self.app.debug = True
self.app.secret_key = 'very secret'
self.app.register_blueprint(split)
self._ctx = self.make_test_request_context()
self._ctx.push()
self.redis = _get_redis_connection()
self.redis.flushall()
self.client = self.app.test_client()
def teardown_method(self, method):
self._ctx.pop()
def make_test_request_context(self):
return self.app.test_request_context()
def assert_redirects(response, location):
"""
Checks if response is an HTTP redirect to the
given location.
:param response: Flask response
:param location: relative URL (i.e. without **http://localhost**)
"""
assert response.status_code in (301, 302)
assert response.location == 'http://localhost' + location
| Fix redis initialization in tests | Fix redis initialization in tests
| Python | mit | jpvanhal/flask-split,jpvanhal/flask-split,jpvanhal/flask-split | ---
+++
@@ -2,19 +2,19 @@
from flask import Flask
from flask_split import split
-from redis import Redis
+from flask_split.core import _get_redis_connection
class TestCase(object):
def setup_method(self, method):
- self.redis = Redis()
- self.redis.flushall()
self.app = Flask(__name__)
self.app.debug = True
self.app.secret_key = 'very secret'
self.app.register_blueprint(split)
self._ctx = self.make_test_request_context()
self._ctx.push()
+ self.redis = _get_redis_connection()
+ self.redis.flushall()
self.client = self.app.test_client()
def teardown_method(self, method): |
7e6a8de053383a322ecc2416dc1a2700ac5fed29 | tests/argument.py | tests/argument.py | from spec import Spec, eq_, skip, ok_, raises
from invoke.parser import Argument
class Argument_(Spec):
def may_take_names_list(self):
names = ('--foo', '-f')
a = Argument(names=names)
for name in names:
assert a.answers_to(name)
def may_take_name_arg(self):
assert Argument(name='-b').answers_to('-b')
@raises(TypeError)
def must_have_at_least_one_name(self):
Argument()
def defaults_to_not_needing_a_value(self):
assert not Argument(name='a').needs_value
def may_specify_value_factory(self):
assert Argument(name='a', value=str).needs_value
class answers_to:
def returns_True_if_given_name_matches(self):
assert Argument(names=('--foo',)).answers_to('--foo')
class needs_value:
def returns_True_if_this_argument_needs_a_value(self):
assert Argument(name='-b', value=str).needs_value
def returns_False_if_it_does_not_need_a_value(self):
assert not Argument(name='-b', value=None).needs_value
| from spec import Spec, eq_, skip, ok_, raises
from invoke.parser import Argument
class Argument_(Spec):
def may_take_names_list(self):
names = ('--foo', '-f')
a = Argument(names=names)
for name in names:
assert a.answers_to(name)
def may_take_name_arg(self):
assert Argument(name='-b').answers_to('-b')
@raises(TypeError)
def must_have_at_least_one_name(self):
Argument()
def defaults_to_not_needing_a_value(self):
assert not Argument(name='a').needs_value
def may_specify_value_factory(self):
assert Argument(name='a', value=str).needs_value
class answers_to:
def returns_True_if_given_name_matches(self):
assert Argument(names=('--foo',)).answers_to('--foo')
class names:
def returns_tuple_of_all_names(self):
eq_(Argument(names=('--foo', '-b')).names, ('--foo', '-b'))
eq_(Argument(name='--foo').names, ('--foo',))
class needs_value:
def returns_True_if_this_argument_needs_a_value(self):
assert Argument(name='-b', value=str).needs_value
def returns_False_if_it_does_not_need_a_value(self):
assert not Argument(name='-b', value=None).needs_value
| Add .names to Argument API | Add .names to Argument API
| Python | bsd-2-clause | mattrobenolt/invoke,singingwolfboy/invoke,frol/invoke,pyinvoke/invoke,pfmoore/invoke,tyewang/invoke,frol/invoke,pyinvoke/invoke,mattrobenolt/invoke,pfmoore/invoke,kejbaly2/invoke,mkusz/invoke,mkusz/invoke,kejbaly2/invoke,sophacles/invoke,alex/invoke | ---
+++
@@ -27,6 +27,11 @@
def returns_True_if_given_name_matches(self):
assert Argument(names=('--foo',)).answers_to('--foo')
+ class names:
+ def returns_tuple_of_all_names(self):
+ eq_(Argument(names=('--foo', '-b')).names, ('--foo', '-b'))
+ eq_(Argument(name='--foo').names, ('--foo',))
+
class needs_value:
def returns_True_if_this_argument_needs_a_value(self):
assert Argument(name='-b', value=str).needs_value |
532c80a61bb428fa9b2d73cfd227dc6e95a77c00 | tests/conftest.py | tests/conftest.py | collect_ignore = []
try:
import asyncio
except ImportError:
collect_ignore.append('test_asyncio.py')
| from sys import version_info as v
collect_ignore = []
if not (v[0] >= 3 and v[1] >= 5):
collect_ignore.append('test_asyncio.py')
| Exclude asyncio tests from 3.4 | Exclude asyncio tests from 3.4
| Python | mit | jfhbrook/pyee | ---
+++
@@ -1,6 +1,6 @@
+from sys import version_info as v
+
collect_ignore = []
-try:
- import asyncio
-except ImportError:
+if not (v[0] >= 3 and v[1] >= 5):
collect_ignore.append('test_asyncio.py') |
c9340c70bd6d974e98244a1c3208c3a061aec9bb | tests/cortests.py | tests/cortests.py | #!/usr/bin/python
import unittest
import numpy as np
from corfunc import porod, guinier, fitguinier
class TestStringMethods(unittest.TestCase):
def test_porod(self):
self.assertEqual(porod(1, 1, 0), 1)
def test_guinier(self):
self.assertEqual(guinier(1, 1, 0), 1)
def test_sane_fit(self):
A = np.pi
B = -np.sqrt(2)
x = np.linspace(0, 1, 71)
y = guinier(x, A, B)
g = fitguinier(x, y)[0]
self.assertAlmostEqual(B, g[0])
self.assertAlmostEqual(A, np.exp(g[1]))
if __name__ == '__main__':
unittest.main()
| #!/usr/bin/python
import unittest
import numpy as np
from corfunc import porod, guinier, fitguinier, smooth
class TestStringMethods(unittest.TestCase):
def test_porod(self):
self.assertEqual(porod(1, 1, 0), 1)
def test_guinier(self):
self.assertEqual(guinier(1, 1, 0), 1)
def test_sane_fit(self):
A = np.pi
B = -np.sqrt(2)
x = np.linspace(0, 1, 71)
y = guinier(x, A, B)
g = fitguinier(x, y)[0]
self.assertAlmostEqual(B, g[0])
self.assertAlmostEqual(A, np.exp(g[1]))
def test_smooth(self):
f = lambda x: np.sqrt(x)*np.sin(x/10)
g = lambda x: np.log(1+x)
s = smooth(f, g, 25, 75)
x = np.linspace(0, 1, 100)
fg = np.vstack([f(x), g(x)])
small = np.min(fg, axis=0)
large = np.max(fg, axis=0)
x = np.linspace(0, 1, 100)
self.assertTrue(np.all(small <= s(x)))
self.assertTrue(np.all(s(x) <= large))
self.assertEqual(s(0), f(0))
self.assertEqual(s(25), f(25))
self.assertEqual(s(75), g(75))
self.assertEqual(s(100), g(100))
if __name__ == '__main__':
unittest.main()
| Add tests for function smoothing | Add tests for function smoothing
| Python | mit | rprospero/corfunc-py | ---
+++
@@ -2,7 +2,7 @@
import unittest
import numpy as np
-from corfunc import porod, guinier, fitguinier
+from corfunc import porod, guinier, fitguinier, smooth
class TestStringMethods(unittest.TestCase):
@@ -23,5 +23,25 @@
self.assertAlmostEqual(B, g[0])
self.assertAlmostEqual(A, np.exp(g[1]))
+ def test_smooth(self):
+ f = lambda x: np.sqrt(x)*np.sin(x/10)
+ g = lambda x: np.log(1+x)
+ s = smooth(f, g, 25, 75)
+
+ x = np.linspace(0, 1, 100)
+ fg = np.vstack([f(x), g(x)])
+ small = np.min(fg, axis=0)
+ large = np.max(fg, axis=0)
+
+ x = np.linspace(0, 1, 100)
+
+ self.assertTrue(np.all(small <= s(x)))
+ self.assertTrue(np.all(s(x) <= large))
+ self.assertEqual(s(0), f(0))
+ self.assertEqual(s(25), f(25))
+ self.assertEqual(s(75), g(75))
+ self.assertEqual(s(100), g(100))
+
+
if __name__ == '__main__':
unittest.main() |
1d7cd9fd4bd52cc5917373ff543c5cdb2b22e9bb | tests/test_now.py | tests/test_now.py | # -*- coding: utf-8 -*-
from freezegun import freeze_time
from jinja2 import Environment, exceptions
import pytest
@pytest.fixture(scope='session')
def environment():
return Environment(extensions=['jinja2_time.TimeExtension'])
def test_tz_is_required(environment):
with pytest.raises(exceptions.TemplateSyntaxError):
environment.from_string('{% now %}')
@freeze_time("2015-12-09 23:33:01")
def test_default_datetime_format(environment):
template = environment.from_string("{% now 'utc' %}")
assert template.render() == "2015-12-09"
| # -*- coding: utf-8 -*-
import pytest
from freezegun import freeze_time
from jinja2 import Environment, exceptions
@pytest.fixture(scope='session')
def environment():
return Environment(extensions=['jinja2_time.TimeExtension'])
def test_tz_is_required(environment):
with pytest.raises(exceptions.TemplateSyntaxError):
environment.from_string('{% now %}')
@freeze_time("2015-12-09 23:33:01")
def test_utc_default_datetime_format(environment):
template = environment.from_string("{% now 'utc' %}")
assert template.render() == "2015-12-09"
@pytest.fixture(params=['utc', 'local', 'Europe/Berlin'])
def valid_tz(request):
return request.param
@freeze_time("2015-12-09 23:33:01")
def test_accept_valid_timezones(environment, valid_tz):
template = environment.from_string("{% now '" + valid_tz + "' %}")
assert '2015' in template.render()
| Add a parametrized test for valid timezones | Add a parametrized test for valid timezones
| Python | mit | hackebrot/jinja2-time | ---
+++
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
+
+import pytest
from freezegun import freeze_time
from jinja2 import Environment, exceptions
-import pytest
@pytest.fixture(scope='session')
@@ -16,7 +17,19 @@
@freeze_time("2015-12-09 23:33:01")
-def test_default_datetime_format(environment):
+def test_utc_default_datetime_format(environment):
template = environment.from_string("{% now 'utc' %}")
assert template.render() == "2015-12-09"
+
+
+@pytest.fixture(params=['utc', 'local', 'Europe/Berlin'])
+def valid_tz(request):
+ return request.param
+
+
+@freeze_time("2015-12-09 23:33:01")
+def test_accept_valid_timezones(environment, valid_tz):
+ template = environment.from_string("{% now '" + valid_tz + "' %}")
+
+ assert '2015' in template.render() |
db32e404651533acb857c59a565f539805011c7f | user/consumers.py | user/consumers.py | import json
from channels import Group
from channels.auth import channel_session_user, channel_session_user_from_http
from django.dispatch import receiver
from django.db.models.signals import post_save
from event.models import Event
@receiver(post_save, sender=Event)
def send_update(sender, instance, **kwargs):
Group('users').send({
'text': json.dumps({
'id': instance.id,
'title': instance.title,
})
})
@channel_session_user_from_http
def ws_connect(message):
Group('users').add(message.reply_channel)
message.reply_channel.send({
'accept': True
})
@channel_session_user
def ws_disconnect(message):
Group('users').discard(message.reply_channel)
| import json
from channels import Group
from channels.auth import channel_session_user, channel_session_user_from_http
from django.dispatch import receiver
from django.db.models.signals import post_save
from event.models import Event
@receiver(post_save, sender=Event)
def send_update(sender, instance, **kwargs):
for user in instance.users.all():
channel = Group('user-{}'.format(user.id))
channel.send({
'text': json.dumps({
'id': instance.id,
'title': instance.title,
})
})
@channel_session_user_from_http
def ws_connect(message):
message.reply_channel.send({'accept': True})
if message.user.is_authenticated:
Group('user-{}'.format(message.user.id)).add(message.reply_channel)
@channel_session_user
def ws_disconnect(message):
Group('user-{}'.format(message.user.id)).discard(message.reply_channel)
| Add sending a message to event subscribers | Add sending a message to event subscribers
| Python | mit | FedorSelitsky/eventrack,FedorSelitsky/eventrack,FedorSelitsky/eventrack,FedorSelitsky/eventrack | ---
+++
@@ -11,22 +11,23 @@
@receiver(post_save, sender=Event)
def send_update(sender, instance, **kwargs):
- Group('users').send({
- 'text': json.dumps({
- 'id': instance.id,
- 'title': instance.title,
+ for user in instance.users.all():
+ channel = Group('user-{}'.format(user.id))
+ channel.send({
+ 'text': json.dumps({
+ 'id': instance.id,
+ 'title': instance.title,
+ })
})
- })
@channel_session_user_from_http
def ws_connect(message):
- Group('users').add(message.reply_channel)
- message.reply_channel.send({
- 'accept': True
- })
+ message.reply_channel.send({'accept': True})
+ if message.user.is_authenticated:
+ Group('user-{}'.format(message.user.id)).add(message.reply_channel)
@channel_session_user
def ws_disconnect(message):
- Group('users').discard(message.reply_channel)
+ Group('user-{}'.format(message.user.id)).discard(message.reply_channel) |
a3811c7ba8ac59853002e392d29ab4b3800bf096 | src/test/testlexer.py | src/test/testlexer.py |
from cStringIO import StringIO
from nose.tools import *
from parse import EeyoreLexer
def _lex( string ):
return list( EeyoreLexer.Lexer( StringIO( string ) ) )
def _assert_token( token, text, tp, line = None, col = None ):
assert_equal( token.getText(), text )
assert_equal( token.getType(), tp )
if line is not None:
assert_equal( token.getLine(), line )
if col is not None:
assert_equal( token.getColumn(), col )
def test_hello_world():
tokens = _lex( """print( "Hello, world!" )""" )
_assert_token( tokens[0], "print", EeyoreLexer.SYMBOL, 1, 1 )
_assert_token( tokens[1], "(", EeyoreLexer.LPAREN, 1, 6 )
_assert_token( tokens[2], "Hello, world!", EeyoreLexer.STRING, 1, 8 )
_assert_token( tokens[3], ")", EeyoreLexer.RPAREN, 1, 24 )
assert_equal( len( tokens ), 4 )
|
from cStringIO import StringIO
from nose.tools import *
from parse import EeyoreLexer
def _lex( string ):
return list( EeyoreLexer.Lexer( StringIO( string ) ) )
def _assert_token( token, text, tp, line = None, col = None ):
assert_equal( token.getText(), text )
assert_equal( token.getType(), tp )
if line is not None:
assert_equal( token.getLine(), line )
if col is not None:
assert_equal( token.getColumn(), col )
def test_hello_world():
tokens = _lex( """print( "Hello, world!" )""" )
_assert_token( tokens[0], "print", EeyoreLexer.SYMBOL, 1, 1 )
_assert_token( tokens[1], "(", EeyoreLexer.LPAREN, 1, 6 )
_assert_token( tokens[2], "Hello, world!", EeyoreLexer.STRING, 1, 8 )
_assert_token( tokens[3], ")", EeyoreLexer.RPAREN, 1, 24 )
assert_equal( len( tokens ), 4 )
def test_import():
tokens = _lex( """
import a
print()
""" )
_assert_token( tokens[0], "import", EeyoreLexer.SYMBOL, 2, 1 )
_assert_token( tokens[1], "a", EeyoreLexer.SYMBOL, 2, 8 )
_assert_token( tokens[2], "print", EeyoreLexer.SYMBOL, 4, 1 )
_assert_token( tokens[3], "(", EeyoreLexer.LPAREN, 4, 6 )
_assert_token( tokens[4], ")", EeyoreLexer.RPAREN, 4, 7 )
assert_equal( len( tokens ), 5 )
| Add a test for lexing an import statment. | Add a test for lexing an import statment.
| Python | mit | andybalaam/pepper,andybalaam/pepper,andybalaam/pepper,andybalaam/pepper,andybalaam/pepper | ---
+++
@@ -25,3 +25,20 @@
assert_equal( len( tokens ), 4 )
+
+def test_import():
+ tokens = _lex( """
+import a
+
+print()
+""" )
+
+ _assert_token( tokens[0], "import", EeyoreLexer.SYMBOL, 2, 1 )
+ _assert_token( tokens[1], "a", EeyoreLexer.SYMBOL, 2, 8 )
+ _assert_token( tokens[2], "print", EeyoreLexer.SYMBOL, 4, 1 )
+ _assert_token( tokens[3], "(", EeyoreLexer.LPAREN, 4, 6 )
+ _assert_token( tokens[4], ")", EeyoreLexer.RPAREN, 4, 7 )
+
+ assert_equal( len( tokens ), 5 )
+
+ |
1f3577ab890d1b4ba2382e4b5be2500e7e610fbe | mailer/management/commands/send_mail.py | mailer/management/commands/send_mail.py | import logging
from django.conf import settings
from django.core.management.base import NoArgsCommand
from mailer.engine import send_all
# allow a sysadmin to pause the sending of mail temporarily.
PAUSE_SEND = getattr(settings, "MAILER_PAUSE_SEND", False)
class Command(NoArgsCommand):
help = "Do one pass through the mail queue, attempting to send all mail."
def handle_noargs(self, **options):
logging.basicConfig(level=logging.DEBUG, format="%(message)s")
logging.info("-" * 72)
# if PAUSE_SEND is turned on don't do anything.
if not PAUSE_SEND:
send_all()
else:
logging.info("sending is paused, quitting.")
| import logging
from django.conf import settings
from django.core.management.base import NoArgsCommand
from optparse import make_option
from mailer.engine import send_all
# allow a sysadmin to pause the sending of mail temporarily.
PAUSE_SEND = getattr(settings, "MAILER_PAUSE_SEND", False)
class Command(NoArgsCommand):
help = "Do one pass through the mail queue, attempting to send all mail."
option_list = NoArgsCommand.option_list + (
make_option('-q', '--quiet', dest='quiet', default=False,
action='store_true', help='Silence output unless an error occurs.'),
)
def handle_noargs(self, **options):
quiet = options.get('quiet', False)
# Set logging level if quiet
if quiet:
logging.disable(logging.INFO)
logging.basicConfig(level=logging.DEBUG, format="%(message)s")
logging.info("-" * 72)
# if PAUSE_SEND is turned on don't do anything.
if not PAUSE_SEND:
send_all()
else:
logging.info("sending is paused, quitting.")
| Add a --quiet option to the send_all management command. | Add a --quiet option to the send_all management command.
| Python | mit | DarkHorseComics/django-mailer | ---
+++
@@ -3,6 +3,7 @@
from django.conf import settings
from django.core.management.base import NoArgsCommand
+from optparse import make_option
from mailer.engine import send_all
@@ -12,8 +13,19 @@
class Command(NoArgsCommand):
help = "Do one pass through the mail queue, attempting to send all mail."
+
+ option_list = NoArgsCommand.option_list + (
+ make_option('-q', '--quiet', dest='quiet', default=False,
+ action='store_true', help='Silence output unless an error occurs.'),
+ )
def handle_noargs(self, **options):
+ quiet = options.get('quiet', False)
+
+ # Set logging level if quiet
+ if quiet:
+ logging.disable(logging.INFO)
+
logging.basicConfig(level=logging.DEBUG, format="%(message)s")
logging.info("-" * 72)
# if PAUSE_SEND is turned on don't do anything. |
7356dd66137cbb606c3026802ff42ab666af6c08 | jmbo_twitter/admin.py | jmbo_twitter/admin.py | from django.contrib import admin
from django.core.urlresolvers import reverse
from jmbo.admin import ModelBaseAdmin
from jmbo_twitter import models
class FeedAdmin(ModelBaseAdmin):
inlines = []
list_display = ('title', '_image', 'subtitle', 'publish_on', 'retract_on', \
'_get_absolute_url', 'owner', 'created', '_actions'
)
def _image(self, obj):
if obj.profile_image_url:
return '<img src="%s" />' % obj.profile_image_url
else:
return ''
_image.short_description = 'Image'
_image.allow_tags = True
def _actions(self, obj):
try:
parent = super(FeedAdmin, self)._actions(obj)
except AttributeError:
parent = ''
return parent + '''<ul>
<li><a href="%s">Fetch tweets</a></li>
<li><a href="%s">View tweets</a></li>
</ul>''' % (
reverse('feed-fetch-force', args=[obj.name]),
reverse('feed-tweets', args=[obj.name])
)
_actions.short_description = 'Actions'
_actions.allow_tags = True
admin.site.register(models.Feed, FeedAdmin)
| from django.contrib import admin
from django.core.urlresolvers import reverse
from jmbo.admin import ModelBaseAdmin
from jmbo_twitter import models
class FeedAdmin(ModelBaseAdmin):
inlines = []
list_display = ('title', '_image', 'subtitle', 'publish_on', 'retract_on', \
'_get_absolute_url', 'owner', 'created', '_actions'
)
def _image(self, obj):
if obj.profile_image_url:
return '<img src="%s" />' % obj.profile_image_url
else:
return ''
_image.short_description = 'Image'
_image.allow_tags = True
def _actions(self, obj):
# Once a newer version of jmbo is out the try-except can be removed
try:
parent = super(FeedAdmin, self)._actions(obj)
except AttributeError:
parent = ''
return parent + '''<ul>
<li><a href="%s">Fetch tweets</a></li>
<li><a href="%s">View tweets</a></li>
</ul>''' % (
reverse('feed-fetch-force', args=[obj.name]),
reverse('feed-tweets', args=[obj.name])
)
_actions.short_description = 'Actions'
_actions.allow_tags = True
admin.site.register(models.Feed, FeedAdmin)
| Add a comment explaining AttributeError | Add a comment explaining AttributeError
| Python | bsd-3-clause | praekelt/jmbo-twitter,praekelt/jmbo-twitter,praekelt/jmbo-twitter | ---
+++
@@ -21,6 +21,7 @@
_image.allow_tags = True
def _actions(self, obj):
+ # Once a newer version of jmbo is out the try-except can be removed
try:
parent = super(FeedAdmin, self)._actions(obj)
except AttributeError: |
e0eeba656b42ddd2d79bd0f31ad36d64a70dfda0 | moniker/backend/__init__.py | moniker/backend/__init__.py | # Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <kiall@managedit.ie>
#
# 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 moniker.openstack.common import cfg
from moniker.openstack.common import log as logging
from moniker.plugin import Plugin
LOG = logging.getLogger(__name__)
cfg.CONF.register_opts([
cfg.StrOpt('backend-driver', default='bind9',
help='The backend driver to use')
])
def get_backend(conf):
return Plugin.get_plugin(cfg.CONF.backend_driver, ns=__name__, conf=conf)
| # Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <kiall@managedit.ie>
#
# 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 moniker.openstack.common import cfg
from moniker.openstack.common import log as logging
from moniker.plugin import Plugin
LOG = logging.getLogger(__name__)
cfg.CONF.register_opts([
cfg.StrOpt('backend-driver', default='bind9',
help='The backend driver to use')
])
def get_backend(conf):
return Plugin.get_plugin(cfg.CONF.backend_driver, ns=__name__,
conf=conf, invoke_on_load=True)
| Fix so it invokes on load | Fix so it invokes on load
Change-Id: I9806ac61bc1338e566a533f57a50c214ec6e14e7
| Python | apache-2.0 | kiall/designate-py3,openstack/designate,tonyli71/designate,cneill/designate,cneill/designate-testing,richm/designate,muraliselva10/designate,NeCTAR-RC/designate,muraliselva10/designate,kiall/designate-py3,melodous/designate,cneill/designate,kiall/designate-py3,ionrock/designate,melodous/designate,tonyli71/designate,ramsateesh/designate,NeCTAR-RC/designate,melodous/designate,tonyli71/designate,grahamhayes/designate,grahamhayes/designate,cneill/designate-testing,cneill/designate,openstack/designate,kiall/designate-py3,ramsateesh/designate,openstack/designate,grahamhayes/designate,cneill/designate-testing,muraliselva10/designate,ionrock/designate,richm/designate,ramsateesh/designate,cneill/designate,cneill/designate,melodous/designate,ionrock/designate,kiall/designate-py3 | ---
+++
@@ -26,4 +26,5 @@
def get_backend(conf):
- return Plugin.get_plugin(cfg.CONF.backend_driver, ns=__name__, conf=conf)
+ return Plugin.get_plugin(cfg.CONF.backend_driver, ns=__name__,
+ conf=conf, invoke_on_load=True) |
32ca2e07aae40fea18a55875760c506281113313 | examples/dbus_client.py | examples/dbus_client.py |
import dbus
bus = dbus.SystemBus()
# This adds a signal match so that the client gets signals sent by Blivet1's
# ObjectManager. These signals are used to notify clients of changes to the
# managed objects (for blivet, this will be devices, formats, and actions).
bus.add_match_string("type='signal',sender='com.redhat.Blivet1',path_namespace='/com/redhat/Blivet1'")
blivet = bus.get_object('com.redhat.Blivet1', '/com/redhat/Blivet1/Blivet')
blivet.Reset()
object_manager = bus.get_object('com.redhat.Blivet1', '/com/redhat/Blivet1')
objects = object_manager.GetManagedObjects()
for object_path in blivet.ListDevices():
device = objects[object_path]['com.redhat.Blivet1.Device']
print(device['Name'], device['Type'], device['Size'], device['FormatType'])
|
import dbus
bus = dbus.SystemBus()
# This adds a signal match so that the client gets signals sent by Blivet1's
# ObjectManager. These signals are used to notify clients of changes to the
# managed objects (for blivet, this will be devices, formats, and actions).
bus.add_match_string("type='signal',sender='com.redhat.Blivet1',path_namespace='/com/redhat/Blivet1'")
blivet = bus.get_object('com.redhat.Blivet1', '/com/redhat/Blivet1/Blivet')
blivet.Reset()
object_manager = bus.get_object('com.redhat.Blivet1', '/com/redhat/Blivet1')
objects = object_manager.GetManagedObjects()
for object_path in blivet.ListDevices():
device = objects[object_path]['com.redhat.Blivet1.Device']
fmt = objects[device['Format']]['com.redhat.Blivet1.Format']
print(device['Name'], device['Type'], device['Size'], fmt['Type'])
| Update example dbus client to account for Format interface. | Update example dbus client to account for Format interface.
| Python | lgpl-2.1 | jkonecny12/blivet,rvykydal/blivet,AdamWill/blivet,jkonecny12/blivet,AdamWill/blivet,vpodzime/blivet,vojtechtrefny/blivet,rvykydal/blivet,vpodzime/blivet,vojtechtrefny/blivet | ---
+++
@@ -15,4 +15,5 @@
objects = object_manager.GetManagedObjects()
for object_path in blivet.ListDevices():
device = objects[object_path]['com.redhat.Blivet1.Device']
- print(device['Name'], device['Type'], device['Size'], device['FormatType'])
+ fmt = objects[device['Format']]['com.redhat.Blivet1.Format']
+ print(device['Name'], device['Type'], device['Size'], fmt['Type']) |
d5458286244d2ba14fe0af33a9e8fdc9ab728669 | tests/test_replies.py | tests/test_replies.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import time
import unittest
class ReplyTestCase(unittest.TestCase):
def test_base_reply(self):
from wechatpy.replies import TextReply
timestamp = int(time.time())
reply = TextReply(source='user1', target='user2')
self.assertEqual('user1', reply.source)
self.assertEqual('user2', reply.target)
self.assertLessEqual(timestamp, reply.time)
| # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import time
import unittest
class ReplyTestCase(unittest.TestCase):
def test_base_reply(self):
from wechatpy.replies import TextReply
timestamp = int(time.time())
reply = TextReply(source='user1', target='user2')
self.assertEqual('user1', reply.source)
self.assertEqual('user2', reply.target)
self.assertTrue(timestamp <= reply.time)
| Fix test error under Python 2.6 where assertLessEqual not defined | Fix test error under Python 2.6 where assertLessEqual not defined
| Python | mit | cloverstd/wechatpy,wechatpy/wechatpy,cysnake4713/wechatpy,tdautc19841202/wechatpy,zaihui/wechatpy,hunter007/wechatpy,Luckyseal/wechatpy,cysnake4713/wechatpy,navcat/wechatpy,Luckyseal/wechatpy,mruse/wechatpy,chenjiancan/wechatpy,mruse/wechatpy,zhaoqz/wechatpy,zhaoqz/wechatpy,EaseCloud/wechatpy,zaihui/wechatpy,tdautc19841202/wechatpy,tdautc19841202/wechatpy,messense/wechatpy,hunter007/wechatpy,Dufy/wechatpy,cloverstd/wechatpy,jxtech/wechatpy,chenjiancan/wechatpy,Dufy/wechatpy,Luckyseal/wechatpy,navcat/wechatpy,cysnake4713/wechatpy,EaseCloud/wechatpy | ---
+++
@@ -14,4 +14,4 @@
self.assertEqual('user1', reply.source)
self.assertEqual('user2', reply.target)
- self.assertLessEqual(timestamp, reply.time)
+ self.assertTrue(timestamp <= reply.time) |
dedb1736e333ec98c79bc4f8b494869e9e9be4da | froide/campaign/apps.py | froide/campaign/apps.py | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class CampaignConfig(AppConfig):
name = "froide.campaign"
verbose_name = _("Campaign")
def ready(self):
from froide.foirequest.models import FoiRequest
from .listeners import connect_campaign
FoiRequest.request_created.connect(connect_campaign)
| from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class CampaignConfig(AppConfig):
name = "froide.campaign"
verbose_name = _("Campaign")
def ready(self):
from froide.foirequest.models import FoiRequest
from .listeners import connect_campaign
FoiRequest.request_sent.connect(connect_campaign)
| Connect request_sent for campaign connection | Connect request_sent for campaign connection | Python | mit | fin/froide,fin/froide,fin/froide,fin/froide | ---
+++
@@ -10,4 +10,4 @@
from froide.foirequest.models import FoiRequest
from .listeners import connect_campaign
- FoiRequest.request_created.connect(connect_campaign)
+ FoiRequest.request_sent.connect(connect_campaign) |
dd9344755c2bb573b77788b5ad6afa06576d0ae1 | froide/document/apps.py | froide/document/apps.py | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
from django.urls import reverse
class DocumentConfig(AppConfig):
name = 'froide.document'
verbose_name = _('Document')
def ready(self):
import froide.document.signals # noqa
from froide.helper.search import search_registry
search_registry.register(add_search)
def add_search(request):
if request.user.is_staff:
return {
'title': _('Documents'),
'name': 'document',
'url': reverse('document-search')
}
| from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
from django.urls import reverse
class DocumentConfig(AppConfig):
name = 'froide.document'
verbose_name = _('Document')
def ready(self):
import froide.document.signals # noqa
from froide.helper.search import search_registry
search_registry.register(add_search)
def add_search(request):
if request.user.is_staff:
return {
'title': _('Documents (beta)'),
'name': 'document',
'url': reverse('document-search')
}
| Mark document search as beta | Mark document search as beta | Python | mit | stefanw/froide,fin/froide,fin/froide,fin/froide,stefanw/froide,stefanw/froide,stefanw/froide,fin/froide,stefanw/froide | ---
+++
@@ -18,7 +18,7 @@
def add_search(request):
if request.user.is_staff:
return {
- 'title': _('Documents'),
+ 'title': _('Documents (beta)'),
'name': 'document',
'url': reverse('document-search')
} |
508965ffac8b370cbc831b394b8939c26793f58c | installer/installer_config/admin.py | installer/installer_config/admin.py | from django.contrib import admin
from installer_config.models import EnvironmentProfile
from installer_config.models import UserChoice, Step
# class PackageAdmin(admin.ModelAdmin):
# model = Package
# list_display = ('id', 'display_name', 'version', 'website')
# class TerminalPromptAdmin(admin.ModelAdmin):
# model = TerminalPrompt
# list_display = ('id', 'display_name', 'install_name', 'description')
class EnvironmentProfileAdmin(admin.ModelAdmin):
model = EnvironmentProfile
list_display = ('id', 'user', 'description',)
class UserChoiceAdmin(admin.ModelAdmin):
model = UserChoice
list_display = ('id', 'description')
class StepAdmin(admin.ModelAdmin):
model = Step
list_display = ('id', 'step_type', 'url', 'args', 'dependency', 'user_choice')
# admin.site.register(Package, PackageAdmin)
# admin.site.register(TerminalPrompt, TerminalPromptAdmin)
admin.site.register(UserChoice, UserChoiceAdmin)
admin.site.register(Step, StepAdmin)
admin.site.register(EnvironmentProfile, EnvironmentProfileAdmin)
| from django.contrib import admin
from installer_config.models import EnvironmentProfile
from installer_config.models import UserChoice, Step
# class PackageAdmin(admin.ModelAdmin):
# model = Package
# list_display = ('id', 'display_name', 'version', 'website')
# class TerminalPromptAdmin(admin.ModelAdmin):
# model = TerminalPrompt
# list_display = ('id', 'display_name', 'install_name', 'description')
class EnvironmentProfileAdmin(admin.ModelAdmin):
model = EnvironmentProfile
list_display = ('id', 'user', 'description',)
class ChoiceInline(admin.TabularInline):
model = Step
extra = 2
class UserChoiceAdmin(admin.ModelAdmin):
model = UserChoice
inlines = [ChoiceInline]
list_display = ('id', 'description')
class StepAdmin(admin.ModelAdmin):
model = Step
list_display = ('id', 'step_type', 'url', 'args', 'dependency', 'user_choice')
# admin.site.register(Package, PackageAdmin)
# admin.site.register(TerminalPrompt, TerminalPromptAdmin)
admin.site.register(UserChoice, UserChoiceAdmin)
admin.site.register(Step, StepAdmin)
admin.site.register(EnvironmentProfile, EnvironmentProfileAdmin)
| Add inline for steps to User Choice | Add inline for steps to User Choice
| Python | mit | alibulota/Package_Installer,alibulota/Package_Installer,ezPy-co/ezpy,ezPy-co/ezpy | ---
+++
@@ -18,8 +18,14 @@
list_display = ('id', 'user', 'description',)
+class ChoiceInline(admin.TabularInline):
+ model = Step
+ extra = 2
+
+
class UserChoiceAdmin(admin.ModelAdmin):
model = UserChoice
+ inlines = [ChoiceInline]
list_display = ('id', 'description')
|
c017d8fa711724fc7acb7e90b85f208be074d1ec | drupdates/plugins/repolist/__init__.py | drupdates/plugins/repolist/__init__.py | from drupdates.utils import *
from drupdates.repos import *
'''
Note: you need an ssh key set up with Stash to make this script work
'''
class repolist(repoTool):
def __init__(self):
currentDir = os.path.dirname(os.path.realpath(__file__))
self.localsettings = Settings(currentDir)
def gitRepos(self):
#Get list of Stash repos in the Rain Project.
repoDict = self.localsettings.get('repoDict')
if not repoDict:
return {}
else:
return repoDict
| from drupdates.utils import *
from drupdates.repos import *
'''
Note: you need an ssh key set up with Stash to make this script work
'''
class repolist(repoTool):
def __init__(self):
currentDir = os.path.dirname(os.path.realpath(__file__))
self.localsettings = Settings(currentDir)
def gitRepos(self):
#Get list of Stash repos in the Rain Project.
repoDict = self.localsettings.get('repoDict')
if (not repoDict) or (type(repoDict) is not dict):
return {}
else:
return repoDict
| Add extra check to repo list to verify a dictionary is returned | Add extra check to repo list to verify a dictionary is returned
| Python | mit | jalama/drupdates | ---
+++
@@ -14,7 +14,7 @@
def gitRepos(self):
#Get list of Stash repos in the Rain Project.
repoDict = self.localsettings.get('repoDict')
- if not repoDict:
+ if (not repoDict) or (type(repoDict) is not dict):
return {}
else:
return repoDict |
d4ef63250075dbbefbeed4bb37e8679f1ae2495f | tms/__init__.py | tms/__init__.py | from tms.workday import WorkDay
from tms.scraper import scraper
from tms.workweek import WorkWeek | from tms.workday import WorkDay
from tms.scraper import scraper
from tms.workweek import WorkWeek
from tms.breakrule import BreakRule | Change to account for the move of the breakrule call | Change to account for the move of the breakrule call
| Python | mit | marmstr93ng/TimeManagementSystem,marmstr93ng/TimeManagementSystem | ---
+++
@@ -1,3 +1,4 @@
from tms.workday import WorkDay
from tms.scraper import scraper
from tms.workweek import WorkWeek
+from tms.breakrule import BreakRule |
f76086c1900bce156291e2180827570477342f70 | tweepy/error.py | tweepy/error.py | # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from __future__ import print_function
import six
class TweepError(Exception):
"""Tweepy exception"""
def __init__(self, reason, response=None, api_code=None):
self.reason = six.text_type(reason)
self.response = response
self.api_code = api_code
Exception.__init__(self, reason)
def __str__(self):
return self.reason
def is_rate_limit_error_message(message):
"""Check if the supplied error message belongs to a rate limit error."""
return isinstance(message, list) \
and len(message) > 0 \
and 'code' in message[0] \
and message[0]['code'] == 88
class RateLimitError(TweepError):
"""Exception for Tweepy hitting the rate limit."""
# RateLimitError has the exact same properties and inner workings
# as TweepError for backwards compatibility reasons.
pass
| # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from __future__ import print_function
import six
class TweepError(Exception):
"""Tweepy exception"""
def __init__(self, reason, response=None, api_code=None):
self.reason = six.text_type(reason)
self.response = response
self.api_code = api_code
super(TweepError, self).__init__(self, reason)
def __str__(self):
return self.reason
def is_rate_limit_error_message(message):
"""Check if the supplied error message belongs to a rate limit error."""
return isinstance(message, list) \
and len(message) > 0 \
and 'code' in message[0] \
and message[0]['code'] == 88
class RateLimitError(TweepError):
"""Exception for Tweepy hitting the rate limit."""
# RateLimitError has the exact same properties and inner workings
# as TweepError for backwards compatibility reasons.
pass
| Use super in TweepError initialization | Use super in TweepError initialization
| Python | mit | svven/tweepy,tweepy/tweepy | ---
+++
@@ -13,7 +13,7 @@
self.reason = six.text_type(reason)
self.response = response
self.api_code = api_code
- Exception.__init__(self, reason)
+ super(TweepError, self).__init__(self, reason)
def __str__(self):
return self.reason |
d81a6930d21262464ee06ae8afb51b65920f378c | tap/tests/test_pytest_plugin.py | tap/tests/test_pytest_plugin.py | # Copyright (c) 2015, Matt Layman
try:
from unittest import mock
except ImportError:
import mock
from tap.plugins import pytest
from tap.tests import TestCase
from tap.tracker import Tracker
class TestPytestPlugin(TestCase):
def setUp(self):
"""The pytest plugin uses module scope so a fresh tracker
must be installed each time."""
pytest.tracker = Tracker()
def test_includes_options(self):
group = mock.Mock()
parser = mock.Mock()
parser.getgroup.return_value = group
pytest.pytest_addoption(parser)
self.assertEqual(group.addoption.call_count, 1)
def test_tracker_outdir_set(self):
config = mock.Mock()
config.option.tap_outdir = 'fakeout'
pytest.pytest_configure(config)
self.assertEqual(pytest.tracker.outdir, 'fakeout')
| # Copyright (c) 2015, Matt Layman
try:
from unittest import mock
except ImportError:
import mock
import tempfile
from tap.plugins import pytest
from tap.tests import TestCase
from tap.tracker import Tracker
class TestPytestPlugin(TestCase):
def setUp(self):
"""The pytest plugin uses module scope so a fresh tracker
must be installed each time."""
pytest.tracker = Tracker()
def test_includes_options(self):
group = mock.Mock()
parser = mock.Mock()
parser.getgroup.return_value = group
pytest.pytest_addoption(parser)
self.assertEqual(group.addoption.call_count, 1)
def test_tracker_outdir_set(self):
outdir = tempfile.mkdtemp()
config = mock.Mock()
config.option.tap_outdir = outdir
pytest.pytest_configure(config)
self.assertEqual(pytest.tracker.outdir, outdir)
| Fix test to not create a new directory in the project. | Fix test to not create a new directory in the project.
| Python | bsd-2-clause | mblayman/tappy,python-tap/tappy,Mark-E-Hamilton/tappy | ---
+++
@@ -4,6 +4,7 @@
from unittest import mock
except ImportError:
import mock
+import tempfile
from tap.plugins import pytest
from tap.tests import TestCase
@@ -25,7 +26,8 @@
self.assertEqual(group.addoption.call_count, 1)
def test_tracker_outdir_set(self):
+ outdir = tempfile.mkdtemp()
config = mock.Mock()
- config.option.tap_outdir = 'fakeout'
+ config.option.tap_outdir = outdir
pytest.pytest_configure(config)
- self.assertEqual(pytest.tracker.outdir, 'fakeout')
+ self.assertEqual(pytest.tracker.outdir, outdir) |
0ab7d60f02abe3bd4509c3377ebc6cb11f0a5e0f | ydf/templating.py | ydf/templating.py | """
ydf/templating
~~~~~~~~~~~~~~
Contains functions to be exported into the Jinja2 environment and accessible from templates.
"""
import jinja2
import os
from ydf import instructions, __version__
DEFAULT_TEMPLATE_PATH = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'templates')
def render_vars(yaml_vars):
"""
Build a dict containing all variables accessible to a template during the rendering process.
This is a merge of the YAML variables parsed from the file + build variables defined by :mod:`~ydf` itself.
:param yaml_vars: Parsed from the parsed YAML file.
:return: Dict of all variables available to template.
"""
return dict(ydf=dict(version=__version__), **yaml_vars)
def environ(path=DEFAULT_TEMPLATE_PATH, **kwargs):
"""
Build a Jinja2 environment for the given template directory path and options.
:param path: Path to search for Jinja2 template files
:param kwargs: Options to configure the environment
:return: :class:`~jinja2.Environment` instance
"""
kwargs.setdefault('trim_blocks', True)
kwargs.setdefault('lstrip_blocks', True)
env = jinja2.Environment(loader=jinja2.FileSystemLoader(path), **kwargs)
env.globals[instructions.convert_instruction.__name__] = instructions.convert_instruction
return env
| """
ydf/templating
~~~~~~~~~~~~~~
Contains functions to be exported into the Jinja2 environment and accessible from templates.
"""
import jinja2
import os
from ydf import instructions, __version__
DEFAULT_TEMPLATE_NAME = 'default.tpl'
DEFAULT_TEMPLATE_PATH = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'templates')
def render_vars(yaml_vars):
"""
Build a dict containing all variables accessible to a template during the rendering process.
This is a merge of the YAML variables parsed from the file + build variables defined by :mod:`~ydf` itself.
:param yaml_vars: Parsed from the parsed YAML file.
:return: Dict of all variables available to template.
"""
return dict(ydf=dict(version=__version__), **yaml_vars)
def environ(path=DEFAULT_TEMPLATE_PATH, **kwargs):
"""
Build a Jinja2 environment for the given template directory path and options.
:param path: Path to search for Jinja2 template files
:param kwargs: Options to configure the environment
:return: :class:`~jinja2.Environment` instance
"""
kwargs.setdefault('trim_blocks', True)
kwargs.setdefault('lstrip_blocks', True)
env = jinja2.Environment(loader=jinja2.FileSystemLoader(path), **kwargs)
env.globals[instructions.convert_instruction.__name__] = instructions.convert_instruction
return env
| Add global for default template name. | Add global for default template name.
| Python | apache-2.0 | ahawker/ydf | ---
+++
@@ -11,6 +11,7 @@
from ydf import instructions, __version__
+DEFAULT_TEMPLATE_NAME = 'default.tpl'
DEFAULT_TEMPLATE_PATH = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'templates')
|
8354cfd953bb09723abcff7fefe620fc4aa6b855 | tests/test_git_helpers.py | tests/test_git_helpers.py | from unittest import TestCase, mock
from invoke.runner import Result
from semantic_release.git_helpers import commit_new_version, get_commit_log
class GetCommitLogTest(TestCase):
def test_first_commit_is_not_initial_commit(self):
self.assertNotEqual(next(get_commit_log()), 'Initial commit')
class CommitNewVersionTests(TestCase):
@mock.patch('semantic_release.git_helpers.run',
return_value=Result(stdout='', stderr='', pty='', exited=0))
def test_add_and_commit(self, mock_run):
commit_new_version('1.0.0')
self.assertEqual(
mock_run.call_args_list,
[mock.call('git add semantic_release/__init__.py', hide=True),
mock.call('git commit -m "1.0.0"', hide=True)]
)
| from unittest import TestCase, mock
from invoke.runner import Result
from semantic_release.git_helpers import (commit_new_version, get_commit_log, push_new_version,
tag_new_version)
class GitHelpersTests(TestCase):
def test_first_commit_is_not_initial_commit(self):
self.assertNotEqual(next(get_commit_log()), 'Initial commit')
@mock.patch('semantic_release.git_helpers.run',
return_value=Result(stdout='', stderr='', pty='', exited=0))
def test_add_and_commit(self, mock_run):
commit_new_version('1.0.0')
self.assertEqual(
mock_run.call_args_list,
[mock.call('git add semantic_release/__init__.py', hide=True),
mock.call('git commit -m "1.0.0"', hide=True)]
)
@mock.patch('semantic_release.git_helpers.run')
def test_tag_new_version(self, mock_run):
tag_new_version('1.0.0')
mock_run.assert_called_with('git tag v1.0.0 HEAD', hide=True)
@mock.patch('semantic_release.git_helpers.run')
def test_push_new_version(self, mock_run):
push_new_version()
mock_run.assert_called_with('git push && git push --tags', hide=True)
| Add test for git helpers | Add test for git helpers
| Python | mit | relekang/python-semantic-release,relekang/python-semantic-release,wlonk/python-semantic-release,riddlesio/python-semantic-release,jvrsantacruz/python-semantic-release | ---
+++
@@ -2,15 +2,15 @@
from invoke.runner import Result
-from semantic_release.git_helpers import commit_new_version, get_commit_log
+from semantic_release.git_helpers import (commit_new_version, get_commit_log, push_new_version,
+ tag_new_version)
-class GetCommitLogTest(TestCase):
+class GitHelpersTests(TestCase):
+
def test_first_commit_is_not_initial_commit(self):
self.assertNotEqual(next(get_commit_log()), 'Initial commit')
-
-class CommitNewVersionTests(TestCase):
@mock.patch('semantic_release.git_helpers.run',
return_value=Result(stdout='', stderr='', pty='', exited=0))
def test_add_and_commit(self, mock_run):
@@ -20,3 +20,13 @@
[mock.call('git add semantic_release/__init__.py', hide=True),
mock.call('git commit -m "1.0.0"', hide=True)]
)
+
+ @mock.patch('semantic_release.git_helpers.run')
+ def test_tag_new_version(self, mock_run):
+ tag_new_version('1.0.0')
+ mock_run.assert_called_with('git tag v1.0.0 HEAD', hide=True)
+
+ @mock.patch('semantic_release.git_helpers.run')
+ def test_push_new_version(self, mock_run):
+ push_new_version()
+ mock_run.assert_called_with('git push && git push --tags', hide=True) |
44ea85224eec34376194349d01938aa7fc3cf3d1 | dota2league-tracker/app.py | dota2league-tracker/app.py | from flask import Flask, abort, request
from config import parse
from bson.json_util import dumps
config = parse('config.yml')
app = Flask(__name__)
#TODO: add more depth here
@app.route('/health')
def get_health():
return "Ok"
@app.route('/config')
def get_config():
return dumps(config)
if __name__ == "__main__":
app.run(host='0.0.0.0', **config['server'])
| from flask import Flask, abort, request
from config import parse
from bson.json_util import dumps
config = parse('config.yml')
app = Flask(__name__)
#TODO: add more depth here
@app.route('/health')
def get_health():
return "Ok"
@app.route('/config')
def get_config():
return dumps(config)
class Dummy:
def __init__(self, data):
self._data = data
def __str__(self):
return "Object containing " + str(self._data)
def method1(self):
return "Yay, it's method1!"
def method2(self, param):
return "Yay, it's method2 with param value of " + str(param)
o = Dummy('Sikret data')
def expose_as_api(info, path):
if not path.endswith('/'):
path = path + '/'
if not path.startswith('/'):
path = '/' + path
@app.route(path)
def get_string_repr():
return dumps({'info':str(info)})
@app.route(path + '<action>/')
def get_object_action(action):
try:
getter = getattr(o, action) #TODO what if it's not a GET action?
args = {_:request.args.get(_) for _ in request.args} # '?value=a&value=b'? No way!
return dumps(getter(**args))
except AttributeError:
abort(404)
expose_as_api(Dummy('sikret data'), '/object')
@app.route('/obj/')
def get():
args = request.args
key = args.get('key')
#return str([_ for _ in args])
#args = dict(request.args)
args = {_:args.get(_) for _ in args}
return str(args)
return str(args[key])
if __name__ == "__main__":
app.run(host='0.0.0.0', **config['server'])
| Add exposing objects to API | Add exposing objects to API
| Python | mit | Daerdemandt/dota2league-tracker | ---
+++
@@ -15,5 +15,48 @@
def get_config():
return dumps(config)
+class Dummy:
+ def __init__(self, data):
+ self._data = data
+ def __str__(self):
+ return "Object containing " + str(self._data)
+ def method1(self):
+ return "Yay, it's method1!"
+ def method2(self, param):
+ return "Yay, it's method2 with param value of " + str(param)
+
+o = Dummy('Sikret data')
+
+def expose_as_api(info, path):
+ if not path.endswith('/'):
+ path = path + '/'
+ if not path.startswith('/'):
+ path = '/' + path
+
+ @app.route(path)
+ def get_string_repr():
+ return dumps({'info':str(info)})
+
+ @app.route(path + '<action>/')
+ def get_object_action(action):
+ try:
+ getter = getattr(o, action) #TODO what if it's not a GET action?
+ args = {_:request.args.get(_) for _ in request.args} # '?value=a&value=b'? No way!
+ return dumps(getter(**args))
+ except AttributeError:
+ abort(404)
+
+expose_as_api(Dummy('sikret data'), '/object')
+
+@app.route('/obj/')
+def get():
+ args = request.args
+ key = args.get('key')
+ #return str([_ for _ in args])
+ #args = dict(request.args)
+ args = {_:args.get(_) for _ in args}
+ return str(args)
+ return str(args[key])
+
if __name__ == "__main__":
app.run(host='0.0.0.0', **config['server']) |
9ad4944b8c37902e80c684f8484105ff952f3dba | tests/test_program.py | tests/test_program.py | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import io
from hypothesis import given
from hypothesis.strategies import lists, integers
from sensibility import Program, vocabulary
#semicolon = vocabulary.to_index(';')
@given(lists(integers(min_value=vocabulary.start_token_index + 1,
max_value=vocabulary.end_token_index - 1),
min_size=1))
def test_program_random(tokens):
p = Program('<none>', tokens)
assert 0 <= p.random_token_index() < len(p)
assert 0 <= p.random_insertion_point() <= len(p)
@given(lists(integers(min_value=vocabulary.start_token_index + 1,
max_value=vocabulary.end_token_index - 1),
min_size=1))
def test_program_print(tokens):
program = Program('<none>', tokens)
with io.StringIO() as output:
program.print(output)
output_text = output.getvalue()
assert len(program) >= 1
assert len(program) == len(output_text.split())
| #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import io
from hypothesis import given
from hypothesis.strategies import builds, lists, integers, just
from sensibility import Program, vocabulary
tokens = integers(min_value=vocabulary.start_token_index + 1,
max_value=vocabulary.end_token_index - 1)
vectors = lists(tokens, min_size=1)
programs = builds(Program, just('<test>'), vectors)
@given(programs)
def test_program_random(program):
assert 0 <= program.random_token_index() < len(program)
assert 0 <= program.random_insertion_point() <= len(program)
@given(programs)
def test_program_print(program):
with io.StringIO() as output:
program.print(output)
output_text = output.getvalue()
assert len(program) == len(output_text.split())
| Clean up test a bit. | Clean up test a bit.
| Python | apache-2.0 | naturalness/sensibility,naturalness/sensibility,naturalness/sensibility,naturalness/sensibility | ---
+++
@@ -4,28 +4,26 @@
import io
from hypothesis import given
-from hypothesis.strategies import lists, integers
+from hypothesis.strategies import builds, lists, integers, just
from sensibility import Program, vocabulary
-#semicolon = vocabulary.to_index(';')
-@given(lists(integers(min_value=vocabulary.start_token_index + 1,
- max_value=vocabulary.end_token_index - 1),
- min_size=1))
-def test_program_random(tokens):
- p = Program('<none>', tokens)
- assert 0 <= p.random_token_index() < len(p)
- assert 0 <= p.random_insertion_point() <= len(p)
+tokens = integers(min_value=vocabulary.start_token_index + 1,
+ max_value=vocabulary.end_token_index - 1)
+vectors = lists(tokens, min_size=1)
+programs = builds(Program, just('<test>'), vectors)
-@given(lists(integers(min_value=vocabulary.start_token_index + 1,
- max_value=vocabulary.end_token_index - 1),
- min_size=1))
-def test_program_print(tokens):
- program = Program('<none>', tokens)
+@given(programs)
+def test_program_random(program):
+ assert 0 <= program.random_token_index() < len(program)
+ assert 0 <= program.random_insertion_point() <= len(program)
+
+
+@given(programs)
+def test_program_print(program):
with io.StringIO() as output:
program.print(output)
output_text = output.getvalue()
- assert len(program) >= 1
assert len(program) == len(output_text.split()) |
bcccd3aec5fdf64d2730d895ee7fbfc740fd9809 | tests/test_sorting.py | tests/test_sorting.py | from tip.algorithms.sorting.mergesort import mergesort
class TestMergesort():
"""Test class for Merge Sort algorithm."""
def test_mergesort_basic(self):
"""Test basic sorting."""
unsorted_list = [5, 3, 7, 8, 9, 3]
sorted_list = mergesort(unsorted_list)
assert sorted_list == sorted(unsorted_list)
def test_mergesort_trivial(self):
"""Test sorting when it's only one item."""
unsorted_list = [1]
sorted_list = mergesort(unsorted_list)
assert sorted_list == sorted(unsorted_list)
def test_mergesort_with_duplicates(self):
"""Test sorting a list with duplicates."""
unsorted_list = [1, 1, 1, 1]
sorted_list = mergesort(unsorted_list)
assert sorted_list == sorted(unsorted_list)
def test_mergesort_with_empty_list(self):
"""Test sorting a empty list."""
unsorted_list = []
sorted_list = mergesort(unsorted_list)
assert sorted_list == sorted(unsorted_list)
| from tip.algorithms.sorting.mergesort import mergesort
class TestMergesort:
"""Test class for Merge Sort algorithm."""
def test_mergesort_basic(self):
"""Test basic sorting."""
unsorted_list = [5, 3, 7, 8, 9, 3]
sorted_list = mergesort(unsorted_list)
assert sorted_list == sorted(unsorted_list)
def test_mergesort_trivial(self):
"""Test sorting when it's only one item."""
unsorted_list = [1]
sorted_list = mergesort(unsorted_list)
assert sorted_list == sorted(unsorted_list)
def test_mergesort_with_duplicates(self):
"""Test sorting a list with duplicates."""
unsorted_list = [1, 1, 1, 1]
sorted_list = mergesort(unsorted_list)
assert sorted_list == sorted(unsorted_list)
def test_mergesort_with_empty_list(self):
"""Test sorting a empty list."""
unsorted_list = []
sorted_list = mergesort(unsorted_list)
assert sorted_list == sorted(unsorted_list)
| Update with modern class definition | Update with modern class definition
| Python | unlicense | davidgasquez/tip | ---
+++
@@ -1,7 +1,7 @@
from tip.algorithms.sorting.mergesort import mergesort
-class TestMergesort():
+class TestMergesort:
"""Test class for Merge Sort algorithm."""
def test_mergesort_basic(self): |
3b2dab6b7c7a2e0f155825d2819c14de20135fd1 | scripts/add_global_subscriptions.py | scripts/add_global_subscriptions.py | """
This migration subscribes each user to USER_SUBSCRIPTIONS_AVAILABLE if a subscription
does not already exist.
"""
import logging
import sys
from website.app import init_app
from website import models
from website.notifications.model import NotificationSubscription
from website.notifications import constants
from website.notifications.utils import to_subscription_key
from scripts import utils as scripts_utils
logger = logging.getLogger(__name__)
app = init_app()
def add_global_subscriptions():
notification_type = 'email_transactional'
user_events = constants.USER_SUBSCRIPTIONS_AVAILABLE
for user in models.User.find():
for user_event in user_events:
user_event_id = to_subscription_key(user._id, user_event)
subscription = NotificationSubscription.load(user_event_id)
if not subscription:
subscription = NotificationSubscription(_id=user_event_id, owner=user, event_name=user_event)
subscription.add_user_to_subscription(user, notification_type)
subscription.save()
logger.info('No subscription found. {} created.'.format(subscription))
else:
logger.info('Subscription {} found.'.format(subscription))
if __name__ == '__main__':
dry = '--dry' in sys.argv
if not dry:
scripts_utils.add_file_logger(logger, __file__)
add_global_subscriptions()
| """
This migration subscribes each user to USER_SUBSCRIPTIONS_AVAILABLE if a subscription
does not already exist.
"""
import logging
import sys
from website.app import init_app
from website import models
from website.notifications.model import NotificationSubscription
from website.notifications import constants
from website.notifications.utils import to_subscription_key
from scripts import utils as scripts_utils
logger = logging.getLogger(__name__)
app = init_app()
def add_global_subscriptions():
notification_type = 'email_transactional'
user_events = constants.USER_SUBSCRIPTIONS_AVAILABLE
for user in models.User.find():
if user.is_active and user.is_registered:
for user_event in user_events:
user_event_id = to_subscription_key(user._id, user_event)
subscription = NotificationSubscription.load(user_event_id)
if not subscription:
subscription = NotificationSubscription(_id=user_event_id, owner=user, event_name=user_event)
subscription.add_user_to_subscription(user, notification_type)
subscription.save()
logger.info('No subscription found. {} created.'.format(subscription))
else:
logger.info('Subscription {} found.'.format(subscription))
if __name__ == '__main__':
dry = '--dry' in sys.argv
if not dry:
scripts_utils.add_file_logger(logger, __file__)
add_global_subscriptions()
| Add check for active and registered users | Add check for active and registered users
| Python | apache-2.0 | caneruguz/osf.io,alexschiller/osf.io,rdhyee/osf.io,SSJohns/osf.io,DanielSBrown/osf.io,HalcyonChimera/osf.io,chrisseto/osf.io,mfraezz/osf.io,aaxelb/osf.io,mattclark/osf.io,baylee-d/osf.io,CenterForOpenScience/osf.io,samchrisinger/osf.io,cslzchen/osf.io,laurenrevere/osf.io,chennan47/osf.io,caseyrollins/osf.io,mfraezz/osf.io,chrisseto/osf.io,Nesiehr/osf.io,felliott/osf.io,Johnetordoff/osf.io,wearpants/osf.io,Johnetordoff/osf.io,alexschiller/osf.io,hmoco/osf.io,erinspace/osf.io,baylee-d/osf.io,adlius/osf.io,Nesiehr/osf.io,binoculars/osf.io,wearpants/osf.io,amyshi188/osf.io,aaxelb/osf.io,brianjgeiger/osf.io,amyshi188/osf.io,HalcyonChimera/osf.io,mluo613/osf.io,emetsger/osf.io,alexschiller/osf.io,amyshi188/osf.io,acshi/osf.io,laurenrevere/osf.io,mfraezz/osf.io,brianjgeiger/osf.io,monikagrabowska/osf.io,caneruguz/osf.io,samchrisinger/osf.io,caseyrollins/osf.io,chrisseto/osf.io,hmoco/osf.io,TomBaxter/osf.io,binoculars/osf.io,acshi/osf.io,mluo613/osf.io,cwisecarver/osf.io,brianjgeiger/osf.io,mluo613/osf.io,leb2dg/osf.io,adlius/osf.io,Nesiehr/osf.io,mluo613/osf.io,crcresearch/osf.io,mattclark/osf.io,monikagrabowska/osf.io,cwisecarver/osf.io,caseyrollins/osf.io,alexschiller/osf.io,sloria/osf.io,rdhyee/osf.io,alexschiller/osf.io,chennan47/osf.io,TomBaxter/osf.io,crcresearch/osf.io,erinspace/osf.io,SSJohns/osf.io,CenterForOpenScience/osf.io,mluo613/osf.io,DanielSBrown/osf.io,aaxelb/osf.io,pattisdr/osf.io,cslzchen/osf.io,felliott/osf.io,chennan47/osf.io,wearpants/osf.io,mattclark/osf.io,pattisdr/osf.io,baylee-d/osf.io,HalcyonChimera/osf.io,binoculars/osf.io,pattisdr/osf.io,Johnetordoff/osf.io,samchrisinger/osf.io,acshi/osf.io,Johnetordoff/osf.io,sloria/osf.io,felliott/osf.io,monikagrabowska/osf.io,sloria/osf.io,icereval/osf.io,emetsger/osf.io,rdhyee/osf.io,Nesiehr/osf.io,caneruguz/osf.io,amyshi188/osf.io,felliott/osf.io,emetsger/osf.io,acshi/osf.io,acshi/osf.io,cslzchen/osf.io,DanielSBrown/osf.io,leb2dg/osf.io,monikagrabowska/osf.io,wearpants/osf.io,erinspace/osf.io,rdhyee/osf.io,cslzchen/osf.io,HalcyonChimera/osf.io,adlius/osf.io,samchrisinger/osf.io,aaxelb/osf.io,cwisecarver/osf.io,saradbowman/osf.io,leb2dg/osf.io,mfraezz/osf.io,SSJohns/osf.io,emetsger/osf.io,saradbowman/osf.io,hmoco/osf.io,TomBaxter/osf.io,hmoco/osf.io,icereval/osf.io,crcresearch/osf.io,CenterForOpenScience/osf.io,chrisseto/osf.io,brianjgeiger/osf.io,adlius/osf.io,SSJohns/osf.io,CenterForOpenScience/osf.io,DanielSBrown/osf.io,leb2dg/osf.io,laurenrevere/osf.io,monikagrabowska/osf.io,cwisecarver/osf.io,icereval/osf.io,caneruguz/osf.io | ---
+++
@@ -25,17 +25,18 @@
user_events = constants.USER_SUBSCRIPTIONS_AVAILABLE
for user in models.User.find():
- for user_event in user_events:
- user_event_id = to_subscription_key(user._id, user_event)
+ if user.is_active and user.is_registered:
+ for user_event in user_events:
+ user_event_id = to_subscription_key(user._id, user_event)
- subscription = NotificationSubscription.load(user_event_id)
- if not subscription:
- subscription = NotificationSubscription(_id=user_event_id, owner=user, event_name=user_event)
- subscription.add_user_to_subscription(user, notification_type)
- subscription.save()
- logger.info('No subscription found. {} created.'.format(subscription))
- else:
- logger.info('Subscription {} found.'.format(subscription))
+ subscription = NotificationSubscription.load(user_event_id)
+ if not subscription:
+ subscription = NotificationSubscription(_id=user_event_id, owner=user, event_name=user_event)
+ subscription.add_user_to_subscription(user, notification_type)
+ subscription.save()
+ logger.info('No subscription found. {} created.'.format(subscription))
+ else:
+ logger.info('Subscription {} found.'.format(subscription))
if __name__ == '__main__':
dry = '--dry' in sys.argv |
dffa52e4c72d274dcefdc4c6bbe44b30ed541f89 | tests/test_platform_telegram.py | tests/test_platform_telegram.py | import aiohttp
import pytest
from bottery.platform.telegram.api import TelegramAPI
def test_platform_telegram_api_non_existent_method():
api = TelegramAPI('token', aiohttp.ClientSession)
with pytest.raises(AttributeError):
api.non_existent_method()
@pytest.mark.asyncio
async def test_platform_telegram_api_get_updates():
api = TelegramAPI('token', aiohttp.ClientSession)
with pytest.raises(TypeError):
await api.get_updates()
| import aiohttp
import pytest
from bottery.platform.telegram.api import TelegramAPI
def test_platform_telegram_api_non_existent_method():
api = TelegramAPI('token', aiohttp.ClientSession)
with pytest.raises(AttributeError):
api.non_existent_method()
@pytest.mark.asyncio
async def test_platform_telegram_api_get_updates():
api = TelegramAPI('token', aiohttp.ClientSession)
with pytest.raises(TypeError):
await api.get_updates()
| Fix "Imports are incorrectly sorted" error | Fix "Imports are incorrectly sorted" error
| Python | mit | rougeth/bottery | ---
+++
@@ -1,5 +1,4 @@
import aiohttp
-
import pytest
from bottery.platform.telegram.api import TelegramAPI |
4018f7414ca88cc51cf05591f9aec44e5d4b4944 | python/foolib/setup.py | python/foolib/setup.py | from distutils.core import setup, Extension
module1 = Extension('foolib',
define_macros = [('MAJOR_VERSION', '1'),
('MINOR_VERSION', '0')],
sources = ['foolibmodule.c'])
setup (name = 'foolib',
version = '1.0',
description = 'This is a demo package',
author = 'Tom Kraljevic',
author_email = 'tomk@tomk.net',
url = 'http://example-of-where-to-put-url.org',
long_description = '''
This is really just a demo package.
''',
ext_modules = [module1])
| from distutils.core import setup, Extension
module1 = Extension('foolib',
define_macros = [('MAJOR_VERSION', '1'),
('MINOR_VERSION', '0')],
include_dirs = ['../../cxx/include'],
sources = ['foolibmodule.c', '../../cxx/src/foolib_c.cxx'])
setup (name = 'foolib',
version = '1.0',
description = 'This is a demo package',
author = 'Tom Kraljevic',
author_email = 'tomk@tomk.net',
url = 'http://example-of-where-to-put-url.org',
long_description = '''
This is really just a demo package.
''',
ext_modules = [module1])
| Add include directory and c library file. | Add include directory and c library file.
| Python | apache-2.0 | tomkraljevic/polyglot-to-cxx-examples,tomkraljevic/polyglot-to-cxx-examples,tomkraljevic/polyglot-to-cxx-examples | ---
+++
@@ -3,7 +3,8 @@
module1 = Extension('foolib',
define_macros = [('MAJOR_VERSION', '1'),
('MINOR_VERSION', '0')],
- sources = ['foolibmodule.c'])
+ include_dirs = ['../../cxx/include'],
+ sources = ['foolibmodule.c', '../../cxx/src/foolib_c.cxx'])
setup (name = 'foolib',
version = '1.0', |
2cbbcb6c900869d37f9a11ae56ea38f548233274 | dask/compatibility.py | dask/compatibility.py | from __future__ import absolute_import, division, print_function
import sys
PY3 = sys.version_info[0] == 3
PY2 = sys.version_info[0] == 2
if PY3:
import builtins
from queue import Queue, Empty
from itertools import zip_longest
from io import StringIO, BytesIO
from urllib.request import urlopen
from urllib.parse import urlparse
from urllib.parse import quote, unquote
unicode = str
long = int
def apply(func, args, kwargs=None):
if not isinstance(args, list) and kwargs is None:
return func(args)
elif not isinstance(args, list):
return func(args, **kwargs)
elif kwargs:
return func(*args, **kwargs)
else:
return func(*args)
range = range
else:
import __builtin__ as builtins
from Queue import Queue, Empty
import operator
from itertools import izip_longest as zip_longest
from StringIO import StringIO
from io import BytesIO
from urllib2 import urlopen
from urlparse import urlparse
from urllib import quote, unquote
unicode = unicode
long = long
apply = apply
range = xrange
def skip(func):
return
| from __future__ import absolute_import, division, print_function
import sys
PY3 = sys.version_info[0] == 3
PY2 = sys.version_info[0] == 2
if PY3:
import builtins
from queue import Queue, Empty
from itertools import zip_longest
from io import StringIO, BytesIO
from urllib.request import urlopen
from urllib.parse import urlparse
from urllib.parse import quote, unquote
unicode = str
long = int
def apply(func, args, kwargs=None):
if not isinstance(args, list) and not isinstance(args, tuple) and kwargs is None:
return func(args)
elif not isinstance(args, list) and not isinstance(args, tuple):
return func(args, **kwargs)
elif kwargs:
return func(*args, **kwargs)
else:
return func(*args)
range = range
else:
import __builtin__ as builtins
from Queue import Queue, Empty
import operator
from itertools import izip_longest as zip_longest
from StringIO import StringIO
from io import BytesIO
from urllib2 import urlopen
from urlparse import urlparse
from urllib import quote, unquote
unicode = unicode
long = long
apply = apply
range = xrange
def skip(func):
return
| Allow for tuple-based args in map also | Allow for tuple-based args in map also
| Python | bsd-3-clause | vikhyat/dask,blaze/dask,mrocklin/dask,wiso/dask,mikegraham/dask,pombredanne/dask,pombredanne/dask,clarkfitzg/dask,jayhetee/dask,cowlicks/dask,blaze/dask,jayhetee/dask,cpcloud/dask,jcrist/dask,mraspaud/dask,jakirkham/dask,jakirkham/dask,ContinuumIO/dask,mrocklin/dask,chrisbarber/dask,dask/dask,ssanderson/dask,PhE/dask,dask/dask,PhE/dask,clarkfitzg/dask,gameduell/dask,ContinuumIO/dask,vikhyat/dask,wiso/dask,ssanderson/dask,mraspaud/dask,jcrist/dask | ---
+++
@@ -16,9 +16,9 @@
unicode = str
long = int
def apply(func, args, kwargs=None):
- if not isinstance(args, list) and kwargs is None:
+ if not isinstance(args, list) and not isinstance(args, tuple) and kwargs is None:
return func(args)
- elif not isinstance(args, list):
+ elif not isinstance(args, list) and not isinstance(args, tuple):
return func(args, **kwargs)
elif kwargs:
return func(*args, **kwargs) |
6b4df3c1784cf2933933fc757c9a097909709ea1 | permachart/charter/forms.py | permachart/charter/forms.py | from collections import defaultdict
from django.http import QueryDict
from google.appengine.ext import db
from google.appengine.ext.db import djangoforms
from charter.models import Chart, ChartDataSet, DataRow
from charter.form_utils import BaseFormSet
class ChartForm(djangoforms.ModelForm):
class Meta:
model = Chart
exclude = ('data', 'user', 'hash',)
class DataSetForm(djangoforms.ModelForm):
class Meta:
model = ChartDataSet
exclude = ('previous_version',)
def __init__(self, *args, **kwargs):
foo = kwargs['instance'].data_rows
super(DataSetForm, self).__init__(*args, **kwargs)
class DataRowForm(djangoforms.ModelForm):
class Meta:
model = DataRow
class DataRowFormSet(BaseFormSet):
base_form = DataRowForm
| from collections import defaultdict
from django.http import QueryDict
from google.appengine.ext import db
from google.appengine.ext.db import djangoforms
from charter.models import Chart, ChartDataSet, DataRow
from charter.form_utils import BaseFormSet
class ChartForm(djangoforms.ModelForm):
class Meta:
model = Chart
exclude = ('data', 'user', 'hash','counter',)
class DataSetForm(djangoforms.ModelForm):
class Meta:
model = ChartDataSet
exclude = ('previous_version',)
def __init__(self, *args, **kwargs):
foo = kwargs['instance'].data_rows
super(DataSetForm, self).__init__(*args, **kwargs)
class DataRowForm(djangoforms.ModelForm):
class Meta:
model = DataRow
class DataRowFormSet(BaseFormSet):
base_form = DataRowForm
| Exclude counter from chart form | Exclude counter from chart form
| Python | bsd-3-clause | justinabrahms/permachart,justinabrahms/permachart | ---
+++
@@ -8,7 +8,7 @@
class ChartForm(djangoforms.ModelForm):
class Meta:
model = Chart
- exclude = ('data', 'user', 'hash',)
+ exclude = ('data', 'user', 'hash','counter',)
class DataSetForm(djangoforms.ModelForm):
class Meta: |
861ae4cfe6148838ac0d7e1ceaa2efd5fbb49a8b | recipes/android/src/android/__init__.py | recipes/android/src/android/__init__.py | # legacy import
from android._android import *
import os
import android.apk as apk
expansion = os.environ.get("ANDROID_EXPANSION", None)
assets = android.apk.APK(apk=expansion)
| # legacy import
from android._android import *
import os
import android.apk as apk
expansion = os.environ.get("ANDROID_EXPANSION", None)
assets = apk.APK(apk=expansion)
| Use the version of apk we've imported. | Use the version of apk we've imported.
| Python | lgpl-2.1 | renpytom/python-for-android,renpytom/python-for-android,renpytom/python-for-android,renpytom/python-for-android,renpytom/python-for-android,renpytom/python-for-android | ---
+++
@@ -5,5 +5,5 @@
import android.apk as apk
expansion = os.environ.get("ANDROID_EXPANSION", None)
-assets = android.apk.APK(apk=expansion)
+assets = apk.APK(apk=expansion)
|
d9477dc81b16d572a16ae3578eafd965e8d9fb25 | test/win/gyptest-link-pdb.py | test/win/gyptest-link-pdb.py | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that the 'Profile' attribute in VCLinker is extracted properly.
"""
import TestGyp
import os
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
CHDIR = 'linker-flags'
test.run_gyp('program-database.gyp', chdir=CHDIR)
test.build('program-database.gyp', test.ALL, chdir=CHDIR)
def FindFile(pdb):
full_path = test.built_file_path(pdb, chdir=CHDIR)
return os.path.isfile(full_path)
# Verify the specified PDB is created when ProgramDatabaseFile
# is provided.
if not FindFile('name_set.pdb'):
test.fail_test()
else:
test.pass_test() | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that the 'Profile' attribute in VCLinker is extracted properly.
"""
import TestGyp
import os
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
CHDIR = 'linker-flags'
test.run_gyp('program-database.gyp', chdir=CHDIR)
test.build('program-database.gyp', test.ALL, chdir=CHDIR)
def FindFile(pdb):
full_path = test.built_file_path(pdb, chdir=CHDIR)
return os.path.isfile(full_path)
# Verify the specified PDB is created when ProgramDatabaseFile
# is provided.
if not FindFile('name_set.pdb'):
test.fail_test()
else:
test.pass_test()
| Insert empty line at to fix patch. | Insert empty line at to fix patch.
gyptest-link-pdb.py was checked in without a blank line. This appears
to cause a patch issue with the try bots. This CL is only a whitespace
change to attempt to fix that problem.
SEE:
patching file test/win/gyptest-link-pdb.py
Hunk #1 FAILED at 26.
1 out of 1 hunk FAILED -- saving rejects to file test/win/gyptest-link-pdb.py.rej
===================================================================
--- test/win/gyptest-link-pdb.py (revision 1530)
+++ test/win/gyptest-link-pdb.py (working copy)
@@ -26,7 +26,9 @@
# Verify the specified PDB is created when ProgramDatabaseFile
# is provided.
- if not FindFile('name_set.pdb'):
+ if not FindFile('name_outdir.pdb'):
test.fail_test()
- else:
- test.pass_test()
\ No newline at end of file
+ if not FindFile('name_proddir.pdb'):
+ test.fail_test()
+
+ test.pass_test()
Index: test/win/linker-flags/program-database.gyp
TBR=bradnelson@chromium.org
Review URL: https://codereview.chromium.org/11368061 | Python | bsd-3-clause | witwall/gyp,witwall/gyp,witwall/gyp,witwall/gyp,witwall/gyp | |
1dca7eeb036423d1d5889e5ec084f9f91f90eb74 | spacy/tests/regression/test_issue957.py | spacy/tests/regression/test_issue957.py | import pytest
from ... import load as load_spacy
def test_issue913(en_tokenizer):
'''Test that spaCy doesn't hang on many periods.'''
string = '0'
for i in range(1, 100):
string += '.%d' % i
doc = en_tokenizer(string)
# Don't want tests to fail if they haven't installed pytest-timeout plugin
try:
test_issue913 = pytest.mark.timeout(5)(test_issue913)
except NameError:
pass
| from __future__ import unicode_literals
import pytest
from ... import load as load_spacy
def test_issue957(en_tokenizer):
'''Test that spaCy doesn't hang on many periods.'''
string = '0'
for i in range(1, 100):
string += '.%d' % i
doc = en_tokenizer(string)
# Don't want tests to fail if they haven't installed pytest-timeout plugin
try:
test_issue913 = pytest.mark.timeout(5)(test_issue913)
except NameError:
pass
| Add unicode declaration on new regression test | Add unicode declaration on new regression test
| Python | mit | honnibal/spaCy,raphael0202/spaCy,raphael0202/spaCy,oroszgy/spaCy.hu,honnibal/spaCy,honnibal/spaCy,aikramer2/spaCy,aikramer2/spaCy,recognai/spaCy,recognai/spaCy,raphael0202/spaCy,Gregory-Howard/spaCy,Gregory-Howard/spaCy,recognai/spaCy,recognai/spaCy,explosion/spaCy,Gregory-Howard/spaCy,oroszgy/spaCy.hu,recognai/spaCy,Gregory-Howard/spaCy,explosion/spaCy,spacy-io/spaCy,raphael0202/spaCy,oroszgy/spaCy.hu,aikramer2/spaCy,honnibal/spaCy,oroszgy/spaCy.hu,oroszgy/spaCy.hu,explosion/spaCy,spacy-io/spaCy,explosion/spaCy,aikramer2/spaCy,spacy-io/spaCy,aikramer2/spaCy,aikramer2/spaCy,explosion/spaCy,Gregory-Howard/spaCy,Gregory-Howard/spaCy,raphael0202/spaCy,oroszgy/spaCy.hu,spacy-io/spaCy,spacy-io/spaCy,raphael0202/spaCy,explosion/spaCy,recognai/spaCy,spacy-io/spaCy | ---
+++
@@ -1,8 +1,10 @@
+from __future__ import unicode_literals
+
import pytest
from ... import load as load_spacy
-def test_issue913(en_tokenizer):
+def test_issue957(en_tokenizer):
'''Test that spaCy doesn't hang on many periods.'''
string = '0'
for i in range(1, 100): |
934eeaf4fcee84f22c4f58bdebc1d99ca5e7a31d | tests/rules/test_git_push.py | tests/rules/test_git_push.py | import pytest
from thefuck.rules.git_push import match, get_new_command
from tests.utils import Command
@pytest.fixture
def stderr():
return '''fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
'''
def test_match(stderr):
assert match(Command('git push', stderr=stderr))
assert match(Command('git push master', stderr=stderr))
assert not match(Command('git push master'))
assert not match(Command('ls', stderr=stderr))
def test_get_new_command(stderr):
assert get_new_command(Command('git push', stderr=stderr))\
== "git push --set-upstream origin master"
assert get_new_command(Command('git push --quiet', stderr=stderr))\
== "git push --set-upstream origin master --quiet"
| import pytest
from thefuck.rules.git_push import match, get_new_command
from tests.utils import Command
@pytest.fixture
def stderr():
return '''fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
'''
def test_match(stderr):
assert match(Command('git push', stderr=stderr))
assert match(Command('git push master', stderr=stderr))
assert not match(Command('git push master'))
assert not match(Command('ls', stderr=stderr))
def test_get_new_command(stderr):
assert get_new_command(Command('git push', stderr=stderr))\
== "git push --set-upstream origin master"
assert get_new_command(Command('git push -u origin', stderr=stderr))\
== "git push --set-upstream origin master"
assert get_new_command(Command('git push --set-upstream origin', stderr=stderr))\
== "git push --set-upstream origin master"
assert get_new_command(Command('git push --quiet', stderr=stderr))\
== "git push --set-upstream origin master --quiet"
| Test that `git push -u origin` still works | Test that `git push -u origin` still works
This was broken by https://github.com/nvbn/thefuck/pull/538
| Python | mit | nvbn/thefuck,nvbn/thefuck,Clpsplug/thefuck,SimenB/thefuck,mlk/thefuck,SimenB/thefuck,Clpsplug/thefuck,scorphus/thefuck,scorphus/thefuck,mlk/thefuck | ---
+++
@@ -23,5 +23,9 @@
def test_get_new_command(stderr):
assert get_new_command(Command('git push', stderr=stderr))\
== "git push --set-upstream origin master"
+ assert get_new_command(Command('git push -u origin', stderr=stderr))\
+ == "git push --set-upstream origin master"
+ assert get_new_command(Command('git push --set-upstream origin', stderr=stderr))\
+ == "git push --set-upstream origin master"
assert get_new_command(Command('git push --quiet', stderr=stderr))\
== "git push --set-upstream origin master --quiet" |
18e6f40dcd6cf675f26197d6beb8a3f3d9064b1e | app.py | app.py | import tornado.ioloop
import tornado.web
from tornado.websocket import WebSocketHandler
from tornado import template
class MainHandler(tornado.web.RequestHandler):
DEMO_TURN = {
'player_id': 'abc',
'player_turn': 1,
'card': {
'id': 'card_1',
'name': 'Card Name',
'image': None,
'description': 'This is a card',
'attributes': {
'power': 9001,
'strength': 100,
'speed': 50,
'agility': 20,
'smell': 4
}
}
}
def get(self):
self.write(application.template_loader.load("index.html").generate(turn=self.DEMO_TURN))
class SocketHandler(WebSocketHandler):
def open(self):
print("WebSocket opened")
def on_message(self, message):
self.write_message(u"You said: " + message)
def on_close(self):
print("WebSocket closed")
application = tornado.web.Application([
(r"/", MainHandler),
(r"/sockets", SocketHandler),
(r"/content/(.*)", tornado.web.StaticFileHandler, {"path": "static"})
#(r"/", MainHandler),
])
if __name__ == "__main__":
application.listen(8888)
application.template_loader = template.Loader("templates")
tornado.ioloop.IOLoop.current().start() | import json
import tornado.ioloop
import tornado.web
from tornado.websocket import WebSocketHandler
from tornado import template
class MainHandler(tornado.web.RequestHandler):
DEMO_TURN = {
'player_id': 'abc',
'player_turn': 1,
'card': {
'id': 'card_1',
'name': 'Card Name',
'image': None,
'description': 'This is a card',
'attributes': {
'power': 9001,
'strength': 100,
'speed': 50,
'agility': 20,
'smell': 4
}
}
}
def get(self):
self.write(application.template_loader.load("index.html").generate(turn=self.DEMO_TURN))
class SocketHandler(WebSocketHandler):
def open(self):
print("WebSocket opened")
def on_message(self, message):
self.write_message(json.dumps(self.DEMO_TURN))
def on_close(self):
print("WebSocket closed")
application = tornado.web.Application([
(r"/", MainHandler),
(r"/sockets", SocketHandler),
(r"/content/(.*)", tornado.web.StaticFileHandler, {"path": "static"})
#(r"/", MainHandler),
])
if __name__ == "__main__":
application.listen(8888)
application.template_loader = template.Loader("templates")
tornado.ioloop.IOLoop.current().start() | Send demo turn over websocket. | Send demo turn over websocket.
| Python | apache-2.0 | ohmygourd/dewbrick,ohmygourd/dewbrick,ohmygourd/dewbrick | ---
+++
@@ -1,3 +1,4 @@
+import json
import tornado.ioloop
import tornado.web
from tornado.websocket import WebSocketHandler
@@ -33,7 +34,7 @@
print("WebSocket opened")
def on_message(self, message):
- self.write_message(u"You said: " + message)
+ self.write_message(json.dumps(self.DEMO_TURN))
def on_close(self):
print("WebSocket closed") |
5b162e1f6f1512e72257e1e5fa01435f4529537f | app.py | app.py | from flask import Flask
import os
app = Flask(__name__)
app.debug = True
# Secret Key setting based on debug setting
if app.debug:
app.secret_key = "T3st_s3cret_k3y!~$@"
else:
app.secret_key = os.urandom(30)
@app.route("/domain", methods=["GET", "POST"])
def domain():
if request.method == "GET":
# search domain
pass
elif request.method == "POST":
# register domain
pass
@app.route("/")
def index():
return "Index Page"
if __name__ == "__main__":
app.run(host="0.0.0.0", threaded=True)
| from flask import Flask, request, render_template
import os
app = Flask(__name__)
app.debug = True
# Secret Key setting based on debug setting
if app.debug:
app.secret_key = "T3st_s3cret_k3y!~$@"
else:
app.secret_key = os.urandom(30)
@app.route("/domain", methods=["GET", "POST"])
def domain():
if request.method == "GET":
# search domain
pass
elif request.method == "POST":
# register domain
pass
@app.route("/")
def index():
return render_template("index.html")
if __name__ == "__main__":
app.run(host="0.0.0.0", threaded=True)
| Add render in index page | Add render in index page
| Python | apache-2.0 | bunseokbot/proxy_register,bunseokbot/proxy_register | ---
+++
@@ -1,4 +1,4 @@
-from flask import Flask
+from flask import Flask, request, render_template
import os
@@ -26,7 +26,7 @@
@app.route("/")
def index():
- return "Index Page"
+ return render_template("index.html")
if __name__ == "__main__": |
2e8956d6401daef2793724dfb981e6b41d685457 | weatbag/tiles/s1e1.py | weatbag/tiles/s1e1.py | # First bug quest tile.
from weatbag import words
import weatbag
class Tile:
def __init__(self):
self.bug_is_here = True
self.first_visit = True
self.hasnt_gone_south = True
pass
def describe(self):
print("There is a stream here. "
"It runs from South to North.")
if self.bug_is_here:
print("You see a huge, ugly bug rush past you, "
"following the river South.")
self.bug_is_here = False
else:
print("You remember this is where you saw that bug going South.")
# Nothing to do here.
def action(self, player, do):
pass
# Player can only exit the bug quest going back North.
# Player gets different messages the first time he
# exits this tile, depending on their direction.
def leave(self, player, direction):
restricted_directions = { 'w', 'e' }
if direction in restricted_directions:
print("The undergrowth in that direction "
"is impassable. You turn back.")
return False
elif direction == 's' and hasnt_gone_south:
print("Bugs are the enemy and must be crushed!\n"
"So you decide to follow the bug upstream.")
input()
self.first_visit = False
self.hasnt_gone_south = False
return True
else:
if self.first_visit:
print("Bugs do not interest you very much.\n"
"Lets get out of here.")
self.first_visit = False
input()
return True
| # First bug quest tile.
from weatbag import words
import weatbag
class Tile:
def __init__(self):
self.bug_is_here = True
self.first_visit = True
self.hasnt_gone_south = True
pass
def describe(self):
print("There is a stream here. "
"It runs from South to North.")
if self.bug_is_here:
print("You see a huge, ugly bug rush past you, "
"following the river South.")
self.bug_is_here = False
else:
print("You remember this is where you saw that bug going South.")
# Nothing to do here.
def action(self, player, do):
pass
# Player can only exit the bug quest going back North.
# Player gets different messages the first time he
# exits this tile, depending on his direction.
def leave(self, player, direction):
restricted_directions = { 'w', 'e' }
if direction in restricted_directions:
print("The undergrowth in that direction "
"is impassable. You turn back.")
return False
elif direction == 's' and hasnt_gone_south:
print("Bugs are the enemy and must be crushed!\n"
"So you decide to follow the bug upstream.")
input()
self.first_visit = False
self.hasnt_gone_south = False
return True
else:
if self.first_visit:
print("Bugs do not interest you very much.\n"
"Lets get out of here.")
self.first_visit = False
input()
return True
| Revert "Made a sexist comment more PC." | Revert "Made a sexist comment more PC."
This reverts commit 3632fc802ba9c537653e633b12d9430c7ed3f0b6.
| Python | mit | jantuomi/weatbag,takluyver/weatbag | ---
+++
@@ -26,7 +26,7 @@
# Player can only exit the bug quest going back North.
# Player gets different messages the first time he
- # exits this tile, depending on their direction.
+ # exits this tile, depending on his direction.
def leave(self, player, direction):
restricted_directions = { 'w', 'e' }
if direction in restricted_directions: |
d8c6f429c875a2cfdc5d520d91ea9d3a37b33ac9 | bot.py | bot.py | import praw
import urllib
import cv2, numpy as np
DOWNSCALE = 2
r = praw.Reddit('/u/powderblock Glasses Bot')
foundImage = False
for post in r.get_subreddit('all').get_new(limit=15):
if "imgur.com" in post.url and (".jpg" in post.url or ".png" in post.url):
print str(post.url)
foundImage = True
break
if foundImage:
urllib.urlretrieve(str(post.url), "image.jpg")
# load the image we want to detect features on
frame = cv2.imread('image.jpg')
minisize = (frame.shape[1]/DOWNSCALE,frame.shape[0]/DOWNSCALE)
miniframe = cv2.resize(frame, minisize)
cv2.imshow("Loading Images From a Buffer From a URL", miniframe)
while True:
# key handling (to close window)
key = cv2.waitKey(20)
if key in [27, ord('Q'), ord('q')]: # exit on ESC
cv2.destroyWindow("Facial Features Test")
break
if not foundImage:
print("No Image found.")
| import praw
import urllib
import cv2, numpy as np
from PIL import Image
DOWNSCALE = 2
r = praw.Reddit('/u/powderblock Glasses Bot')
foundImage = False
for post in r.get_subreddit('all').get_new(limit=15):
if "imgur.com" in post.url and (".jpg" in post.url or ".png" in post.url):
print str(post.url)
foundImage = True
break
if foundImage:
response = urllib.urlopen(str(post.url))
# load the image we want to detect features on
# Convert rawImage to Mat
filearray = np.asarray(bytearray(response.read()), dtype=np.uint8)
frame = cv2.imdecode(filearray, cv2.CV_LOAD_IMAGE_UNCHANGED)
minisize = (frame.shape[1]/DOWNSCALE,frame.shape[0]/DOWNSCALE)
miniframe = cv2.resize(frame, minisize)
cv2.imshow("Loading Image Buffer From a URL", miniframe)
while True:
# key handling (to close window)
key = cv2.waitKey(20)
if key in [27, ord('Q'), ord('q')]: # exit on ESC
cv2.destroyWindow("Loading Image Buffer From a URL")
break
if not foundImage:
print("No Image found.")
| Load image from URL into buffer | Load image from URL into buffer
Feed image into array, convert it, display it.
| Python | mit | powderblock/DealWithItReddit,porglezomp/PyDankReddit,powderblock/PyDankReddit | ---
+++
@@ -1,13 +1,14 @@
import praw
import urllib
import cv2, numpy as np
+from PIL import Image
DOWNSCALE = 2
r = praw.Reddit('/u/powderblock Glasses Bot')
foundImage = False
-
+
for post in r.get_subreddit('all').get_new(limit=15):
if "imgur.com" in post.url and (".jpg" in post.url or ".png" in post.url):
print str(post.url)
@@ -15,18 +16,21 @@
break
if foundImage:
- urllib.urlretrieve(str(post.url), "image.jpg")
+ response = urllib.urlopen(str(post.url))
# load the image we want to detect features on
- frame = cv2.imread('image.jpg')
+ # Convert rawImage to Mat
+ filearray = np.asarray(bytearray(response.read()), dtype=np.uint8)
+ frame = cv2.imdecode(filearray, cv2.CV_LOAD_IMAGE_UNCHANGED)
minisize = (frame.shape[1]/DOWNSCALE,frame.shape[0]/DOWNSCALE)
miniframe = cv2.resize(frame, minisize)
- cv2.imshow("Loading Images From a Buffer From a URL", miniframe)
+ cv2.imshow("Loading Image Buffer From a URL", miniframe)
while True:
# key handling (to close window)
key = cv2.waitKey(20)
if key in [27, ord('Q'), ord('q')]: # exit on ESC
- cv2.destroyWindow("Facial Features Test")
+ cv2.destroyWindow("Loading Image Buffer From a URL")
break
+
if not foundImage:
print("No Image found.") |
bf08dfaa3384c67dbaf86f31006c1cea462ae7db | bot.py | bot.py | import discord
import commands
bot = discord.Client()
@bot.event
def on_ready():
print('Logged in as:')
print('Username: ' + bot.user.name)
print('ID: ' + bot.user.id)
print('------')
@bot.event
def on_message(message):
commands.dispatch_messages(bot, message)
if __name__ == '__main__':
commands.load_config()
bot.login(commands.config['username'], commands.config['password'])
bot.run()
| import discord
import commands
bot = discord.Client()
@bot.event
def on_ready():
print('Logged in as:')
print('Username: ' + bot.user.name)
print('ID: ' + bot.user.id)
print('------')
@bot.event
def on_message(message):
commands.dispatch_messages(bot, message)
@bot.event
def on_member_join(member):
if member.server.id == '86177841854566400':
# check if this is /r/Splatoon
channel = discord.utils.find(lambda c: c.id == '86177841854566400', member.server.channels)
if channel is not None:
bot.send_message(channel, 'Welcome {}, to the /r/Splatoon Discord.'.format(member.name))
if __name__ == '__main__':
commands.load_config()
bot.login(commands.config['username'], commands.config['password'])
bot.run()
| Add welcome message for /r/splatoon chat. | Add welcome message for /r/splatoon chat.
| Python | mpl-2.0 | Rapptz/RoboDanny,haitaka/DroiTaka | ---
+++
@@ -14,6 +14,14 @@
def on_message(message):
commands.dispatch_messages(bot, message)
+@bot.event
+def on_member_join(member):
+ if member.server.id == '86177841854566400':
+ # check if this is /r/Splatoon
+ channel = discord.utils.find(lambda c: c.id == '86177841854566400', member.server.channels)
+ if channel is not None:
+ bot.send_message(channel, 'Welcome {}, to the /r/Splatoon Discord.'.format(member.name))
+
if __name__ == '__main__':
commands.load_config()
bot.login(commands.config['username'], commands.config['password']) |
48402464f8e1feb9b50c0c98003bc808a7c33ed9 | card_match.py | card_match.py | import pyglet
def draw_card():
pyglet.graphics.draw(4, pyglet.gl.GL_QUADS,
('v2i',
(10, 15,
10, 35,
20, 35,
20, 15)
)
)
window = pyglet.window.Window()
label = pyglet.text.Label('Hello, world',
font_name='Times New Roman',
font_size=36,
x=window.width // 2, y=window.height // 2,
anchor_x='center', anchor_y='center')
# Set up event handlers
# We need to do this after declaring the variables the handlers use
# but before we start running the app
@window.event
def on_draw():
window.clear()
label.draw()
draw_card()
pyglet.app.run()
| import pyglet
card_vertices = [
0, 0,
0, 1,
1, 1,
1, 0
]
def draw_card(window):
pyglet.graphics.draw(4, pyglet.gl.GL_QUADS,
('v2i',
(get_scaled_vertices(window))
)
)
def get_scale(window):
return 100, 100 # Place holder
def get_scaled_vertices(window):
scale = get_scale(window)
scaled_vertices = []
for i in range(0, len(card_vertices), 2):
scaled_vertices.append(card_vertices[i] * scale[0])
scaled_vertices.append(card_vertices[i + 1] * scale[1])
return scaled_vertices
window = pyglet.window.Window()
label = pyglet.text.Label('Hello, world',
font_name='Times New Roman',
font_size=36,
x=window.width // 2, y=window.height // 2,
anchor_x='center', anchor_y='center')
# Set up event handlers
# We need to do this after declaring the variables the handlers use
# but before we start running the app
@window.event
def on_draw():
window.clear()
label.draw()
draw_card(window)
pyglet.app.run()
| Add skelton code for scaling card size | Add skelton code for scaling card size
| Python | mit | SingingTree/CardMatchPyglet | ---
+++
@@ -1,15 +1,33 @@
import pyglet
-def draw_card():
+card_vertices = [
+ 0, 0,
+ 0, 1,
+ 1, 1,
+ 1, 0
+]
+
+
+def draw_card(window):
pyglet.graphics.draw(4, pyglet.gl.GL_QUADS,
('v2i',
- (10, 15,
- 10, 35,
- 20, 35,
- 20, 15)
+ (get_scaled_vertices(window))
)
)
+
+
+def get_scale(window):
+ return 100, 100 # Place holder
+
+
+def get_scaled_vertices(window):
+ scale = get_scale(window)
+ scaled_vertices = []
+ for i in range(0, len(card_vertices), 2):
+ scaled_vertices.append(card_vertices[i] * scale[0])
+ scaled_vertices.append(card_vertices[i + 1] * scale[1])
+ return scaled_vertices
window = pyglet.window.Window()
@@ -28,7 +46,7 @@
def on_draw():
window.clear()
label.draw()
- draw_card()
+ draw_card(window)
pyglet.app.run() |
c3eac81cffbfbb2cc00629d6c773e7b2e985d071 | cider/_lib.py | cider/_lib.py | def lazyproperty(fn):
@property
def _lazyproperty(self):
attr = "_" + fn.__name__
if not hasattr(self, attr):
setattr(self, attr, fn(self))
return getattr(self, attr)
return _lazyproperty
| from functools import wraps
def lazyproperty(fn):
@property
@wraps(fn)
def _lazyproperty(self):
attr = "_" + fn.__name__
if not hasattr(self, attr):
setattr(self, attr, fn(self))
return getattr(self, attr)
return _lazyproperty
| Fix lazyproperty decorator to preserve property attribute | Fix lazyproperty decorator to preserve property attribute
| Python | mit | msanders/cider | ---
+++
@@ -1,5 +1,8 @@
+from functools import wraps
+
def lazyproperty(fn):
@property
+ @wraps(fn)
def _lazyproperty(self):
attr = "_" + fn.__name__
if not hasattr(self, attr): |
f8d793eef586f2097a9a80e79c497204d2f6ffa0 | banner/models.py | banner/models.py | from django.db import models
from django.utils.translation import ugettext_lazy as _
from jmbo.models import Image, ModelBase
from link.models import Link
from banner.styles import BANNER_STYLE_CLASSES
class Banner(ModelBase):
"""Base class for all banners"""
link = models.ForeignKey(
Link, help_text=_("Link to which this banner should redirect.")
)
background_image = models.OneToOneField(
Image, null=True, blank=True
)
style = models.CharField(choices=[(klass.__name__, klass.__name__) for klass in BANNER_STYLE_CLASSES], max_length=128)
class Button(models.Model):
"""Call to action handling"""
text = models.CharField(
max_length=60,
help_text=_("The text to be displayed as the button label")
)
link = models.ForeignKey(
Link, help_text=_("CTA link for this button"), null=True, blank=True
)
banner = models.ManyToManyField(to=Banner, related_name="buttons", null=True, blank=True, through="ButtonOrder")
class ButtonOrder(models.Model):
banner = models.ForeignKey(Banner)
button = models.ForeignKey(Button)
position = models.PositiveIntegerField(default=0)
class Meta(object):
ordering = ["position"]
| from django.db import models
from django.utils.translation import ugettext_lazy as _
from jmbo.models import Image, ModelBase
from link.models import Link
from banner.styles import BANNER_STYLE_CLASSES
class Banner(ModelBase):
"""Base class for all banners"""
link = models.ForeignKey(
Link, help_text=_("Link to which this banner should redirect."),
blank=True, null=True
)
background_image = models.OneToOneField(
Image, null=True, blank=True
)
style = models.CharField(choices=[(klass.__name__, klass.__name__) for klass in BANNER_STYLE_CLASSES], max_length=128)
class Button(models.Model):
"""Call to action handling"""
text = models.CharField(
max_length=60,
help_text=_("The text to be displayed as the button label")
)
link = models.ForeignKey(
Link, help_text=_("CTA link for this button"), null=True, blank=True
)
banner = models.ManyToManyField(to=Banner, related_name="buttons", null=True, blank=True, through="ButtonOrder")
class ButtonOrder(models.Model):
banner = models.ForeignKey(Banner)
button = models.ForeignKey(Button)
position = models.PositiveIntegerField(default=0)
class Meta(object):
ordering = ["position"]
| Make link on Banner model nullable | Make link on Banner model nullable
| Python | bsd-3-clause | praekelt/jmbo-banner,praekelt/jmbo-banner | ---
+++
@@ -10,7 +10,8 @@
class Banner(ModelBase):
"""Base class for all banners"""
link = models.ForeignKey(
- Link, help_text=_("Link to which this banner should redirect.")
+ Link, help_text=_("Link to which this banner should redirect."),
+ blank=True, null=True
)
background_image = models.OneToOneField(
Image, null=True, blank=True |
b18cea920e5deea57adabd98872f0a6fa0490e33 | rover.py | rover.py | class Rover:
compass = ['N', 'E', 'S', 'W']
def __init__(self, x=0, y=0, direction='N'):
self.x = x
self.y = y
self.direction = direction
@property
def position(self):
return self.x, self.y, self.direction
@property
def compass_index(self):
return next(i for i in range(0, len(self.compass)) if self.compass[i] == self.direction)
@property
def axis(self):
# 0 if pointing along x axis
# 1 if pointing along y axis
return (self.compass_index + 1) % 2
@property
def multiplier(self):
# 1 if pointing N or E
# -1 if pointing S or W
if self.compass_index <= 1:
return 1
else:
return -1
def set_position(self, x=None, y=None, direction=None):
if x is not None:
self.x = x
if y is not None:
self.y = y
if direction is not None:
self.direction = direction
def move(self, *args):
for command in args:
if command == 'F':
# Move forward command
if self.compass_index < 2:
# Upper right quadrant, increasing x/y
pass
else:
pass
| class Rover:
compass = ['N', 'E', 'S', 'W']
def __init__(self, x=0, y=0, direction='N'):
self.x = x
self.y = y
self.direction = direction
@property
def position(self):
return self.x, self.y, self.direction
@property
def compass_index(self):
return next(i for i in range(0, len(self.compass)) if self.compass[i] == self.direction)
@property
def axis(self):
# 0 if pointing along x axis
# 1 if pointing along y axis
return (self.compass_index + 1) % 2
@property
def multiplier(self):
# 1 if pointing N or E
# -1 if pointing S or W
if self.compass_index <= 1:
return 1
else:
return -1
def set_position(self, x=None, y=None, direction=None):
if x is not None:
self.x = x
if y is not None:
self.y = y
if direction is not None:
self.direction = direction
def move(self, *args):
for command in args:
if command == 'F':
# Move forward command
if self.axis == 0:
# Working on X axis
self.x = self.x + 1 * self.multiplier
else:
# Working on Y axis
self.y = self.y + 1 * self.multiplier
else:
pass
| Fix failing move forward tests | Fix failing move forward tests
| Python | mit | authentik8/rover | ---
+++
@@ -45,8 +45,11 @@
for command in args:
if command == 'F':
# Move forward command
- if self.compass_index < 2:
- # Upper right quadrant, increasing x/y
- pass
+ if self.axis == 0:
+ # Working on X axis
+ self.x = self.x + 1 * self.multiplier
+ else:
+ # Working on Y axis
+ self.y = self.y + 1 * self.multiplier
else:
pass |
e0ba0ea428fb4691b43d9be91b22105ce5aa0dc6 | alg_selection_sort.py | alg_selection_sort.py | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def selection_sort(nums):
"""Selection Sort algortihm.
Time complexity: O(n^2).
Space complexity: O(1).
"""
# Start from the last num, select next max num to swap.
for i in reversed(range(len(nums))):
i_max = 0
for j in range(1, i + 1):
if nums[j] > nums[i_max]:
i_max = j
nums[i_max], nums[i] = nums[i], nums[i_max]
def main():
nums = [54, 26, 93, 17, 77, 31, 44, 55, 20]
print('By selection sort: ')
selection_sort(nums)
print(nums)
if __name__ == '__main__':
main()
| from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def selection_sort(nums):
"""Selection sort algortihm.
Time complexity: O(n^2).
Space complexity: O(1).
"""
# Start from pos=n-1,..1, select next max num to swap with its num.
for i in reversed(range(1, len(nums))):
i_max = 0
for j in range(1, i + 1):
if nums[j] > nums[i_max]:
i_max = j
nums[i_max], nums[i] = nums[i], nums[i_max]
def main():
nums = [54, 26, 93, 17, 77, 31, 44, 55, 20]
print('By selection sort: ')
selection_sort(nums)
print(nums)
if __name__ == '__main__':
main()
| Revise docstring & comment, reduce redundant for loop | Revise docstring & comment, reduce redundant for loop
| Python | bsd-2-clause | bowen0701/algorithms_data_structures | ---
+++
@@ -4,13 +4,13 @@
def selection_sort(nums):
- """Selection Sort algortihm.
+ """Selection sort algortihm.
Time complexity: O(n^2).
Space complexity: O(1).
"""
- # Start from the last num, select next max num to swap.
- for i in reversed(range(len(nums))):
+ # Start from pos=n-1,..1, select next max num to swap with its num.
+ for i in reversed(range(1, len(nums))):
i_max = 0
for j in range(1, i + 1):
if nums[j] > nums[i_max]: |
7d9f5efb915c179bc655a9cead2870729a45ed90 | setup.py | setup.py | #!/usr/bin/env python
# Require setuptools. See http://pypi.python.org/pypi/setuptools for
# installation instructions, or run the ez_setup script found at
# http://peak.telecommunity.com/dist/ez_setup.py
from setuptools import setup, find_packages
setup(
name = "cobe",
version = "2.1.1",
author = "Peter Teichman",
author_email = "peter@teichman.org",
url = "http://wiki.github.com/pteichman/cobe/",
description = "Markov chain based text generator library and chatbot",
packages = ["cobe"],
test_suite = "tests",
install_requires = [
"PyStemmer==1.3.0",
"argparse==1.2.1",
"irc==8.9.1"
],
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Artificial Intelligence"
],
entry_points = {
"console_scripts" : [
"cobe = cobe.control:main"
]
}
)
| #!/usr/bin/env python
# Require setuptools. See http://pypi.python.org/pypi/setuptools for
# installation instructions, or run the ez_setup script found at
# http://peak.telecommunity.com/dist/ez_setup.py
from setuptools import setup, find_packages
setup(
name = "cobe",
version = "2.1.2",
author = "Peter Teichman",
author_email = "peter@teichman.org",
url = "http://wiki.github.com/pteichman/cobe/",
description = "Markov chain based text generator library and chatbot",
packages = ["cobe"],
test_suite = "tests",
install_requires = [
"PyStemmer==1.3.0",
"argparse==1.2.1",
"irc==12.1.1"
],
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Artificial Intelligence"
],
entry_points = {
"console_scripts" : [
"cobe = cobe.control:main"
]
}
)
| Update irc to 12.1.1, bump cobe version to 2.1.2 | Update irc to 12.1.1, bump cobe version to 2.1.2
The irc library update fixes issue #20.
| Python | mit | meska/cobe,pteichman/cobe,tiagochiavericosta/cobe,LeMagnesium/cobe,meska/cobe,pteichman/cobe,LeMagnesium/cobe,DarkMio/cobe,tiagochiavericosta/cobe,DarkMio/cobe | ---
+++
@@ -7,7 +7,7 @@
setup(
name = "cobe",
- version = "2.1.1",
+ version = "2.1.2",
author = "Peter Teichman",
author_email = "peter@teichman.org",
url = "http://wiki.github.com/pteichman/cobe/",
@@ -18,7 +18,7 @@
install_requires = [
"PyStemmer==1.3.0",
"argparse==1.2.1",
- "irc==8.9.1"
+ "irc==12.1.1"
],
classifiers = [ |
aba663dea0b0027cb4d92b423c2b2f7327738cc8 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
import sys
import os
import glob
setup(name = "scilifelab",
version = "0.2.2",
author = "Science for Life Laboratory",
author_email = "genomics_support@scilifelab.se",
description = "Useful scripts for use at SciLifeLab",
license = "MIT",
scripts = glob.glob('scripts/*.py') + glob.glob('scripts/bcbb_helpers/*.py') + ['scripts/pm'],
install_requires = [
"bcbio-nextgen >= 0.2",
"drmaa >= 0.5",
"sphinx >= 1.1.3",
"couchdb >= 0.8",
"reportlab >= 2.5",
"cement >= 2.0.2",
"mock",
"PIL",
"pyPdf",
"logbook >= 0.4",
# pandas screws up installation; tries to look for local site
# packages and not in virtualenv
#"pandas >= 0.9",
"biopython",
"rst2pdf",
#"psutil",
],
test_suite = 'nose.collector',
packages=find_packages(exclude=['tests']),
package_data = {'scilifelab':[
'data/grf/*',
'data/templates/*',
]}
)
os.system("git rev-parse --short --verify HEAD > ~/.scilifelab_version")
| #!/usr/bin/env python
from setuptools import setup, find_packages
import sys
import os
import glob
setup(name = "scilifelab",
version = "0.2.2",
author = "Science for Life Laboratory",
author_email = "genomics_support@scilifelab.se",
description = "Useful scripts for use at SciLifeLab",
license = "MIT",
scripts = glob.glob('scripts/*.py') + glob.glob('scripts/bcbb_helpers/*.py') + ['scripts/pm'],
install_requires = [
"bcbio-nextgen >= 0.2",
"drmaa >= 0.5",
"sphinx >= 1.1.3",
"couchdb >= 0.8",
"reportlab >= 2.5",
"cement >= 2.0.2",
"mock",
"PIL",
"pyPdf",
"logbook >= 0.4",
# pandas screws up installation; tries to look for local site
# packages and not in virtualenv
#"pandas >= 0.9",
"biopython",
"rst2pdf",
#"psutil",
],
test_suite = 'nose.collector',
packages=find_packages(exclude=['tests']),
package_data = {'scilifelab':[
'data/grf/*',
'data/templates/rst/*',
]}
)
os.system("git rev-parse --short --verify HEAD > ~/.scilifelab_version")
| Package data locations have changed for rst templates apparently | HotFix: Package data locations have changed for rst templates apparently
| Python | mit | jun-wan/scilifelab,SciLifeLab/scilifelab,SciLifeLab/scilifelab,senthil10/scilifelab,senthil10/scilifelab,SciLifeLab/scilifelab,jun-wan/scilifelab,kate-v-stepanova/scilifelab,SciLifeLab/scilifelab,senthil10/scilifelab,kate-v-stepanova/scilifelab,kate-v-stepanova/scilifelab,senthil10/scilifelab,kate-v-stepanova/scilifelab,jun-wan/scilifelab,jun-wan/scilifelab | ---
+++
@@ -33,7 +33,7 @@
packages=find_packages(exclude=['tests']),
package_data = {'scilifelab':[
'data/grf/*',
- 'data/templates/*',
+ 'data/templates/rst/*',
]}
)
|
d48ceb2364f463c725175010c3d29ea903dbcd1a | setup.py | setup.py | from distutils.core import setup
DESCRIPTION = """
Python money class with optional CLDR-backed locale-aware formatting and an extensible currency exchange solution.
"""
setup(
name='money',
description='Python Money Class',
# long_description=DESCRIPTION,
version='1.1.0-dev',
author='Carlos Palol',
author_email='carlos.palol@awarepixel.com',
url='https://github.com/carlospalol/money',
license='MIT',
packages=[
'money',
],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.3',
'Topic :: Software Development :: Libraries',
]
)
| from distutils.core import setup
DESCRIPTION = """
Python money class with optional CLDR-backed locale-aware formatting and an extensible currency exchange solution.
"""
SOURCE_ROOT = 'src'
# Python 2 backwards compatibility
if sys.version_info[0] == 2:
SOURCE_ROOT = 'src-py2'
setup(
name='money',
description='Python Money Class',
# long_description=DESCRIPTION,
version='1.1.0-dev',
author='Carlos Palol',
author_email='carlos.palol@awarepixel.com',
url='https://github.com/carlospalol/money',
license='MIT',
package_dir={'': SOURCE_ROOT},
packages=[
'money',
],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.3',
'Topic :: Software Development :: Libraries',
]
)
| Switch source root if py2 | Switch source root if py2
| Python | mit | carlospalol/money,Isendir/money | ---
+++
@@ -4,6 +4,13 @@
DESCRIPTION = """
Python money class with optional CLDR-backed locale-aware formatting and an extensible currency exchange solution.
"""
+
+SOURCE_ROOT = 'src'
+
+# Python 2 backwards compatibility
+if sys.version_info[0] == 2:
+ SOURCE_ROOT = 'src-py2'
+
setup(
name='money',
@@ -14,6 +21,7 @@
author_email='carlos.palol@awarepixel.com',
url='https://github.com/carlospalol/money',
license='MIT',
+ package_dir={'': SOURCE_ROOT},
packages=[
'money',
], |
f53675c17449d414eff9263faad8d18530c23b5d | setup.py | setup.py | from distutils.core import setup
setup(
name='boundary',
version='0.0.6',
url="https://github.com/boundary/boundary-api-cli",
author='David Gwartney',
author_email='davidg@boundary.com',
packages=['boundary',],
scripts=[
'bin/alarm-create',
'bin/alarm-list',
'bin/action-installed',
'bin/action-types',
'bin/hostgroup-create',
'bin/hostgroup-delete',
'bin/hostgroup-get',
'bin/hostgroup-list',
'bin/hostgroup-update',
'bin/measurement-create',
'bin/metric-create',
'bin/metric-delete',
'bin/metric-export',
'bin/metric-import',
'bin/metric-list',
'bin/metric-markdown',
'bin/metric-ref',
'bin/plugin-add',
'bin/plugin-get',
'bin/plugin-get-components',
'bin/plugin-list',
'bin/plugin-install',
'bin/plugin-installed',
'bin/plugin-remove',
'bin/plugin-uninstall',
'bin/relay-list',
'bin/user-get',
],
license='LICENSE.txt',
description='Command line interface to Boundary REST APIs',
long_description=open('README.txt').read(),
install_requires=[
"requests >= 2.3.0",
],
)
| from distutils.core import setup
setup(
name='boundary',
version='0.0.6',
url="https://github.com/boundary/boundary-api-cli",
author='David Gwartney',
author_email='davidg@boundary.com',
packages=['boundary',],
scripts=[
'bin/alarm-create',
'bin/alarm-list',
'bin/action-installed',
'bin/action-types',
'bin/hostgroup-create',
'bin/hostgroup-delete',
'bin/hostgroup-get',
'bin/hostgroup-list',
'bin/hostgroup-update',
'bin/measurement-create',
'bin/metric-create',
'bin/metric-delete',
'bin/metric-export',
'bin/metric-import',
'bin/metric-list',
'bin/metric-markdown',
'bin/metric-ref',
'bin/plugin-add',
'bin/plugin-get',
'bin/plugin-get-components',
'bin/plugin-list',
'bin/plugin-install',
'bin/plugin-installed',
'bin/plugin-remove',
'bin/plugin-uninstall',
'bin/relay-list',
'bin/user-get',
'src/main/scripts/metrics/metric-add',
],
license='LICENSE.txt',
description='Command line interface to Boundary REST APIs',
long_description=open('README.txt').read(),
install_requires=[
"requests >= 2.3.0",
],
)
| Add bash script to add measures | Add bash script to add measures
| Python | apache-2.0 | jdgwartney/boundary-api-cli,wcainboundary/boundary-api-cli,boundary/boundary-api-cli,jdgwartney/boundary-api-cli,jdgwartney/pulse-api-cli,boundary/boundary-api-cli,boundary/pulse-api-cli,boundary/pulse-api-cli,jdgwartney/pulse-api-cli,wcainboundary/boundary-api-cli | ---
+++
@@ -34,6 +34,7 @@
'bin/plugin-uninstall',
'bin/relay-list',
'bin/user-get',
+ 'src/main/scripts/metrics/metric-add',
],
license='LICENSE.txt',
description='Command line interface to Boundary REST APIs', |
f7ae33604d50250594c6fe55c1a83f70af9a68ae | 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/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,
)
| #!/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.7'
],
install_requires=[
'Django ==1.8.6',
'djangorestframework >=3.1.1',
'djangorestframework-gis >=0.8.1',
'django-filter >=0.9.2',
'djsonb >=0.1.7',
'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,
)
| Increment djsonb version to fix empty-query bug | Increment djsonb version to fix empty-query bug
| Python | mit | azavea/ashlar,flibbertigibbet/ashlar,flibbertigibbet/ashlar,azavea/ashlar | ---
+++
@@ -13,14 +13,14 @@
keywords='gis jsonschema',
packages=find_packages(exclude=['tests']),
dependency_links=[
- 'https://github.com/azavea/djsonb/tarball/develop#egg=djsonb-0.1.6'
+ 'https://github.com/azavea/djsonb/tarball/develop#egg=djsonb-0.1.7'
],
install_requires=[
'Django ==1.8.6',
'djangorestframework >=3.1.1',
'djangorestframework-gis >=0.8.1',
'django-filter >=0.9.2',
- 'djsonb >=0.1.6',
+ 'djsonb >=0.1.7',
'jsonschema >=2.4.0',
'psycopg2 >=2.6',
'django-extensions >=1.6.1', |
a9f51a8fb952bc8785af22e32e7d66c280a9bda5 | setup.py | setup.py | try:
import multiprocessing
except ImportError:
pass
import setuptools
import re
# read VERSION file
version = None
with open('VERSION', 'r') as version_file:
if version_file:
version = version_file.readline().strip()
if version and not re.match("[0-9]+\\.[0-9]+\\.[0-9]+", version):
version = None
if version:
print("Can't read version")
else:
setuptools.setup(name='Ryu SDN-IP', version=version)
| try:
import multiprocessing
except ImportError:
pass
import setuptools
import re
# read VERSION file
version = None
with open('VERSION', 'r') as version_file:
if version_file:
version = version_file.readline().strip()
if version and not re.match("[0-9]+\\.[0-9]+\\.[0-9]+", version):
version = None
if not version:
print("Can't read version")
else:
setuptools.setup(name='Ryu SDN-IP', version=version)
| Fix can't read version bug | Fix can't read version bug
| Python | mit | sdnds-tw/Ryu-SDN-IP | ---
+++
@@ -17,7 +17,7 @@
if version and not re.match("[0-9]+\\.[0-9]+\\.[0-9]+", version):
version = None
-if version:
+if not version:
print("Can't read version")
else: |
f4311c2ff9f9ddd1730c8e0c5b2d0216052c3ffa | setup.py | setup.py | #!/usr/bin/env python
from os import environ
from setuptools import Extension, find_packages, setup
# Opt-in to building the C extensions for Python 2 by setting the
# ENABLE_DJB_HASH_CEXT environment variable
if environ.get('ENABLE_DJB_HASH_CEXT'):
ext_modules = [
Extension('cdblib._djb_hash', sources=['cdblib/_djb_hash.c']),
]
else:
ext_modules = []
description = "Pure Python reader/writer for Dan J. Berstein's CDB format."
setup(
author='David Wilson',
author_email='dw@botanicus.net',
description=description,
long_description=description,
download_url='https://github.com/dw/python-pure-cdb',
keywords='cdb file format appengine database db',
license='MIT',
name='pure-cdb',
version='2.1.0',
packages=find_packages(include=['cdblib']),
ext_modules=ext_modules,
install_requires=['six>=1.0.0,<2.0.0'],
test_suite='tests',
tests_require=['flake8'],
entry_points={
'console_scripts': ['python-pure-cdbmake=cdblib.cdbmake:main'],
},
)
| #!/usr/bin/env python
from os import environ
from setuptools import Extension, find_packages, setup
# Opt-in to building the C extensions for Python 2 by setting the
# ENABLE_DJB_HASH_CEXT environment variable
if environ.get('ENABLE_DJB_HASH_CEXT'):
ext_modules = [
Extension('cdblib._djb_hash', sources=['cdblib/_djb_hash.c']),
]
else:
ext_modules = []
description = "Pure Python reader/writer for Dan J. Berstein's CDB format."
setup(
author='David Wilson',
author_email='dw@botanicus.net',
description=description,
long_description=description,
download_url='https://github.com/dw/python-pure-cdb',
keywords='cdb file format appengine database db',
license='MIT',
name='pure-cdb',
version='2.1.0',
packages=find_packages(include=['cdblib']),
ext_modules=ext_modules,
install_requires=['six>=1.0.0,<2.0.0'],
test_suite='tests',
tests_require=['flake8'],
entry_points={
'console_scripts': [
'python-pure-cdbmake=cdblib.cdbmake:main',
'python-pure-cdbdump=cdblib.cdbdump:main',
],
},
)
| Add console_scripts entry for python-pure-cdbdump | Add console_scripts entry for python-pure-cdbdump
| Python | mit | pombredanne/python-pure-cdb,pombredanne/python-pure-cdb,dw/python-pure-cdb,dw/python-pure-cdb | ---
+++
@@ -31,6 +31,9 @@
test_suite='tests',
tests_require=['flake8'],
entry_points={
- 'console_scripts': ['python-pure-cdbmake=cdblib.cdbmake:main'],
+ 'console_scripts': [
+ 'python-pure-cdbmake=cdblib.cdbmake:main',
+ 'python-pure-cdbdump=cdblib.cdbdump:main',
+ ],
},
) |
841144ddc1c9f0b88e81a31b590ca816d5f9b45b | setup.py | setup.py | from setuptools import setup
setup(name='pymongo_smart_auth',
version='0.2.0',
description='This package extends PyMongo to provide built-in smart authentication.',
url='https://github.com/PLPeeters/PyMongo-Smart-Auth',
author='Pierre-Louis Peeters',
author_email='PLPeeters@users.noreply.github.com',
license='MIT',
packages=['pymongo_smart_auth'],
install_requires=[
'pymongo'
],
zip_safe=True)
| from setuptools import setup
setup(name='pymongo_smart_auth',
version='0.2.0',
description='This package extends PyMongo to provide built-in smart authentication.',
url='https://github.com/PLPeeters/PyMongo-Smart-Auth',
author='Pierre-Louis Peeters',
author_email='PLPeeters@users.noreply.github.com',
license='MIT',
packages=['pymongo_smart_auth'],
install_requires=[
'pymongo'
],
keywords=['mongo', 'pymongo', 'authentication', 'seamless'],
zip_safe=True)
| Add keywords to package info | Add keywords to package info
| Python | mit | PLPeeters/PyMongo-Smart-Auth,PLPeeters/PyMongo-Smart-Auth | ---
+++
@@ -11,4 +11,5 @@
install_requires=[
'pymongo'
],
+ keywords=['mongo', 'pymongo', 'authentication', 'seamless'],
zip_safe=True) |
54dc38f51f06a71f520dfe2087ba8fddfa722b0c | setup.py | setup.py | #!/usr/bin/env python
# coding: utf-8
from setuptools import setup, find_packages
setup(
name="bentoo",
description="Benchmarking tools",
version="0.13",
packages=find_packages(),
scripts=["scripts/bentoo-generator.py", "scripts/bentoo-runner.py",
"scripts/bentoo-collector.py", "scripts/bentoo-analyser.py",
"scripts/bentoo-likwid-metric.py", "scripts/bentoo-quickstart.py",
"scripts/bentoo-calltree.py", "scripts/bentoo-merge.py",
"scripts/bentoo-calltree-analyser.py"],
package_data={
'': ['*.adoc', '*.rst', '*.md']
},
author="Zhang YANG",
author_email="zyangmath@gmail.com",
license="PSF",
keywords="Benchmark;Performance Analysis",
url="http://github.com/ProgramFan/bentoo"
)
| #!/usr/bin/env python
# coding: utf-8
from setuptools import setup, find_packages
setup(
name="bentoo",
description="Benchmarking tools",
version="0.14.dev",
packages=find_packages(),
scripts=["scripts/bentoo-generator.py", "scripts/bentoo-runner.py",
"scripts/bentoo-collector.py", "scripts/bentoo-analyser.py",
"scripts/bentoo-likwid-metric.py", "scripts/bentoo-quickstart.py",
"scripts/bentoo-calltree.py", "scripts/bentoo-merge.py",
"scripts/bentoo-calltree-analyser.py"],
package_data={
'': ['*.adoc', '*.rst', '*.md']
},
author="Zhang YANG",
author_email="zyangmath@gmail.com",
license="PSF",
keywords="Benchmark;Performance Analysis",
url="http://github.com/ProgramFan/bentoo"
)
| Prepare for next dev cycle | Prepare for next dev cycle
| Python | mit | ProgramFan/bentoo | ---
+++
@@ -5,7 +5,7 @@
setup(
name="bentoo",
description="Benchmarking tools",
- version="0.13",
+ version="0.14.dev",
packages=find_packages(),
scripts=["scripts/bentoo-generator.py", "scripts/bentoo-runner.py",
"scripts/bentoo-collector.py", "scripts/bentoo-analyser.py", |
074c59e3e8d570e4bbda57a5a3163f18a1b293da | setup.py | setup.py | #!/usr/bin/env python,
from setuptools import setup, find_packages
import versioneer
setup(
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
name='nsls2-auto-builder',
description='toolset for analyzing automated conda package building at NSLS2',
author='Eric Dill',
author_email='edill@bnl.gov',
url='https://github.com/ericdill/conda_build_utils',
packages=find_packages(),
include_package_data=True,
entry_points="""
[console_scripts]
devbuild=nsls2_build_tools.build:cli
"""
)
| #!/usr/bin/env python,
from setuptools import setup, find_packages
import versioneer
setup(
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
name='nsls2-auto-builder',
description='toolset for analyzing automated conda package building at NSLS2',
author='Eric Dill',
author_email='edill@bnl.gov',
url='https://github.com/ericdill/conda_build_utils',
packages=find_packages(),
include_package_data=True,
install_requires=['click', 'yaml', 'pyyaml'],
entry_points="""
[console_scripts]
devbuild=nsls2_build_tools.build:cli
"""
)
| Add click yaml and pyyaml to install_requires | Add click yaml and pyyaml to install_requires
| Python | bsd-3-clause | NSLS-II/lightsource2-recipes,NSLS-II/lightsource2-recipes,NSLS-II/lightsource2-recipes,NSLS-II/lightsource2-recipes,NSLS-II/auto-build-tagged-recipes,NSLS-II/auto-build-tagged-recipes | ---
+++
@@ -12,6 +12,7 @@
url='https://github.com/ericdill/conda_build_utils',
packages=find_packages(),
include_package_data=True,
+ install_requires=['click', 'yaml', 'pyyaml'],
entry_points="""
[console_scripts]
devbuild=nsls2_build_tools.build:cli |
8e585518b65c0f37b2f7458b7b0fda13bfcf24f5 | setup.py | setup.py | from setuptools import setup
setup(
name='troposphere',
version='1.4.0',
description="AWS CloudFormation creation library",
author="Mark Peek",
author_email="mark@peek.org",
url="https://github.com/cloudtools/troposphere",
license="New BSD license",
packages=['troposphere', 'troposphere.openstack', 'troposphere.helpers'],
scripts=['scripts/cfn', 'scripts/cfn2py'],
test_suite="tests",
tests_require=["awacs"],
use_2to3=True,
)
| from setuptools import setup
setup(
name='troposphere',
version='1.4.0',
description="AWS CloudFormation creation library",
author="Mark Peek",
author_email="mark@peek.org",
url="https://github.com/cloudtools/troposphere",
license="New BSD license",
packages=['troposphere', 'troposphere.openstack', 'troposphere.helpers'],
scripts=['scripts/cfn', 'scripts/cfn2py'],
test_suite="tests",
tests_require=["awacs"],
extras_require={'policy': ['awacs']},
use_2to3=True,
)
| Add awacs as a soft dependency | Add awacs as a soft dependency | Python | bsd-2-clause | cloudtools/troposphere,alonsodomin/troposphere,pas256/troposphere,cloudtools/troposphere,pas256/troposphere,dmm92/troposphere,7digital/troposphere,dmm92/troposphere,ikben/troposphere,horacio3/troposphere,johnctitus/troposphere,ikben/troposphere,horacio3/troposphere,alonsodomin/troposphere,johnctitus/troposphere,Yipit/troposphere,7digital/troposphere | ---
+++
@@ -12,5 +12,6 @@
scripts=['scripts/cfn', 'scripts/cfn2py'],
test_suite="tests",
tests_require=["awacs"],
+ extras_require={'policy': ['awacs']},
use_2to3=True,
) |
8db643b23716e3678ec02bcea6ade0f10a81bf76 | setup.py | setup.py | #!/usr/bin/env python
"""Setup script for PythonTemplateDemo."""
import setuptools
from demo import __project__, __version__
import os
if os.path.exists('README.rst'):
README = open('README.rst').read()
else:
README = "" # a placeholder until README is generated on release
CHANGES = open('CHANGES.md').read()
setuptools.setup(
name=__project__,
version=__version__,
description="PythonTemplateDemo is a Python package template.",
url='https://github.com/jacebrowning/template-python-demo',
author='Jace Browning',
author_email='jacebrowning@gmail.com',
packages=setuptools.find_packages(),
entry_points={'console_scripts': []},
long_description=(README + '\n' + CHANGES),
license='MIT',
classifiers=[
# TODO: update this list to match your application: https://pypi.python.org/pypi?%3Aaction=list_classifiers
'Development Status :: 1 - Planning',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'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',
],
install_requires=open('requirements.txt').readlines(),
)
| #!/usr/bin/env python
"""Setup script for PythonTemplateDemo."""
import setuptools
from demo import __project__, __version__
import os
if os.path.exists('README.rst'):
README = open('README.rst').read()
else:
README = "" # a placeholder until README is generated on release
CHANGES = open('CHANGES.md').read()
setuptools.setup(
name=__project__,
version=__version__,
description="A sample project templated from jacebrowning/template-python.",
url='https://github.com/jacebrowning/template-python-demo',
author='Jace Browning',
author_email='jacebrowning@gmail.com',
packages=setuptools.find_packages(),
entry_points={'console_scripts': []},
long_description=(README + '\n' + CHANGES),
license='MIT',
classifiers=[
# TODO: update this list to match your application: https://pypi.python.org/pypi?%3Aaction=list_classifiers
'Development Status :: 1 - Planning',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'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',
],
install_requires=open('requirements.txt').readlines(),
)
| Deploy Travis CI build 623 to GitHub | Deploy Travis CI build 623 to GitHub
| Python | mit | jacebrowning/template-python-demo | ---
+++
@@ -18,7 +18,7 @@
name=__project__,
version=__version__,
- description="PythonTemplateDemo is a Python package template.",
+ description="A sample project templated from jacebrowning/template-python.",
url='https://github.com/jacebrowning/template-python-demo',
author='Jace Browning',
author_email='jacebrowning@gmail.com', |
12f56ba2ae1b10e2a07f4cc9348dbd814432d50f | setup.py | setup.py | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.14',
packages=['todoist', 'todoist.managers'],
author='Doist Team',
author_email='info@todoist.com',
license='BSD',
description='todoist-python - The official Todoist Python API library',
long_description = read('README.md'),
install_requires=[
'requests',
],
# see here for complete list of classifiers
# http://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=(
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
),
)
| # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.15',
packages=['todoist', 'todoist.managers'],
author='Doist Team',
author_email='info@todoist.com',
license='BSD',
description='todoist-python - The official Todoist Python API library',
long_description = read('README.md'),
install_requires=[
'requests',
],
# see here for complete list of classifiers
# http://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=(
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
),
)
| Update the PyPI version to 0.2.15. | Update the PyPI version to 0.2.15.
| Python | mit | electronick1/todoist-python,Doist/todoist-python | ---
+++
@@ -10,7 +10,7 @@
setup(
name='todoist-python',
- version='0.2.14',
+ version='0.2.15',
packages=['todoist', 'todoist.managers'],
author='Doist Team',
author_email='info@todoist.com', |
8d744032bb5a023a24f525aea95719e58ab12098 | setup.py | setup.py | try:
from setuptools.core import setup
except ImportError:
from distutils.core import setup
import sys
svem_flag = '--single-version-externally-managed'
if svem_flag in sys.argv:
# Die, setuptools, die.
sys.argv.remove(svem_flag)
with open('jupyter_kernel/__init__.py', 'rb') as fid:
for line in fid:
line = line.decode('utf-8')
if line.startswith('__version__'):
version = line.strip().split()[-1][1:-1]
break
setup(name='jupyter_kernel',
version=version,
description='Jupyter Kernel Tools',
long_description="Jupyter Kernel Tools using kernel wrappers",
author='Steven Silvester',
author_email='steven.silvester@ieee.org',
url="https://github.com/blink1073/jupyter_kernel",
install_requires=['IPython >= 3.0'],
packages=['jupyter_kernel', 'jupyter_kernel.magics',
'jupyter_kernel.tests'],
classifiers=[
'Framework :: IPython',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2',
'Programming Language :: Scheme',
'Topic :: System :: Shells',
]
)
| try:
from setuptools.core import setup
except ImportError:
from distutils.core import setup
import sys
svem_flag = '--single-version-externally-managed'
if svem_flag in sys.argv:
# Die, setuptools, die.
sys.argv.remove(svem_flag)
with open('jupyter_kernel/__init__.py', 'rb') as fid:
for line in fid:
line = line.decode('utf-8')
if line.startswith('__version__'):
version = line.strip().split()[-1][1:-1]
break
setup(name='jupyter_kernel',
version=version,
description='Jupyter Kernel Tools',
long_description="Jupyter Kernel Tools using kernel wrappers",
author='Steven Silvester',
author_email='steven.silvester@ieee.org',
url="https://github.com/blink1073/jupyter_kernel",
install_requires=['IPython'],
packages=['jupyter_kernel', 'jupyter_kernel.magics',
'jupyter_kernel.tests'],
classifiers=[
'Framework :: IPython',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2',
'Programming Language :: Scheme',
'Topic :: System :: Shells',
]
)
| Remove v3.0 requirement for now | Remove v3.0 requirement for now
| Python | bsd-3-clause | Calysto/metakernel | ---
+++
@@ -26,7 +26,7 @@
author='Steven Silvester',
author_email='steven.silvester@ieee.org',
url="https://github.com/blink1073/jupyter_kernel",
- install_requires=['IPython >= 3.0'],
+ install_requires=['IPython'],
packages=['jupyter_kernel', 'jupyter_kernel.magics',
'jupyter_kernel.tests'],
classifiers=[ |
c29b173a5316e2e02e51bd2859d138dd49cf3885 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
setup(
name="delcom904x",
version="0.2",
description="A python class to control Delcom USBLMP Products 904x multi-color, USB, visual signal indicators",
author="Aaron Linville",
author_email="aaron@linville.org",
url="https://github.com/linville/delcom904x",
py_modules=["delcom904x"],
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
"Topic :: System :: Hardware :: Hardware Drivers",
"License :: OSI Approved :: ISC License (ISCL)",
],
license="ISC",
install_requires=["hidapi"],
python_requires=">=3.5",
setup_requires=["wheel"],
scripts=['control_delcom904x.py'],
)
| #!/usr/bin/env python
from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="delcom904x",
version="0.2.1",
description="A python class to control Delcom USBLMP Products 904x multi-color, USB, visual signal indicators",
long_description=long_description,
long_description_content_type="text/markdown",
author="Aaron Linville",
author_email="aaron@linville.org",
url="https://github.com/linville/delcom904x",
py_modules=["delcom904x"],
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
"Topic :: System :: Hardware :: Hardware Drivers",
"License :: OSI Approved :: ISC License (ISCL)",
],
license="ISC",
install_requires=["hidapi"],
python_requires=">=3.5",
setup_requires=["wheel"],
scripts=['control_delcom904x.py'],
)
| Add long description for PyPi. | Add long description for PyPi. | Python | isc | linville/delcom904x | ---
+++
@@ -2,10 +2,15 @@
from setuptools import setup
+with open("README.md", "r") as fh:
+ long_description = fh.read()
+
setup(
name="delcom904x",
- version="0.2",
+ version="0.2.1",
description="A python class to control Delcom USBLMP Products 904x multi-color, USB, visual signal indicators",
+ long_description=long_description,
+ long_description_content_type="text/markdown",
author="Aaron Linville",
author_email="aaron@linville.org",
url="https://github.com/linville/delcom904x", |
062af2465be55aba3e7bd95a8e2a9639c1273a61 | setup.py | setup.py | # Copyright 2017 Verily Life Sciences Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Package configuration."""
from setuptools import find_packages
from setuptools import setup
REQUIRED_PACKAGES = ['pandas',
'google-api-core==1.1.2',
'google-auth==1.4.1',
'google-cloud-bigquery==1.5.0',
'google-cloud-storage==1.10.0',
'pysqlite>=2.8.3',
'ddt',
'typing']
setup(
name='analysis-py-utils',
version='0.4.0',
license='Apache 2.0',
author='Verily Life Sciences',
url='https://github.com/verilylifesciences/analysis-py-utils',
install_requires=REQUIRED_PACKAGES,
packages=find_packages(),
include_package_data=True,
description='Python utilities for data analysis.',
requires=[])
| # Copyright 2017 Verily Life Sciences Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Package configuration."""
from setuptools import find_packages
from setuptools import setup
REQUIRED_PACKAGES = ['pandas',
'google-api-core==1.1.2',
'google-auth==1.4.1',
'google-cloud-bigquery==1.6.0',
'google-cloud-storage==1.10.0',
'pysqlite>=2.8.3',
'ddt',
'typing']
setup(
name='analysis-py-utils',
version='0.4.0',
license='Apache 2.0',
author='Verily Life Sciences',
url='https://github.com/verilylifesciences/analysis-py-utils',
install_requires=REQUIRED_PACKAGES,
packages=find_packages(),
include_package_data=True,
description='Python utilities for data analysis.',
requires=[])
| Update google-cloud-bigquery to get changes to DEFAULT_RETRY. | Update google-cloud-bigquery to get changes to DEFAULT_RETRY.
Change-Id: Id24ae732121556ad2df9c1ca465400a43429a0e6
| Python | apache-2.0 | verilylifesciences/analysis-py-utils,verilylifesciences/analysis-py-utils | ---
+++
@@ -19,7 +19,7 @@
REQUIRED_PACKAGES = ['pandas',
'google-api-core==1.1.2',
'google-auth==1.4.1',
- 'google-cloud-bigquery==1.5.0',
+ 'google-cloud-bigquery==1.6.0',
'google-cloud-storage==1.10.0',
'pysqlite>=2.8.3',
'ddt', |
6988ce27efd98f01776246afe6bd615f23644413 | setup.py | setup.py | #!/usr/bin/env python
# encoding: utf-8
'''
Created on Aug 29, 2014
@author: tmahrt
'''
from setuptools import setup
import io
setup(name='praatio',
version='4.2.1',
author='Tim Mahrt',
author_email='timmahrt@gmail.com',
url='https://github.com/timmahrt/praatIO',
package_dir={'praatio':'praatio'},
packages=['praatio',
'praatio.utilities'],
package_data={'praatio': ['praatScripts/*.praat', ]},
license='LICENSE',
description='A library for working with praat, textgrids, time aligned audio transcripts, and audio files.',
long_description=io.open('README.md', 'r', encoding="utf-8").read(),
long_description_content_type="text/markdown",
# install_requires=[], # No requirements! # requires 'from setuptools import setup'
)
| #!/usr/bin/env python
# encoding: utf-8
"""
Created on Aug 29, 2014
@author: tmahrt
"""
from setuptools import setup
import io
setup(
name="praatio",
version="4.2.1",
author="Tim Mahrt",
author_email="timmahrt@gmail.com",
url="https://github.com/timmahrt/praatIO",
package_dir={"praatio": "praatio"},
packages=["praatio", "praatio.utilities"],
package_data={
"praatio": [
"praatScripts/*.praat",
]
},
license="LICENSE",
description="A library for working with praat, textgrids, time aligned audio transcripts, and audio files.",
long_description=io.open("README.md", "r", encoding="utf-8").read(),
long_description_content_type="text/markdown",
# install_requires=[], # No requirements! # requires 'from setuptools import setup'
)
| Format file with python Black | Format file with python Black
| Python | mit | timmahrt/praatIO | ---
+++
@@ -1,24 +1,29 @@
#!/usr/bin/env python
# encoding: utf-8
-'''
+"""
Created on Aug 29, 2014
@author: tmahrt
-'''
+"""
from setuptools import setup
import io
-setup(name='praatio',
- version='4.2.1',
- author='Tim Mahrt',
- author_email='timmahrt@gmail.com',
- url='https://github.com/timmahrt/praatIO',
- package_dir={'praatio':'praatio'},
- packages=['praatio',
- 'praatio.utilities'],
- package_data={'praatio': ['praatScripts/*.praat', ]},
- license='LICENSE',
- description='A library for working with praat, textgrids, time aligned audio transcripts, and audio files.',
- long_description=io.open('README.md', 'r', encoding="utf-8").read(),
- long_description_content_type="text/markdown",
-# install_requires=[], # No requirements! # requires 'from setuptools import setup'
- )
+
+setup(
+ name="praatio",
+ version="4.2.1",
+ author="Tim Mahrt",
+ author_email="timmahrt@gmail.com",
+ url="https://github.com/timmahrt/praatIO",
+ package_dir={"praatio": "praatio"},
+ packages=["praatio", "praatio.utilities"],
+ package_data={
+ "praatio": [
+ "praatScripts/*.praat",
+ ]
+ },
+ license="LICENSE",
+ description="A library for working with praat, textgrids, time aligned audio transcripts, and audio files.",
+ long_description=io.open("README.md", "r", encoding="utf-8").read(),
+ long_description_content_type="text/markdown",
+ # install_requires=[], # No requirements! # requires 'from setuptools import setup'
+) |
6cdd2c06987e35451ac834cbab01b47a2679f5d9 | setup.py | setup.py | import os
from setuptools import setup
setup(
name="pcanet",
version="0.0.1",
author="Takeshi Ishita",
py_modules=["pcanet"],
install_requires=[
'chainer',
'numpy',
'psutil',
'recommonmark',
'scikit-learn',
'scipy',
'sphinx'
],
dependency_links = [
'-e git://github.com/cupy/cupy.git#egg=cupy'
]
)
| import os
from setuptools import setup
setup(
name="pcanet",
version="0.0.1",
author="Takeshi Ishita",
py_modules=["pcanet"],
install_requires=[
'cupy==5.0.0a1',
'chainer',
'numpy',
'psutil',
'recommonmark',
'scikit-learn',
'scipy',
'sphinx',
]
)
| Add 'cupy==5.0.0a1' to the requirements | Add 'cupy==5.0.0a1' to the requirements
| Python | mit | IshitaTakeshi/PCANet | ---
+++
@@ -7,16 +7,13 @@
author="Takeshi Ishita",
py_modules=["pcanet"],
install_requires=[
+ 'cupy==5.0.0a1',
'chainer',
'numpy',
'psutil',
'recommonmark',
'scikit-learn',
'scipy',
- 'sphinx'
- ],
-
- dependency_links = [
- '-e git://github.com/cupy/cupy.git#egg=cupy'
+ 'sphinx',
]
) |
2fc1b2463a2270312e16c9aee62e09610614bd7b | setup.py | setup.py | from os.path import dirname, abspath, join, exists
from setuptools import setup
long_description = None
if exists("README.md"):
long_description = open("README.md").read()
setup(
name="mpegdash",
packages=["mpegdash"],
description="MPEG-DASH MPD(Media Presentation Description) Parser",
long_description=long_description,
author="supercast",
author_email="gamzabaw@gmail.com",
version="0.1.6",
license="MIT",
zip_safe=False,
include_package_data=True,
install_requires=["future"],
url="https://github.com/caststack/python-mpegdash",
tests_require=["unittest2"],
test_suite="tests.my_module_suite",
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Environment :: Other Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
],
)
| from os.path import dirname, abspath, join, exists
from setuptools import setup
long_description = None
if exists("README.md"):
long_description = open("README.md").read()
setup(
name="mpegdash",
packages=["mpegdash"],
description="MPEG-DASH MPD(Media Presentation Description) Parser",
long_description=long_description,
author="supercast",
author_email="gamzabaw@gmail.com",
version="0.2.0",
license="MIT",
zip_safe=False,
include_package_data=True,
install_requires=["future"],
url="https://github.com/caststack/python-mpegdash",
tests_require=["unittest2"],
test_suite="tests.my_module_suite",
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Environment :: Other Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
],
)
| Set release version to 0.2.0 | Set release version to 0.2.0
| Python | mit | caststack/python-mpegdash | ---
+++
@@ -12,7 +12,7 @@
long_description=long_description,
author="supercast",
author_email="gamzabaw@gmail.com",
- version="0.1.6",
+ version="0.2.0",
license="MIT",
zip_safe=False,
include_package_data=True, |
bf37a9f1c24494ae26f6a38f123e5bd828001d09 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name="ducted",
version='1.0',
url='http://github.com/ducted/duct',
license='MIT',
description="A monitoring agent and event processor",
author='Colin Alston',
author_email='colin.alston@gmail.com',
packages=find_packages() + [
"twisted.plugins",
],
package_data={
'twisted.plugins': ['twisted/plugins/duct_plugin.py']
},
include_package_data=True,
install_requires=[
'Twisted',
'PyYaml',
'protobuf',
'construct<2.6',
'pysnmp==4.2.5',
'cryptography',
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: System :: Monitoring',
],
)
| from setuptools import setup, find_packages
setup(
name="ducted",
version='1.1',
url='http://github.com/ducted/duct',
license='MIT',
description="A monitoring agent and event processor",
author='Colin Alston',
author_email='colin.alston@gmail.com',
packages=find_packages() + [
"twisted.plugins",
],
package_data={
'twisted.plugins': ['twisted/plugins/duct_plugin.py']
},
include_package_data=True,
install_requires=[
'Twisted',
'PyYaml',
'protobuf',
'construct<2.6',
'pysnmp==4.2.5',
'cryptography',
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: System :: Monitoring',
],
)
| Set our next target version | Set our next target version
| Python | mit | ducted/duct,ducted/duct,ducted/duct,ducted/duct | ---
+++
@@ -3,7 +3,7 @@
setup(
name="ducted",
- version='1.0',
+ version='1.1',
url='http://github.com/ducted/duct',
license='MIT',
description="A monitoring agent and event processor", |
11741fe35b7a62effa5e07ced86946b0d744015a | setup.py | setup.py | import os
import sys
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
requires = [
'h5py',
'numpy',
'ConfigSpace'
'pandas', # missing dependency of nasbench
'https://github.com/google-research/nasbench/archive/master.zip'
]
setup(name='profet',
version='0.0.1',
description='tabular benchmarks for feed forward neural networks',
author='Aaron Klein',
author_email='kleinaa@cs.uni-freiburg.de',
keywords='hyperparameter optimization',
packages=find_packages(),
install_requires=requires)
| import os
import sys
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
requires = [
'h5py',
'numpy',
'ConfigSpace'
'pandas', # missing dependency of nasbench
'git+https://github.com/google-research/nasbench.git@master'
]
setup(name='profet',
version='0.0.1',
description='tabular benchmarks for feed forward neural networks',
author='Aaron Klein',
author_email='kleinaa@cs.uni-freiburg.de',
keywords='hyperparameter optimization',
packages=find_packages(),
install_requires=requires)
| Change nasbench dependency to git+https style. | Change nasbench dependency to git+https style. | Python | bsd-3-clause | automl/nas_benchmarks | ---
+++
@@ -8,7 +8,7 @@
'numpy',
'ConfigSpace'
'pandas', # missing dependency of nasbench
- 'https://github.com/google-research/nasbench/archive/master.zip'
+ 'git+https://github.com/google-research/nasbench.git@master'
]
setup(name='profet', |
e8529bc3d7aa87bbb9ae19c629d6d1a9bc205285 | setup.py | setup.py | #!/usr/bin/env python
# encoding: utf-8
from setuptools import setup, find_packages
setup(
name='reddit2Kindle',
scripts=['r2K.py'],
packages=find_packages(),
install_requires=[
'markdown2',
'praw',
'docopt'
],
version='0.5.0',
author='Antriksh Yadav',
author_email='antrikshy@gmail.com',
url='http://www.antrikshy.com/projects/reddit2Kindle.htm',
description=(
'Compiles top posts from a specified subreddit for a specified time'
'period into a well-formatted Kindle book.'
),
long_description=(
'See http://www.github.com/Antrikshy/reddit2Kindle for instructions.'
'Requires KindleGen from Amazon to convert HTML result to .mobi for'
'Kindle.'
),
classifiers=[
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Utilities',
'Development Status :: 4 - Beta',
'Intended Audience :: End Users/Desktop',
'Natural Language :: English',
'License :: OSI Approved :: MIT License'
],
)
| #!/usr/bin/env python
# encoding: utf-8
from setuptools import setup, find_packages
setup(
name='reddit2Kindle',
scripts=['r2K.py'],
packages=find_packages(),
install_requires=[
'markdown2',
'praw',
'docopt',
'jinja2'
],
version='0.5.0',
author='Antriksh Yadav',
author_email='antrikshy@gmail.com',
url='http://www.antrikshy.com/projects/reddit2Kindle.htm',
description=(
'Compiles top posts from a specified subreddit for a specified time'
'period into a well-formatted Kindle book.'
),
long_description=(
'See http://www.github.com/Antrikshy/reddit2Kindle for instructions.'
'Requires KindleGen from Amazon to convert HTML result to .mobi for'
'Kindle.'
),
classifiers=[
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Utilities',
'Development Status :: 4 - Beta',
'Intended Audience :: End Users/Desktop',
'Natural Language :: English',
'License :: OSI Approved :: MIT License'
],
)
| Add jinja2 as a dependency for HTML generation. | Add jinja2 as a dependency for HTML generation.
| Python | mit | Antrikshy/reddit2Kindle | ---
+++
@@ -9,7 +9,8 @@
install_requires=[
'markdown2',
'praw',
- 'docopt'
+ 'docopt',
+ 'jinja2'
],
version='0.5.0',
author='Antriksh Yadav', |
041123e7348cf05dd1432d8550cc497a1995351d | setup.py | setup.py | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import os.path
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
README_FILE = os.path.join(ROOT_DIR, "README.rst")
with open(README_FILE) as f:
long_description = f.read()
setup(
name="xutils",
version="0.8.2",
description="A Fragmentary Python Library.",
long_description=long_description,
author="xgfone",
author_email="xgfone@126.com",
maintainer="xgfone",
maintainer_email="xgfone@126.com",
url="https://github.com/xgfone/xutils",
packages=["xutils"],
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
],
)
| try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import os.path
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
README_FILE = os.path.join(ROOT_DIR, "README.rst")
with open(README_FILE) as f:
long_description = f.read()
setup(
name="xutils",
version="0.9",
description="A Fragmentary Python Library.",
long_description=long_description,
author="xgfone",
author_email="xgfone@126.com",
maintainer="xgfone",
maintainer_email="xgfone@126.com",
url="https://github.com/xgfone/xutils",
packages=["xutils"],
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
],
)
| Set the version to 0.9 | Set the version to 0.9
| Python | mit | xgfone/xutils,xgfone/pycom | ---
+++
@@ -13,7 +13,7 @@
setup(
name="xutils",
- version="0.8.2",
+ version="0.9",
description="A Fragmentary Python Library.",
long_description=long_description,
author="xgfone", |
dc15bd3c16758dcc420505794a7e3cadf38ffd36 | tests/api/test_bills.py | tests/api/test_bills.py | from tests import PMGTestCase
from tests.fixtures import dbfixture, BillData, BillTypeData
class TestBillAPI(PMGTestCase):
def setUp(self):
super(TestBillAPI, self).setUp()
self.fx = dbfixture.data(BillTypeData, BillData)
self.fx.setup()
def test_total_bill(self):
"""
Viewing all private member bills
"""
res = self.client.get("bill/", base_url="http://api.pmg.test:5000/")
self.assertEqual(200, res.status_code)
self.assertEqual(6, res.json["count"])
def test_private_memeber_bill(self):
"""
Count the total number of private bills
"""
res = self.client.get("bill/pmb/", base_url="http://api.pmg.test:5000/")
self.assertEqual(200, res.status_code)
self.assertEqual(2, res.json["count"])
| from tests import PMGTestCase
from tests.fixtures import dbfixture, BillData, BillTypeData
class TestBillAPI(PMGTestCase):
def setUp(self):
super(TestBillAPI, self).setUp()
self.fx = dbfixture.data(BillTypeData, BillData)
self.fx.setup()
def test_total_bill(self):
"""
Viewing all private member bills
"""
res = self.client.get("bill/", base_url="http://api.pmg.test:5000/")
self.assertEqual(200, res.status_code)
self.assertEqual(7, res.json["count"])
def test_private_memeber_bill(self):
"""
Count the total number of private bills
"""
res = self.client.get("bill/pmb/", base_url="http://api.pmg.test:5000/")
self.assertEqual(200, res.status_code)
self.assertEqual(2, res.json["count"])
| Fix number of bills test | Fix number of bills test
| Python | apache-2.0 | Code4SA/pmg-cms-2,Code4SA/pmg-cms-2,Code4SA/pmg-cms-2 | ---
+++
@@ -14,7 +14,7 @@
"""
res = self.client.get("bill/", base_url="http://api.pmg.test:5000/")
self.assertEqual(200, res.status_code)
- self.assertEqual(6, res.json["count"])
+ self.assertEqual(7, res.json["count"])
def test_private_memeber_bill(self):
""" |
85cadb6dc02e38890ba32c06543b0839314be594 | setup.py | setup.py | import os
from setuptools import 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-smsish',
version='1.1',
packages=[
'smsish',
'smsish.sms',
],
include_package_data=True,
license='MIT', # example license
description='A simple Django app to send SMS messages using an API similar to that of django.core.mail.',
long_description=README,
url='https://github.com/RyanBalfanz/django-smsish',
author='Ryan Balfanz',
author_email='ryan@ryanbalfanz.net',
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 1.8',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Topic :: Communications',
'Topic :: Communications :: Telephony',
],
)
| import os
from setuptools import 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-smsish',
version='1.1',
packages=[
'smsish',
'smsish.sms',
],
include_package_data=True,
license='MIT', # example license
description='A simple Django app to send SMS messages using an API similar to that of django.core.mail.',
long_description=README,
url='https://github.com/RyanBalfanz/django-smsish',
author='Ryan Balfanz',
author_email='ryan@ryanbalfanz.net',
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Topic :: Communications',
'Topic :: Communications :: Telephony',
],
)
| Add 'Framework :: Django :: 1.9' to classifiers | Add 'Framework :: Django :: 1.9' to classifiers
https://travis-ci.org/RyanBalfanz/django-smsish/builds/105968596 | Python | mit | RyanBalfanz/django-smsish | ---
+++
@@ -25,6 +25,7 @@
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 1.8',
+ 'Framework :: Django :: 1.9',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent', |
25a5fdc540f9eaa78aed5f7a4ec91981610053cb | setup.py | setup.py | #!/usr/bin/env python
from os.path import exists
from setuptools import setup
setup(name='streamz',
version='0.3.0',
description='Streams',
url='http://github.com/mrocklin/streamz/',
maintainer='Matthew Rocklin',
maintainer_email='mrocklin@gmail.com',
license='BSD',
keywords='streams',
packages=['streamz', 'streamz.dataframe',
# 'streamz.tests'
],
long_description=(open('README.rst').read() if exists('README.rst')
else ''),
install_requires=list(open('requirements.txt').read().strip().split('\n')),
zip_safe=False)
| #!/usr/bin/env python
from os.path import exists
from setuptools import setup
packages = ['streamz', 'streamz.dataframe']
tests = [p + '.tests' for p in packages]
setup(name='streamz',
version='0.3.0',
description='Streams',
url='http://github.com/mrocklin/streamz/',
maintainer='Matthew Rocklin',
maintainer_email='mrocklin@gmail.com',
license='BSD',
keywords='streams',
packages=packages + tests,
long_description=(open('README.rst').read() if exists('README.rst')
else ''),
install_requires=list(open('requirements.txt').read().strip().split('\n')),
zip_safe=False)
| Package the tests so downstream extensions can use them | Package the tests so downstream extensions can use them
| Python | bsd-3-clause | mrocklin/streams | ---
+++
@@ -2,6 +2,10 @@
from os.path import exists
from setuptools import setup
+
+packages = ['streamz', 'streamz.dataframe']
+
+tests = [p + '.tests' for p in packages]
setup(name='streamz',
@@ -12,9 +16,7 @@
maintainer_email='mrocklin@gmail.com',
license='BSD',
keywords='streams',
- packages=['streamz', 'streamz.dataframe',
- # 'streamz.tests'
- ],
+ packages=packages + tests,
long_description=(open('README.rst').read() if exists('README.rst')
else ''),
install_requires=list(open('requirements.txt').read().strip().split('\n')), |
07ad3d59d3553082721edf5c085dd6f5a4f1ec9f | setup.py | setup.py | from setuptools import setup
setup(
name='jupyterhub-ldapauthenticator',
version='0.1',
description='LDAP Authenticator for JupyterHub',
url='https://github.com/yuvipanda/ldapauthenticator',
author='Yuvi Panda',
author_email='yuvipanda@riseup.net',
license='3 Clause BSD',
packages=['ldapauthenticator'],
)
| from setuptools import setup
setup(
name='jupyterhub-ldapauthenticator',
version='0.1',
description='LDAP Authenticator for JupyterHub',
url='https://github.com/yuvipanda/ldapauthenticator',
author='Yuvi Panda',
author_email='yuvipanda@riseup.net',
license='3 Clause BSD',
packages=['ldapauthenticator'],
install_requires=[
'ldap3',
]
)
| Add ldap3 requirement to install_requires | Add ldap3 requirement to install_requires
| Python | bsd-3-clause | ViaSat/ldapauthenticator,yuvipanda/ldapauthenticator | ---
+++
@@ -9,4 +9,7 @@
author_email='yuvipanda@riseup.net',
license='3 Clause BSD',
packages=['ldapauthenticator'],
+ install_requires=[
+ 'ldap3',
+ ]
) |
e20ed9c03d7ee58bd39ce6d1a5d1ffb50da06962 | setup.py | setup.py | #!/usr/bin/env python
import sys
from setuptools import setup, find_packages
if sys.version_info < (3, 3):
sys.exit('Sorry, Python < 3.3 is not supported')
setup(
name='pyecore',
version='0.5.6-dev',
description=('A Python(ic) Implementation of the Eclipse Modeling '
'Framework (EMF/Ecore)'),
long_description=open('README.rst').read(),
keywords='model metamodel EMF Ecore MDE',
url='https://github.com/pyecore/pyecore',
author='Vincent Aranega',
author_email='vincent.aranega@gmail.com',
packages=find_packages(exclude=['examples', 'tests']),
data_files=[('', ['LICENSE', 'README.rst'])],
install_requires=['enum34;python_version<"3.4"',
'ordered-set',
'lxml'],
tests_require={'pytest'},
license='BSD 3-Clause',
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Operating System :: OS Independent',
'Intended Audience :: Developers',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'License :: OSI Approved :: BSD License',
]
)
| #!/usr/bin/env python
import sys
from setuptools import setup, find_packages
if sys.version_info < (3, 3):
sys.exit('Sorry, Python < 3.3 is not supported')
setup(
name='pyecore',
version='0.5.6-dev',
description=('A Python(ic) Implementation of the Eclipse Modeling '
'Framework (EMF/Ecore)'),
long_description=open('README.rst').read(),
keywords='model metamodel EMF Ecore MDE',
url='https://github.com/pyecore/pyecore',
author='Vincent Aranega',
author_email='vincent.aranega@gmail.com',
packages=find_packages(exclude=['examples', 'tests']),
# data_files=[('', ['LICENSE', 'README.rst'])],
install_requires=['enum34;python_version<"3.4"',
'ordered-set',
'lxml'],
tests_require={'pytest'},
license='BSD 3-Clause',
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Operating System :: OS Independent',
'Intended Audience :: Developers',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'License :: OSI Approved :: BSD License',
]
)
| Remove LICENCE inclusion from package | Remove LICENCE inclusion from package
| Python | bsd-3-clause | aranega/pyecore,pyecore/pyecore | ---
+++
@@ -18,7 +18,7 @@
author_email='vincent.aranega@gmail.com',
packages=find_packages(exclude=['examples', 'tests']),
- data_files=[('', ['LICENSE', 'README.rst'])],
+ # data_files=[('', ['LICENSE', 'README.rst'])],
install_requires=['enum34;python_version<"3.4"',
'ordered-set',
'lxml'], |
7d75b96211404902c2fd3ae977860ed97f351b7d | tests/test_conductor.py | tests/test_conductor.py | """Test the conductor REST module."""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from _pytest.python import raises
from future import standard_library
standard_library.install_aliases()
from responses import activate, GET, POST, add
from pytest import mark
from gobble.config import OS_URL
from gobble.conductor import API, build_api_request
request_functions = [
('authorize_user', '/user/authorize', GET),
('oauth_callback', '/oauth/callback', GET),
('update_user', '/user/update', POST),
('search_users', '/search/user', GET),
('search_packages', '/search/package', GET),
('prepare_upload', '/datastore/', POST)
]
@activate
@mark.parametrize('function, endpoint, verb', request_functions)
def test_api_requests_hit_correct_endpoints(function, endpoint, verb):
endpoint_url = OS_URL + endpoint
# Mock the request with responses
add(verb, endpoint_url, status=200)
response = getattr(API, function)()
assert response.status_code == 200
def test_passing_endpoint_item_not_string_raises_type_error():
with raises(TypeError):
build_api_request('GET', 1000)()
def test_build_api_request_with_invalid_verb_raise_assertion_error():
with raises(AssertionError):
build_api_request('BAR', 'foo')
| """Test the conductor REST module."""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from _pytest.python import raises
from future import standard_library
standard_library.install_aliases()
import responses
import pytest
from gobble.config import OS_URL
from gobble.conductor import API, build_api_request
request_functions = [
('authorize_user', '/user/authorize', 'GET'),
('oauth_callback', '/oauth/callback', 'GET'),
('update_user', '/user/update', 'POST'),
('search_users', '/search/user', 'GET'),
('search_packages', '/search/package', 'GET'),
('prepare_upload', '/datastore/', 'POST')
]
@responses.activate
@pytest.mark.parametrize('function, endpoint, verb', request_functions)
def test_api_requests_hit_correct_endpoints(function, endpoint, verb):
endpoint_url = OS_URL + endpoint
# Mock the request with responses
responses.add(verb, endpoint_url, status=200)
response = getattr(API, function)()
assert response.status_code == 200
def test_passing_endpoint_item_not_string_raises_type_error():
with raises(TypeError):
build_api_request('GET', 1000)()
def test_build_api_request_with_invalid_verb_raise_assertion_error():
with raises(AssertionError):
build_api_request('BAR', 'foo')
| Switch to module imports for readability. | Switch to module imports for readability.
| Python | mit | openspending/gobble | ---
+++
@@ -10,29 +10,28 @@
standard_library.install_aliases()
-from responses import activate, GET, POST, add
-from pytest import mark
+import responses
+import pytest
from gobble.config import OS_URL
from gobble.conductor import API, build_api_request
-
request_functions = [
- ('authorize_user', '/user/authorize', GET),
- ('oauth_callback', '/oauth/callback', GET),
- ('update_user', '/user/update', POST),
- ('search_users', '/search/user', GET),
- ('search_packages', '/search/package', GET),
- ('prepare_upload', '/datastore/', POST)
+ ('authorize_user', '/user/authorize', 'GET'),
+ ('oauth_callback', '/oauth/callback', 'GET'),
+ ('update_user', '/user/update', 'POST'),
+ ('search_users', '/search/user', 'GET'),
+ ('search_packages', '/search/package', 'GET'),
+ ('prepare_upload', '/datastore/', 'POST')
]
-@activate
-@mark.parametrize('function, endpoint, verb', request_functions)
+@responses.activate
+@pytest.mark.parametrize('function, endpoint, verb', request_functions)
def test_api_requests_hit_correct_endpoints(function, endpoint, verb):
endpoint_url = OS_URL + endpoint
# Mock the request with responses
- add(verb, endpoint_url, status=200)
+ responses.add(verb, endpoint_url, status=200)
response = getattr(API, function)()
assert response.status_code == 200
|
c3d5b69eac928bcf7f6198b9fc3a40d5b06a7caa | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='atlassian-jwt-auth',
packages=find_packages(),
version='0.0.1',
install_requires=[
'cryptography==0.8.2',
'PyJWT==1.1.0',
'requests==2.6.0',
],
tests_require=['mock',],
test_suite='atlassian_jwt_auth.test',
platforms=['any'],
license='MIT',
zip_safe=False,
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'License :: OSI Approved :: MIT License',
],
)
| #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='atlassian-jwt-auth',
packages=find_packages(),
version='0.0.1',
install_requires=[
'cryptography==0.8.2',
'PyJWT==1.1.0',
'requests==2.6.0',
],
tests_require=['mock', 'nose',],
test_suite='nose.collector',
platforms=['any'],
license='MIT',
zip_safe=False,
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'License :: OSI Approved :: MIT License',
],
)
| Use nose for running tests. | Use nose for running tests.
Signed-off-by: David Black <c4b737561a711e07c31fd1e1811f33a5d770e31c@atlassian.com>
| Python | mit | atlassian/asap-authentication-python | ---
+++
@@ -11,8 +11,8 @@
'PyJWT==1.1.0',
'requests==2.6.0',
],
- tests_require=['mock',],
- test_suite='atlassian_jwt_auth.test',
+ tests_require=['mock', 'nose',],
+ test_suite='nose.collector',
platforms=['any'],
license='MIT',
zip_safe=False, |
3eae6b2f66831259f1f1e237e1581207d0256e3e | setup.py | setup.py | import os
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
packages = []
package_dir = "dbbackup"
for dirpath, dirnames, filenames in os.walk(package_dir):
# ignore dirnames that start with '.'
for i, dirname in enumerate(dirnames):
if dirname.startswith("."):
del dirnames[i]
if "__init__.py" in filenames:
pkg = dirpath.replace(os.path.sep, '.')
if os.path.altsep:
pkg = pkg.replace(os.path.altsep, '.')
packages.append(pkg)
setup(
name='django-dbbackup',
version='1.9.0',
description='Management commands to help backup and restore a project database to AmazonS3, Dropbox or local disk.',
long_description=read('README.md'),
author='Michael Shepanski',
author_email='mjs7231@gmail.com',
install_requires=['boto', 'dropbox'],
license='BSD',
url='http://bitbucket.org/mjs7231/django-dbbackup',
keywords=['django', 'dropbox', 'database', 'backup', 'amazon', 's3'],
packages=packages
)
| import os
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
packages = []
package_dir = "dbbackup"
for dirpath, dirnames, filenames in os.walk(package_dir):
# ignore dirnames that start with '.'
for i, dirname in enumerate(dirnames):
if dirname.startswith("."):
del dirnames[i]
if "__init__.py" in filenames:
pkg = dirpath.replace(os.path.sep, '.')
if os.path.altsep:
pkg = pkg.replace(os.path.altsep, '.')
packages.append(pkg)
setup(
name='django-dbbackup',
version='1.9.0',
description='Management commands to help backup and restore a project database to AmazonS3, Dropbox or local disk.',
long_description=read('README.md'),
author='Michael Shepanski',
author_email='mjs7231@gmail.com',
install_requires=[],
license='BSD',
url='http://bitbucket.org/mjs7231/django-dbbackup',
keywords=['django', 'dropbox', 'database', 'backup', 'amazon', 's3'],
packages=packages
)
| Remove dropbox and boto as dependencies because they are optional and boto is not py3 compat | Remove dropbox and boto as dependencies because they are optional and boto is not py3 compat
| Python | bsd-3-clause | leukeleu/django-dbbackup | ---
+++
@@ -27,7 +27,7 @@
long_description=read('README.md'),
author='Michael Shepanski',
author_email='mjs7231@gmail.com',
- install_requires=['boto', 'dropbox'],
+ install_requires=[],
license='BSD',
url='http://bitbucket.org/mjs7231/django-dbbackup',
keywords=['django', 'dropbox', 'database', 'backup', 'amazon', 's3'], |
728e7d5cb5624138225ce51b2fc37d8957016872 | setup.py | setup.py | # coding: utf-8
from __future__ import unicode_literals
from setuptools import (
setup,
find_packages,
)
setup(
name='natasha',
version='0.8.1',
description='Named-entity recognition for russian language',
url='https://github.com/natasha/natasha',
author='Natasha contributors',
author_email='d.a.veselov@yandex.ru',
license='MIT',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'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',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Scientific/Engineering :: Information Analysis',
'Topic :: Text Processing :: Linguistic',
],
keywords='natural language processing, russian morphology, named entity recognition, tomita',
packages=find_packages(),
package_data={
'natasha': [
'data/*',
]
},
install_requires=[
'yargy'
],
)
| # coding: utf-8
from __future__ import unicode_literals
from setuptools import (
setup,
find_packages,
)
setup(
name='natasha',
version='0.8.1',
description='Named-entity recognition for russian language',
url='https://github.com/natasha/natasha',
author='Natasha contributors',
author_email='d.a.veselov@yandex.ru',
license='MIT',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'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',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Scientific/Engineering :: Information Analysis',
'Topic :: Text Processing :: Linguistic',
],
keywords='natural language processing, russian morphology, named entity recognition, tomita',
packages=find_packages(),
package_data={
'natasha': [
'data/dicts/*',
'data/models/*',
]
},
install_requires=[
'yargy'
],
)
| Add dicts and models to package | Add dicts and models to package
| Python | mit | natasha/natasha | ---
+++
@@ -37,7 +37,8 @@
packages=find_packages(),
package_data={
'natasha': [
- 'data/*',
+ 'data/dicts/*',
+ 'data/models/*',
]
},
install_requires=[ |
6499c1f5e292f7445c0c9274a623c28c0eb7ce7b | setup.py | setup.py | #!/usr/bin/env python
from os.path import join
from setuptools import setup, find_packages
# Change geokey_sapelli version here (and here alone!):
VERSION_PARTS = (0, 6, 7)
name = 'geokey-sapelli'
version = '.'.join(map(str, VERSION_PARTS))
repository = join('https://github.com/ExCiteS', name)
def get_install_requires():
"""
parse requirements.txt, ignore links, exclude comments
"""
requirements = list()
for line in open('requirements.txt').readlines():
# skip to next iteration if comment or empty line
if line.startswith('#') or line.startswith('git+https') or line == '':
continue
# add line to requirements
requirements.append(line.rstrip())
return requirements
setup(
name=name,
version=version,
description='Read Sapelli project and load data from CSVs to GeoKey',
url=repository,
download_url=join(repository, 'tarball', version),
author='ExCiteS',
author_email='excitesucl@gmail.com',
packages=find_packages(exclude=['*.tests', '*.tests.*', 'tests.*']),
install_requires=get_install_requires(),
include_package_data=True,
)
| #!/usr/bin/env python
from os.path import join
from setuptools import setup, find_packages
# Change geokey_sapelli version here (and here alone!):
VERSION_PARTS = (0, 6, 7)
name = 'geokey-sapelli'
version = '.'.join(map(str, VERSION_PARTS))
repository = join('https://github.com/ExCiteS', name)
def get_install_requires():
"""
parse requirements.txt, ignore links, exclude comments
"""
requirements = list()
for line in open('requirements.txt').readlines():
# skip to next iteration if comment, Git repository or empty line
if line.startswith('#') or line.startswith('git+https') or line == '':
continue
# add line to requirements
requirements.append(line.rstrip())
return requirements
setup(
name=name,
version=version,
description='Read Sapelli project and load data from CSVs to GeoKey',
url=repository,
download_url=join(repository, 'tarball', version),
author='ExCiteS',
author_email='excitesucl@gmail.com',
packages=find_packages(exclude=['*.tests', '*.tests.*', 'tests.*']),
install_requires=get_install_requires(),
include_package_data=True,
)
| Comment about excluding Git repositories from requirements.txt | Comment about excluding Git repositories from requirements.txt
| Python | mit | ExCiteS/geokey-sapelli,ExCiteS/geokey-sapelli | ---
+++
@@ -17,7 +17,7 @@
"""
requirements = list()
for line in open('requirements.txt').readlines():
- # skip to next iteration if comment or empty line
+ # skip to next iteration if comment, Git repository or empty line
if line.startswith('#') or line.startswith('git+https') or line == '':
continue
# add line to requirements |
f2857458441cebb2cee2308c90688d3e20d69d8d | setup.py | setup.py | #!/usr/bin/env python
from setuptools import find_packages, Command
setup_params = dict(
name='bugimporters',
version=0.1,
author='Various contributers to the OpenHatch project, Berry Phillips',
author_email='all@openhatch.org, berryphillips@gmail.com',
packages=find_packages(),
description='Bug importers for the OpenHatch project',
install_requires=[
'gdata',
'lxml',
'pyopenssl',
'unicodecsv',
'feedparser',
'twisted',
'python-dateutil',
'decorator',
'scrapy>0.9',
'argparse',
'mock',
'PyYAML',
'importlib',
'autoresponse>=0.2',
],
)
if __name__ == '__main__':
from setuptools import setup
setup(**setup_params)
| #!/usr/bin/env python
from setuptools import find_packages, Command
setup_params = dict(
name='bugimporters',
version=0.1,
author='Various contributers to the OpenHatch project, Berry Phillips',
author_email='all@openhatch.org, berryphillips@gmail.com',
packages=find_packages(),
description='Bug importers for the OpenHatch project',
install_requires=[
'gdata',
'lxml',
'pyopenssl',
'unicodecsv',
'feedparser',
'twisted',
'python-dateutil',
'decorator',
'scrapy>0.9',
'argparse',
'mock',
'PyYAML',
'autoresponse>=0.2',
],
)
### Python 2.7 already has importlib. Because of that,
### we can't put it in install_requires. We test for
### that here; if needed, we add it.
try:
import importlib
except ImportError:
install_requires.append('importlib')
if __name__ == '__main__':
from setuptools import setup
setup(**setup_params)
| Make importlib dependency only take place if you need it | Make importlib dependency only take place if you need it
| Python | agpl-3.0 | openhatch/oh-bugimporters,openhatch/oh-bugimporters,openhatch/oh-bugimporters | ---
+++
@@ -22,10 +22,17 @@
'argparse',
'mock',
'PyYAML',
- 'importlib',
'autoresponse>=0.2',
],
)
+
+### Python 2.7 already has importlib. Because of that,
+### we can't put it in install_requires. We test for
+### that here; if needed, we add it.
+try:
+ import importlib
+except ImportError:
+ install_requires.append('importlib')
if __name__ == '__main__': |
57a94ef6d186969b57b727d01135d94b7c9af4af | setup.py | setup.py | from setuptools import setup, find_packages
with open('arcpyext/_version.py') as fin: exec(fin.read(), globals())
with open('requirements.txt') as fin: requirements=[s.strip() for s in fin.readlines()]
with open('readme.rst') as fin: long_description = fin.read()
packages = find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"])
setup(
name = "arcpyext",
version = __version__,
packages = packages,
#dependencies
install_requires = requirements,
#misc files to include
package_data = {
"": ["LICENSE"]
},
#PyPI MetaData
author = __author__,
description = "Extended functionality for Esri's ArcPy site-package",
long_description = long_description,
license = "BSD 3-Clause",
keywords = "arcgis esri arcpy",
url = "https://github.com/DavidWhittingham/arcpyext",
classifiers = (
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Natural Language :: English",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python"
),
zip_safe = False
)
| from setuptools import setup, find_packages
with open('arcpyext/_version.py') as fin: exec(fin.read(), globals())
with open('requirements.txt') as fin: requirements=[s.strip() for s in fin.readlines()]
with open('readme.rst') as fin: long_description = fin.read()
packages = find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"])
setup(
name = "arcpyext",
version = __version__,
packages = packages,
#dependencies
install_requires = requirements,
#misc files to include
package_data = {
"": ["LICENSE"]
},
#PyPI MetaData
author = __author__,
description = "Extended functionality for Esri's ArcPy site-package",
long_description = long_description,
long_description_content_type = "text/x-rst",
license = "BSD 3-Clause",
keywords = "arcgis esri arcpy",
url = "https://github.com/DavidWhittingham/arcpyext",
classifiers = (
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Natural Language :: English",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python"
),
zip_safe = False
)
| Add long description format identifier | Add long description format identifier
| Python | bsd-3-clause | DavidWhittingham/arcpyext | ---
+++
@@ -23,6 +23,7 @@
author = __author__,
description = "Extended functionality for Esri's ArcPy site-package",
long_description = long_description,
+ long_description_content_type = "text/x-rst",
license = "BSD 3-Clause",
keywords = "arcgis esri arcpy",
url = "https://github.com/DavidWhittingham/arcpyext", |
95428c238dc8d80c61e7c15116ab01f53b643f85 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
setup(
name='Tigger',
version='0.1.0',
packages=['tigger',],
license='MIT',
description="Command-line tagging tool.",
long_description="Tigger is a command-line tagging tool written in " +
"python, intended for tracking tags on files in a form which can " +
"be transferred with the files while remaining out of sight " +
"normally (much like git's metadata, except not so clever).",
entry_points={
"console_scripts": [
"tigger = tigger.app:main",
],
},
)
| #!/usr/bin/env python
from setuptools import setup
setup(
name="Tigger",
version="0.1.0",
packages=["tigger",],
license="MIT",
description="Command-line tagging tool.",
long_description="Tigger is a command-line tagging tool written in " +
"python, intended for tracking tags on files in a form which can " +
"be transferred with the files while remaining out of sight " +
"normally (much like git's metadata, except not so clever).",
entry_points={
"console_scripts": [
"tigger = tigger.app:main",
],
},
)
| Correct inconsistent quote usage, release 0.1.0. | Correct inconsistent quote usage, release 0.1.0.
| Python | mit | jesskay/tigger | ---
+++
@@ -2,10 +2,10 @@
from setuptools import setup
setup(
- name='Tigger',
- version='0.1.0',
- packages=['tigger',],
- license='MIT',
+ name="Tigger",
+ version="0.1.0",
+ packages=["tigger",],
+ license="MIT",
description="Command-line tagging tool.",
long_description="Tigger is a command-line tagging tool written in " +
"python, intended for tracking tags on files in a form which can " + |
8922e56b230c59a8f83374f3e3cb7c9ed4968784 | setup.py | setup.py | #!/usr/bin/env python
"""
Install wagtailvideos using setuptools
"""
with open('README.rst', 'r') as f:
readme = f.read()
from setuptools import find_packages, setup
setup(
name='wagtailvideos',
version='0.1.11',
description="A wagtail module for uploading and displaying videos in various codecs.",
long_description=readme,
author='Takeflight',
author_email='developers@takeflight.com.au',
url='https://github.com/takeflight/wagtailvideos',
install_requires=[
'wagtail>=1.4',
'django-enumchoicefield==0.6.0',
],
extras_require={
'testing': [
'mock==2.0.0'
]
},
zip_safe=False,
license='BSD License',
packages=find_packages(),
include_package_data=True,
package_data={},
classifiers=[
'Environment :: Web Environment',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Framework :: Django',
'License :: OSI Approved :: BSD License',
],
)
| #!/usr/bin/env python
"""
Install wagtailvideos using setuptools
"""
with open('README.rst', 'r') as f:
readme = f.read()
from setuptools import find_packages, setup
setup(
name='wagtailvideos',
version='0.1.11',
description="A wagtail module for uploading and displaying videos in various codecs.",
long_description=readme,
author='Takeflight',
author_email='developers@takeflight.com.au',
url='https://github.com/takeflight/wagtailvideos',
install_requires=[
'wagtail>=1.4',
'Django>=1.8',
'django-enumchoicefield==0.6.0',
],
extras_require={
'testing': [
'mock==2.0.0'
]
},
zip_safe=False,
license='BSD License',
packages=find_packages(),
include_package_data=True,
package_data={},
classifiers=[
'Environment :: Web Environment',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Framework :: Django',
'License :: OSI Approved :: BSD License',
],
)
| Make sure django is 1.8 or higher | Make sure django is 1.8 or higher
| Python | bsd-3-clause | takeflight/wagtailvideos,takeflight/wagtailvideos,takeflight/wagtailvideos | ---
+++
@@ -19,6 +19,7 @@
install_requires=[
'wagtail>=1.4',
+ 'Django>=1.8',
'django-enumchoicefield==0.6.0',
],
extras_require={ |
e2094a9814e6c38cbe5b3a3c49b6205c5ad89ed1 | setup.py | setup.py | from setuptools import setup
setup(name = 'graphysio',
version = '0.73',
description = 'Graphical visualization of physiologic time series',
url = 'https://github.com/jaj42/graphysio',
author = 'Jona JOACHIM',
author_email = 'jona@joachim.cc',
license = 'ISC',
python_requires = '>=3.4',
install_requires = ['pyqtgraph', 'pandas', 'numpy', 'scipy'],
scripts = ['scripts/graphysioui.py'],
packages = ['graphysio', 'graphysio.ui'],
)
| from setuptools import setup
setup(name = 'graphysio',
version = '0.74',
description = 'Graphical visualization of physiologic time series',
url = 'https://github.com/jaj42/graphysio',
author = 'Jona JOACHIM',
author_email = 'jona@joachim.cc',
license = 'ISC',
python_requires = '>=3.4',
install_requires = ['pyqtgraph', 'pandas', 'numpy', 'scipy'],
scripts = ['scripts/graphysioui.py'],
packages = ['graphysio', 'graphysio.ui'],
include_package_data = True
)
| Install ui files in site-packages | Install ui files in site-packages
| Python | isc | jaj42/dyngraph,jaj42/GraPhysio,jaj42/GraPhysio | ---
+++
@@ -1,7 +1,7 @@
from setuptools import setup
setup(name = 'graphysio',
- version = '0.73',
+ version = '0.74',
description = 'Graphical visualization of physiologic time series',
url = 'https://github.com/jaj42/graphysio',
author = 'Jona JOACHIM',
@@ -11,4 +11,5 @@
install_requires = ['pyqtgraph', 'pandas', 'numpy', 'scipy'],
scripts = ['scripts/graphysioui.py'],
packages = ['graphysio', 'graphysio.ui'],
+ include_package_data = True
) |
09b707e7c190357cd41953aa4304a331eb7182f5 | setup.py | setup.py | from setuptools import setup
setup(
name='downstream-farmer',
version='',
packages=['downstream-farmer'],
url='',
license='',
author='Storj Labs',
author_email='info@storj.io',
description=''
)
| from setuptools import setup
setup(
name='downstream-farmer',
version='',
packages=['downstream-farmer'],
url='',
license='',
author='Storj Labs',
author_email='info@storj.io',
description='',
install_requires=[
'heartbeat==0.1.2'
],
dependency_links = [
'https://github.com/Storj/heartbeat/archive/v0.1.2.tar.gz#egg=heartbeat-0.1.2'
]
)
| Add heartbeat to install reqs | Add heartbeat to install reqs
| Python | mit | Storj/downstream-farmer | ---
+++
@@ -8,5 +8,11 @@
license='',
author='Storj Labs',
author_email='info@storj.io',
- description=''
+ description='',
+ install_requires=[
+ 'heartbeat==0.1.2'
+ ],
+ dependency_links = [
+ 'https://github.com/Storj/heartbeat/archive/v0.1.2.tar.gz#egg=heartbeat-0.1.2'
+ ]
) |
16db51ec820381ccfb48ad1c5ada6fb25dbf1e9c | setup.py | setup.py | from distutils.core import setup, Extension
import numpy.distutils.misc_util
module = Extension(
'cnaturalneighbor',
include_dirs=numpy.distutils.misc_util.get_numpy_include_dirs(),
library_dirs=['/usr/local/lib'],
extra_compile_args=['--std=c++11'],
sources=[
'naturalneighbor/cnaturalneighbor.cpp',
],
)
setup(
name='naturalneighbor',
version='0.1.3',
description='Fast, discrete natural neighbor interpolation in 3D on a CPU.',
long_description=open('README.rst', 'r').read(),
author='Reece Stevens',
author_email='rstevens@innolitics.com',
license='MIT',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Scientific/Engineering',
'Topic :: Software Development',
],
keywords='interpolation scipy griddata numpy sibson',
install_requires=[
'numpy>=1.13',
],
url='https://github.com/innolitics/natural-neighbor-interpolation',
ext_modules=[module],
)
| from distutils.core import setup, Extension
import numpy.distutils.misc_util
module = Extension(
'cnaturalneighbor',
include_dirs=numpy.distutils.misc_util.get_numpy_include_dirs(),
library_dirs=['/usr/local/lib'],
extra_compile_args=['--std=c++11'],
sources=[
'naturalneighbor/cnaturalneighbor.cpp',
],
)
setup(
name='naturalneighbor',
version='0.1.3',
description='Fast, discrete natural neighbor interpolation in 3D on a CPU.',
long_description=open('README.rst', 'r').read(),
author='Reece Stevens',
author_email='rstevens@innolitics.com',
license='MIT',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Scientific/Engineering',
'Topic :: Software Development',
],
keywords='interpolation scipy griddata numpy sibson',
install_requires=[
'numpy>=1.13',
],
url='https://github.com/innolitics/natural-neighbor-interpolation',
ext_modules=[module],
packages=['naturalneighbor'],
)
| Make sure the package is exported by distutils | Make sure the package is exported by distutils
| Python | mit | innolitics/natural-neighbor-interpolation,innolitics/natural-neighbor-interpolation,innolitics/natural-neighbor-interpolation | ---
+++
@@ -42,4 +42,5 @@
],
url='https://github.com/innolitics/natural-neighbor-interpolation',
ext_modules=[module],
+ packages=['naturalneighbor'],
) |
558b756763f0a07fd2316128ccf64878ab3ea715 | setup.py | setup.py | from distutils.core import setup
setup(
name = 'processout',
packages = ['processout'],
version = '1.1.0',
description = 'ProcessOut API bindings for python',
author = 'Manuel Huez',
author_email = 'manuel@processout.com',
url = 'https://github.com/processout/processout-python',
download_url = 'https://github.com/processout/processout-python/tarball/1.0.0',
keywords = ['aggregation', 'payment', 'processor', 'API', 'bindings', 'ProcessOut'],
classifiers = [],
) | from distutils.core import setup
setup(
name = 'processout',
packages = ['processout'],
version = '1.1.1',
description = 'ProcessOut API bindings for python',
author = 'Manuel Huez',
author_email = 'manuel@processout.com',
url = 'https://github.com/processout/processout-python',
download_url = 'https://github.com/processout/processout-python/tarball/1.1.1',
keywords = ['aggregation', 'payment', 'processor', 'API', 'bindings', 'ProcessOut'],
classifiers = [],
) | Debug download link and update version number | Debug download link and update version number
| Python | mit | ProcessOut/processout-python | ---
+++
@@ -3,12 +3,12 @@
setup(
name = 'processout',
packages = ['processout'],
- version = '1.1.0',
+ version = '1.1.1',
description = 'ProcessOut API bindings for python',
author = 'Manuel Huez',
author_email = 'manuel@processout.com',
url = 'https://github.com/processout/processout-python',
- download_url = 'https://github.com/processout/processout-python/tarball/1.0.0',
+ download_url = 'https://github.com/processout/processout-python/tarball/1.1.1',
keywords = ['aggregation', 'payment', 'processor', 'API', 'bindings', 'ProcessOut'],
classifiers = [],
) |
1372bc3d373ef7cda6b1b016d4355e5d96db5ff0 | setup.py | setup.py | #!/usr/bin/env python
# Generated by jaraco.develop (https://bitbucket.org/jaraco/jaraco.develop)
import setuptools
with open('README.txt', encoding='utf-8') as readme:
long_description = readme.read()
with open('CHANGES.txt', encoding='utf-8') as changes:
long_description += '\n\n' + changes.read()
setup_params = dict(
name='portend',
use_hg_version=True,
author="Jason R. Coombs",
author_email="jaraco@jaraco.com",
description="TCP port monitoring utilities",
long_description=long_description,
url="https://bitbucket.org/jaraco/portend",
packages=setuptools.find_packages(),
py_modules=['portend'],
install_requires=[
'jaraco.timing',
],
setup_requires=[
'hgtools',
'pytest-runner',
],
tests_require=[
'pytest',
],
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
],
)
if __name__ == '__main__':
setuptools.setup(**setup_params)
| #!/usr/bin/env python
# Generated by jaraco.develop (https://bitbucket.org/jaraco/jaraco.develop)
import io
import setuptools
with io.open('README.txt', encoding='utf-8') as readme:
long_description = readme.read()
with io.open('CHANGES.txt', encoding='utf-8') as changes:
long_description += '\n\n' + changes.read()
setup_params = dict(
name='portend',
use_hg_version=True,
author="Jason R. Coombs",
author_email="jaraco@jaraco.com",
description="TCP port monitoring utilities",
long_description=long_description,
url="https://bitbucket.org/jaraco/portend",
packages=setuptools.find_packages(),
py_modules=['portend'],
install_requires=[
'jaraco.timing',
],
setup_requires=[
'hgtools',
'pytest-runner',
],
tests_require=[
'pytest',
],
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
],
)
if __name__ == '__main__':
setuptools.setup(**setup_params)
| Use io.open for Python 2 compatibility. | Use io.open for Python 2 compatibility.
| Python | mit | jaraco/portend | ---
+++
@@ -1,10 +1,12 @@
#!/usr/bin/env python
# Generated by jaraco.develop (https://bitbucket.org/jaraco/jaraco.develop)
+import io
+
import setuptools
-with open('README.txt', encoding='utf-8') as readme:
+with io.open('README.txt', encoding='utf-8') as readme:
long_description = readme.read()
-with open('CHANGES.txt', encoding='utf-8') as changes:
+with io.open('CHANGES.txt', encoding='utf-8') as changes:
long_description += '\n\n' + changes.read()
setup_params = dict( |
8ac39062cf1a0fbc3fd3483491e0719e1482f42a | setup.py | setup.py | from distutils.core import setup
setup(
name = 'PyFVCOM',
packages = ['PyFVCOM'],
version = '1.2',
description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."),
author = 'Pierre Cazenave',
author_email = 'pica@pml.ac.uk',
url = 'https://gitlab.ecosystem-modelling.pml.ac.uk/pica/PyFVCOM',
download_url = 'https://gitlab.ecosystem-modelling.pml.ac.uk/fvcom/PyFVCOM/tarball/1.2',
keywords = ['fvcom', 'unstructured grid', 'mesh'],
license = 'MIT',
platforms = 'any',
classifiers = []
)
| from distutils.core import setup
setup(
name = 'PyFVCOM',
packages = ['PyFVCOM'],
version = '1.2',
description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."),
author = 'Pierre Cazenave',
author_email = 'pica@pml.ac.uk',
url = 'https://gitlab.ecosystem-modelling.pml.ac.uk/fvcom/PyFVCOM',
download_url = 'http://gitlab.em.pml.ac.uk/fvcom/PyFVCOM/repository/archive.tar.gz?ref=1.2',
keywords = ['fvcom', 'unstructured grid', 'mesh'],
license = 'MIT',
platforms = 'any',
classifiers = []
)
| Fix links for the archive and the homepage too. | Fix links for the archive and the homepage too.
| Python | mit | pwcazenave/PyFVCOM | ---
+++
@@ -7,8 +7,8 @@
description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."),
author = 'Pierre Cazenave',
author_email = 'pica@pml.ac.uk',
- url = 'https://gitlab.ecosystem-modelling.pml.ac.uk/pica/PyFVCOM',
- download_url = 'https://gitlab.ecosystem-modelling.pml.ac.uk/fvcom/PyFVCOM/tarball/1.2',
+ url = 'https://gitlab.ecosystem-modelling.pml.ac.uk/fvcom/PyFVCOM',
+ download_url = 'http://gitlab.em.pml.ac.uk/fvcom/PyFVCOM/repository/archive.tar.gz?ref=1.2',
keywords = ['fvcom', 'unstructured grid', 'mesh'],
license = 'MIT',
platforms = 'any', |
66b9761a85fa101da5c1c0f45846df0a35bedaf2 | setup.py | setup.py | from setuptools import setup
from setup_config import DESCRIPTION, VERSION, PROJECT_NAME, PROJECT_AUTHORS, GLOBAL_ENTRY_POINTS, PROJECT_EMAILS, PROJECT_URL, SHORT_DESCRIPTION
setup(name=PROJECT_NAME.lower(),
version=VERSION,
author=PROJECT_AUTHORS,
author_email=PROJECT_EMAILS,
packages=["jenkinsapi",], # Disabled use fo find-packages to exclude examples & tests
zip_safe=True,
include_package_data = False,
entry_points = GLOBAL_ENTRY_POINTS,
url=PROJECT_URL,
description=SHORT_DESCRIPTION,
long_description=DESCRIPTION,
)
| from setuptools import setup
from setup_config import DESCRIPTION, VERSION, PROJECT_NAME, PROJECT_AUTHORS, GLOBAL_ENTRY_POINTS, PROJECT_EMAILS, PROJECT_URL, SHORT_DESCRIPTION
setup(name=PROJECT_NAME.lower(),
version=VERSION,
author=PROJECT_AUTHORS,
author_email=PROJECT_EMAILS,
packages=["jenkinsapi",'jenkinsapi.utils'], # Disabled use fo find-packages to exclude examples & tests
zip_safe=True,
include_package_data = False,
entry_points = GLOBAL_ENTRY_POINTS,
url=PROJECT_URL,
description=SHORT_DESCRIPTION,
long_description=DESCRIPTION,
)
| Install fails without utils package which is required by JenkinsBase | Install fails without utils package which is required by JenkinsBase
We only install jenkinsapi package and nothing below it as it is specified now in the setup.py
This breaks the library because we need the jenkinsapi.utils package in JenkinsBase class
| Python | mit | imsardine/jenkinsapi,JohnLZeller/jenkinsapi,salimfadhley/jenkinsapi,ramonvanalteren/jenkinsapi,mistermocha/jenkinsapi,zaro0508/jenkinsapi,JohnLZeller/jenkinsapi,JohnLZeller/jenkinsapi,domenkozar/jenkinsapi,jduan/jenkinsapi,aerickson/jenkinsapi,domenkozar/jenkinsapi,salimfadhley/jenkinsapi,imsardine/jenkinsapi,zaro0508/jenkinsapi,zaro0508/jenkinsapi,mistermocha/jenkinsapi,imsardine/jenkinsapi,EwoutVDC/jenkinsapi,jduan/jenkinsapi,mistermocha/jenkinsapi,aerickson/jenkinsapi | ---
+++
@@ -5,7 +5,7 @@
version=VERSION,
author=PROJECT_AUTHORS,
author_email=PROJECT_EMAILS,
- packages=["jenkinsapi",], # Disabled use fo find-packages to exclude examples & tests
+ packages=["jenkinsapi",'jenkinsapi.utils'], # Disabled use fo find-packages to exclude examples & tests
zip_safe=True,
include_package_data = False,
entry_points = GLOBAL_ENTRY_POINTS, |
ba366f9910cf69c51f4a43fcf892751e600c06db | setup.py | setup.py | from setuptools import setup, find_packages
setup(
version='0.35',
name="pydvkbiology",
packages=find_packages(),
description='Python scripts used in my biology/bioinformatics research',
author='DV Klopfenstein',
author_email='music_pupil@yahoo.com',
scripts=['./pydvkbiology/NCBI/cols.py'],
license='BSD',
url='http://github.com/dvklopfenstein/biocode',
download_url='http://github.com/dvklopfenstein/biocode/tarball/0.1',
keywords=['NCBI', 'biology', 'bioinformatics'],
classifiers = [
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Topic :: Scientific/Engineering :: Bio-Informatics'],
#install_requires=['sys', 're', 'os', 'collections']
# Potential other requires:
# Entrez
# math
# matplotlib
# numpy
# requests
# shutil
)
| from setuptools import setup, find_packages
setup(
version='0.36',
name="pydvkbiology",
packages=find_packages(),
description='Python scripts used in my biology/bioinformatics research',
author='DV Klopfenstein',
author_email='music_pupil@yahoo.com',
scripts=['./pydvkbiology/NCBI/cols.py'],
license='BSD',
url='http://github.com/dvklopfenstein/biocode',
download_url='http://github.com/dvklopfenstein/biocode/tarball/0.1',
keywords=['NCBI', 'biology', 'bioinformatics'],
classifiers = [
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Topic :: Scientific/Engineering :: Bio-Informatics'],
#install_requires=['sys', 're', 'os', 'collections']
# Potential other requires:
# Entrez
# math
# matplotlib
# numpy
# requests
# shutil
)
| Handle illegal namedtuple field names, if found in a csv file. | Handle illegal namedtuple field names, if found in a csv file.
| Python | mit | dvklopfenstein/biocode | ---
+++
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
setup(
- version='0.35',
+ version='0.36',
name="pydvkbiology",
packages=find_packages(),
description='Python scripts used in my biology/bioinformatics research', |
20fe9ad0986c8034c3435484d11a18c2b2b1123b | setup.py | setup.py | import setuptools
setuptools.setup(
name="discode-server",
version="0.0.1",
url="https://github.com/d0ugal/discode-server",
license="BSD",
description="Quick code review",
long_description="TODO",
author="Dougal Matthews",
author_email="dougal@dougalmatthews.com",
keywords='code review codereview discussion',
packages=setuptools.find_packages(),
include_package_date=True,
zip_safe=False,
install_requires=[
# Rwmove the following on the next Sanic release (and add Sanic).
'httptools>=0.0.9',
'uvloop>=0.5.3',
'ujson>=1.35',
'aiofiles>=0.3.0',
],
entry_points={
'console_scripts': [
'discode-server = discode_server.__main__:cli',
],
'pygments.lexers': [
'mistral = discode_server.lexers.mistral.MistralLexer',
]
},
classifier=[
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 3.6',
'Topic :: Internet',
'Topic :: Utilities'
],
)
| import setuptools
setuptools.setup(
name="discode-server",
version="0.0.1",
url="https://github.com/d0ugal/discode-server",
license="BSD",
description="Quick code review",
long_description="TODO",
author="Dougal Matthews",
author_email="dougal@dougalmatthews.com",
keywords='code review codereview discussion',
packages=setuptools.find_packages(),
include_package_date=True,
zip_safe=False,
install_requires=[
# Rwmove the following on the next Sanic release (and add Sanic).
'httptools>=0.0.9',
'uvloop>=0.5.3',
'ujson>=1.35',
'aiofiles>=0.3.0',
],
entry_points={
'console_scripts': [
'discode-server = discode_server.__main__:cli',
],
'pygments.lexers': [
'mistral = discode_server.lexers.mistral:MistralLexer',
]
},
classifier=[
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 3.6',
'Topic :: Internet',
'Topic :: Utilities'
],
)
| Correct the Mistral lexer entry point | Correct the Mistral lexer entry point
| Python | bsd-2-clause | d0ugal/discode-server,d0ugal/discode-server,d0ugal/discode-server | ---
+++
@@ -25,7 +25,7 @@
'discode-server = discode_server.__main__:cli',
],
'pygments.lexers': [
- 'mistral = discode_server.lexers.mistral.MistralLexer',
+ 'mistral = discode_server.lexers.mistral:MistralLexer',
]
},
classifier=[ |
cf536666d2fd9f2fe56db8b7c998e8bbba55a443 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='vumi-wikipedia',
version='dev',
description='Vumi Wikipedia App',
packages=find_packages(),
install_requires=[
'vumi > 0.3.1',
'BeautifulSoup',
],
url='http://github.com/praekelt/vumi-wikipedia',
license='BSD',
long_description=open('README', 'r').read(),
maintainer='Praekelt Foundation',
maintainer_email='dev@praekelt.com',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Operating System :: POSIX',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Networking',
],
)
| from setuptools import setup, find_packages
setup(
name='vumi-wikipedia',
version='dev',
description='Vumi Wikipedia App',
packages=find_packages(),
install_requires=[
'vumi > 0.3.1',
'BeautifulSoup',
],
url='http://github.com/praekelt/vumi-wikipedia',
license='BSD',
long_description=open('README', 'r').read(),
maintainer='Praekelt Foundation',
maintainer_email='dev@praekelt.com',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: POSIX',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Networking',
],
)
| Add a suitable license classifier. | Add a suitable license classifier.
| Python | bsd-3-clause | praekelt/vumi-wikipedia,praekelt/vumi-wikipedia | ---
+++
@@ -18,6 +18,7 @@
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
+ 'License :: OSI Approved :: BSD License',
'Operating System :: POSIX',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7', |
55fa7b929e855ea98ac00f700c7c41bb5a971ddb | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(
name="stale",
version='1.1',
description="Identifies (and optionally removes) stale Delicious and Pinboard links",
author="Jon Parise",
author_email="jon@indelible.org",
url="https://github.com/jparise/stale",
scripts=['stale'],
license="MIT License",
classifiers=['License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python'],
)
| #!/usr/bin/env python
from distutils.core import setup
setup(
name="stale",
version='1.1',
description="Identifies (and optionally removes) stale Delicious and Pinboard links",
author="Jon Parise",
author_email="jon@indelible.org",
url="https://github.com/jparise/stale",
scripts=['stale'],
install_requires=['pydelicious'],
license="MIT License",
classifiers=['License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python'],
)
| Declare 'pydelicious' as a package dependency. | Declare 'pydelicious' as a package dependency.
Stock distutils will ignore this, but a setuptools-based installer
(easy_install or pip) will honor it.
| Python | mit | jparise/stale | ---
+++
@@ -10,6 +10,7 @@
author_email="jon@indelible.org",
url="https://github.com/jparise/stale",
scripts=['stale'],
+ install_requires=['pydelicious'],
license="MIT License",
classifiers=['License :: OSI Approved :: MIT License',
'Operating System :: OS Independent', |
cdccf3de5fa06414a7e0ee5544df02f8c0087bf1 | setup.py | setup.py | from setuptools import setup
setup(
name="colorlog",
version="6.1.1a1",
description="Add colours to the output of Python's logging module.",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
author="Sam Clements",
author_email="sam@borntyping.co.uk",
url="https://github.com/borntyping/python-colorlog",
license="MIT License",
packages=["colorlog"],
package_data={"colorlog": ["py.typed"]},
setup_requires=["setuptools>=38.6.0"],
extras_require={
':sys_platform=="win32"': ["colorama"],
"development": ["black", "flake8", "mypy", "pytest", "types-colorama"],
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"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 :: Terminals",
"Topic :: Utilities",
],
)
| from setuptools import setup
setup(
name="colorlog",
version="6.1.1a1",
description="Add colours to the output of Python's logging module.",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
author="Sam Clements",
author_email="sam@borntyping.co.uk",
url="https://github.com/borntyping/python-colorlog",
license="MIT License",
packages=["colorlog"],
package_data={"colorlog": ["py.typed"]},
setup_requires=["setuptools>=38.6.0"],
extras_require={
':sys_platform=="win32"': ["colorama"],
"development": ["black", "flake8", "mypy", "pytest", "types-colorama"],
},
python_requires=">=3.5",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Terminals",
"Topic :: Utilities",
],
)
| Add python_requires to help pip and classifier for PyPI | Add python_requires to help pip and classifier for PyPI
| Python | mit | borntyping/python-colorlog | ---
+++
@@ -17,6 +17,7 @@
':sys_platform=="win32"': ["colorama"],
"development": ["black", "flake8", "mypy", "pytest", "types-colorama"],
},
+ python_requires=">=3.5",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
@@ -29,6 +30,7 @@
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
"Topic :: Terminals",
"Topic :: Utilities",
], |
aa2e84828ddc5b9676c1df3e96669e0d892e164f | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name = "Greengraph",
version = "0.1",
packages = find_packages(exclude=["*test"]),
scripts = ["scripts/greengraph"],
install_requires = ["argparse","matplotlib"]
)
| from setuptools import setup, find_packages
setup(
name = "Greengraph",
version = "0.1",
packages = find_packages(exclude=["*test"]),
scripts = ["scripts/greengraph"],
install_requires = ["argparse","matplotlib","numpy","requests","geopy"]
)
| Add missing packages to install_requires | Add missing packages to install_requires
| Python | mit | MikeVasmer/GreenGraphCoursework | ---
+++
@@ -5,5 +5,5 @@
version = "0.1",
packages = find_packages(exclude=["*test"]),
scripts = ["scripts/greengraph"],
- install_requires = ["argparse","matplotlib"]
+ install_requires = ["argparse","matplotlib","numpy","requests","geopy"]
) |
6b26102efdee4ae365ddd0bce126d6045865a9bc | stock.py | stock.py | import bisect
import collections
PriceEvent = collections.namedtuple("PriceEvent", ["timestamp", "price"])
class Stock:
def __init__(self, symbol):
"""Constructor for Stock instance.
Args:
symbol: The stock symbol.
"""
self.symbol = symbol
self.price_history = []
@property
def price(self):
"""Returns the stocks most recent price.
Returns: Most recent price.
"""
return self.price_history[-1].price if self.price_history else None
def update(self, timestamp, price):
"""Updates the stock's price history.
Args:
timestamp: The timestamp of the update.
price: The new price of the stock.
"""
if price < 0:
raise ValueError("price should not be negative")
bisect.insort_left(self.price_history, PriceEvent(timestamp, price))
def is_increasing_trend(self):
"""Determines if last three prices were ascending in value.
Returns: True if there is an increasing trend, False if not.
"""
return self.price_history[-3].price < self.price_history[-2].price < self.price_history[-1].price
| # -*- coding: utf-8 -*-
"""Stock class and associated features.
Attributes:
stock_price_event: A namedtuple with timestamp and price of a stock price update.
"""
import bisect
import collections
stock_price_event = collections.namedtuple("stock_price_event", ["timestamp", "price"])
class Stock:
def __init__(self, symbol):
"""A Stock object representing its price history.
Args:
symbol (str): The stock symbol.
Attributes:
symbol (str): The stock symbol.
price (float): The most recent price.
"""
self.symbol = symbol
self.price_history = []
@property
def price(self):
"""Returns the stocks most recent price.
Returns: Most recent price.
"""
return self.price_history[-1].price if self.price_history else None
def update(self, timestamp, price):
"""Updates the stock's price history.
Args:
timestamp: The timestamp of the update.
price: The new price of the stock.
"""
if price < 0:
raise ValueError("price should not be negative")
bisect.insort_left(self.price_history, stock_price_event(timestamp, price))
def is_increasing_trend(self):
"""Determines if last three prices were ascending in value.
Returns: True if there is an increasing trend, False if not.
"""
return self.price_history[-3].price < self.price_history[-2].price < self.price_history[-1].price
| Update comments and variable names. | Update comments and variable names.
| Python | mit | bsmukasa/stock_alerter | ---
+++
@@ -1,15 +1,27 @@
+# -*- coding: utf-8 -*-
+"""Stock class and associated features.
+
+Attributes:
+ stock_price_event: A namedtuple with timestamp and price of a stock price update.
+
+"""
import bisect
import collections
-PriceEvent = collections.namedtuple("PriceEvent", ["timestamp", "price"])
+stock_price_event = collections.namedtuple("stock_price_event", ["timestamp", "price"])
class Stock:
def __init__(self, symbol):
- """Constructor for Stock instance.
+ """A Stock object representing its price history.
Args:
- symbol: The stock symbol.
+ symbol (str): The stock symbol.
+
+ Attributes:
+ symbol (str): The stock symbol.
+ price (float): The most recent price.
+
"""
self.symbol = symbol
self.price_history = []
@@ -29,10 +41,11 @@
Args:
timestamp: The timestamp of the update.
price: The new price of the stock.
+
"""
if price < 0:
raise ValueError("price should not be negative")
- bisect.insort_left(self.price_history, PriceEvent(timestamp, price))
+ bisect.insort_left(self.price_history, stock_price_event(timestamp, price))
def is_increasing_trend(self):
"""Determines if last three prices were ascending in value. |
1e33b557ca0539da3f5c95acc3be5eaab65e45f2 | setup.py | setup.py | import os
from setuptools import setup
HERE = os.path.abspath(os.path.dirname(__file__))
VERSION_NS = {}
with open(os.path.join(HERE, 'lc_wrapper', '_version.py')) as f:
exec(f.read(), {}, VERSION_NS)
setup(
name='lc_wrapper',
version=VERSION_NS['__version__'],
packages=['lc_wrapper', 'lc_wrapper.ipython'],
install_requires=['ipykernel>=4.0.0', 'jupyter_client', 'python-dateutil'],
description='Kernel Wrapper for Literate Computing',
author='NII Cloud Operation Team',
url='https://github.com/NII-cloud-operation/'
)
| import os
from setuptools import setup
HERE = os.path.abspath(os.path.dirname(__file__))
VERSION_NS = {}
with open(os.path.join(HERE, 'lc_wrapper', '_version.py')) as f:
exec(f.read(), {}, VERSION_NS)
setup(
name='lc_wrapper',
version=VERSION_NS['__version__'],
packages=['lc_wrapper', 'lc_wrapper.ipython', 'lc_wrapper.bash'],
install_requires=['ipykernel>=4.0.0', 'jupyter_client', 'python-dateutil'],
description='Kernel Wrapper for Literate Computing',
author='NII Cloud Operation Team',
url='https://github.com/NII-cloud-operation/'
)
| Add sub-package for Bash Wrapper | Add sub-package for Bash Wrapper
| Python | bsd-3-clause | NII-cloud-operation/Jupyter-LC_wrapper,NII-cloud-operation/Jupyter-LC_wrapper | ---
+++
@@ -10,7 +10,7 @@
setup(
name='lc_wrapper',
version=VERSION_NS['__version__'],
- packages=['lc_wrapper', 'lc_wrapper.ipython'],
+ packages=['lc_wrapper', 'lc_wrapper.ipython', 'lc_wrapper.bash'],
install_requires=['ipykernel>=4.0.0', 'jupyter_client', 'python-dateutil'],
description='Kernel Wrapper for Literate Computing',
author='NII Cloud Operation Team', |
88dc8fa2c2337b4b0688eae368f2960e2682bb46 | setup.py | setup.py | #!/usr/bin/env python
import twelve
import twelve.adapters
import twelve.services
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name="twelve",
version=twelve.__version__,
description="12factor inspired settings for a variety of backing services archetypes.",
long_description=open("README.rst").read() + '\n\n' +
open("CHANGELOG.rst").read(),
author="Donald Stufft",
author_email="donald.stufft@gmail.com",
url="https://crate.io/packages/twelve/",
packages=[
"twelve",
],
package_data={"": ["LICENSE"]},
include_package_data=True,
install_requires=[
"extensions"
],
license=open("LICENSE").read(),
classifiers=(
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.0",
"Programming Language :: Python :: 3.1",
),
)
| #!/usr/bin/env python
import twelve
import twelve.adapters
import twelve.services
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name="twelve",
version=twelve.__version__,
description="12factor inspired settings for a variety of backing services archetypes.",
long_description="\n\n".join([open("README.rst").read(), open("CHANGELOG.rst").read()]),
author="Donald Stufft",
author_email="donald.stufft@gmail.com",
url="https://crate.io/packages/twelve/",
packages=[
"twelve",
],
package_data={"": ["LICENSE"]},
include_package_data=True,
install_requires=[
"extensions"
],
license=open("LICENSE").read(),
classifiers=(
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.0",
"Programming Language :: Python :: 3.1",
),
)
| Clean up pulling README.rst and CHANGELOG.rst into the long_description | Clean up pulling README.rst and CHANGELOG.rst into the long_description
| Python | bsd-3-clause | dstufft/twelve | ---
+++
@@ -12,8 +12,7 @@
name="twelve",
version=twelve.__version__,
description="12factor inspired settings for a variety of backing services archetypes.",
- long_description=open("README.rst").read() + '\n\n' +
- open("CHANGELOG.rst").read(),
+ long_description="\n\n".join([open("README.rst").read(), open("CHANGELOG.rst").read()]),
author="Donald Stufft",
author_email="donald.stufft@gmail.com",
url="https://crate.io/packages/twelve/", |
d6c514d6282415d243b990375e2582ed8530be04 | setup.py | setup.py | import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.version_info <= (2, 4):
error = 'Requires Python Version 2.5 or above... exiting.'
print >> sys.stderr, error
sys.exit(1)
requirements = [
'requests>=2.11.1,<3.0',
]
setup(name='googlemaps',
version='3.0.2',
description='Python client library for Google Maps API Web Services',
scripts=[],
url='https://github.com/googlemaps/google-maps-services-python',
packages=['googlemaps'],
license='Apache 2.0',
platforms='Posix; MacOS X; Windows',
setup_requires=requirements,
install_requires=requirements,
test_suite='googlemaps.test',
classifiers=['Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Internet',
]
)
| import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.version_info <= (2, 4):
error = 'Requires Python Version 2.5 or above... exiting.'
print >> sys.stderr, error
sys.exit(1)
requirements = [
'requests>=2.20.0,<3.0',
]
setup(name='googlemaps',
version='3.0.2',
description='Python client library for Google Maps API Web Services',
scripts=[],
url='https://github.com/googlemaps/google-maps-services-python',
packages=['googlemaps'],
license='Apache 2.0',
platforms='Posix; MacOS X; Windows',
setup_requires=requirements,
install_requires=requirements,
test_suite='googlemaps.test',
classifiers=['Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Internet',
]
)
| Increase the required version of requests. | Increase the required version of requests.
Versions of the requests library prior to 2.20.0 have a known
security vulnerability (CVE-2018-18074).
| Python | apache-2.0 | googlemaps/google-maps-services-python | ---
+++
@@ -14,7 +14,7 @@
requirements = [
- 'requests>=2.11.1,<3.0',
+ 'requests>=2.20.0,<3.0',
]
setup(name='googlemaps', |
d725a22557f9fef564ae00cde9829064c7616f54 | setup.py | setup.py | import os
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='django-uuslug',
version='0.3',
description = "A Unicode slug that is also guaranteed to be unique",
long_description = read('README'),
author='Val L33',
author_email='val@neekware.com',
url='http://bitbucket.org/un33k/django-uuslug',
packages=['uuslug'],
install_requires = ['Unidecode>=0.04.5'],
classifiers=['Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Utilities'],
)
| import os
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='django-uuslug',
version='0.4',
description = "A Unicode slug that is also guaranteed to be unique",
long_description = read('README'),
author='Val L33',
author_email='val@neekware.com',
url='http://github.com/un33k/django-uuslug',
packages=['uuslug'],
install_requires = ['Unidecode>=0.04.5'],
classifiers=['Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Utilities'],
)
| Switch to github and up the version | Switch to github and up the version
| Python | mit | un33k/django-uuslug,un33k/django-uuslug | ---
+++
@@ -5,12 +5,12 @@
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='django-uuslug',
- version='0.3',
+ version='0.4',
description = "A Unicode slug that is also guaranteed to be unique",
long_description = read('README'),
author='Val L33',
author_email='val@neekware.com',
- url='http://bitbucket.org/un33k/django-uuslug',
+ url='http://github.com/un33k/django-uuslug',
packages=['uuslug'],
install_requires = ['Unidecode>=0.04.5'],
classifiers=['Development Status :: 4 - Beta', |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.