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
|
|---|---|---|---|---|---|---|---|---|---|---|
fc73dfb33f4e19d649672f19a1dc4cf09b229d29
|
echo_server.py
|
echo_server.py
|
#! /usr/bin/env python
"""Echo server in socket connection: receives and sends back a message."""
import socket
if __name__ == '__main__':
"""Run from terminal, this will recieve a messages and send them back."""
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM,
socket.IPPROTO_IP)
server_socket.bind(('127.0.0.1', 50000))
server_socket.listen(1)
buffsize = 32
try:
while True:
msg = ''
done = False
conn, addr = server_socket.accept()
while not done:
msg_part = conn.recv(buffsize)
msg += msg_part
if len(msg_part) < buffsize:
done = True
conn.sendall(msg)
conn.shutdown(socket.SHUT_WR)
conn.close()
except KeyboardInterrupt:
print 'I successfully stopped.'
server_socket.close()
|
#! /usr/bin/env python
"""Echo server in socket connection: receives and sends back a message."""
import socket
def response_ok():
"""Return byte string 200 ok response."""
return u"HTTP/1.1 200 OK\nContent-Type: text/plain\nContent-length: 18\n\r\neverything is okay".encode('utf-8')
def reponse_error(error_code, reason):
"""Return byte string error code."""
return u"HTTP/1.1 {} {}".format(error_code, reason).encode('utf-8')
if __name__ == '__main__':
"""Run from terminal, this will recieve a messages and send them back."""
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM,
socket.IPPROTO_IP)
server_socket.bind(('127.0.0.1', 50000))
server_socket.listen(1)
buffsize = 32
try:
while True:
msg = ''
done = False
conn, addr = server_socket.accept()
while not done:
msg_part = conn.recv(buffsize)
msg += msg_part
if len(msg_part) < buffsize:
done = True
conn.sendall(msg)
conn.shutdown(socket.SHUT_WR)
conn.close()
except KeyboardInterrupt:
print 'I successfully stopped.'
server_socket.close()
|
Add response_ok and response_error methods which return byte strings.
|
Add response_ok and response_error methods which return byte strings.
|
Python
|
mit
|
bm5w/network_tools
|
---
+++
@@ -1,6 +1,16 @@
#! /usr/bin/env python
"""Echo server in socket connection: receives and sends back a message."""
import socket
+
+
+def response_ok():
+ """Return byte string 200 ok response."""
+ return u"HTTP/1.1 200 OK\nContent-Type: text/plain\nContent-length: 18\n\r\neverything is okay".encode('utf-8')
+
+
+def reponse_error(error_code, reason):
+ """Return byte string error code."""
+ return u"HTTP/1.1 {} {}".format(error_code, reason).encode('utf-8')
if __name__ == '__main__':
|
d97144e2b45750c416d3adbf9f49f78bfa8e7e6e
|
Lib/sandbox/pyem/misc.py
|
Lib/sandbox/pyem/misc.py
|
# Last Change: Sat Jun 09 07:00 PM 2007 J
#========================================================
# Constants used throughout the module (def args, etc...)
#========================================================
# This is the default dimension for representing confidence ellipses
DEF_VIS_DIM = [0, 1]
DEF_ELL_NP = 100
DEF_LEVEL = 0.39
#=====================================================================
# "magic number", that is number used to control regularization and co
# Change them at your risk !
#=====================================================================
# max deviation allowed when comparing double (this is actually stupid,
# I should actually use a number of decimals)
_MAX_DBL_DEV = 1e-10
# max conditional number allowed
_MAX_COND = 1e8
_MIN_INV_COND = 1/_MAX_COND
# Default alpha for regularization
_DEF_ALPHA = 1e-1
# Default min delta for regularization
_MIN_DBL_DELTA = 1e-5
|
# Last Change: Sat Jun 09 08:00 PM 2007 J
#========================================================
# Constants used throughout the module (def args, etc...)
#========================================================
# This is the default dimension for representing confidence ellipses
DEF_VIS_DIM = (0, 1)
DEF_ELL_NP = 100
DEF_LEVEL = 0.39
#=====================================================================
# "magic number", that is number used to control regularization and co
# Change them at your risk !
#=====================================================================
# max deviation allowed when comparing double (this is actually stupid,
# I should actually use a number of decimals)
_MAX_DBL_DEV = 1e-10
# max conditional number allowed
_MAX_COND = 1e8
_MIN_INV_COND = 1/_MAX_COND
# Default alpha for regularization
_DEF_ALPHA = 1e-1
# Default min delta for regularization
_MIN_DBL_DELTA = 1e-5
|
Set def arguments to immutable to avoid nasty side effect.
|
Set def arguments to immutable to avoid nasty side effect.
git-svn-id: 003f22d385e25de9cff933a5ea4efd77cb5e7b28@3086 d6536bca-fef9-0310-8506-e4c0a848fbcf
|
Python
|
bsd-3-clause
|
scipy/scipy-svn,lesserwhirls/scipy-cwt,jasonmccampbell/scipy-refactor,lesserwhirls/scipy-cwt,lesserwhirls/scipy-cwt,scipy/scipy-svn,lesserwhirls/scipy-cwt,scipy/scipy-svn,scipy/scipy-svn,jasonmccampbell/scipy-refactor,jasonmccampbell/scipy-refactor,jasonmccampbell/scipy-refactor
|
---
+++
@@ -1,10 +1,10 @@
-# Last Change: Sat Jun 09 07:00 PM 2007 J
+# Last Change: Sat Jun 09 08:00 PM 2007 J
#========================================================
# Constants used throughout the module (def args, etc...)
#========================================================
# This is the default dimension for representing confidence ellipses
-DEF_VIS_DIM = [0, 1]
+DEF_VIS_DIM = (0, 1)
DEF_ELL_NP = 100
DEF_LEVEL = 0.39
#=====================================================================
|
de2e3dd947660b4b1222820141c5c7cd66098349
|
django_split/models.py
|
django_split/models.py
|
from django.db import models
class ExperimentGroup(models.Model):
experiment = models.CharField(max_length=48)
user = models.ForeignKey('auth.User', related_name=None)
group = models.IntegerField()
class Meta:
unique_together = (
('experiment', 'user'),
)
class ExperimentState(models.Model):
experiment = models.CharField(max_length=48, primary_key=True)
started = models.DateTimeField(null=True)
completed = models.DateTimeField(null=True)
class ExperimentResult(models.Model):
experiment = models.CharField(max_length=48)
group = models.IntegerField()
metric = models.IntegerField()
percentile = models.IntegerField()
value = models.FloatField()
class Meta:
unique_together = (
('experiment', 'group', 'metric', 'percentile'),
)
|
from django.db import models
class ExperimentGroup(models.Model):
experiment = models.CharField(max_length=48)
user = models.ForeignKey(
'auth.User',
related_name='django_split_experiment_groups',
)
group = models.IntegerField()
class Meta:
unique_together = (
('experiment', 'user'),
)
class ExperimentState(models.Model):
experiment = models.CharField(max_length=48, primary_key=True)
started = models.DateTimeField(null=True)
completed = models.DateTimeField(null=True)
class ExperimentResult(models.Model):
experiment = models.CharField(max_length=48)
group = models.IntegerField()
metric = models.IntegerField()
percentile = models.IntegerField()
value = models.FloatField()
class Meta:
unique_together = (
('experiment', 'group', 'metric', 'percentile'),
)
|
Add an explicit related name
|
Add an explicit related name
|
Python
|
mit
|
prophile/django_split
|
---
+++
@@ -3,7 +3,10 @@
class ExperimentGroup(models.Model):
experiment = models.CharField(max_length=48)
- user = models.ForeignKey('auth.User', related_name=None)
+ user = models.ForeignKey(
+ 'auth.User',
+ related_name='django_split_experiment_groups',
+ )
group = models.IntegerField()
|
4299f4f410f768066aaacf885ff0a38e8af175c9
|
intro-django/readit/books/forms.py
|
intro-django/readit/books/forms.py
|
from django import forms
from .models import Book
class ReviewForm(forms.Form):
"""
Form for reviewing a book
"""
is_favourite = forms.BooleanField(
label = 'Favourite?',
help_text = 'In your top 100 books of all time?',
required = False,
)
review = forms.CharField(
widget = forms.Textarea,
min_length = 100,
error_messages = {
'required': 'Please enter your review',
'min_length': 'Please write atleast 100 characters (You have written %(show_value)s',
}
)
class BookForm(forms.ModelForm) :
class Meta:
model = Book
fields = ['title', 'authors']
|
from django import forms
from .models import Book
class ReviewForm(forms.Form):
"""
Form for reviewing a book
"""
is_favourite = forms.BooleanField(
label = 'Favourite?',
help_text = 'In your top 100 books of all time?',
required = False,
)
review = forms.CharField(
widget = forms.Textarea,
min_length = 100,
error_messages = {
'required': 'Please enter your review',
'min_length': 'Please write atleast 100 characters (You have written %(show_value)s',
}
)
class BookForm(forms.ModelForm) :
class Meta:
model = Book
fields = ['title', 'authors']
def clean(self):
# Super the clean method to maintain main validation and error messages
super(BookForm, self).clean()
try:
title = self.cleaned_data.get('title')
authors = self.cleaned_data.get('authors')
book = Book.objects.get(title=title, authors=authors)
raise forms.ValidationError(
'The book {} by {} already exists.'.format(title, book.list_authors()),
code = 'bookexists'
)
except Book.DoesNotExist:
return self.cleaned_data
|
Add custom form validation enforcing that each new book is unique
|
Add custom form validation enforcing that each new book is unique
|
Python
|
mit
|
nirajkvinit/python3-study,nirajkvinit/python3-study,nirajkvinit/python3-study,nirajkvinit/python3-study
|
---
+++
@@ -25,3 +25,19 @@
class Meta:
model = Book
fields = ['title', 'authors']
+
+ def clean(self):
+ # Super the clean method to maintain main validation and error messages
+ super(BookForm, self).clean()
+
+ try:
+ title = self.cleaned_data.get('title')
+ authors = self.cleaned_data.get('authors')
+ book = Book.objects.get(title=title, authors=authors)
+
+ raise forms.ValidationError(
+ 'The book {} by {} already exists.'.format(title, book.list_authors()),
+ code = 'bookexists'
+ )
+ except Book.DoesNotExist:
+ return self.cleaned_data
|
ddeffc09ce1eab426fe46129bead712059f93f45
|
docker/settings/web.py
|
docker/settings/web.py
|
from .docker_compose import DockerBaseSettings
class WebDevSettings(DockerBaseSettings):
# Needed to serve 404 pages properly
# NOTE: it may introduce some strange behavior
DEBUG = False
WebDevSettings.load_settings(__name__)
|
from .docker_compose import DockerBaseSettings
class WebDevSettings(DockerBaseSettings):
pass
WebDevSettings.load_settings(__name__)
|
Remove DEBUG=False that's not needed anymore
|
Remove DEBUG=False that's not needed anymore
Now we are serving 404s via El Proxito and forcing DEBUG=False is not
needed anymore.
|
Python
|
mit
|
rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org
|
---
+++
@@ -1,9 +1,8 @@
from .docker_compose import DockerBaseSettings
+
class WebDevSettings(DockerBaseSettings):
+ pass
- # Needed to serve 404 pages properly
- # NOTE: it may introduce some strange behavior
- DEBUG = False
WebDevSettings.load_settings(__name__)
|
01e1900a139d7525a0803d5a160a9d91210fe219
|
csv2kmz/csv2kmz.py
|
csv2kmz/csv2kmz.py
|
import os
import argparse
from buildkmz import create_kmz_from_csv
def main():
""" Build file as per user inputs
"""
args = get_cmd_args()
iPath = args.input
sPath = args.styles
oDir = args.output
create_kmz_from_csv(iPath,sPath,oDir)
def get_cmd_args():
"""Get, process and return command line arguments to the script
"""
help_description = '''
CSVtoKMZ
Converts a parsed .csv file to a .kmz Google Earth overlay.
'''
help_epilog = ''
parser = argparse.ArgumentParser(description=help_description,
formatter_class=argparse.RawTextHelpFormatter,
epilog=help_epilog)
parser.add_argument('-o','--output', help='Specify alternate output directory',
default='../output/')
parser.add_argument('-s','--styles', help='Specify location of settings for point styles',
default='settings/styles.json')
parser.add_argument('-i','--input', help='Specify file to convert',
default='data/Example.csv')
return parser.parse_args()
if __name__ == '__main__':
main()
|
import os
import argparse
import logging
from buildkmz import create_kmz_from_csv
def main():
""" Build file as per user inputs
"""
logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s', level=logging.INFO)
args = get_cmd_args()
iPath = args.input
sPath = args.styles
oDir = args.output
create_kmz_from_csv(iPath,sPath,oDir)
def get_cmd_args():
"""Get, process and return command line arguments to the script
"""
help_description = '''
CSVtoKMZ
Converts a parsed .csv file to a .kmz Google Earth overlay.
'''
help_epilog = ''
parser = argparse.ArgumentParser(description=help_description,
formatter_class=argparse.RawTextHelpFormatter,
epilog=help_epilog)
parser.add_argument('-o','--output', help='Specify alternate output directory',
default='../output/')
parser.add_argument('-s','--styles', help='Specify location of settings for point styles',
default='settings/styles.json')
parser.add_argument('-i','--input', help='Specify file to convert',
default='data/Example.csv')
return parser.parse_args()
if __name__ == '__main__':
main()
|
Add logging output when called from command line
|
Add logging output when called from command line
|
Python
|
mit
|
aguinane/csvtokmz
|
---
+++
@@ -1,10 +1,13 @@
import os
import argparse
+import logging
from buildkmz import create_kmz_from_csv
def main():
""" Build file as per user inputs
"""
+
+ logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s', level=logging.INFO)
args = get_cmd_args()
iPath = args.input
|
984c395e3f43764a4d8125aea7556179bb4766dd
|
test/_mysqldb_test.py
|
test/_mysqldb_test.py
|
'''
$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 211
Server version: 5.6.15 Homebrew
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database luigi;
Query OK, 1 row affected (0.00 sec)
'''
import mysql.connector
from luigi.contrib.mysqldb import MySqlTarget
import unittest
host = 'localhost'
port = 3306
database = 'luigi_test'
username = None
password = None
table_updates = 'table_updates'
def _create_test_database():
con = mysql.connector.connect(user=username,
password=password,
host=host,
port=port,
autocommit=True)
con.cursor().execute('CREATE DATABASE IF NOT EXISTS %s' % database)
_create_test_database()
target = MySqlTarget(host, database, username, password, '', 'update_id')
class MySqlTargetTest(unittest.TestCase):
def test_touch_and_exists(self):
drop()
self.assertFalse(target.exists(),
'Target should not exist before touching it')
target.touch()
self.assertTrue(target.exists(),
'Target should exist after touching it')
def drop():
con = target.connect(autocommit=True)
con.cursor().execute('DROP TABLE IF EXISTS %s' % table_updates)
|
import mysql.connector
from luigi.contrib.mysqldb import MySqlTarget
import unittest
host = 'localhost'
port = 3306
database = 'luigi_test'
username = None
password = None
table_updates = 'table_updates'
def _create_test_database():
con = mysql.connector.connect(user=username,
password=password,
host=host,
port=port,
autocommit=True)
con.cursor().execute('CREATE DATABASE IF NOT EXISTS %s' % database)
_create_test_database()
target = MySqlTarget(host, database, username, password, '', 'update_id')
class MySqlTargetTest(unittest.TestCase):
def test_touch_and_exists(self):
drop()
self.assertFalse(target.exists(),
'Target should not exist before touching it')
target.touch()
self.assertTrue(target.exists(),
'Target should exist after touching it')
def drop():
con = target.connect(autocommit=True)
con.cursor().execute('DROP TABLE IF EXISTS %s' % table_updates)
|
Remove the doc that describes the setup. Setup is automated now
|
Remove the doc that describes the setup. Setup is automated now
|
Python
|
apache-2.0
|
moritzschaefer/luigi,kalaidin/luigi,riga/luigi,foursquare/luigi,dylanjbarth/luigi,Dawny33/luigi,harveyxia/luigi,graingert/luigi,slvnperron/luigi,harveyxia/luigi,sahitya-pavurala/luigi,hadesbox/luigi,rayrrr/luigi,humanlongevity/luigi,Tarrasch/luigi,Magnetic/luigi,percyfal/luigi,torypages/luigi,stroykova/luigi,theoryno3/luigi,leafjungle/luigi,slvnperron/luigi,vine/luigi,Houzz/luigi,SeedScientific/luigi,stephenpascoe/luigi,fw1121/luigi,LamCiuLoeng/luigi,ivannotes/luigi,kalaidin/luigi,dhruvg/luigi,meyerson/luigi,ViaSat/luigi,jw0201/luigi,anyman/luigi,bowlofstew/luigi,kalaidin/luigi,Yoone/luigi,stephenpascoe/luigi,SkyTruth/luigi,dlstadther/luigi,dstandish/luigi,ZhenxingWu/luigi,theoryno3/luigi,Dawny33/luigi,PeteW/luigi,ZhenxingWu/luigi,mbruggmann/luigi,aeron15/luigi,foursquare/luigi,penelopy/luigi,laserson/luigi,h3biomed/luigi,wakamori/luigi,adaitche/luigi,kevhill/luigi,ContextLogic/luigi,slvnperron/luigi,dstandish/luigi,samepage-labs/luigi,huiyi1990/luigi,rayrrr/luigi,meyerson/luigi,ContextLogic/luigi,bmaggard/luigi,penelopy/luigi,torypages/luigi,slvnperron/luigi,hellais/luigi,linearregression/luigi,ehdr/luigi,springcoil/luigi,neilisaac/luigi,lungetech/luigi,spotify/luigi,Tarrasch/luigi,PeteW/luigi,dstandish/luigi,javrasya/luigi,dhruvg/luigi,torypages/luigi,wakamori/luigi,jw0201/luigi,rayrrr/luigi,springcoil/luigi,lungetech/luigi,laserson/luigi,h3biomed/luigi,realgo/luigi,mfcabrera/luigi,jw0201/luigi,joeshaw/luigi,oldpa/luigi,soxofaan/luigi,republic-analytics/luigi,ChrisBeaumont/luigi,rizzatti/luigi,graingert/luigi,linsomniac/luigi,penelopy/luigi,casey-green/luigi,DomainGroupOSS/luigi,neilisaac/luigi,altaf-ali/luigi,belevtsoff/luigi,gpoulin/luigi,edx/luigi,laserson/luigi,anyman/luigi,altaf-ali/luigi,DomainGroupOSS/luigi,dhruvg/luigi,adaitche/luigi,PeteW/luigi,huiyi1990/luigi,walkers-mv/luigi,dkroy/luigi,alkemics/luigi,JackDanger/luigi,moandcompany/luigi,altaf-ali/luigi,dlstadther/luigi,jamesmcm/luigi,tuulos/luigi,edx/luigi,vine/luigi,walkers-mv/luigi,anyman/luigi,linearregression/luigi,jamesmcm/luigi,glenndmello/luigi,JackDanger/luigi,moritzschaefer/luigi,thejens/luigi,soxofaan/luigi,kalaidin/luigi,stroykova/luigi,neilisaac/luigi,dkroy/luigi,ViaSat/luigi,17zuoye/luigi,anyman/luigi,ehdr/luigi,samuell/luigi,samuell/luigi,graingert/luigi,vine/luigi,belevtsoff/luigi,SkyTruth/luigi,upworthy/luigi,upworthy/luigi,lichia/luigi,joeshaw/luigi,fabriziodemaria/luigi,neilisaac/luigi,humanlongevity/luigi,wakamori/luigi,percyfal/luigi,Dawny33/luigi,lichia/luigi,ViaSat/luigi,hadesbox/luigi,dylanjbarth/luigi,17zuoye/luigi,Houzz/luigi,PeteW/luigi,joeshaw/luigi,samepage-labs/luigi,meyerson/luigi,ChrisBeaumont/luigi,ehdr/luigi,LamCiuLoeng/luigi,ZhenxingWu/luigi,dylanjbarth/luigi,Magnetic/luigi,theoryno3/luigi,samepage-labs/luigi,dhruvg/luigi,theoryno3/luigi,mfcabrera/luigi,kevhill/luigi,h3biomed/luigi,DomainGroupOSS/luigi,17zuoye/luigi,fabriziodemaria/luigi,leafjungle/luigi,drincruz/luigi,javrasya/luigi,LamCiuLoeng/luigi,mbruggmann/luigi,cpcloud/luigi,dstandish/luigi,lichia/luigi,ViaSat/luigi,fw1121/luigi,dylanjbarth/luigi,hadesbox/luigi,bmaggard/luigi,ivannotes/luigi,oldpa/luigi,Tarrasch/luigi,lichia/luigi,soxofaan/luigi,tuulos/luigi,linsomniac/luigi,realgo/luigi,qpxu007/luigi,qpxu007/luigi,bmaggard/luigi,moritzschaefer/luigi,graingert/luigi,springcoil/luigi,foursquare/luigi,soxofaan/luigi,riga/luigi,springcoil/luigi,spotify/luigi,realgo/luigi,upworthy/luigi,ivannotes/luigi,SeedScientific/luigi,percyfal/luigi,republic-analytics/luigi,pkexcellent/luigi,ehdr/luigi,walkers-mv/luigi,thejens/luigi,humanlongevity/luigi,rizzatti/luigi,ChrisBeaumont/luigi,ThQ/luigi,drincruz/luigi,fabriziodemaria/luigi,samepage-labs/luigi,glenndmello/luigi,vine/luigi,republic-analytics/luigi,ContextLogic/luigi,mfcabrera/luigi,republic-analytics/luigi,jamesmcm/luigi,Wattpad/luigi,mbruggmann/luigi,ThQ/luigi,rizzatti/luigi,bowlofstew/luigi,hadesbox/luigi,linsomniac/luigi,stephenpascoe/luigi,dlstadther/luigi,belevtsoff/luigi,stroykova/luigi,upworthy/luigi,stroykova/luigi,moritzschaefer/luigi,casey-green/luigi,leafjungle/luigi,SkyTruth/luigi,casey-green/luigi,dlstadther/luigi,JackDanger/luigi,moandcompany/luigi,moandcompany/luigi,Houzz/luigi,ivannotes/luigi,lungetech/luigi,javrasya/luigi,Tarrasch/luigi,mfcabrera/luigi,DomainGroupOSS/luigi,spotify/luigi,humanlongevity/luigi,wakamori/luigi,linearregression/luigi,qpxu007/luigi,moandcompany/luigi,hellais/luigi,17zuoye/luigi,bowlofstew/luigi,riga/luigi,pkexcellent/luigi,altaf-ali/luigi,harveyxia/luigi,riga/luigi,h3biomed/luigi,samuell/luigi,ChrisBeaumont/luigi,kevhill/luigi,rayrrr/luigi,LamCiuLoeng/luigi,penelopy/luigi,sahitya-pavurala/luigi,aeron15/luigi,samuell/luigi,rizzatti/luigi,jw0201/luigi,SkyTruth/luigi,alkemics/luigi,Dawny33/luigi,bmaggard/luigi,linearregression/luigi,alkemics/luigi,SeedScientific/luigi,ThQ/luigi,sahitya-pavurala/luigi,jamesmcm/luigi,dkroy/luigi,oldpa/luigi,lungetech/luigi,Wattpad/luigi,dkroy/luigi,aeron15/luigi,gpoulin/luigi,thejens/luigi,Magnetic/luigi,JackDanger/luigi,belevtsoff/luigi,sahitya-pavurala/luigi,pkexcellent/luigi,casey-green/luigi,walkers-mv/luigi,Yoone/luigi,glenndmello/luigi,Magnetic/luigi,qpxu007/luigi,drincruz/luigi,Wattpad/luigi,hellais/luigi,ZhenxingWu/luigi,glenndmello/luigi,huiyi1990/luigi,linsomniac/luigi,edx/luigi,aeron15/luigi,adaitche/luigi,fw1121/luigi,thejens/luigi,meyerson/luigi,fw1121/luigi,SeedScientific/luigi,kevhill/luigi,fabriziodemaria/luigi,harveyxia/luigi,foursquare/luigi,percyfal/luigi,laserson/luigi,leafjungle/luigi,tuulos/luigi,drincruz/luigi,bowlofstew/luigi,oldpa/luigi,spotify/luigi,tuulos/luigi,joeshaw/luigi,gpoulin/luigi,pkexcellent/luigi,gpoulin/luigi,Yoone/luigi,adaitche/luigi,huiyi1990/luigi,ThQ/luigi,torypages/luigi,hellais/luigi,stephenpascoe/luigi,edx/luigi,cpcloud/luigi,ContextLogic/luigi,javrasya/luigi,realgo/luigi,mbruggmann/luigi,Houzz/luigi,alkemics/luigi,Yoone/luigi
|
---
+++
@@ -1,21 +1,3 @@
-'''
-$ mysql
-Welcome to the MySQL monitor. Commands end with ; or \g.
-Your MySQL connection id is 211
-Server version: 5.6.15 Homebrew
-
-Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
-
-Oracle is a registered trademark of Oracle Corporation and/or its
-affiliates. Other names may be trademarks of their respective
-owners.
-
-Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
-
-mysql> create database luigi;
-Query OK, 1 row affected (0.00 sec)
-'''
-
import mysql.connector
from luigi.contrib.mysqldb import MySqlTarget
import unittest
|
a48f651435d212907cb34164470a9028ba161300
|
test/test_vasp_raman.py
|
test/test_vasp_raman.py
|
# -*- coding: utf-8 -*-
import os
import time
import unittest
import vasp_raman
class VaspRamanTester(unittest.TestCase):
def testMAT_m_VEC(self):
self.assertTrue(False)
|
# -*- coding: utf-8 -*-
import os
import time
import unittest
import vasp_raman
class VaspRamanTester(unittest.TestCase):
def testT(self):
m = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
mref = [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
mres = vasp_raman.T(m)
for i in range(len(m)):
self.assertSequenceEqual(mref[i], mres[i])
|
Add a test for vasp_raman.T
|
Add a test for vasp_raman.T
|
Python
|
mit
|
raman-sc/VASP,raman-sc/VASP
|
---
+++
@@ -5,5 +5,10 @@
import vasp_raman
class VaspRamanTester(unittest.TestCase):
- def testMAT_m_VEC(self):
- self.assertTrue(False)
+ def testT(self):
+ m = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
+ mref = [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
+
+ mres = vasp_raman.T(m)
+ for i in range(len(m)):
+ self.assertSequenceEqual(mref[i], mres[i])
|
c99bbc0a30dca8aaa72a4c79543400d9fbf97ebb
|
tests/test_compat.py
|
tests/test_compat.py
|
import click
import pytest
if click.__version__ >= '3.0':
def test_legacy_callbacks(runner):
def legacy_callback(ctx, value):
return value.upper()
@click.command()
@click.option('--foo', callback=legacy_callback)
def cli(foo):
click.echo(foo)
with pytest.warns(Warning, match='Invoked legacy parameter callback'):
result = runner.invoke(cli, ['--foo', 'wat'])
assert result.exit_code == 0
assert 'WAT' in result.output
def test_bash_func_name():
from click._bashcomplete import get_completion_script
script = get_completion_script('foo-bar baz_blah', '_COMPLETE_VAR').strip()
assert script.startswith('_foo_barbaz_blah_completion()')
assert '_COMPLETE_VAR=complete $1' in script
|
import click
import pytest
if click.__version__ >= '3.0':
def test_legacy_callbacks(runner):
def legacy_callback(ctx, value):
return value.upper()
@click.command()
@click.option('--foo', callback=legacy_callback)
def cli(foo):
click.echo(foo)
with pytest.warns(Warning, match='Invoked legacy parameter callback'):
result = runner.invoke(cli, ['--foo', 'wat'])
assert result.exit_code == 0
assert 'WAT' in result.output
def test_bash_func_name():
from click._bashcomplete import get_completion_script
script = get_completion_script('foo-bar baz_blah', '_COMPLETE_VAR', 'bash').strip()
assert script.startswith('_foo_barbaz_blah_completion()')
assert '_COMPLETE_VAR=complete $1' in script
|
Fix failing bash completion function test signature.
|
Fix failing bash completion function test signature.
|
Python
|
bsd-3-clause
|
pallets/click,mitsuhiko/click
|
---
+++
@@ -20,6 +20,6 @@
def test_bash_func_name():
from click._bashcomplete import get_completion_script
- script = get_completion_script('foo-bar baz_blah', '_COMPLETE_VAR').strip()
+ script = get_completion_script('foo-bar baz_blah', '_COMPLETE_VAR', 'bash').strip()
assert script.startswith('_foo_barbaz_blah_completion()')
assert '_COMPLETE_VAR=complete $1' in script
|
22a1e02efae195ef8f93a34eedfc28a8d9bb40ba
|
tests/test_prompt.py
|
tests/test_prompt.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_prompt
--------------
Tests for `cookiecutter.prompt` module.
"""
import unittest
from cookiecutter import prompt
class TestPrompt(unittest.TestCase):
def test_prompt_for_config(self):
context = {"cookiecutter": {"full_name": "Your Name",
"email": "you@example.com"}}
# TODO: figure out how to mock input with pexpect or something
# prompt.prompt_for_config(context)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_prompt
--------------
Tests for `cookiecutter.prompt` module.
"""
import unittest
from unittest.mock import patch
from cookiecutter import prompt
# class TestPrompt(unittest.TestCase):
# def test_prompt_for_config(self):
# context = {"cookiecutter": {"full_name": "Your Name",
# "email": "you@example.com"}}
# TODO: figure out how to mock input with pexpect or something
# prompt.prompt_for_config(context)
class TestQueryAnswers(unittest.TestCase):
@patch('builtins.input', lambda: 'y')
def test_query_y(self):
answer = prompt.query_yes_no("Blah?")
self.assertTrue(answer)
@patch('builtins.input', lambda: 'ye')
def test_query_ye(self):
answer = prompt.query_yes_no("Blah?")
self.assertTrue(answer)
@patch('builtins.input', lambda: 'yes')
def test_query_yes(self):
answer = prompt.query_yes_no("Blah?")
self.assertTrue(answer)
@patch('builtins.input', lambda: 'n')
def test_query_n(self):
answer = prompt.query_yes_no("Blah?")
self.assertFalse(answer)
@patch('builtins.input', lambda: 'no')
def test_query_n(self):
answer = prompt.query_yes_no("Blah?")
self.assertFalse(answer)
# @patch('builtins.input', lambda: 'junk')
# def test_query_junk(self):
# answer = prompt.query_yes_no("Blah?")
# self.assertTrue(answer)
class TestQueryDefaults(unittest.TestCase):
@patch('builtins.input', lambda: 'y')
def test_query_y_none_default(self):
answer = prompt.query_yes_no("Blah?", default=None)
self.assertTrue(answer)
@patch('builtins.input', lambda: 'n')
def test_query_n_none_default(self):
answer = prompt.query_yes_no("Blah?", default=None)
self.assertFalse(answer)
@patch('builtins.input', lambda: '')
def test_query_no_default(self):
answer = prompt.query_yes_no("Blah?", default='no')
self.assertFalse(answer)
@patch('builtins.input', lambda: 'junk')
def test_query_bad_default(self):
self.assertRaises(ValueError, prompt.query_yes_no, "Blah?", default='yn')
|
Add many tests for prompt.query_yes_no().
|
Add many tests for prompt.query_yes_no().
|
Python
|
bsd-3-clause
|
kkujawinski/cookiecutter,utek/cookiecutter,foodszhang/cookiecutter,audreyr/cookiecutter,alex/cookiecutter,letolab/cookiecutter,venumech/cookiecutter,dajose/cookiecutter,venumech/cookiecutter,michaeljoseph/cookiecutter,atlassian/cookiecutter,willingc/cookiecutter,pjbull/cookiecutter,vincentbernat/cookiecutter,sp1rs/cookiecutter,dajose/cookiecutter,moi65/cookiecutter,benthomasson/cookiecutter,cguardia/cookiecutter,ramiroluz/cookiecutter,Springerle/cookiecutter,audreyr/cookiecutter,0k/cookiecutter,atlassian/cookiecutter,Vauxoo/cookiecutter,letolab/cookiecutter,takeflight/cookiecutter,lucius-feng/cookiecutter,sp1rs/cookiecutter,agconti/cookiecutter,moi65/cookiecutter,alex/cookiecutter,drgarcia1986/cookiecutter,lgp171188/cookiecutter,lgp171188/cookiecutter,nhomar/cookiecutter,nhomar/cookiecutter,hackebrot/cookiecutter,Springerle/cookiecutter,luzfcb/cookiecutter,drgarcia1986/cookiecutter,jhermann/cookiecutter,lucius-feng/cookiecutter,cguardia/cookiecutter,kkujawinski/cookiecutter,tylerdave/cookiecutter,terryjbates/cookiecutter,vincentbernat/cookiecutter,cichm/cookiecutter,foodszhang/cookiecutter,janusnic/cookiecutter,stevepiercy/cookiecutter,vintasoftware/cookiecutter,michaeljoseph/cookiecutter,cichm/cookiecutter,ionelmc/cookiecutter,janusnic/cookiecutter,pjbull/cookiecutter,hackebrot/cookiecutter,vintasoftware/cookiecutter,christabor/cookiecutter,benthomasson/cookiecutter,christabor/cookiecutter,ramiroluz/cookiecutter,willingc/cookiecutter,Vauxoo/cookiecutter,luzfcb/cookiecutter,0k/cookiecutter,ionelmc/cookiecutter,jhermann/cookiecutter,agconti/cookiecutter,stevepiercy/cookiecutter,utek/cookiecutter,terryjbates/cookiecutter,tylerdave/cookiecutter,takeflight/cookiecutter
|
---
+++
@@ -9,14 +9,68 @@
"""
import unittest
+from unittest.mock import patch
from cookiecutter import prompt
-class TestPrompt(unittest.TestCase):
- def test_prompt_for_config(self):
- context = {"cookiecutter": {"full_name": "Your Name",
- "email": "you@example.com"}}
+# class TestPrompt(unittest.TestCase):
+# def test_prompt_for_config(self):
+# context = {"cookiecutter": {"full_name": "Your Name",
+# "email": "you@example.com"}}
# TODO: figure out how to mock input with pexpect or something
# prompt.prompt_for_config(context)
+
+class TestQueryAnswers(unittest.TestCase):
+
+ @patch('builtins.input', lambda: 'y')
+ def test_query_y(self):
+ answer = prompt.query_yes_no("Blah?")
+ self.assertTrue(answer)
+
+ @patch('builtins.input', lambda: 'ye')
+ def test_query_ye(self):
+ answer = prompt.query_yes_no("Blah?")
+ self.assertTrue(answer)
+
+ @patch('builtins.input', lambda: 'yes')
+ def test_query_yes(self):
+ answer = prompt.query_yes_no("Blah?")
+ self.assertTrue(answer)
+
+ @patch('builtins.input', lambda: 'n')
+ def test_query_n(self):
+ answer = prompt.query_yes_no("Blah?")
+ self.assertFalse(answer)
+
+ @patch('builtins.input', lambda: 'no')
+ def test_query_n(self):
+ answer = prompt.query_yes_no("Blah?")
+ self.assertFalse(answer)
+
+ # @patch('builtins.input', lambda: 'junk')
+ # def test_query_junk(self):
+ # answer = prompt.query_yes_no("Blah?")
+ # self.assertTrue(answer)
+
+class TestQueryDefaults(unittest.TestCase):
+
+ @patch('builtins.input', lambda: 'y')
+ def test_query_y_none_default(self):
+ answer = prompt.query_yes_no("Blah?", default=None)
+ self.assertTrue(answer)
+
+ @patch('builtins.input', lambda: 'n')
+ def test_query_n_none_default(self):
+ answer = prompt.query_yes_no("Blah?", default=None)
+ self.assertFalse(answer)
+
+ @patch('builtins.input', lambda: '')
+ def test_query_no_default(self):
+ answer = prompt.query_yes_no("Blah?", default='no')
+ self.assertFalse(answer)
+
+ @patch('builtins.input', lambda: 'junk')
+ def test_query_bad_default(self):
+ self.assertRaises(ValueError, prompt.query_yes_no, "Blah?", default='yn')
|
eed78d3a671aee0fcc0760f15087085f2918da6c
|
travis_ci/settings.py
|
travis_ci/settings.py
|
"""GeoKey settings."""
from geokey.core.settings.dev import *
DEFAULT_FROM_EMAIL = 'no-reply@travis-ci.org'
ACCOUNT_EMAIL_VERIFICATION = 'optional'
SECRET_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxx'
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'geokey',
'USER': 'postgres',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
INSTALLED_APPS += (
'geokey_epicollect',
)
STATIC_URL = '/static/'
MEDIA_ROOT = normpath(join(dirname(dirname(abspath(__file__))), 'assets'))
MEDIA_URL = '/assets/'
WSGI_APPLICATION = 'wsgi.application'
|
"""GeoKey settings."""
from geokey.core.settings.dev import *
DEFAULT_FROM_EMAIL = 'no-reply@travis-ci.org'
ACCOUNT_EMAIL_VERIFICATION = 'optional'
SECRET_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxx'
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'geokey',
'USER': 'postgres',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
ALLOWED_HOSTS = ['localhost']
INSTALLED_APPS += (
'geokey_epicollect',
)
STATIC_URL = '/static/'
MEDIA_ROOT = normpath(join(dirname(dirname(abspath(__file__))), 'assets'))
MEDIA_URL = '/assets/'
WSGI_APPLICATION = 'wsgi.application'
|
Add "localhost" in the allowed hosts for testing purposes
|
Add "localhost" in the allowed hosts for testing purposes
|
Python
|
mit
|
ExCiteS/geokey-epicollect,ExCiteS/geokey-epicollect
|
---
+++
@@ -19,6 +19,8 @@
}
}
+ALLOWED_HOSTS = ['localhost']
+
INSTALLED_APPS += (
'geokey_epicollect',
)
|
4c6fb23dd40216604f914d4f869b40d23b13bf73
|
django/__init__.py
|
django/__init__.py
|
VERSION = (1, 4, 5, 'final', 0)
def get_version(version=None):
"""Derives a PEP386-compliant version number from VERSION."""
if version is None:
version = VERSION
assert len(version) == 5
assert version[3] in ('alpha', 'beta', 'rc', 'final')
# Now build the two parts of the version number:
# main = X.Y[.Z]
# sub = .devN - for pre-alpha releases
# | {a|b|c}N - for alpha, beta and rc releases
parts = 2 if version[2] == 0 else 3
main = '.'.join(str(x) for x in version[:parts])
sub = ''
if version[3] == 'alpha' and version[4] == 0:
# At the toplevel, this would cause an import loop.
from django.utils.version import get_svn_revision
svn_revision = get_svn_revision()[4:]
if svn_revision != 'unknown':
sub = '.dev%s' % svn_revision
elif version[3] != 'final':
mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'}
sub = mapping[version[3]] + str(version[4])
return main + sub
|
VERSION = (1, 4, 6, 'alpha', 0)
def get_version(version=None):
"""Derives a PEP386-compliant version number from VERSION."""
if version is None:
version = VERSION
assert len(version) == 5
assert version[3] in ('alpha', 'beta', 'rc', 'final')
# Now build the two parts of the version number:
# main = X.Y[.Z]
# sub = .devN - for pre-alpha releases
# | {a|b|c}N - for alpha, beta and rc releases
parts = 2 if version[2] == 0 else 3
main = '.'.join(str(x) for x in version[:parts])
sub = ''
if version[3] == 'alpha' and version[4] == 0:
# At the toplevel, this would cause an import loop.
from django.utils.version import get_svn_revision
svn_revision = get_svn_revision()[4:]
if svn_revision != 'unknown':
sub = '.dev%s' % svn_revision
elif version[3] != 'final':
mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'}
sub = mapping[version[3]] + str(version[4])
return main + sub
|
Bump version to no longer claim to be 1.4.5 final.
|
[1.4.x] Bump version to no longer claim to be 1.4.5 final.
|
Python
|
bsd-3-clause
|
riklaunim/django-custom-multisite,riklaunim/django-custom-multisite,riklaunim/django-custom-multisite
|
---
+++
@@ -1,4 +1,4 @@
-VERSION = (1, 4, 5, 'final', 0)
+VERSION = (1, 4, 6, 'alpha', 0)
def get_version(version=None):
"""Derives a PEP386-compliant version number from VERSION."""
|
0e46b47a3053e63f50d6fd90b1ba810e4694c9be
|
blo/__init__.py
|
blo/__init__.py
|
from blo.BloArticle import BloArticle
from blo.DBControl import DBControl
class Blo:
def __init__(self, db_file_path, template_dir=""):
self.template_dir = template_dir
# create tables
self.db_file_path = db_file_path
self.db_control = DBControl(self.db_file_path)
self.db_control.create_tables()
self.db_control.close_connect()
def insert_article(self, file_path):
self.db_control = DBControl(self.db_file_path)
article = BloArticle(self.template_dir)
article.load_from_file(file_path)
self.db_control.insert_article(article)
self.db_control.close_connect()
|
import configparser
from blo.BloArticle import BloArticle
from blo.DBControl import DBControl
class Blo:
def __init__(self, config_file_path):
config = configparser.ConfigParser()
config.read(config_file_path)
self.template_dir = config['TEMPLATE']['TEMPLATE_DIR']
self.db_file_path = config['DB']['DB_PATH']
# create tables
self.db_control = DBControl(self.db_file_path)
self.db_control.create_tables()
self.db_control.close_connect()
def insert_article(self, file_path):
self.db_control = DBControl(self.db_file_path)
article = BloArticle(self.template_dir)
article.load_from_file(file_path)
self.db_control.insert_article(article)
self.db_control.close_connect()
|
Implement system configurations load from file.
|
Implement system configurations load from file.
|
Python
|
mit
|
10nin/blo,10nin/blo
|
---
+++
@@ -1,12 +1,16 @@
+import configparser
from blo.BloArticle import BloArticle
from blo.DBControl import DBControl
class Blo:
- def __init__(self, db_file_path, template_dir=""):
- self.template_dir = template_dir
+ def __init__(self, config_file_path):
+ config = configparser.ConfigParser()
+ config.read(config_file_path)
+ self.template_dir = config['TEMPLATE']['TEMPLATE_DIR']
+ self.db_file_path = config['DB']['DB_PATH']
+
# create tables
- self.db_file_path = db_file_path
self.db_control = DBControl(self.db_file_path)
self.db_control.create_tables()
self.db_control.close_connect()
|
91d24b3ce272ff166d1e828f0822e7b9a0124d2c
|
tests/test_dataset.py
|
tests/test_dataset.py
|
import pytest
from zfssnap import Host, Dataset
import subprocess
PROPERTY_PREFIX = 'zfssnap'
class TestDataset(object):
@pytest.fixture
def fs(self):
fs_name = 'zpool/dataset'
host = Host()
return Dataset(host, fs_name)
@pytest.fixture
def ssh_fs(self):
ssh_user = 'root'
ssh_host = 'host'
fs_name = 'zpool/dataset'
host = Host(ssh_user=ssh_user, ssh_host=ssh_host)
return Dataset(host, fs_name)
def test_autoconvert_to_int(self):
assert isinstance(Dataset._autoconvert('123'), int)
def test_autoconvert_to_str(self):
assert isinstance(Dataset._autoconvert('12f'), str)
def test_return_local_location(self, fs):
assert fs.location == 'zpool/dataset'
def test_return_ssh_location(self, ssh_fs):
assert ssh_fs.location == 'root@host:zpool/dataset'
|
import pytest
from zfssnap import autotype, Host, Dataset
import subprocess
PROPERTY_PREFIX = 'zfssnap'
class TestDataset(object):
@pytest.fixture
def fs(self):
fs_name = 'zpool/dataset'
host = Host()
return Dataset(host, fs_name)
@pytest.fixture
def ssh_fs(self):
ssh_user = 'root'
ssh_host = 'host'
fs_name = 'zpool/dataset'
host = Host(ssh_user=ssh_user, ssh_host=ssh_host)
return Dataset(host, fs_name)
def test_autotype_to_int(self):
assert isinstance(autotype('123'), int)
def test_autotype_to_str(self):
assert isinstance(autotype('12f'), str)
def test_return_local_location(self, fs):
assert fs.location == 'zpool/dataset'
def test_return_ssh_location(self, ssh_fs):
assert ssh_fs.location == 'root@host:zpool/dataset'
|
Fix broken tests after moving _autoconvert to autotype
|
Fix broken tests after moving _autoconvert to autotype
|
Python
|
mit
|
hkbakke/zfssnap,hkbakke/zfssnap
|
---
+++
@@ -1,5 +1,5 @@
import pytest
-from zfssnap import Host, Dataset
+from zfssnap import autotype, Host, Dataset
import subprocess
@@ -21,11 +21,11 @@
host = Host(ssh_user=ssh_user, ssh_host=ssh_host)
return Dataset(host, fs_name)
- def test_autoconvert_to_int(self):
- assert isinstance(Dataset._autoconvert('123'), int)
+ def test_autotype_to_int(self):
+ assert isinstance(autotype('123'), int)
- def test_autoconvert_to_str(self):
- assert isinstance(Dataset._autoconvert('12f'), str)
+ def test_autotype_to_str(self):
+ assert isinstance(autotype('12f'), str)
def test_return_local_location(self, fs):
assert fs.location == 'zpool/dataset'
|
a0a1606d115efd3521ac957aa9a39efec60eda8c
|
tests/test_issuers.py
|
tests/test_issuers.py
|
from mollie.api.objects.issuer import Issuer
from .utils import assert_list_object
def test_get_issuers(client, response):
"""Get all the iDeal issuers via the include querystring parameter."""
response.get('https://api.mollie.com/v2/methods/ideal?include=issuers', 'method_get_ideal_with_includes')
issuers = client.methods.get('ideal', include='issuers').issuers
assert_list_object(issuers, Issuer)
# check the last issuer
assert issuer.image_svg == 'https://www.mollie.com/external/icons/ideal-issuers/FVLBNL22.svg'
assert issuer.image_size1x == 'https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/FVLBNL22.png'
assert issuer.image_size2x == 'https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/FVLBNL22.png'
assert issuer.name == 'van Lanschot'
assert issuer.resource == 'issuer'
assert issuer.id == 'ideal_FVLBNL22'
|
from mollie.api.objects.issuer import Issuer
from .utils import assert_list_object
def test_get_issuers(client, response):
"""Get all the iDeal issuers via the include querystring parameter."""
response.get('https://api.mollie.com/v2/methods/ideal?include=issuers', 'method_get_ideal_with_includes')
issuers = client.methods.get('ideal', include='issuers').issuers
assert_list_object(issuers, Issuer)
# check a single retrieved issuer
issuer = next(issuers)
assert issuer.image_svg == 'https://www.mollie.com/external/icons/ideal-issuers/ABNANL2A.svg'
assert issuer.image_size1x == 'https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/ABNANL2A.png'
assert issuer.image_size2x == 'https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/ABNANL2A%402x.png'
assert issuer.name == 'ABN AMRO'
assert issuer.resource == 'issuer'
assert issuer.id == 'ideal_ABNANL2A'
|
Test the first item of the list, not the last
|
Test the first item of the list, not the last
|
Python
|
bsd-2-clause
|
mollie/mollie-api-python
|
---
+++
@@ -10,10 +10,11 @@
issuers = client.methods.get('ideal', include='issuers').issuers
assert_list_object(issuers, Issuer)
- # check the last issuer
- assert issuer.image_svg == 'https://www.mollie.com/external/icons/ideal-issuers/FVLBNL22.svg'
- assert issuer.image_size1x == 'https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/FVLBNL22.png'
- assert issuer.image_size2x == 'https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/FVLBNL22.png'
- assert issuer.name == 'van Lanschot'
+ # check a single retrieved issuer
+ issuer = next(issuers)
+ assert issuer.image_svg == 'https://www.mollie.com/external/icons/ideal-issuers/ABNANL2A.svg'
+ assert issuer.image_size1x == 'https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/ABNANL2A.png'
+ assert issuer.image_size2x == 'https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/ABNANL2A%402x.png'
+ assert issuer.name == 'ABN AMRO'
assert issuer.resource == 'issuer'
- assert issuer.id == 'ideal_FVLBNL22'
+ assert issuer.id == 'ideal_ABNANL2A'
|
1ccd9e7f15cfaccfadf7e4e977dbde724885cab9
|
tests/test_sync_call.py
|
tests/test_sync_call.py
|
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
Tests for synchronous call helper
"""
import time
from switchy import sync_caller
from switchy.apps.players import TonePlay
def test_toneplay(fsip):
'''Test the synchronous caller with a simple toneplay
'''
with sync_caller(fsip, apps={"TonePlay": TonePlay}) as caller:
# have the external prof call itself by default
assert 'TonePlay' in caller.app_names
sess, waitfor = caller(
"doggy@{}:{}".format(caller.client.server, 5080),
'TonePlay',
timeout=3,
)
assert sess.is_outbound()
time.sleep(1)
sess.hangup()
time.sleep(0.1)
assert caller.client.listener.count_calls() == 0
|
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
Tests for synchronous call helper
"""
import time
from switchy import sync_caller
from switchy.apps.players import TonePlay, PlayRec
def test_toneplay(fsip):
'''Test the synchronous caller with a simple toneplay
'''
with sync_caller(fsip, apps={"TonePlay": TonePlay}) as caller:
# have the external prof call itself by default
assert 'TonePlay' in caller.app_names
sess, waitfor = caller(
"doggy@{}:{}".format(caller.client.server, 5080),
'TonePlay',
timeout=3,
)
assert sess.is_outbound()
time.sleep(1)
sess.hangup()
time.sleep(0.1)
assert caller.client.listener.count_calls() == 0
def test_playrec(fsip):
'''Test the synchronous caller with a simulated conversation using the the
`PlayRec` app. Currently this test does no audio checking but merely verifies
the callback chain is invoked as expected.
'''
with sync_caller(fsip, apps={"PlayRec": PlayRec}) as caller:
# have the external prof call itself by default
caller.apps.PlayRec.sim_convo = True
sess, waitfor = caller(
"doggy@{}:{}".format(caller.client.server, 5080),
'PlayRec',
timeout=10,
)
waitfor(sess, 'recorded', timeout=15)
waitfor(sess.call.get_peer(sess), 'recorded', timeout=15)
assert sess.call.vars['record']
time.sleep(1)
assert sess.hungup
|
Add a `PlayRec` app unit test
|
Add a `PlayRec` app unit test
Merely checks that all sessions are recorded as expected and that the call
is hung up afterwards. None of the recorded audio content is verified.
|
Python
|
mpl-2.0
|
sangoma/switchy,wwezhuimeng/switch
|
---
+++
@@ -6,7 +6,7 @@
"""
import time
from switchy import sync_caller
-from switchy.apps.players import TonePlay
+from switchy.apps.players import TonePlay, PlayRec
def test_toneplay(fsip):
@@ -25,3 +25,23 @@
sess.hangup()
time.sleep(0.1)
assert caller.client.listener.count_calls() == 0
+
+
+def test_playrec(fsip):
+ '''Test the synchronous caller with a simulated conversation using the the
+ `PlayRec` app. Currently this test does no audio checking but merely verifies
+ the callback chain is invoked as expected.
+ '''
+ with sync_caller(fsip, apps={"PlayRec": PlayRec}) as caller:
+ # have the external prof call itself by default
+ caller.apps.PlayRec.sim_convo = True
+ sess, waitfor = caller(
+ "doggy@{}:{}".format(caller.client.server, 5080),
+ 'PlayRec',
+ timeout=10,
+ )
+ waitfor(sess, 'recorded', timeout=15)
+ waitfor(sess.call.get_peer(sess), 'recorded', timeout=15)
+ assert sess.call.vars['record']
+ time.sleep(1)
+ assert sess.hungup
|
8793b1a2c4adf480534cf2a669337032edf77020
|
golang/main.py
|
golang/main.py
|
#!/usr/bin/env python
from evolution_master.runners import pkg, download
# Install for Arch
with pkg.pacman() as pkg_man:
pkg_man.install('go')
# Install for Debian & Ubuntu
with pkg.apt() as pkg_man:
pkg_man.install('golang')
# Install for OSX
with pkg.brew() as pkg_man:
pkg_man.install('go')
# Install for Windows
with download.https() as downloader, pkg.msiexec() as installer:
downloader.get('https://storage.googleapis.com/golang/go1.5.1.windows-amd64.msi')
downloader.checksum('sha1', '0a439f49b546b82f85adf84a79bbf40de2b3d5ba')
installer.install_flags('/qn' '/norestart')
installer.await(downloader.finished())
|
from evolution_master.runners import pkg, download
# Install for Arch
with pkg.pacman() as pkg_man:
pkg_man.install('go')
# Install for Debian & Ubuntu
with pkg.apt() as pkg_man:
pkg_man.install('golang')
# Install for OSX
with pkg.brew() as pkg_man:
pkg_man.install('go')
# Install for Windows
with download.https() as downloader, pkg.msiexec() as installer:
downloader.get('https://storage.googleapis.com/golang/go1.5.1.windows-amd64.msi')
downloader.checksum('sha1', '0a439f49b546b82f85adf84a79bbf40de2b3d5ba')
installer.install_flags('/qn' '/norestart')
installer.await(downloader.finished())
|
Remove header, this will be imported by a runner
|
Remove header, this will be imported by a runner
|
Python
|
mit
|
hatchery/Genepool2,hatchery/genepool
|
---
+++
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-
from evolution_master.runners import pkg, download
# Install for Arch
|
6f24aa5e1e1ff78e95ed17ff75acc2646280bdd8
|
typedmarshal/util.py
|
typedmarshal/util.py
|
def pretty_print_recursive(obj, indent=0):
def i_print(s):
print(' ' * indent + s)
if obj is None:
i_print('None')
elif isinstance(obj, (int, float, str)):
i_print(f'{obj}')
elif isinstance(obj, list):
for l in obj:
pretty_print_recursive(l, indent=indent+2)
elif isinstance(obj, dict):
for k, v in obj:
i_print(f'{k}: {v}')
else:
for k, v in obj.__dict__.items():
if not k.startswith('_'):
if v.__class__.__name__ not in __builtins__:
i_print(f'{k}:')
pretty_print_recursive(v, indent=indent+2)
elif isinstance(v, (list, dict)):
i_print(f'{k}:')
pretty_print_recursive(v, indent=indent)
else:
i_print(f'{k}: {v}')
|
def pretty_print_recursive(obj, indent=0):
def i_print(s):
print(' ' * indent + s)
if obj is None:
i_print('None')
elif isinstance(obj, (int, float, str)):
i_print(f'{obj}')
elif isinstance(obj, list):
for l in obj:
pretty_print_recursive(l, indent=indent+2)
elif isinstance(obj, dict):
for k, v in obj.items():
i_print(f'{k}: {repr(v)}')
else:
for k, v in obj.__dict__.items():
if not k.startswith('_'):
if v is None:
i_print(f'{k}: None')
elif v.__class__.__name__ not in __builtins__:
i_print(f'{k}:')
pretty_print_recursive(v, indent=indent+2)
elif isinstance(v, (list, dict)):
i_print(f'{k}:')
pretty_print_recursive(v, indent=indent)
else:
i_print(f'{k}: {repr(v)}')
|
Add None identifier / repr print
|
Add None identifier / repr print
|
Python
|
bsd-3-clause
|
puhitaku/typedmarshal
|
---
+++
@@ -10,16 +10,18 @@
for l in obj:
pretty_print_recursive(l, indent=indent+2)
elif isinstance(obj, dict):
- for k, v in obj:
- i_print(f'{k}: {v}')
+ for k, v in obj.items():
+ i_print(f'{k}: {repr(v)}')
else:
for k, v in obj.__dict__.items():
if not k.startswith('_'):
- if v.__class__.__name__ not in __builtins__:
+ if v is None:
+ i_print(f'{k}: None')
+ elif v.__class__.__name__ not in __builtins__:
i_print(f'{k}:')
pretty_print_recursive(v, indent=indent+2)
elif isinstance(v, (list, dict)):
i_print(f'{k}:')
pretty_print_recursive(v, indent=indent)
else:
- i_print(f'{k}: {v}')
+ i_print(f'{k}: {repr(v)}')
|
4c8dd2b074d2c2227729ff0bd87cf60d06e97485
|
retry.py
|
retry.py
|
# Define retry util function
class RetryException(Exception):
pass
def retry(func, max_retry=10):
"""
@param func: The function that needs to be retry
(to pass function with arguments use partial object)
@param max_retry: Maximum retry of `func` function, default is `10`
@return: result of func
@raise: RetryException if retries exceeded than max_retry
"""
for retry in range(1, max_retry + 1):
try:
return func()
except Exception:
print ('Failed to call {}, in retry({}/{})'.format(func, retry, max_retry))
else:
raise RetryException(max_retry)
|
# Helper script with retry utility function
# set logging for `retry` channel
import logging
logger = logging.getLogger('retry')
# Define Exception class for retry
class RetryException(Exception):
DESCRIPTION = "Exception ({}) raised after {} tries."
def __init__(self, exception, max_retry):
self.exception = exception
self.max_retry = max_retry
def __unicode__(self):
return self.DESCRIPTION.format(self.exception, self.max_retry)
def __str__(self):
return self.__unicode__()
# Define retry utility function
def retry(func, max_retry=10):
"""
@param func: The function that needs to be retry
(to pass function with arguments use partial object)
@param max_retry: Maximum retry of `func` function, default is `10`
@return: result of func
@raise: RetryException if retries exceeded than max_retry
"""
for retry in range(1, max_retry + 1):
try:
return func()
except Exception, e:
logger.info('Failed to call {}, in retry({}/{})'.format(func.func,
retry, max_retry))
else:
raise RetryException(e, max_retry)
|
Extend custom exception and add additional logging
|
Extend custom exception and add additional logging
|
Python
|
mit
|
duboviy/misc
|
---
+++
@@ -1,10 +1,26 @@
-# Define retry util function
+# Helper script with retry utility function
+
+# set logging for `retry` channel
+import logging
+logger = logging.getLogger('retry')
+# Define Exception class for retry
class RetryException(Exception):
- pass
+ DESCRIPTION = "Exception ({}) raised after {} tries."
+ def __init__(self, exception, max_retry):
+ self.exception = exception
+ self.max_retry = max_retry
+
+ def __unicode__(self):
+ return self.DESCRIPTION.format(self.exception, self.max_retry)
+
+ def __str__(self):
+ return self.__unicode__()
+
+# Define retry utility function
def retry(func, max_retry=10):
"""
@param func: The function that needs to be retry
@@ -16,7 +32,8 @@
for retry in range(1, max_retry + 1):
try:
return func()
- except Exception:
- print ('Failed to call {}, in retry({}/{})'.format(func, retry, max_retry))
+ except Exception, e:
+ logger.info('Failed to call {}, in retry({}/{})'.format(func.func,
+ retry, max_retry))
else:
- raise RetryException(max_retry)
+ raise RetryException(e, max_retry)
|
5fbb833cf5fa33f2d364d6b56fcc90240297a57b
|
src/sentry/utils/metrics.py
|
src/sentry/utils/metrics.py
|
from __future__ import absolute_import
__all__ = ['timing', 'incr']
from django_statsd.clients import statsd
from django.conf import settings
from random import random
def _get_key(key):
prefix = settings.SENTRY_METRICS_PREFIX
if prefix:
return '{}{}'.format(prefix, key)
return key
def incr(key, amount=1):
from sentry.app import tsdb
sample_rate = settings.SENTRY_METRICS_SAMPLE_RATE
statsd.incr(_get_key(key), amount,
rate=sample_rate)
if sample_rate >= 1 or random() >= sample_rate:
tsdb.incr(tsdb.models.internal, key)
def timing(key, value):
# TODO(dcramer): implement timing for tsdb
return statsd.timing(_get_key(key), value,
rate=settings.SENTRY_METRICS_SAMPLE_RATE)
def timer(key):
# TODO(dcramer): implement timing for tsdb
return statsd.timer(_get_key(key),
rate=settings.SENTRY_METRICS_SAMPLE_RATE)
|
from __future__ import absolute_import
__all__ = ['timing', 'incr']
from django_statsd.clients import statsd
from django.conf import settings
from random import random
def _get_key(key):
prefix = settings.SENTRY_METRICS_PREFIX
if prefix:
return '{}{}'.format(prefix, key)
return key
def incr(key, amount=1):
from sentry.app import tsdb
sample_rate = settings.SENTRY_METRICS_SAMPLE_RATE
statsd.incr(_get_key(key), amount,
rate=sample_rate)
if sample_rate >= 1 or random() >= sample_rate:
if sample_rate > 0 and sample_rate < 1:
amount = amount * (1.0 / sample_rate)
tsdb.incr(tsdb.models.internal, key, amount)
def timing(key, value):
# TODO(dcramer): implement timing for tsdb
return statsd.timing(_get_key(key), value,
rate=settings.SENTRY_METRICS_SAMPLE_RATE)
def timer(key):
# TODO(dcramer): implement timing for tsdb
return statsd.timer(_get_key(key),
rate=settings.SENTRY_METRICS_SAMPLE_RATE)
|
Handle sample rate in counts
|
Handle sample rate in counts
|
Python
|
bsd-3-clause
|
JackDanger/sentry,zenefits/sentry,argonemyth/sentry,jean/sentry,zenefits/sentry,nicholasserra/sentry,1tush/sentry,songyi199111/sentry,JamesMura/sentry,korealerts1/sentry,gg7/sentry,jean/sentry,zenefits/sentry,argonemyth/sentry,boneyao/sentry,Kryz/sentry,jean/sentry,vperron/sentry,kevinastone/sentry,looker/sentry,ifduyue/sentry,gg7/sentry,boneyao/sentry,BayanGroup/sentry,ewdurbin/sentry,beeftornado/sentry,felixbuenemann/sentry,pauloschilling/sentry,Natim/sentry,looker/sentry,ewdurbin/sentry,vperron/sentry,BuildingLink/sentry,drcapulet/sentry,BuildingLink/sentry,kevinlondon/sentry,ewdurbin/sentry,BuildingLink/sentry,JackDanger/sentry,ifduyue/sentry,wong2/sentry,kevinlondon/sentry,fuziontech/sentry,kevinlondon/sentry,beeftornado/sentry,BayanGroup/sentry,korealerts1/sentry,fotinakis/sentry,gencer/sentry,Natim/sentry,mvaled/sentry,JTCunning/sentry,imankulov/sentry,ifduyue/sentry,looker/sentry,mvaled/sentry,JackDanger/sentry,ngonzalvez/sentry,fuziontech/sentry,songyi199111/sentry,jean/sentry,looker/sentry,alexm92/sentry,nicholasserra/sentry,JTCunning/sentry,daevaorn/sentry,zenefits/sentry,beeftornado/sentry,nicholasserra/sentry,korealerts1/sentry,TedaLIEz/sentry,alexm92/sentry,BuildingLink/sentry,pauloschilling/sentry,1tush/sentry,wujuguang/sentry,TedaLIEz/sentry,mvaled/sentry,1tush/sentry,mitsuhiko/sentry,hongliang5623/sentry,ifduyue/sentry,daevaorn/sentry,JamesMura/sentry,alexm92/sentry,wong2/sentry,ifduyue/sentry,Kryz/sentry,fuziontech/sentry,wujuguang/sentry,fotinakis/sentry,felixbuenemann/sentry,jean/sentry,gencer/sentry,argonemyth/sentry,wujuguang/sentry,songyi199111/sentry,boneyao/sentry,hongliang5623/sentry,mvaled/sentry,drcapulet/sentry,drcapulet/sentry,looker/sentry,kevinastone/sentry,kevinastone/sentry,vperron/sentry,gencer/sentry,daevaorn/sentry,imankulov/sentry,mvaled/sentry,BuildingLink/sentry,JTCunning/sentry,gencer/sentry,imankulov/sentry,llonchj/sentry,fotinakis/sentry,ngonzalvez/sentry,zenefits/sentry,llonchj/sentry,wong2/sentry,gencer/sentry,mitsuhiko/sentry,JamesMura/sentry,mvaled/sentry,ngonzalvez/sentry,BayanGroup/sentry,daevaorn/sentry,Natim/sentry,JamesMura/sentry,fotinakis/sentry,hongliang5623/sentry,Kryz/sentry,felixbuenemann/sentry,llonchj/sentry,gg7/sentry,TedaLIEz/sentry,pauloschilling/sentry,JamesMura/sentry
|
---
+++
@@ -23,7 +23,9 @@
rate=sample_rate)
if sample_rate >= 1 or random() >= sample_rate:
- tsdb.incr(tsdb.models.internal, key)
+ if sample_rate > 0 and sample_rate < 1:
+ amount = amount * (1.0 / sample_rate)
+ tsdb.incr(tsdb.models.internal, key, amount)
def timing(key, value):
|
c2138a35123969651212b1d9cd6cdefef89663ec
|
openedx/core/djangoapps/programs/migrations/0003_auto_20151120_1613.py
|
openedx/core/djangoapps/programs/migrations/0003_auto_20151120_1613.py
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('programs', '0002_programsapiconfig_cache_ttl'),
]
operations = [
migrations.AddField(
model_name='programsapiconfig',
name='authoring_app_css_path',
field=models.CharField(max_length=255, verbose_name="Path to authoring app's CSS", blank=True),
),
migrations.AddField(
model_name='programsapiconfig',
name='authoring_app_js_path',
field=models.CharField(max_length=255, verbose_name="Path to authoring app's JS", blank=True),
),
migrations.AddField(
model_name='programsapiconfig',
name='enable_studio_tab',
field=models.BooleanField(default=False, verbose_name='Enable Studio Authoring Interface'),
),
migrations.AlterField(
model_name='programsapiconfig',
name='enable_student_dashboard',
field=models.BooleanField(default=False, verbose_name='Enable Student Dashboard Displays'),
),
]
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('programs', '0002_programsapiconfig_cache_ttl'),
]
operations = [
migrations.AddField(
model_name='programsapiconfig',
name='authoring_app_css_path',
field=models.CharField(
max_length=255,
help_text='This value is required in order to enable the Studio authoring interface.',
verbose_name="Path to authoring app's CSS",
blank=True
),
),
migrations.AddField(
model_name='programsapiconfig',
name='authoring_app_js_path',
field=models.CharField(
max_length=255,
help_text='This value is required in order to enable the Studio authoring interface.',
verbose_name="Path to authoring app's JS",
blank=True
),
),
migrations.AddField(
model_name='programsapiconfig',
name='enable_studio_tab',
field=models.BooleanField(default=False, verbose_name='Enable Studio Authoring Interface'),
),
migrations.AlterField(
model_name='programsapiconfig',
name='enable_student_dashboard',
field=models.BooleanField(default=False, verbose_name='Enable Student Dashboard Displays'),
),
]
|
Modify existing Programs migration to account for help_text change
|
Modify existing Programs migration to account for help_text change
Prevents makemigrations from creating a new migration for the programs app.
|
Python
|
agpl-3.0
|
shurihell/testasia,fintech-circle/edx-platform,doganov/edx-platform,synergeticsedx/deployment-wipro,proversity-org/edx-platform,stvstnfrd/edx-platform,shurihell/testasia,amir-qayyum-khan/edx-platform,RPI-OPENEDX/edx-platform,analyseuc3m/ANALYSE-v1,kmoocdev2/edx-platform,devs1991/test_edx_docmode,UOMx/edx-platform,solashirai/edx-platform,lduarte1991/edx-platform,cecep-edu/edx-platform,stvstnfrd/edx-platform,Lektorium-LLC/edx-platform,deepsrijit1105/edx-platform,lduarte1991/edx-platform,tanmaykm/edx-platform,JioEducation/edx-platform,longmen21/edx-platform,raccoongang/edx-platform,CredoReference/edx-platform,pomegranited/edx-platform,mitocw/edx-platform,Endika/edx-platform,stvstnfrd/edx-platform,Endika/edx-platform,romain-li/edx-platform,Stanford-Online/edx-platform,proversity-org/edx-platform,devs1991/test_edx_docmode,cecep-edu/edx-platform,simbs/edx-platform,angelapper/edx-platform,MakeHer/edx-platform,chrisndodge/edx-platform,miptliot/edx-platform,shabab12/edx-platform,Edraak/circleci-edx-platform,IndonesiaX/edx-platform,nttks/edx-platform,doganov/edx-platform,bigdatauniversity/edx-platform,solashirai/edx-platform,shabab12/edx-platform,gsehub/edx-platform,longmen21/edx-platform,Edraak/edx-platform,cognitiveclass/edx-platform,jjmiranda/edx-platform,procangroup/edx-platform,kmoocdev2/edx-platform,jzoldak/edx-platform,prarthitm/edxplatform,ahmedaljazzar/edx-platform,Edraak/edraak-platform,proversity-org/edx-platform,appsembler/edx-platform,simbs/edx-platform,pabloborrego93/edx-platform,BehavioralInsightsTeam/edx-platform,fintech-circle/edx-platform,Edraak/edx-platform,philanthropy-u/edx-platform,CredoReference/edx-platform,RPI-OPENEDX/edx-platform,itsjeyd/edx-platform,naresh21/synergetics-edx-platform,shabab12/edx-platform,Endika/edx-platform,philanthropy-u/edx-platform,simbs/edx-platform,edx/edx-platform,mbareta/edx-platform-ft,jolyonb/edx-platform,gsehub/edx-platform,CredoReference/edx-platform,mbareta/edx-platform-ft,mitocw/edx-platform,caesar2164/edx-platform,louyihua/edx-platform,arbrandes/edx-platform,a-parhom/edx-platform,defance/edx-platform,gsehub/edx-platform,10clouds/edx-platform,itsjeyd/edx-platform,kursitet/edx-platform,jolyonb/edx-platform,nttks/edx-platform,appsembler/edx-platform,nttks/edx-platform,pabloborrego93/edx-platform,arbrandes/edx-platform,Stanford-Online/edx-platform,10clouds/edx-platform,halvertoluke/edx-platform,hastexo/edx-platform,Edraak/circleci-edx-platform,bigdatauniversity/edx-platform,zhenzhai/edx-platform,CourseTalk/edx-platform,Edraak/edraak-platform,Edraak/edx-platform,arbrandes/edx-platform,pomegranited/edx-platform,antoviaque/edx-platform,pepeportela/edx-platform,msegado/edx-platform,miptliot/edx-platform,devs1991/test_edx_docmode,antoviaque/edx-platform,philanthropy-u/edx-platform,tanmaykm/edx-platform,cpennington/edx-platform,edx/edx-platform,BehavioralInsightsTeam/edx-platform,romain-li/edx-platform,deepsrijit1105/edx-platform,msegado/edx-platform,CredoReference/edx-platform,prarthitm/edxplatform,ampax/edx-platform,pepeportela/edx-platform,teltek/edx-platform,antoviaque/edx-platform,IndonesiaX/edx-platform,CourseTalk/edx-platform,itsjeyd/edx-platform,chrisndodge/edx-platform,cpennington/edx-platform,ovnicraft/edx-platform,UOMx/edx-platform,prarthitm/edxplatform,waheedahmed/edx-platform,zhenzhai/edx-platform,doganov/edx-platform,longmen21/edx-platform,franosincic/edx-platform,eduNEXT/edunext-platform,waheedahmed/edx-platform,longmen21/edx-platform,philanthropy-u/edx-platform,pepeportela/edx-platform,EDUlib/edx-platform,Ayub-Khan/edx-platform,defance/edx-platform,hastexo/edx-platform,nttks/edx-platform,10clouds/edx-platform,kursitet/edx-platform,bigdatauniversity/edx-platform,BehavioralInsightsTeam/edx-platform,shurihell/testasia,simbs/edx-platform,kursitet/edx-platform,MakeHer/edx-platform,solashirai/edx-platform,cpennington/edx-platform,pomegranited/edx-platform,marcore/edx-platform,Endika/edx-platform,alu042/edx-platform,Ayub-Khan/edx-platform,jzoldak/edx-platform,amir-qayyum-khan/edx-platform,kmoocdev2/edx-platform,IndonesiaX/edx-platform,romain-li/edx-platform,hastexo/edx-platform,fintech-circle/edx-platform,ampax/edx-platform,alu042/edx-platform,a-parhom/edx-platform,kmoocdev2/edx-platform,louyihua/edx-platform,marcore/edx-platform,jolyonb/edx-platform,raccoongang/edx-platform,gymnasium/edx-platform,deepsrijit1105/edx-platform,ovnicraft/edx-platform,doganov/edx-platform,angelapper/edx-platform,antoviaque/edx-platform,UOMx/edx-platform,EDUlib/edx-platform,chrisndodge/edx-platform,shabab12/edx-platform,synergeticsedx/deployment-wipro,stvstnfrd/edx-platform,romain-li/edx-platform,MakeHer/edx-platform,halvertoluke/edx-platform,zhenzhai/edx-platform,Livit/Livit.Learn.EdX,amir-qayyum-khan/edx-platform,ahmedaljazzar/edx-platform,itsjeyd/edx-platform,alu042/edx-platform,caesar2164/edx-platform,analyseuc3m/ANALYSE-v1,EDUlib/edx-platform,EDUlib/edx-platform,alu042/edx-platform,teltek/edx-platform,devs1991/test_edx_docmode,wwj718/edx-platform,louyihua/edx-platform,10clouds/edx-platform,teltek/edx-platform,fintech-circle/edx-platform,hastexo/edx-platform,tanmaykm/edx-platform,zhenzhai/edx-platform,ZLLab-Mooc/edx-platform,raccoongang/edx-platform,eduNEXT/edx-platform,prarthitm/edxplatform,eduNEXT/edx-platform,cecep-edu/edx-platform,naresh21/synergetics-edx-platform,longmen21/edx-platform,Ayub-Khan/edx-platform,devs1991/test_edx_docmode,ESOedX/edx-platform,deepsrijit1105/edx-platform,wwj718/edx-platform,lduarte1991/edx-platform,proversity-org/edx-platform,pepeportela/edx-platform,ovnicraft/edx-platform,ZLLab-Mooc/edx-platform,Livit/Livit.Learn.EdX,nttks/edx-platform,waheedahmed/edx-platform,bigdatauniversity/edx-platform,zhenzhai/edx-platform,doganov/edx-platform,jzoldak/edx-platform,caesar2164/edx-platform,romain-li/edx-platform,halvertoluke/edx-platform,TeachAtTUM/edx-platform,franosincic/edx-platform,mbareta/edx-platform-ft,CourseTalk/edx-platform,mitocw/edx-platform,ahmedaljazzar/edx-platform,IndonesiaX/edx-platform,appsembler/edx-platform,appsembler/edx-platform,ahmedaljazzar/edx-platform,gsehub/edx-platform,Lektorium-LLC/edx-platform,devs1991/test_edx_docmode,naresh21/synergetics-edx-platform,TeachAtTUM/edx-platform,caesar2164/edx-platform,amir-qayyum-khan/edx-platform,ampax/edx-platform,devs1991/test_edx_docmode,analyseuc3m/ANALYSE-v1,TeachAtTUM/edx-platform,msegado/edx-platform,UOMx/edx-platform,cognitiveclass/edx-platform,angelapper/edx-platform,lduarte1991/edx-platform,Edraak/circleci-edx-platform,raccoongang/edx-platform,pomegranited/edx-platform,wwj718/edx-platform,CourseTalk/edx-platform,tanmaykm/edx-platform,arbrandes/edx-platform,ESOedX/edx-platform,cognitiveclass/edx-platform,cecep-edu/edx-platform,jjmiranda/edx-platform,shurihell/testasia,BehavioralInsightsTeam/edx-platform,JioEducation/edx-platform,Stanford-Online/edx-platform,cognitiveclass/edx-platform,bigdatauniversity/edx-platform,kursitet/edx-platform,procangroup/edx-platform,edx-solutions/edx-platform,halvertoluke/edx-platform,simbs/edx-platform,synergeticsedx/deployment-wipro,solashirai/edx-platform,Edraak/edraak-platform,jjmiranda/edx-platform,defance/edx-platform,waheedahmed/edx-platform,RPI-OPENEDX/edx-platform,halvertoluke/edx-platform,MakeHer/edx-platform,franosincic/edx-platform,devs1991/test_edx_docmode,chrisndodge/edx-platform,miptliot/edx-platform,ESOedX/edx-platform,eduNEXT/edunext-platform,pomegranited/edx-platform,synergeticsedx/deployment-wipro,ovnicraft/edx-platform,Lektorium-LLC/edx-platform,eduNEXT/edx-platform,msegado/edx-platform,teltek/edx-platform,miptliot/edx-platform,jjmiranda/edx-platform,gymnasium/edx-platform,jzoldak/edx-platform,Stanford-Online/edx-platform,franosincic/edx-platform,mbareta/edx-platform-ft,cpennington/edx-platform,JioEducation/edx-platform,JioEducation/edx-platform,eduNEXT/edunext-platform,mitocw/edx-platform,kmoocdev2/edx-platform,marcore/edx-platform,defance/edx-platform,kursitet/edx-platform,pabloborrego93/edx-platform,ESOedX/edx-platform,naresh21/synergetics-edx-platform,ZLLab-Mooc/edx-platform,analyseuc3m/ANALYSE-v1,edx/edx-platform,Livit/Livit.Learn.EdX,Edraak/circleci-edx-platform,procangroup/edx-platform,a-parhom/edx-platform,edx/edx-platform,solashirai/edx-platform,Ayub-Khan/edx-platform,eduNEXT/edunext-platform,RPI-OPENEDX/edx-platform,ZLLab-Mooc/edx-platform,cognitiveclass/edx-platform,TeachAtTUM/edx-platform,waheedahmed/edx-platform,edx-solutions/edx-platform,louyihua/edx-platform,Livit/Livit.Learn.EdX,a-parhom/edx-platform,angelapper/edx-platform,Edraak/edx-platform,Edraak/edx-platform,Lektorium-LLC/edx-platform,msegado/edx-platform,ampax/edx-platform,franosincic/edx-platform,wwj718/edx-platform,shurihell/testasia,gymnasium/edx-platform,jolyonb/edx-platform,RPI-OPENEDX/edx-platform,wwj718/edx-platform,MakeHer/edx-platform,Ayub-Khan/edx-platform,ovnicraft/edx-platform,ZLLab-Mooc/edx-platform,marcore/edx-platform,Edraak/circleci-edx-platform,cecep-edu/edx-platform,eduNEXT/edx-platform,IndonesiaX/edx-platform,Edraak/edraak-platform,pabloborrego93/edx-platform,edx-solutions/edx-platform,procangroup/edx-platform,gymnasium/edx-platform,edx-solutions/edx-platform
|
---
+++
@@ -14,12 +14,22 @@
migrations.AddField(
model_name='programsapiconfig',
name='authoring_app_css_path',
- field=models.CharField(max_length=255, verbose_name="Path to authoring app's CSS", blank=True),
+ field=models.CharField(
+ max_length=255,
+ help_text='This value is required in order to enable the Studio authoring interface.',
+ verbose_name="Path to authoring app's CSS",
+ blank=True
+ ),
),
migrations.AddField(
model_name='programsapiconfig',
name='authoring_app_js_path',
- field=models.CharField(max_length=255, verbose_name="Path to authoring app's JS", blank=True),
+ field=models.CharField(
+ max_length=255,
+ help_text='This value is required in order to enable the Studio authoring interface.',
+ verbose_name="Path to authoring app's JS",
+ blank=True
+ ),
),
migrations.AddField(
model_name='programsapiconfig',
|
e34ce0033e1ffc3f6a81d37260056166ac5f582d
|
setup.py
|
setup.py
|
from setuptools import setup, find_packages
version = '3.7'
setup(name='jarn.mkrelease',
version=version,
description='Python egg releaser',
long_description=open('README.txt').read() + '\n' +
open('CHANGES.txt').read(),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
],
keywords='create release python egg eggs',
author='Stefan H. Holek',
author_email='stefan@epy.co.at',
url='http://pypi.python.org/pypi/jarn.mkrelease',
license='BSD',
packages=find_packages(),
namespace_packages=['jarn'],
include_package_data=True,
zip_safe=False,
use_2to3=True,
test_suite='jarn.mkrelease.tests',
install_requires=[
'setuptools',
'setuptools-subversion',
'setuptools-hg',
'setuptools-git',
'lazy',
],
entry_points={
'console_scripts': 'mkrelease=jarn.mkrelease.mkrelease:main',
},
)
|
from setuptools import setup, find_packages
version = '3.7'
setup(name='jarn.mkrelease',
version=version,
description='Python egg releaser',
long_description=open('README.txt').read() + '\n' +
open('CHANGES.txt').read(),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
],
keywords='create release python egg eggs',
author='Stefan H. Holek',
author_email='stefan@epy.co.at',
url='http://pypi.python.org/pypi/jarn.mkrelease',
license='BSD',
packages=find_packages(),
namespace_packages=['jarn'],
include_package_data=True,
zip_safe=False,
test_suite='jarn.mkrelease.tests',
install_requires=[
'setuptools',
'setuptools-subversion',
'setuptools-hg',
'setuptools-git',
'lazy',
],
entry_points={
'console_scripts': 'mkrelease=jarn.mkrelease.mkrelease:main',
},
use_2to3=True,
use_2to3_exclude_fixers=[
'lib2to3.fixes.fix_filter',
'lib2to3.fixes.fix_xrange',
],
)
|
Exclude filter and xrange fixers.
|
Exclude filter and xrange fixers.
|
Python
|
bsd-2-clause
|
Jarn/jarn.mkrelease
|
---
+++
@@ -26,7 +26,6 @@
namespace_packages=['jarn'],
include_package_data=True,
zip_safe=False,
- use_2to3=True,
test_suite='jarn.mkrelease.tests',
install_requires=[
'setuptools',
@@ -38,4 +37,9 @@
entry_points={
'console_scripts': 'mkrelease=jarn.mkrelease.mkrelease:main',
},
+ use_2to3=True,
+ use_2to3_exclude_fixers=[
+ 'lib2to3.fixes.fix_filter',
+ 'lib2to3.fixes.fix_xrange',
+ ],
)
|
f2eb45ea24429fd3e4d32a490dbe3f8a2f383d9f
|
scuole/stats/models/base.py
|
scuole/stats/models/base.py
|
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from .staff_student import StaffStudentBase
@python_2_unicode_compatible
class SchoolYear(models.Model):
name = models.CharField(max_length=9)
def __str__(self):
return self.name
class StatsBase(StaffStudentBase):
"""
An abstract model representing stats commonly tracked across all entities
in TEA data. Meant to be the base used by other apps for establishing
their stats models.
Example:
class CampusStats(StatsBase):
...
"""
class Meta:
abstract = True
|
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from .staff_student import StaffStudentBase
from .postsecondary_readiness import PostSecondaryReadinessBase
@python_2_unicode_compatible
class SchoolYear(models.Model):
name = models.CharField(max_length=9)
def __str__(self):
return self.name
class StatsBase(StaffStudentBase, PostSecondaryReadinessBase):
"""
An abstract model representing stats commonly tracked across all entities
in TEA data. Meant to be the base used by other apps for establishing
their stats models.
Example:
class CampusStats(StatsBase):
...
"""
class Meta:
abstract = True
|
Add postsecondary stats to the StatsBase model
|
Add postsecondary stats to the StatsBase model
|
Python
|
mit
|
texastribune/scuole,texastribune/scuole,texastribune/scuole,texastribune/scuole
|
---
+++
@@ -5,6 +5,7 @@
from django.utils.encoding import python_2_unicode_compatible
from .staff_student import StaffStudentBase
+from .postsecondary_readiness import PostSecondaryReadinessBase
@python_2_unicode_compatible
@@ -15,7 +16,7 @@
return self.name
-class StatsBase(StaffStudentBase):
+class StatsBase(StaffStudentBase, PostSecondaryReadinessBase):
"""
An abstract model representing stats commonly tracked across all entities
in TEA data. Meant to be the base used by other apps for establishing
|
91682c5db1cb4267e719723a15de7b3f34393f9f
|
setup.py
|
setup.py
|
#!/usr/bin/python
from setuptools import setup
from setuptools import find_packages
__author__ = 'Ryan McGrath <ryan@venodesigns.net>'
__version__ = '1.5.0'
setup(
name='twython-django',
version=__version__,
install_requires=['twython>=3.0.0', 'django'],
author='Ryan McGrath',
author_email='ryan@venodesigns.net',
license=open('LICENSE').read(),
url='https://github.com/ryanmcgrath/twython/tree/master',
keywords='twitter search api tweet twython stream django integration',
description='Actively maintained, pure Python wrapper for the Twitter API. Supports both normal and streaming Twitter APIs',
long_description=open('README.rst').read(),
include_package_data=True,
packages=find_packages(),
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Communications :: Chat',
'Topic :: Internet'
]
)
|
#!/usr/bin/env python
import os
import sys
from setuptools import setup
from setuptools import find_packages
__author__ = 'Ryan McGrath <ryan@venodesigns.net>'
__version__ = '1.5.1'
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
setup(
name='twython-django',
version=__version__,
install_requires=['twython>=3.1.0', 'django'],
author='Ryan McGrath',
author_email='ryan@venodesigns.net',
license=open('LICENSE').read(),
url='https://github.com/ryanmcgrath/twython/tree/master',
keywords='twitter search api tweet twython stream django integration',
description='Actively maintained, pure Python wrapper for the Twitter API. Supports both normal and streaming Twitter APIs',
long_description=open('README.rst').read(),
include_package_data=True,
packages=find_packages(),
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Communications :: Chat',
'Topic :: Internet'
]
)
|
Prepare for twython-django pip release
|
Prepare for twython-django pip release
|
Python
|
mit
|
ryanmcgrath/twython-django,c17r/twython-django,aniversarioperu/twython-django,aniversarioperu/twython-django,c17r/twython-django
|
---
+++
@@ -1,15 +1,22 @@
-#!/usr/bin/python
+#!/usr/bin/env python
+
+import os
+import sys
from setuptools import setup
from setuptools import find_packages
__author__ = 'Ryan McGrath <ryan@venodesigns.net>'
-__version__ = '1.5.0'
+__version__ = '1.5.1'
+
+if sys.argv[-1] == 'publish':
+ os.system('python setup.py sdist upload')
+ sys.exit()
setup(
name='twython-django',
version=__version__,
- install_requires=['twython>=3.0.0', 'django'],
+ install_requires=['twython>=3.1.0', 'django'],
author='Ryan McGrath',
author_email='ryan@venodesigns.net',
license=open('LICENSE').read(),
|
26d3b8eb1992b19aebe8f0e3eae386e8b95822fb
|
setup.py
|
setup.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages, Command
import os
packages = find_packages()
class PyTest(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys
import subprocess
errno = subprocess.call([sys.executable, 'runtests.py'])
raise SystemExit(errno)
def get_locals(filename):
l = {}
execfile(filename, {}, l)
return l
metadata = get_locals(os.path.join('scorify', '_metadata.py'))
setup(
name="scorify",
version=metadata['version'],
author=metadata['author'],
author_email=metadata['author_email'],
license=metadata['license'],
url=metadata['url'],
packages=find_packages(),
cmdclass={'test': PyTest},
entry_points={
'console_scripts': [
'score_data = scorify.scripts.score_data:main'
]}
)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from distutils.core import setup, Command
import os
class PyTest(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys
import subprocess
errno = subprocess.call([sys.executable, 'runtests.py'])
raise SystemExit(errno)
def get_locals(filename):
l = {}
with open(filename, 'r') as f:
code = compile(f.read(), filename, 'exec')
exec(code, {}, l)
return l
metadata = get_locals(os.path.join('scorify', '_metadata.py'))
setup(
name="scorify",
version=metadata['version'],
author=metadata['author'],
author_email=metadata['author_email'],
license=metadata['license'],
url=metadata['url'],
packages=['scorify'],
cmdclass={'test': PyTest},
entry_points={
'console_scripts': [
'score_data = scorify.scripts.score_data:main'
]}
)
|
Switch to distutils, fix install for py3.4
|
Switch to distutils, fix install for py3.4
setuptools is goddamned terrible
|
Python
|
mit
|
njvack/scorify
|
---
+++
@@ -1,10 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-from setuptools import setup, find_packages, Command
+from distutils.core import setup, Command
import os
-
-packages = find_packages()
class PyTest(Command):
@@ -25,7 +23,9 @@
def get_locals(filename):
l = {}
- execfile(filename, {}, l)
+ with open(filename, 'r') as f:
+ code = compile(f.read(), filename, 'exec')
+ exec(code, {}, l)
return l
metadata = get_locals(os.path.join('scorify', '_metadata.py'))
@@ -37,7 +37,7 @@
author_email=metadata['author_email'],
license=metadata['license'],
url=metadata['url'],
- packages=find_packages(),
+ packages=['scorify'],
cmdclass={'test': PyTest},
entry_points={
'console_scripts': [
|
6e18192da18b6d1b9c6443981f007126ea7e6927
|
setup.py
|
setup.py
|
#! /usr/bin/env python
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from csdms.dakota import __version__, plugin_script
package_name = 'csdms.dakota'
setup(name=package_name,
version=__version__,
author='Mark Piper',
author_email='mark.piper@colorado.edu',
license='MIT',
description='Python API for Dakota',
long_description=open('README.md').read(),
namespace_packages=['csdms'],
packages=find_packages(exclude=['*.tests']),
entry_points={
'console_scripts': [
plugin_script + ' = ' + package_name + '.run_plugin:main'
]
}
)
|
#! /usr/bin/env python
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from csdms.dakota import __version__, plugin_script
setup(name='csdms-dakota',
version=__version__,
author='Mark Piper',
author_email='mark.piper@colorado.edu',
license='MIT',
description='Python API for Dakota',
long_description=open('README.md').read(),
namespace_packages=['csdms'],
packages=find_packages(exclude=['*.tests']),
entry_points={
'console_scripts': [
plugin_script + ' = csdms.dakota.run_plugin:main'
]
}
)
|
Change package name to use hyphen
|
Change package name to use hyphen
|
Python
|
mit
|
csdms/dakota,csdms/dakota
|
---
+++
@@ -4,9 +4,7 @@
from setuptools import setup, find_packages
from csdms.dakota import __version__, plugin_script
-package_name = 'csdms.dakota'
-
-setup(name=package_name,
+setup(name='csdms-dakota',
version=__version__,
author='Mark Piper',
author_email='mark.piper@colorado.edu',
@@ -17,7 +15,7 @@
packages=find_packages(exclude=['*.tests']),
entry_points={
'console_scripts': [
- plugin_script + ' = ' + package_name + '.run_plugin:main'
+ plugin_script + ' = csdms.dakota.run_plugin:main'
]
}
)
|
0f22ce31a7067386a0b29b6d107c3e9481fc1492
|
setup.py
|
setup.py
|
from setuptools import setup, find_packages
setup(
name = "open511-server",
version = "0.1",
url='',
license = "",
packages = find_packages(),
install_requires = [
'open511==0.5',
'lxml>=3.0,<=4.0',
'WebOb==1.5.1',
'python-dateutil==2.4.2',
'requests==2.8.1',
'pytz>=2015b',
'django-appconf==1.0.1',
'cssselect==0.9.1',
'Django>=1.9.2,<=1.10',
'jsonfield==1.0.3'
],
entry_points = {
'console_scripts': [
'open511-task-runner = open511_server.task_runner.task_runner'
]
},
)
|
from setuptools import setup, find_packages
setup(
name = "open511-server",
version = "0.1",
url='',
license = "",
packages = find_packages(),
install_requires = [
'open511==0.5',
'lxml>=3.0,<=4.0',
'WebOb==1.5.1',
'python-dateutil==2.4.2',
'requests==2.8.1',
'pytz>=2015b',
'django-appconf==1.0.1',
'cssselect==0.9.1',
'Django>=1.9.2,<=1.9.99',
'jsonfield==1.0.3'
],
entry_points = {
'console_scripts': [
'open511-task-runner = open511_server.task_runner.task_runner'
]
},
)
|
Change Django requirement to avoid 1.10 alpha
|
Change Django requirement to avoid 1.10 alpha
|
Python
|
mit
|
Open511/open511-server,Open511/open511-server,Open511/open511-server
|
---
+++
@@ -15,7 +15,7 @@
'pytz>=2015b',
'django-appconf==1.0.1',
'cssselect==0.9.1',
- 'Django>=1.9.2,<=1.10',
+ 'Django>=1.9.2,<=1.9.99',
'jsonfield==1.0.3'
],
entry_points = {
|
fcd6af0a2a02ef87eedd78aa3c09836cc0799a29
|
utils/python_version.py
|
utils/python_version.py
|
#! /usr/bin/env python
"""Print Python interpreter path and version."""
import sys
sys.stdout.write(sys.executable + '\n')
sys.stdout.write(sys.version + '\n')
sys.stdout.flush()
|
#! /usr/bin/env python
"""Print Python interpreter path and version."""
import sys
sys.stdout.write('%s\n' % sys.executable)
sys.stdout.write('%s\n' % sys.version)
try:
import icu # pylint: disable=g-import-not-at-top
sys.stdout.write('ICU %s\n' % icu.ICU_VERSION)
sys.stdout.write('Unicode %s\n' % icu.UNICODE_VERSION)
except ImportError:
pass
sys.stdout.flush()
|
Print ICU and Unicode version, if available
|
Print ICU and Unicode version, if available
|
Python
|
apache-2.0
|
googlei18n/language-resources,googlei18n/language-resources,googlei18n/language-resources,googlei18n/language-resources,google/language-resources,google/language-resources,google/language-resources,google/language-resources,googlei18n/language-resources,googlei18n/language-resources,google/language-resources,google/language-resources
|
---
+++
@@ -4,6 +4,14 @@
import sys
-sys.stdout.write(sys.executable + '\n')
-sys.stdout.write(sys.version + '\n')
+sys.stdout.write('%s\n' % sys.executable)
+sys.stdout.write('%s\n' % sys.version)
+
+try:
+ import icu # pylint: disable=g-import-not-at-top
+ sys.stdout.write('ICU %s\n' % icu.ICU_VERSION)
+ sys.stdout.write('Unicode %s\n' % icu.UNICODE_VERSION)
+except ImportError:
+ pass
+
sys.stdout.flush()
|
15b8810b3bf244295f38b628a0ebb1cb72f46bb3
|
service_time.py
|
service_time.py
|
""" service_time.py """
from datetime import datetime
from flask import Flask, jsonify
app = Flask(__name__)
count = 0
@app.route("/time", methods=['GET'])
def get_datetime():
global count
count += 1
return jsonify(count=count,
datetime=datetime.now().isoformat())
if __name__ == "__main__":
app.run(port=3001, debug=True)
|
""" service_time.py """
from datetime import datetime
from time import sleep
from flask import Flask, jsonify
app = Flask(__name__)
count = 0
@app.route("/time", methods=['GET'])
def get_datetime():
global count
# sleep to simulate the service response time degrading
sleep(count)
count += 1
return jsonify(count=count,
datetime=datetime.now().isoformat())
if __name__ == "__main__":
app.run(port=3001, debug=True)
|
Update time service to simulate gradually increasing slow response times.
|
Update time service to simulate gradually increasing slow response times.
|
Python
|
mit
|
danriti/short-circuit,danriti/short-circuit
|
---
+++
@@ -1,6 +1,7 @@
""" service_time.py """
from datetime import datetime
+from time import sleep
from flask import Flask, jsonify
@@ -12,6 +13,8 @@
@app.route("/time", methods=['GET'])
def get_datetime():
global count
+ # sleep to simulate the service response time degrading
+ sleep(count)
count += 1
return jsonify(count=count,
datetime=datetime.now().isoformat())
|
38c33a772532f33751dbbebe3ee0ecd0ad993616
|
alembic/versions/1fbbb727e1dc_change_last_ip_to_inet.py
|
alembic/versions/1fbbb727e1dc_change_last_ip_to_inet.py
|
"""Change last_ip to inet.
Revision ID: 1fbbb727e1dc
Revises: 2dd8b091742b
Create Date: 2015-08-31 20:54:43.824788
"""
# revision identifiers, used by Alembic.
revision = '1fbbb727e1dc'
down_revision = '2dd8b091742b'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.execute(u'alter table users alter column last_ip type inet using last_ip::inet;')
### end Alembic commands ###
def downgrade():
### commands auto generated by Alembic - please adjust! ###
pass
### end Alembic commands ###
|
"""Change last_ip to inet.
Revision ID: 1fbbb727e1dc
Revises: 2dd8b091742b
Create Date: 2015-08-31 20:54:43.824788
"""
# revision identifiers, used by Alembic.
revision = '1fbbb727e1dc'
down_revision = '2dd8b091742b'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
# Default needs to be dropped because the old default of an empty string cannot be casted to an IP.
op.execute(u'alter table users alter column last_ip drop default;')
op.execute(u'alter table users alter column last_ip type inet using last_ip::inet;')
def downgrade():
### commands auto generated by Alembic - please adjust! ###
pass
### end Alembic commands ###
|
Fix migrations from text to inet.
|
Fix migrations from text to inet.
|
Python
|
agpl-3.0
|
MSPARP/newparp,MSPARP/newparp,MSPARP/newparp
|
---
+++
@@ -17,9 +17,9 @@
def upgrade():
- ### commands auto generated by Alembic - please adjust! ###
+ # Default needs to be dropped because the old default of an empty string cannot be casted to an IP.
+ op.execute(u'alter table users alter column last_ip drop default;')
op.execute(u'alter table users alter column last_ip type inet using last_ip::inet;')
- ### end Alembic commands ###
def downgrade():
|
89cda8553c662ac7b435516d888706e3f3193cb7
|
sir/__main__.py
|
sir/__main__.py
|
import argparse
from .schema import SCHEMA
def reindex(args):
known_entities = SCHEMA.keys()
if args['entities'] is not None:
entities = []
for e in args['entities']:
entities.extend(e.split(','))
unknown_entities = set(known_entities) - set(entities)
if unknown_entities:
raise ValueError("{0} are unkown entity types".format(unknown_entities))
else:
entities = known_entities
print(entities)
def watch(args):
raise NotImplementedError
def main():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
reindex_parser = subparsers.add_parser("reindex", help="Reindexes all or a single entity type")
reindex_parser.set_defaults(func=reindex)
reindex_parser.add_argument('--entities', action='append', help='The entities to reindex' )
watch_parser = subparsers.add_parser("watch", help="Watches for incoming messages on an AMQP queue")
watch_parser.set_defaults(func=watch)
args = parser.parse_args()
args.func(vars(args))
if __name__ == '__main__':
main()
|
import argparse
from .schema import SCHEMA
def reindex(args):
known_entities = SCHEMA.keys()
if args['entities'] is not None:
entities = []
for e in args['entities']:
entities.extend(e.split(','))
unknown_entities = set(entities) - set(known_entities)
if unknown_entities:
raise ValueError("{0} are unkown entity types".format(unknown_entities))
else:
entities = known_entities
print(entities)
def watch(args):
raise NotImplementedError
def main():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
reindex_parser = subparsers.add_parser("reindex", help="Reindexes all or a single entity type")
reindex_parser.set_defaults(func=reindex)
reindex_parser.add_argument('--entities', action='append', help='The entities to reindex' )
watch_parser = subparsers.add_parser("watch", help="Watches for incoming messages on an AMQP queue")
watch_parser.set_defaults(func=watch)
args = parser.parse_args()
args.func(vars(args))
if __name__ == '__main__':
main()
|
Fix the unknown entity type test
|
Fix the unknown entity type test
We want to check if any user-supplied entity name is unkown, not if any
of the known types are not in the user-supplied list
|
Python
|
mit
|
jeffweeksio/sir
|
---
+++
@@ -10,7 +10,7 @@
entities = []
for e in args['entities']:
entities.extend(e.split(','))
- unknown_entities = set(known_entities) - set(entities)
+ unknown_entities = set(entities) - set(known_entities)
if unknown_entities:
raise ValueError("{0} are unkown entity types".format(unknown_entities))
else:
|
bcc206b46c089ea7f7ea5dfbc5c8b11a1fe72447
|
movie_time_app/models.py
|
movie_time_app/models.py
|
from django.db import models
# Create your models here.
class Movie(models.Model):
movie_id = models.IntegerField(primary_key=True)
title = models.CharField(max_length=200)
poster = models.ImageField(null=True, blank=True)
year = models.IntegerField(null=True)
genres = models.CharField(max_length=200)
num_ratings = models.IntegerField(null=True)
rating_median = models.FloatField(null=True)
rating_mean = models.FloatField(null=True)
relatable = models.BooleanField(default=True)
def __str__(self):
return self.title
class LikedOrNot(models.Model):
movie = models.ForeignKey(Movie)
liked_or_not = models.SmallIntegerField(null=True, blank=True,
choices=((-1, "bad"), (0, "alright"), (1, "liked")))
class Similarity(models.Model):
first_movie = models.ForeignKey(Movie, related_name='first_movie')
second_movie = models.ForeignKey(Movie, related_name='second_movie')
similarity_score = models.FloatField()
class Tag(models.Model):
movie = models.ForeignKey(Movie)
tag = models.CharField(max_length=50)
relevance = models.FloatField()
class OnlineLink(models.Model):
movie = models.ForeignKey(Movie)
imdb_id = models.CharField(max_length=50)
|
from django.db import models
# Create your models here.
class Movie(models.Model):
movie_id = models.IntegerField(primary_key=True)
title = models.CharField(max_length=200)
poster = models.ImageField(null=True, blank=True)
year = models.IntegerField(null=True)
genres = models.CharField(max_length=200)
num_ratings = models.IntegerField(null=True)
rating_median = models.FloatField(null=True)
rating_mean = models.FloatField(null=True)
relatable = models.BooleanField(default=True)
liked_or_not = models.NullBooleanField(null=True, blank=True)
def __str__(self):
return self.title
class Similarity(models.Model):
first_movie = models.ForeignKey(Movie, related_name='first_movie')
second_movie = models.ForeignKey(Movie, related_name='second_movie')
similarity_score = models.FloatField()
class Tag(models.Model):
movie = models.ForeignKey(Movie)
tag = models.CharField(max_length=50)
relevance = models.FloatField()
class OnlineLink(models.Model):
movie = models.ForeignKey(Movie)
imdb_id = models.CharField(max_length=50)
|
Add self-rating flag for movies. Removed LikedOrNot table
|
Add self-rating flag for movies. Removed LikedOrNot table
|
Python
|
mit
|
osama-haggag/movie-time,osama-haggag/movie-time
|
---
+++
@@ -11,15 +11,10 @@
rating_median = models.FloatField(null=True)
rating_mean = models.FloatField(null=True)
relatable = models.BooleanField(default=True)
+ liked_or_not = models.NullBooleanField(null=True, blank=True)
def __str__(self):
return self.title
-
-
-class LikedOrNot(models.Model):
- movie = models.ForeignKey(Movie)
- liked_or_not = models.SmallIntegerField(null=True, blank=True,
- choices=((-1, "bad"), (0, "alright"), (1, "liked")))
class Similarity(models.Model):
|
bf97132fd263026aea42d5af9772d378eaec67d9
|
setup.py
|
setup.py
|
import subprocess
import sys
from setuptools import Command, setup
class RunTests(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests'])
raise SystemExit(errno)
with open('README.md') as readme:
long_description = readme.read()
setup(
name='gis_metadata_parser',
description='Parser for GIS metadata standards including FGDC and ISO-19115',
long_description=long_description,
keywords='arcgis,fgdc,iso,ISO-19115,ISO-19139,gis,metadata,parser,xml,gis_metadata,gis_metadata_parser',
version='1.1.2',
packages=[
'gis_metadata', 'gis_metadata.tests'
],
install_requires=[
'parserutils>=1.1', 'six>=1.9.0'
],
url='https://github.com/consbio/gis-metadata-parser',
license='BSD',
cmdclass={'test': RunTests}
)
|
import subprocess
import sys
from setuptools import Command, setup
class RunTests(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests'])
raise SystemExit(errno)
with open('README.md') as readme:
long_description = readme.read()
setup(
name='gis_metadata_parser',
description='Parser for GIS metadata standards including FGDC and ISO-19115',
long_description=long_description,
long_description_content_type='text/markdown',
keywords='arcgis,fgdc,iso,ISO-19115,ISO-19139,gis,metadata,parser,xml,gis_metadata,gis_metadata_parser',
version='1.1.3',
packages=[
'gis_metadata', 'gis_metadata.tests'
],
install_requires=[
'parserutils>=1.1', 'six>=1.9.0'
],
url='https://github.com/consbio/gis-metadata-parser',
license='BSD',
cmdclass={'test': RunTests}
)
|
Enable markdown for PyPI README
|
Enable markdown for PyPI README
|
Python
|
bsd-3-clause
|
consbio/gis-metadata-parser
|
---
+++
@@ -26,8 +26,9 @@
name='gis_metadata_parser',
description='Parser for GIS metadata standards including FGDC and ISO-19115',
long_description=long_description,
+ long_description_content_type='text/markdown',
keywords='arcgis,fgdc,iso,ISO-19115,ISO-19139,gis,metadata,parser,xml,gis_metadata,gis_metadata_parser',
- version='1.1.2',
+ version='1.1.3',
packages=[
'gis_metadata', 'gis_metadata.tests'
],
|
d261a41419ab1d2f0543798743ff34607d3d455f
|
setup.py
|
setup.py
|
from setuptools import setup
import sys
install_requires = ['six']
if sys.version_info[0] == 2 and sys.version_info[1] == 6:
install_requires.extend(['ordereddict', 'argparse'])
setup(
name='pyfaidx',
provides='pyfaidx',
version='0.3.0',
author='Matthew Shirley',
author_email='mdshw5@gmail.com',
url='http://mattshirley.com',
description='pyfaidx: efficient pythonic random '
'access to fasta subsequences',
long_description=open('README.rst').read(),
license='MIT',
packages=['pyfaidx'],
install_requires=install_requires,
entry_points={'console_scripts': ['faidx = pyfaidx.cli:main', 'bedmask = pyfaidx.bedmask:main']},
classifiers=[
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Environment :: Console",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Operating System :: Unix",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Scientific/Engineering :: Bio-Informatics"
]
)
|
from setuptools import setup
import sys
install_requires = ['six']
if sys.version_info[0] == 2 and sys.version_info[1] == 6:
install_requires.extend(['ordereddict', 'argparse'])
setup(
name='pyfaidx',
provides='pyfaidx',
version='0.3.1',
author='Matthew Shirley',
author_email='mdshw5@gmail.com',
url='http://mattshirley.com',
description='pyfaidx: efficient pythonic random '
'access to fasta subsequences',
long_description=open('README.rst').read(),
license='MIT',
packages=['pyfaidx'],
install_requires=install_requires,
entry_points={'console_scripts': ['faidx = pyfaidx.cli:main', 'bedmask = pyfaidx.bedmask:main']},
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Environment :: Console",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Operating System :: Unix",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Scientific/Engineering :: Bio-Informatics"
]
)
|
Increment version for deployment. Update trove classifier.
|
Increment version for deployment. Update trove classifier.
|
Python
|
bsd-3-clause
|
mattions/pyfaidx
|
---
+++
@@ -9,7 +9,7 @@
setup(
name='pyfaidx',
provides='pyfaidx',
- version='0.3.0',
+ version='0.3.1',
author='Matthew Shirley',
author_email='mdshw5@gmail.com',
url='http://mattshirley.com',
@@ -21,7 +21,7 @@
install_requires=install_requires,
entry_points={'console_scripts': ['faidx = pyfaidx.cli:main', 'bedmask = pyfaidx.bedmask:main']},
classifiers=[
- "Development Status :: 4 - Beta",
+ "Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Environment :: Console",
"Intended Audience :: Science/Research",
|
cd7584645548758e59e05531d44121fb29c2e27c
|
setup.py
|
setup.py
|
import sys
from setuptools import find_packages, setup
VERSION = '2.0.dev0'
install_requires = [
'django-local-settings>=1.0a8',
'stashward',
]
if sys.version_info[:2] < (3, 4):
install_requires.append('enum34')
setup(
name='django-arcutils',
version=VERSION,
url='https://github.com/PSU-OIT-ARC/django-arcutils',
author='PSU - OIT - ARC',
author_email='consultants@pdx.edu',
description='Common utilities used in ARC Django projects',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=install_requires,
extras_require={
'cas': [
'django-cas-client>=1.2.0',
],
'ldap': [
'ldap3>=0.9.9.1',
],
'dev': [
'django>=1.7',
'flake8',
'ldap3',
'mock',
'model_mommy',
],
},
entry_points="""
[console_scripts]
arcutils = arcutils.__main__:main
""",
classifiers=[
'Development Status :: 3 - Alpha',
'Framework :: Django',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
|
import sys
from setuptools import find_packages, setup
VERSION = '2.0.dev0'
install_requires = [
'django-local-settings>=1.0a10',
'stashward',
]
if sys.version_info[:2] < (3, 4):
install_requires.append('enum34')
setup(
name='django-arcutils',
version=VERSION,
url='https://github.com/PSU-OIT-ARC/django-arcutils',
author='PSU - OIT - ARC',
author_email='consultants@pdx.edu',
description='Common utilities used in ARC Django projects',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=install_requires,
extras_require={
'cas': [
'django-cas-client>=1.2.0',
],
'ldap': [
'ldap3>=0.9.9.1',
],
'dev': [
'django>=1.7',
'flake8',
'ldap3',
'mock',
'model_mommy',
],
},
entry_points="""
[console_scripts]
arcutils = arcutils.__main__:main
""",
classifiers=[
'Development Status :: 3 - Alpha',
'Framework :: Django',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
|
Upgrade django-local-settings 1.0a8 => 1.0a10
|
Upgrade django-local-settings 1.0a8 => 1.0a10
|
Python
|
mit
|
PSU-OIT-ARC/django-arcutils,wylee/django-arcutils,PSU-OIT-ARC/django-arcutils,wylee/django-arcutils
|
---
+++
@@ -7,7 +7,7 @@
install_requires = [
- 'django-local-settings>=1.0a8',
+ 'django-local-settings>=1.0a10',
'stashward',
]
|
35b49a952da9cb95fae4fd8eb25752ca9faee5ef
|
setup.py
|
setup.py
|
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'Logging wrapper',
'author': 'Feth Arezki',
'url': 'https://github.com/majerteam/quicklogging',
'download_url': 'https://github.com/majerteam/quicklogging',
'author_email': 'tech@majerti.fr',
'version': '0.2',
'packages': ['quicklogging'],
'setup_requires': ['pytest-runner'],
'tests_require': ['pytest', 'pytest-coverage', 'six', 'stringimporter>=0.1.3'],
'name': 'quicklogging'
}
setup(**config)
|
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'Logging wrapper',
'author': 'Feth Arezki',
'url': 'https://github.com/majerteam/quicklogging',
'download_url': 'https://github.com/majerteam/quicklogging',
'author_email': 'tech@majerti.fr',
'version': '0.2',
'packages': ['quicklogging'],
'setup_requires': ['pytest-runner'],
'tests_require': ['pytest', 'pytest-cov', 'six', 'stringimporter>=0.1.3'],
'name': 'quicklogging'
}
setup(**config)
|
Update test deps: pytest-coverage -> pytest-cov
|
Update test deps: pytest-coverage -> pytest-cov
|
Python
|
mit
|
majerteam/quicklogging,majerteam/quicklogging
|
---
+++
@@ -13,7 +13,7 @@
'version': '0.2',
'packages': ['quicklogging'],
'setup_requires': ['pytest-runner'],
- 'tests_require': ['pytest', 'pytest-coverage', 'six', 'stringimporter>=0.1.3'],
+ 'tests_require': ['pytest', 'pytest-cov', 'six', 'stringimporter>=0.1.3'],
'name': 'quicklogging'
}
|
48dc523d438425b2aae9820e835f535b8783d661
|
setup.py
|
setup.py
|
from paperpal import __version__ as version
def slurp(filename):
with open(filename) as opened_file:
return opened_file.read()
from setuptools import setup
setup(name='paperpal',
version=version,
description='Helper to export Zotero data',
long_description=slurp('README.rst'),
url='http://github.com/eddieantonio/paperpal',
entry_points = {
'console_scripts': ['paperpal=paperpal.__main__:main'],
},
author='Eddie Antonio Santos',
author_email='easantos@ualberta.ca',
install_requires=slurp('./requirements.txt').split('\n')[:-1],
license='Apache 2.0',
packages=['paperpal'],
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 2.7',
'Topic :: Text Processing :: Indexing',
]
)
|
from setuptools import setup, find_packages
from paperpal import __version__ as version
def slurp(filename):
with open(filename) as opened_file:
return opened_file.read()
setup(name='paperpal',
version=version,
description='Paper management with Zotero',
long_description=slurp('README.rst'),
url='http://github.com/eddieantonio/paperpal',
entry_points = {
'console_scripts': ['paperpal=paperpal.__main__:main'],
},
author='Eddie Antonio Santos',
author_email='easantos@ualberta.ca',
install_requires=slurp('./requirements.txt').split('\n')[:-1],
license='Apache 2.0',
packages=['paperpal'],
package_data={'paperpal': ['*.js']},
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 2.7',
'Topic :: Text Processing :: Indexing',
]
)
|
Add JavaScript files as package data.
|
Add JavaScript files as package data.
|
Python
|
apache-2.0
|
eddieantonio/paperpal,eddieantonio/paperpal
|
---
+++
@@ -1,14 +1,16 @@
+from setuptools import setup, find_packages
+
from paperpal import __version__ as version
+
def slurp(filename):
with open(filename) as opened_file:
return opened_file.read()
-from setuptools import setup
setup(name='paperpal',
version=version,
- description='Helper to export Zotero data',
+ description='Paper management with Zotero',
long_description=slurp('README.rst'),
url='http://github.com/eddieantonio/paperpal',
entry_points = {
@@ -19,6 +21,7 @@
install_requires=slurp('./requirements.txt').split('\n')[:-1],
license='Apache 2.0',
packages=['paperpal'],
+ package_data={'paperpal': ['*.js']},
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: Apache Software License',
|
798b7976084748d7966b3fc3e4ae2e9a634c99de
|
setup.py
|
setup.py
|
import os
from setuptools import setup, find_packages
import glob
VERSION = "0.6.3"
src_dir = os.path.dirname(__file__)
install_requires = [
"troposphere>=1.8.0",
"boto3>=1.3.1",
"botocore>=1.4.38",
"PyYAML>=3.11",
"awacs>=0.6.0",
"colorama==0.3.7",
]
tests_require = [
"nose>=1.0",
"mock==1.0.1",
"stacker_blueprints",
"moto",
"testfixtures",
]
def read(filename):
full_path = os.path.join(src_dir, filename)
with open(full_path) as fd:
return fd.read()
if __name__ == "__main__":
setup(
name="stacker",
version=VERSION,
author="Michael Barrett",
author_email="loki77@gmail.com",
license="New BSD license",
url="https://github.com/remind101/stacker",
description="Opinionated AWS CloudFormation Stack manager",
long_description=read("README.rst"),
packages=find_packages(),
scripts=glob.glob(os.path.join(src_dir, "scripts", "*")),
install_requires=install_requires,
tests_require=tests_require,
test_suite="nose.collector",
)
|
import os
from setuptools import setup, find_packages
import glob
VERSION = "0.6.3"
src_dir = os.path.dirname(__file__)
install_requires = [
"troposphere~=1.8.0",
"boto3~=1.3.1",
"botocore~=1.4.38",
"PyYAML~=3.11",
"awacs~=0.6.0",
"colorama~=0.3.7",
]
tests_require = [
"nose~=1.0",
"mock~=2.0.0",
"stacker_blueprints~=0.6.0",
"moto~=0.4.25",
"testfixtures~=4.10.0",
]
def read(filename):
full_path = os.path.join(src_dir, filename)
with open(full_path) as fd:
return fd.read()
if __name__ == "__main__":
setup(
name="stacker",
version=VERSION,
author="Michael Barrett",
author_email="loki77@gmail.com",
license="New BSD license",
url="https://github.com/remind101/stacker",
description="Opinionated AWS CloudFormation Stack manager",
long_description=read("README.rst"),
packages=find_packages(),
scripts=glob.glob(os.path.join(src_dir, "scripts", "*")),
install_requires=install_requires,
tests_require=tests_require,
test_suite="nose.collector",
)
|
Use compatible release versions for all dependencies
|
Use compatible release versions for all dependencies
|
Python
|
bsd-2-clause
|
remind101/stacker,remind101/stacker,mhahn/stacker,mhahn/stacker
|
---
+++
@@ -7,20 +7,20 @@
src_dir = os.path.dirname(__file__)
install_requires = [
- "troposphere>=1.8.0",
- "boto3>=1.3.1",
- "botocore>=1.4.38",
- "PyYAML>=3.11",
- "awacs>=0.6.0",
- "colorama==0.3.7",
+ "troposphere~=1.8.0",
+ "boto3~=1.3.1",
+ "botocore~=1.4.38",
+ "PyYAML~=3.11",
+ "awacs~=0.6.0",
+ "colorama~=0.3.7",
]
tests_require = [
- "nose>=1.0",
- "mock==1.0.1",
- "stacker_blueprints",
- "moto",
- "testfixtures",
+ "nose~=1.0",
+ "mock~=2.0.0",
+ "stacker_blueprints~=0.6.0",
+ "moto~=0.4.25",
+ "testfixtures~=4.10.0",
]
|
a2bd15575f6799a6d473c7fef9bfd4a629a8350a
|
setup.py
|
setup.py
|
from setuptools import setup
with open('README.md') as file:
long_description = file.read()
setup(
name="guacamole-files",
version="0.1.0",
author="Antonin Messinger",
author_email="antonin.messinger@gmail.com",
description=" Upload any file, get a URL back",
long_description=long_description,
license="MIT License",
url="https://github.com/Antojitos/guacamole",
download_url="https://github.com/Antojitos/guacamole/archive/0.1.0.tar.gz",
keywords=["guacamole", "url", "files"],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Flask',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Topic :: Internet :: WWW/HTTP',
],
packages=['guacamole'],
install_requires=[
'Flask==0.10.1',
'Flask-PyMongo==0.4.0',
],
test_suite='tests.main'
)
|
from setuptools import setup
with open('README.md') as file:
long_description = file.read()
setup(
name="guacamole-files",
version="0.1.0",
author="Antonin Messinger",
author_email="antonin.messinger@gmail.com",
description=" Upload any file, get a URL back",
long_description=long_description,
license="MIT License",
url="https://github.com/Antojitos/guacamole",
download_url="https://github.com/Antojitos/guacamole/archive/0.1.0.tar.gz",
keywords=["guacamole", "url", "files"],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Flask',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Topic :: Internet :: WWW/HTTP',
],
packages=['guacamole'],
install_requires=[
'Flask==0.12.3',
'Flask-PyMongo==0.4.0',
],
test_suite='tests.main'
)
|
Upgrade to Flask 0.12.3 to fix CVE-2018-1000656
|
Upgrade to Flask 0.12.3 to fix CVE-2018-1000656
|
Python
|
mit
|
Antojitos/guacamole
|
---
+++
@@ -28,7 +28,7 @@
packages=['guacamole'],
install_requires=[
- 'Flask==0.10.1',
+ 'Flask==0.12.3',
'Flask-PyMongo==0.4.0',
],
|
8ed470f474b2cac84a18fe3709e67b3a160cfdc6
|
setup.py
|
setup.py
|
import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).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-nexmo',
version='2.0.0',
packages=['djexmo'],
include_package_data=True,
license='MIT',
description='A simple Django app to send text messages using the Nexmo api.',
long_description=README,
url='https://github.com/thibault/django-nexmo',
author='Thibault Jouannic',
author_email='thibault@miximum.fr',
setup_requires=('setuptools'),
install_requires=[
'libnexmo',
],
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved',
'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',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)
|
import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).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-nexmo',
version='2.0.0',
packages=['djexmo'],
include_package_data=True,
license='MIT',
description='A simple Django app to send text messages using the Nexmo api.',
long_description=README,
url='https://github.com/thibault/django-nexmo',
author='Thibault Jouannic',
author_email='thibault@miximum.fr',
setup_requires=('setuptools'),
install_requires=[
'nexmo',
],
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved',
'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',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)
|
Move lib dependency to nexmo
|
Move lib dependency to nexmo
|
Python
|
mit
|
thibault/django-nexmo
|
---
+++
@@ -19,7 +19,7 @@
author_email='thibault@miximum.fr',
setup_requires=('setuptools'),
install_requires=[
- 'libnexmo',
+ 'nexmo',
],
classifiers=[
'Environment :: Web Environment',
@@ -31,7 +31,7 @@
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.3',
+ 'Programming Language :: Python :: 3.4',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
|
59761e83b240fe7573370f542ea6e877c5850907
|
setup.py
|
setup.py
|
#!/usr/bin/env python
from distutils.core import setup, Extension
uinput = Extension('libuinput',
sources = ['src/uinput.c'])
setup(name='python-steamcontroller',
version='1.0',
description='Steam Controller userland driver',
author='Stany MARCEL',
author_email='stanypub@gmail.com',
url='https://github.com/ynsta/steamcontroller',
package_dir={'steamcontroller': 'src'},
packages=['steamcontroller'],
scripts=['scripts/sc-dump.py',
'scripts/sc-xbox.py'],
license='MIT',
platforms=['Linux'],
ext_modules=[uinput, ])
|
#!/usr/bin/env python
from distutils.core import setup, Extension
uinput = Extension('libuinput',
sources = ['src/uinput.c'])
setup(name='python-steamcontroller',
version='1.0',
description='Steam Controller userland driver',
author='Stany MARCEL',
author_email='stanypub@gmail.com',
url='https://github.com/ynsta/steamcontroller',
package_dir={'steamcontroller': 'src'},
packages=['steamcontroller'],
scripts=['scripts/sc-dump.py',
'scripts/sc-xbox.py',
'scripts/vdf2json.py',
'scripts/json2vdf.py'],
license='MIT',
platforms=['Linux'],
ext_modules=[uinput, ])
|
Add json to from vdf scripts
|
Add json to from vdf scripts
Signed-off-by: Stany MARCEL <3e139d47b96f775f4bc13af807cbc2ea7c67e72b@gmail.com>
|
Python
|
mit
|
ynsta/steamcontroller,oneru/steamcontroller,oneru/steamcontroller,ynsta/steamcontroller
|
---
+++
@@ -14,7 +14,9 @@
package_dir={'steamcontroller': 'src'},
packages=['steamcontroller'],
scripts=['scripts/sc-dump.py',
- 'scripts/sc-xbox.py'],
+ 'scripts/sc-xbox.py',
+ 'scripts/vdf2json.py',
+ 'scripts/json2vdf.py'],
license='MIT',
platforms=['Linux'],
ext_modules=[uinput, ])
|
ca06378b83a2cef1902bff1204cb3f506433f974
|
setup.py
|
setup.py
|
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
DESCRIPTION = "Convert Matplotlib plots into Leaflet web maps"
LONG_DESCRIPTION = DESCRIPTION
NAME = "mplleaflet"
AUTHOR = "Jacob Wasserman"
AUTHOR_EMAIL = "jwasserman@gmail.com"
MAINTAINER = "Jacob Wasserman"
MAINTAINER_EMAIL = "jwasserman@gmail.com"
DOWNLOAD_URL = 'http://github.com/jwass/mplleaflet'
LICENSE = 'BSD 3-clause'
VERSION = '0.0.2'
setup(
name=NAME,
version=VERSION,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
url=DOWNLOAD_URL,
download_url=DOWNLOAD_URL,
license=LICENSE,
packages=find_packages(),
package_data={'': ['*.html']}, # Include the templates
install_requires=[
"jinja2",
"six",
],
)
|
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
with open('AUTHORS.md') as f:
authors = f.read()
description = "Convert Matplotlib plots into Leaflet web maps"
long_description = description + "\n\n" + authors
NAME = "mplleaflet"
AUTHOR = "Jacob Wasserman"
AUTHOR_EMAIL = "jwasserman@gmail.com"
MAINTAINER = "Jacob Wasserman"
MAINTAINER_EMAIL = "jwasserman@gmail.com"
DOWNLOAD_URL = 'http://github.com/jwass/mplleaflet'
LICENSE = 'BSD 3-clause'
VERSION = '0.0.3'
setup(
name=NAME,
version=VERSION,
description=description,
long_description=long_description,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
url=DOWNLOAD_URL,
download_url=DOWNLOAD_URL,
license=LICENSE,
packages=find_packages(),
package_data={'': ['*.html']}, # Include the templates
install_requires=[
"jinja2",
"six",
],
)
|
Add authors to long description.
|
Add authors to long description.
|
Python
|
bsd-3-clause
|
jwass/mplleaflet,ocefpaf/mplleaflet,jwass/mplleaflet,ocefpaf/mplleaflet
|
---
+++
@@ -3,8 +3,11 @@
except ImportError:
from distutils.core import setup, find_packages
-DESCRIPTION = "Convert Matplotlib plots into Leaflet web maps"
-LONG_DESCRIPTION = DESCRIPTION
+with open('AUTHORS.md') as f:
+ authors = f.read()
+
+description = "Convert Matplotlib plots into Leaflet web maps"
+long_description = description + "\n\n" + authors
NAME = "mplleaflet"
AUTHOR = "Jacob Wasserman"
AUTHOR_EMAIL = "jwasserman@gmail.com"
@@ -12,13 +15,13 @@
MAINTAINER_EMAIL = "jwasserman@gmail.com"
DOWNLOAD_URL = 'http://github.com/jwass/mplleaflet'
LICENSE = 'BSD 3-clause'
-VERSION = '0.0.2'
+VERSION = '0.0.3'
setup(
name=NAME,
version=VERSION,
- description=DESCRIPTION,
- long_description=LONG_DESCRIPTION,
+ description=description,
+ long_description=long_description,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
maintainer=MAINTAINER,
|
f18e291a4ebfb51c6eec18c9c64a8d928fd3aa9e
|
setup.py
|
setup.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
try:
from pypandoc import convert
read_md = lambda f: convert(f, 'rst')
long_description = read_md('README.md')
except IOError:
print("warning: README.md not found")
long_description = ""
except ImportError:
print("warning: pypandoc module not found, could not convert Markdown to RST")
long_description = ""
setup(
name="pybossa-pbs",
version="1.1",
author="Daniel Lombraña González",
author_email="info@pybossa.com",
description="PyBossa command line client",
long_description=long_description,
license="AGPLv3",
url="https://github.com/PyBossa/pbs",
classifiers = ['Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
'Operating System :: OS Independent',
'Programming Language :: Python',],
py_modules=['pbs', 'helpers'],
install_requires=['Click', 'pybossa-client', 'requests', 'nose', 'mock', 'coverage',
'rednose', 'pypandoc'],
entry_points='''
[console_scripts]
pbs=pbs:cli
'''
)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
try:
from pypandoc import convert
long_description = convert('README.md', 'md', format='rst')
except IOError:
print("warning: README.md not found")
long_description = ""
except ImportError:
print("warning: pypandoc module not found, could not convert Markdown to RST")
long_description = ""
setup(
name="pybossa-pbs",
version="1.1",
author="Daniel Lombraña González",
author_email="info@pybossa.com",
description="PyBossa command line client",
long_description=long_description,
license="AGPLv3",
url="https://github.com/PyBossa/pbs",
classifiers = ['Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
'Operating System :: OS Independent',
'Programming Language :: Python',],
py_modules=['pbs', 'helpers'],
install_requires=['Click', 'pybossa-client', 'requests', 'nose', 'mock', 'coverage',
'rednose', 'pypandoc'],
entry_points='''
[console_scripts]
pbs=pbs:cli
'''
)
|
Fix for md to rst
|
Fix for md to rst
|
Python
|
agpl-3.0
|
PyBossa/pbs,PyBossa/pbs,PyBossa/pbs
|
---
+++
@@ -5,8 +5,7 @@
try:
from pypandoc import convert
- read_md = lambda f: convert(f, 'rst')
- long_description = read_md('README.md')
+ long_description = convert('README.md', 'md', format='rst')
except IOError:
print("warning: README.md not found")
long_description = ""
|
9b1ae7410004635dd59d07fda89c9aa93979a88f
|
setup.py
|
setup.py
|
import codecs
from setuptools import setup, find_packages
def long_description():
with codecs.open('README.rst', encoding='utf8') as f:
return f.read()
setup(
name='django-querysetsequence',
packages=find_packages(),
version='0.1',
description='Chain together multiple (disparate) QuerySets to treat them as a single QuerySet.',
long_description=long_description(),
author='Percipient Networks, LLC',
author_email='support@percipientnetworks.com',
url='https://github.com/percipient/django-querysetsequence',
download_url='https://github.com/percipient/django-querysetsequence',
keywords=['django', 'queryset', 'chain', 'multi', 'multiple', 'iterable'],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries :: Python Modules',
'Environment :: Web Environment',
'Topic :: Internet',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Framework :: Django',
'License :: OSI Approved :: ISC License (ISCL)',
],
install_requires=[
'django>=1.8.0',
],
)
|
import codecs
from setuptools import setup, find_packages
def long_description():
with codecs.open('README.rst', encoding='utf8') as f:
return f.read()
setup(
name='django-querysetsequence',
py_modules=['queryset_sequence'],
version='0.1',
description='Chain together multiple (disparate) QuerySets to treat them as a single QuerySet.',
long_description=long_description(),
author='Percipient Networks, LLC',
author_email='support@percipientnetworks.com',
url='https://github.com/percipient/django-querysetsequence',
download_url='https://github.com/percipient/django-querysetsequence',
keywords=['django', 'queryset', 'chain', 'multi', 'multiple', 'iterable'],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries :: Python Modules',
'Environment :: Web Environment',
'Topic :: Internet',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Framework :: Django',
'License :: OSI Approved :: ISC License (ISCL)',
],
install_requires=[
'django>=1.8.0',
],
)
|
Use py_modules instead of packages.
|
Use py_modules instead of packages.
This is necessary when only having a "root package".
|
Python
|
isc
|
percipient/django-querysetsequence
|
---
+++
@@ -9,7 +9,7 @@
setup(
name='django-querysetsequence',
- packages=find_packages(),
+ py_modules=['queryset_sequence'],
version='0.1',
description='Chain together multiple (disparate) QuerySets to treat them as a single QuerySet.',
long_description=long_description(),
|
6f2690858d41a86ee1d2f3345b544a50438a493f
|
setup.py
|
setup.py
|
import sys
from setuptools import setup, find_packages
extra_setup = {}
if sys.version_info >= (3,):
extra_setup['use_2to3'] = True
setup(
name='blessings',
version='1.4',
description='A thin, practical wrapper around terminal coloring, styling, and positioning',
long_description=open('README.rst').read(),
author='Erik Rose',
author_email='erikrose@grinchcentral.com',
license='MIT',
packages=find_packages(exclude=['ez_setup']),
tests_require=['Nose'],
url='https://github.com/erikrose/blessings',
include_package_data=True,
classifiers=[
'Intended Audience :: Developers',
'Natural Language :: English',
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Environment :: Console :: Curses',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.5',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: User Interfaces',
'Topic :: Terminals'
],
keywords=['terminal', 'tty', 'curses', 'ncurses', 'formatting', 'style', 'color', 'console'],
**extra_setup
)
|
import sys
from setuptools import setup, find_packages
extra_setup = {}
if sys.version_info >= (3,):
extra_setup['use_2to3'] = True
setup(
name='blessings',
version='1.4',
description='A thin, practical wrapper around terminal coloring, styling, and positioning',
long_description=open('README.rst').read(),
author='Erik Rose',
author_email='erikrose@grinchcentral.com',
license='MIT',
packages=find_packages(exclude=['ez_setup']),
tests_require=['nose'],
url='https://github.com/erikrose/blessings',
include_package_data=True,
classifiers=[
'Intended Audience :: Developers',
'Natural Language :: English',
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Environment :: Console :: Curses',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.5',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: User Interfaces',
'Topic :: Terminals'
],
keywords=['terminal', 'tty', 'curses', 'ncurses', 'formatting', 'style', 'color', 'console'],
**extra_setup
)
|
Fix case of "nose" in tests_require.
|
Fix case of "nose" in tests_require.
|
Python
|
mit
|
tartley/blessings,erikrose/blessings,jquast/blessed
|
---
+++
@@ -16,7 +16,7 @@
author_email='erikrose@grinchcentral.com',
license='MIT',
packages=find_packages(exclude=['ez_setup']),
- tests_require=['Nose'],
+ tests_require=['nose'],
url='https://github.com/erikrose/blessings',
include_package_data=True,
classifiers=[
|
825ab4f2a26e7a5c4348f1adfa8e5163013e43f7
|
setup.py
|
setup.py
|
#!/usr/bin/env python
#coding: utf-8
from cms import VERSION
from setuptools import setup, find_packages
EXCLUDE_FROM_PACKAGES = ['cms.bin']
setup(
name="onespacemedia-cms",
version=".".join(str(n) for n in VERSION),
url="https://github.com/onespacemedia/cms",
author="Daniel Samuels",
author_email="daniel@onespacemedia.com",
license="BSD",
packages=find_packages(exclude=EXCLUDE_FROM_PACKAGES),
include_package_data=True,
scripts=['cms/bin/start_cms_project.py'],
zip_safe=False,
entry_points={
"console_scripts": [
"start_cms_project.py = cms.bin.start_cms_project:main",
],
},
description='CMS used by Onespacemedia',
install_requires=[
'django',
'psycopg2',
'django-suit',
'django-optimizations',
'Pillow',
'django-reversion',
'django-usertools',
'django-historylinks',
'django-watson',
'django-extensions',
'Werkzeug'
],
)
|
#!/usr/bin/env python
#coding: utf-8
from cms import VERSION
from setuptools import setup, find_packages
EXCLUDE_FROM_PACKAGES = ['cms.bin']
setup(
name="onespacemedia-cms",
version=".".join(str(n) for n in VERSION),
url="https://github.com/onespacemedia/cms",
author="Daniel Samuels",
author_email="daniel@onespacemedia.com",
license="BSD",
packages=find_packages(exclude=EXCLUDE_FROM_PACKAGES),
include_package_data=True,
scripts=['cms/bin/start_cms_project.py'],
zip_safe=False,
entry_points={
"console_scripts": [
"start_cms_project.py = cms.bin.start_cms_project:main",
],
},
description='CMS used by Onespacemedia',
install_requires=[
'django',
'psycopg2',
'django-suit',
'django-optimizations',
'Pillow',
'django-reversion',
'django-usertools',
'django-historylinks',
'django-watson',
'django-extensions',
'Werkzeug',
'raven'
],
)
|
Add raven to the dependancy list.
|
Add raven to the dependancy list.
|
Python
|
bsd-3-clause
|
jamesfoley/cms,danielsamuels/cms,lewiscollard/cms,danielsamuels/cms,lewiscollard/cms,dan-gamble/cms,lewiscollard/cms,dan-gamble/cms,jamesfoley/cms,danielsamuels/cms,dan-gamble/cms,jamesfoley/cms,jamesfoley/cms
|
---
+++
@@ -35,6 +35,7 @@
'django-historylinks',
'django-watson',
'django-extensions',
- 'Werkzeug'
+ 'Werkzeug',
+ 'raven'
],
)
|
a620066a23f21b8a736cae0238dfa3ee8549e3a7
|
setup.py
|
setup.py
|
#!/usr/bin/env python
import os
import sys
from serfclient import __version__
try:
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
except ImportError:
from distutils.core import setup
PyTest = lambda x: x
try:
long_description = open(os.path.join(os.path.dirname(__file__),
'README.rst')).read()
except:
long_description = None
setup(
name='serfclient',
version=__version__,
description='Python client for the Serf orchestration tool',
long_description=long_description,
url='https://github.com/KushalP/serfclient-py',
author='Kushal Pisavadia',
author_email='kushal@violentlymild.com',
maintainer='Kushal Pisavadia',
maintainer_email='kushal@violentlymild.com',
keywords=['Serf', 'orchestration', 'service discovery'],
license='MIT',
packages=['serfclient'],
install_requires=['msgpack-python >= 0.4.0'],
tests_require=['pytest >= 2.5.2'],
cmdclass={'test': PyTest}
)
|
#!/usr/bin/env python
import os
import sys
from serfclient import __version__
try:
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
except ImportError:
from distutils.core import setup
PyTest = lambda x: x
try:
long_description = open(os.path.join(os.path.dirname(__file__),
'README.rst')).read()
except:
long_description = None
setup(
name='serfclient',
version=__version__,
description='Python client for the Serf orchestration tool',
long_description=long_description,
url='https://github.com/KushalP/serfclient-py',
author='Kushal Pisavadia',
author_email='kushal@violentlymild.com',
maintainer='Kushal Pisavadia',
maintainer_email='kushal@violentlymild.com',
keywords=['Serf', 'orchestration', 'service discovery'],
license='MIT',
packages=['serfclient'],
install_requires=['msgpack-python >= 0.4.0'],
tests_require=['pytest >= 2.5.2', 'pytest-cov >= 1.6'],
cmdclass={'test': PyTest}
)
|
Add pytest-cov as a test dependency
|
Add pytest-cov as a test dependency
As part of CI we want to check our code coverage as we work on this
python module.
|
Python
|
mit
|
charleswhchan/serfclient-py,KushalP/serfclient-py
|
---
+++
@@ -42,6 +42,6 @@
license='MIT',
packages=['serfclient'],
install_requires=['msgpack-python >= 0.4.0'],
- tests_require=['pytest >= 2.5.2'],
+ tests_require=['pytest >= 2.5.2', 'pytest-cov >= 1.6'],
cmdclass={'test': PyTest}
)
|
3c89214e45f631d8258f75e7f96c252c181dfdab
|
setup.py
|
setup.py
|
from sys import version_info
from setuptools import find_packages, setup
VERSION = open('puresnmp/version.txt').read().strip()
DEPENDENCIES = []
if version_info < (3, 5):
DEPENDENCIES.append('typing')
setup(
name="puresnmp",
version=VERSION,
description="Pure Python SNMP implementation",
long_description=open("README.rst").read(),
author="Michel Albert",
author_email="michel@albert.lu",
provides=['puresnmp'],
license="MIT",
include_package_data=True,
install_requires=DEPENDENCIES,
extras_require={
'dev': [],
'test': ['pytest-xdist', 'pytest', 'pytest-coverage']
},
packages=find_packages(exclude=["tests.*", "tests", "docs"]),
url="https://github.com/exhuma/puresnmp",
keywords="networking snmp",
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Topic :: System :: Networking',
'Topic :: System :: Networking :: Monitoring',
'Topic :: System :: Systems Administration',
]
)
|
from sys import version_info
from setuptools import find_packages, setup
VERSION = open('puresnmp/version.txt').read().strip()
DEPENDENCIES = []
if version_info < (3, 5):
DEPENDENCIES.append('typing')
if version_info < (3, 3):
DEPENDENCIES.append('ipaddress')
DEPENDENCIES.append('mock')
setup(
name="puresnmp",
version=VERSION,
description="Pure Python SNMP implementation",
long_description=open("README.rst").read(),
author="Michel Albert",
author_email="michel@albert.lu",
provides=['puresnmp'],
license="MIT",
include_package_data=True,
install_requires=DEPENDENCIES,
extras_require={
'dev': [],
'test': ['pytest-xdist', 'pytest', 'pytest-coverage']
},
packages=find_packages(exclude=["tests.*", "tests", "docs"]),
url="https://github.com/exhuma/puresnmp",
keywords="networking snmp",
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Topic :: System :: Networking',
'Topic :: System :: Networking :: Monitoring',
'Topic :: System :: Systems Administration',
]
)
|
Add missing dependencies for Python 2
|
Add missing dependencies for Python 2
|
Python
|
mit
|
exhuma/puresnmp,exhuma/puresnmp
|
---
+++
@@ -6,6 +6,9 @@
DEPENDENCIES = []
if version_info < (3, 5):
DEPENDENCIES.append('typing')
+if version_info < (3, 3):
+ DEPENDENCIES.append('ipaddress')
+ DEPENDENCIES.append('mock')
setup(
name="puresnmp",
|
179e72db3d95a41d53ebd019a5cb698a7767eb45
|
setup.py
|
setup.py
|
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name="xutils",
version="0.8",
description="A Fragmentary Python Library.",
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
setup(
name="xutils",
version="0.8.1",
description="A Fragmentary Python Library.",
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.8.1
|
Set the version to 0.8.1
|
Python
|
mit
|
xgfone/xutils,xgfone/pycom
|
---
+++
@@ -5,7 +5,7 @@
setup(
name="xutils",
- version="0.8",
+ version="0.8.1",
description="A Fragmentary Python Library.",
author="xgfone",
author_email="xgfone@126.com",
|
2df022622348c568bfb2620dfa2b9803de3ca2d5
|
setup.py
|
setup.py
|
#!/usr/bin/env python
from setuptools import setup
URL_BASE = 'https://github.com/astropy/astropy-tools/'
setup(
name='astropy-tools',
version='0.0.0.dev0',
author='The Astropy Developers',
author_email='astropy.team@gmail.com',
url=URL_BASE,
download_url=URL_BASE + 'archive/master.zip',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development',
'Topic :: Utilities'
],
py_modules=[
'gitastropyplots',
'gh_issuereport',
'issue2pr',
'suggest_backports'
],
entry_points={
'console_scripts': [
'gh_issuereport = gh_issuereport:main',
'issue2pr = issue2pr:main',
'suggest_backports = suggest_backports:main'
]
}
)
|
#!/usr/bin/env python
from setuptools import setup
URL_BASE = 'https://github.com/astropy/astropy-tools/'
setup(
name='astropy-tools',
version='0.0.0.dev0',
author='The Astropy Developers',
author_email='astropy.team@gmail.com',
url=URL_BASE,
download_url=URL_BASE + 'archive/master.zip',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development',
'Topic :: Utilities'
],
py_modules=[
'gitastropyplots',
'gh_issuereport',
'issue2pr',
'suggest_backports'
],
entry_points={
'console_scripts': [
'gh_issuereport = gh_issuereport:main',
'issue2pr = issue2pr:main',
'suggest_backports = suggest_backports:main'
]
},
install_requires=['requests']
)
|
Include requests module in requirements for use by the gh_issuereport script
|
Include requests module in requirements for use by the gh_issuereport script
|
Python
|
bsd-3-clause
|
astropy/astropy-tools,astropy/astropy-tools
|
---
+++
@@ -37,6 +37,7 @@
'issue2pr = issue2pr:main',
'suggest_backports = suggest_backports:main'
]
- }
+ },
+ install_requires=['requests']
)
|
fea6c5e84104b320c3d9475e59f7cf8625339a29
|
setup.py
|
setup.py
|
from setuptools import setup
setup(
name='tangled.mako',
version='0.1a3.dev0',
description='Tangled Mako integration',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.mako/tags',
author='Wyatt Baldwin',
author_email='self@wyattbaldwin.com',
include_package_data=True,
packages=[
'tangled',
'tangled.mako',
'tangled.mako.tests',
],
install_requires=[
'tangled.web>=0.1a5',
'Mako>=0.9.1',
],
extras_require={
'dev': [
'tangled.web[dev]>=0.1a5',
],
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
|
from setuptools import setup
setup(
name='tangled.mako',
version='0.1a3.dev0',
description='Tangled Mako integration',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.mako/tags',
author='Wyatt Baldwin',
author_email='self@wyattbaldwin.com',
include_package_data=True,
packages=[
'tangled',
'tangled.mako',
'tangled.mako.tests',
],
install_requires=[
'tangled.web>=0.1a5',
'Mako>=0.9.1',
],
extras_require={
'dev': [
'tangled.web[dev]>=0.1a5',
],
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
|
Add generic Python 3 trove classifier
|
Add generic Python 3 trove classifier
|
Python
|
mit
|
TangledWeb/tangled.mako
|
---
+++
@@ -29,6 +29,7 @@
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
+ 'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
|
82da444753249df9bbd4c516a7b1f9f5a4a7a29a
|
setup.py
|
setup.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='yg.emanate',
use_scm_version=True,
description="Lightweight event system for Python",
author="YouGov, plc",
author_email='dev@yougov.com',
url='https://github.com/yougov/yg.emanate',
packages=[
'yg.emanate',
],
namespace_packages=['yg'],
include_package_data=True,
setup_requires=['setuptools_scm>=1.15'],
zip_safe=False,
keywords='emanate',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
],
test_suite='tests',
python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",
)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='yg.emanate',
use_scm_version=True,
description="Lightweight event system for Python",
author="YouGov, plc",
author_email='dev@yougov.com',
url='https://github.com/yougov/yg.emanate',
packages=[
'yg.emanate',
],
namespace_packages=['yg'],
include_package_data=True,
setup_requires=['setuptools_scm>=1.15'],
keywords='emanate',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
],
test_suite='tests',
python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",
)
|
Remove deprecated 'zip_safe' flag. It's probably safe anyhow.
|
Remove deprecated 'zip_safe' flag. It's probably safe anyhow.
|
Python
|
mit
|
yougov/emanate
|
---
+++
@@ -16,7 +16,6 @@
namespace_packages=['yg'],
include_package_data=True,
setup_requires=['setuptools_scm>=1.15'],
- zip_safe=False,
keywords='emanate',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
|
5145e5cfccaef99be1fd7c1240e289ab132a858b
|
setup.py
|
setup.py
|
from setuptools import find_packages, setup
from virtualenvapi import __version__
setup(
name='virtualenv-api',
version=__version__,
license='BSD',
author='Sam Kingston and AUTHORS',
author_email='sam@sjkwi.com.au',
description='An API for virtualenv/pip',
long_description=open('README.rst', 'r').read(),
url='https://github.com/sjkingo/virtualenv-api',
install_requires=['six',
'virtualenv'
],
packages=find_packages(),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
|
from setuptools import find_packages, setup
from virtualenvapi import __version__
setup(
name='virtualenv-api',
version=__version__,
license='BSD',
author='Sam Kingston and AUTHORS',
author_email='sam@sjkwi.com.au',
description='An API for virtualenv/pip',
long_description=open('README.rst', 'r').read(),
url='https://github.com/sjkingo/virtualenv-api',
install_requires=['six',
'virtualenv'
],
packages=find_packages(),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
|
Remove python 3.3 from trove classifiers
|
Remove python 3.3 from trove classifiers [skip ci]
|
Python
|
bsd-2-clause
|
sjkingo/virtualenv-api
|
---
+++
@@ -24,7 +24,6 @@
'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',
|
7609c1df444d13efdb8be295003af13dc9de3d96
|
setup.py
|
setup.py
|
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name = "OpenFisca-Country-Template",
version = "3.9.4",
author = "OpenFisca Team",
author_email = "contact@openfisca.org",
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Operating System :: POSIX",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Information Analysis",
],
description = "OpenFisca tax and benefit system for Country-Template",
keywords = "benefit microsimulation social tax",
license ="http://www.fsf.org/licensing/licenses/agpl-3.0.html",
url = "https://github.com/openfisca/country-template",
include_package_data = True, # Will read MANIFEST.in
data_files = [
("share/openfisca/openfisca-country-template", ["CHANGELOG.md", "LICENSE", "README.md"]),
],
install_requires = [
"OpenFisca-Core[web-api] >=27.0,<32.0",
],
extras_require = {
"dev": [
"autopep8 ==1.4.4",
"flake8 >=3.5.0,<3.8.0",
"flake8-print",
"pycodestyle >=2.3.0,<2.6.0", # To avoid incompatibility with flake
]
},
packages=find_packages(),
)
|
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name = "OpenFisca-Country-Template",
version = "3.9.4",
author = "OpenFisca Team",
author_email = "contact@openfisca.org",
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Operating System :: POSIX",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Information Analysis",
],
description = "OpenFisca tax and benefit system for Country-Template",
keywords = "benefit microsimulation social tax",
license ="http://www.fsf.org/licensing/licenses/agpl-3.0.html",
url = "https://github.com/openfisca/country-template",
include_package_data = True, # Will read MANIFEST.in
data_files = [
("share/openfisca/openfisca-country-template", ["CHANGELOG.md", "LICENSE", "README.md"]),
],
install_requires = [
"OpenFisca-Core[web-api] >=27.0,<33.0",
],
extras_require = {
"dev": [
"autopep8 ==1.4.4",
"flake8 >=3.5.0,<3.8.0",
"flake8-print",
"pycodestyle >=2.3.0,<2.6.0", # To avoid incompatibility with flake
]
},
packages=find_packages(),
)
|
Update openfisca-core requirement from <32.0,>=27.0 to >=27.0,<33.0
|
Update openfisca-core requirement from <32.0,>=27.0 to >=27.0,<33.0
Updates the requirements on [openfisca-core](https://github.com/openfisca/openfisca-core) to permit the latest version.
- [Release notes](https://github.com/openfisca/openfisca-core/releases)
- [Changelog](https://github.com/openfisca/openfisca-core/blob/master/CHANGELOG.md)
- [Commits](https://github.com/openfisca/openfisca-core/compare/27.0.0...32.1.0)
Signed-off-by: dependabot[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
|
Python
|
agpl-3.0
|
openfisca/country-template,openfisca/country-template
|
---
+++
@@ -23,7 +23,7 @@
("share/openfisca/openfisca-country-template", ["CHANGELOG.md", "LICENSE", "README.md"]),
],
install_requires = [
- "OpenFisca-Core[web-api] >=27.0,<32.0",
+ "OpenFisca-Core[web-api] >=27.0,<33.0",
],
extras_require = {
"dev": [
|
ae290af846848a63b85e3832d694de6c5c25a4dc
|
setup.py
|
setup.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
long_description = """
Django URL routing system DRYed.
"""
requirements = [
'django>=1.8',
'six',
]
test_requirements = [
'mock',
'coveralls'
]
setup(
name='urljects',
version='1.10.4',
description="Django URLS DRYed.",
long_description=long_description,
author="Visgean Skeloru",
author_email='visgean@gmail.com',
url='https://github.com/visgean/urljects',
packages=[
'urljects',
],
package_dir={'urljects': 'urljects'},
include_package_data=True,
install_requires=requirements,
license="BSD",
zip_safe=False,
keywords='urljects',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
],
test_suite='tests',
tests_require=test_requirements
)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
long_description = """
Django URL routing system DRYed.
"""
requirements = [
'django>=1.9',
'six',
]
test_requirements = [
'mock',
'coveralls'
]
setup(
name='urljects',
version='1.10.4',
description="Django URLS DRYed.",
long_description=long_description,
author="Visgean Skeloru",
author_email='visgean@gmail.com',
url='https://github.com/visgean/urljects',
packages=[
'urljects',
],
package_dir={'urljects': 'urljects'},
include_package_data=True,
install_requires=requirements,
license="BSD",
zip_safe=False,
keywords='urljects',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
test_suite='tests',
tests_require=test_requirements
)
|
Increase python compatibility version and bump to v1.2.0
|
Increase python compatibility version and bump to v1.2.0
|
Python
|
bsd-3-clause
|
Visgean/urljects
|
---
+++
@@ -13,7 +13,7 @@
requirements = [
- 'django>=1.8',
+ 'django>=1.9',
'six',
]
@@ -49,6 +49,7 @@
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
],
test_suite='tests',
tests_require=test_requirements
|
fec10deb7670abb2b0daf72c80ebdcc6346e0545
|
setup.py
|
setup.py
|
from setuptools import setup
REPO_URL = 'http://github.com/okfn-brasil/serenata-toolbox'
setup(
author='Serenata de Amor',
author_email='contato@serenata.ai',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
'Topic :: Utilities',
],
description='Toolbox for Serenata de Amor project',
zip_safe=False,
install_requires=[
'aiofiles',
'aiohttp',
'beautifulsoup4>=4.4',
'lxml>=3.6',
'pandas>=0.18',
'python-decouple>=3.1',
'tqdm'
],
keywords='serenata de amor, data science, brazil, corruption',
license='MIT',
long_description='Check `Serenata Toolbox at GitHub <{}>`_.'.format(REPO_URL),
name='serenata-toolbox',
packages=[
'serenata_toolbox',
'serenata_toolbox.federal_senate',
'serenata_toolbox.chamber_of_deputies',
'serenata_toolbox.datasets'
],
url=REPO_URL,
python_requires='>=3.6',
version='15.0.2',
)
|
from setuptools import setup
REPO_URL = 'http://github.com/okfn-brasil/serenata-toolbox'
with open('README.rst') as fobj:
long_description = fobj.read()
setup(
author='Serenata de Amor',
author_email='contato@serenata.ai',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
'Topic :: Utilities',
],
description='Toolbox for Serenata de Amor project',
zip_safe=False,
install_requires=[
'aiofiles',
'aiohttp',
'beautifulsoup4>=4.4',
'lxml>=3.6',
'pandas>=0.18',
'python-decouple>=3.1',
'tqdm'
],
keywords='serenata de amor, data science, brazil, corruption',
license='MIT',
long_description=long_description,
name='serenata-toolbox',
packages=[
'serenata_toolbox',
'serenata_toolbox.federal_senate',
'serenata_toolbox.chamber_of_deputies',
'serenata_toolbox.datasets'
],
url=REPO_URL,
python_requires='>=3.6',
version='15.0.3',
)
|
Add README.rst contents to PyPI page
|
Add README.rst contents to PyPI page
That is to say, what is visible at https://pypi.org/project/serenata-toolbox/
|
Python
|
mit
|
datasciencebr/serenata-toolbox
|
---
+++
@@ -2,6 +2,8 @@
REPO_URL = 'http://github.com/okfn-brasil/serenata-toolbox'
+with open('README.rst') as fobj:
+ long_description = fobj.read()
setup(
author='Serenata de Amor',
@@ -26,7 +28,7 @@
],
keywords='serenata de amor, data science, brazil, corruption',
license='MIT',
- long_description='Check `Serenata Toolbox at GitHub <{}>`_.'.format(REPO_URL),
+ long_description=long_description,
name='serenata-toolbox',
packages=[
'serenata_toolbox',
@@ -36,5 +38,5 @@
],
url=REPO_URL,
python_requires='>=3.6',
- version='15.0.2',
+ version='15.0.3',
)
|
0e4abdd8ab8ced760dbd2eb2c39afd8e88e4e87f
|
setup.py
|
setup.py
|
from setuptools import setup, find_packages
setup(
name = 'plumbing',
version = '2.9.9',
description = 'Helps with plumbing-type programing in python.',
license = 'MIT',
url = 'http://github.com/xapple/plumbing/',
author = 'Lucas Sinclair',
author_email = 'lucas.sinclair@me.com',
packages = find_packages(),
install_requires = ['autopaths>=1.4.2', 'six', 'pandas', 'numpy', 'matplotlib',
'retry', 'tzlocal', 'packaging'],
long_description = open('README.md').read(),
long_description_content_type = 'text/markdown',
include_package_data = True,
)
|
from setuptools import setup, find_packages
setup(
name = 'plumbing',
version = '2.9.9',
description = 'Helps with plumbing-type programing in python.',
license = 'MIT',
url = 'http://github.com/xapple/plumbing/',
author = 'Lucas Sinclair',
author_email = 'lucas.sinclair@me.com',
packages = find_packages(),
install_requires = ['autopaths>=1.4.2', 'six', 'pandas', 'numpy', 'matplotlib',
'retry', 'tzlocal', 'packaging', 'requests'],
long_description = open('README.md').read(),
long_description_content_type = 'text/markdown',
include_package_data = True,
)
|
Add requests as a dependency
|
Add requests as a dependency
|
Python
|
mit
|
xapple/plumbing
|
---
+++
@@ -10,7 +10,7 @@
author_email = 'lucas.sinclair@me.com',
packages = find_packages(),
install_requires = ['autopaths>=1.4.2', 'six', 'pandas', 'numpy', 'matplotlib',
- 'retry', 'tzlocal', 'packaging'],
+ 'retry', 'tzlocal', 'packaging', 'requests'],
long_description = open('README.md').read(),
long_description_content_type = 'text/markdown',
include_package_data = True,
|
6a07e4b3b0c67c442f0501f19c0253b4c99637cd
|
setup.py
|
setup.py
|
from setuptools import setup
import transip
setup(
name = transip.__name__,
version = transip.__version__,
author = transip.__author__,
author_email = transip.__email__,
license = transip.__license__,
description = transip.__doc__.splitlines()[0],
long_description = open('README.rst').read(),
url = 'http://github.com/goabout/transip-backup',
download_url = 'http://github.com/goabout/transip-backup/archives/master',
packages = ['transip', 'transip.service'],
include_package_data = True,
zip_safe = False,
platforms = ['all'],
test_suite = 'tests',
entry_points = {
'console_scripts': [
'transip-api = transip.transip_cli:main',
],
},
install_requires = [
'requests',
],
)
|
from setuptools import setup
import transip
setup(
name = transip.__name__,
version = transip.__version__,
author = transip.__author__,
author_email = transip.__email__,
license = transip.__license__,
description = transip.__doc__.splitlines()[0],
long_description = open('README.rst').read(),
url = 'http://github.com/goabout/transip-backup',
download_url = 'http://github.com/goabout/transip-backup/archives/master',
packages = ['transip', 'transip.service'],
include_package_data = True,
zip_safe = False,
platforms = ['all'],
test_suite = 'tests',
entry_points = {
'console_scripts': [
'transip-api = transip.transip_cli:main',
],
},
install_requires = [
'requests',
'rsa',
'suds',
],
)
|
Add more requirements that are needed for this module
|
Add more requirements that are needed for this module
|
Python
|
mit
|
benkonrath/transip-api,benkonrath/transip-api
|
---
+++
@@ -24,6 +24,8 @@
},
install_requires = [
'requests',
+ 'rsa',
+ 'suds',
],
)
|
06dab661c2d3cc0e34b527654691659a054f3a5d
|
setup.py
|
setup.py
|
from setuptools import setup, find_packages
with open('README.rst') as file:
long_description = file.read()
setup(
name="frijoles",
version="0.1.0",
author="Pablo SEMINARIO",
author_email="pablo@seminar.io",
description="Simple notifications powered by jumping beans",
long_description=long_description,
license="GNU Affero General Public License v3",
url="http://frijoles.antojitos.io/",
download_url="https://github.com/Antojitos/frijoles/archive/0.1.0.tar.gz",
keywords=["frijoles", "notifications", "api"],
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'Framework :: Flask',
'License :: OSI Approved :: GNU Affero General Public License v3',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Topic :: Internet :: WWW/HTTP',
],
package_dir={'': 'src'},
packages=find_packages('src'),
install_requires=[
'Flask==0.10.1',
'Flask-PyMongo==0.4.0'
],
)
|
from setuptools import setup, find_packages
with open('README.rst') as file:
long_description = file.read()
setup(
name="frijoles",
version="0.1.0",
author="Pablo SEMINARIO",
author_email="pablo@seminar.io",
description="Simple notifications powered by jumping beans",
long_description=long_description,
license="GNU Affero General Public License v3",
url="http://frijoles.antojitos.io/",
download_url="https://github.com/Antojitos/frijoles/archive/0.1.0.tar.gz",
keywords=["frijoles", "notifications", "api"],
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'Framework :: Flask',
'License :: OSI Approved :: GNU Affero General Public License v3',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Topic :: Internet :: WWW/HTTP',
],
package_dir={'': 'src'},
packages=find_packages('src'),
install_requires=[
'Flask==0.12.3',
'Flask-PyMongo==0.4.0'
],
)
|
Upgrade to Flask 0.12.3 to fix CVE-2018-1000656
|
Upgrade to Flask 0.12.3 to fix CVE-2018-1000656
|
Python
|
agpl-3.0
|
Antojitos/frijoles
|
---
+++
@@ -30,7 +30,7 @@
package_dir={'': 'src'},
packages=find_packages('src'),
install_requires=[
- 'Flask==0.10.1',
+ 'Flask==0.12.3',
'Flask-PyMongo==0.4.0'
],
)
|
29cb760030021f97906d5eaec1c0b885e8bb2930
|
example/gravity.py
|
example/gravity.py
|
"""
Compute the force of gravity between the Earth and Sun.
Copyright 2012, Casey W. Stark. See LICENSE.txt for more information.
"""
# Import the gravitational constant and the Quantity class
from dimensionful import G, Quantity
# Supply the mass of Earth, mass of Sun, and the distance between.
mass_earth = Quantity(5.9742e27, "g")
mass_sun = Quantity(1.0, "Msun")
distance = Quantity(1.0, "AU")
# Calculate it
force_gravity = G * mass_earth * mass_sun / distance**2
force_gravity.convert_to_cgs()
# Report
print ""
print "The force of gravity between the Earth and Sun is %s" % force_gravity
print ""
|
"""
Compute the force of gravity between the Earth and Sun.
Copyright 2012, Casey W. Stark. See LICENSE.txt for more information.
"""
# Import the gravitational constant and the Quantity class
from dimensionful import G, Quantity
# Supply the mass of Earth, mass of Sun, and the distance between.
mass_earth = Quantity(5.9742e27, "g")
mass_sun = Quantity(1.0, "Msun")
distance = Quantity(1.0, "AU")
# Calculate it
force_gravity = G * mass_earth * mass_sun / distance**2
force_gravity.convert_to_cgs()
# Report
print ""
print "The force of gravity between the Earth and Sun is %s" % force_gravity
print ""
# prints "The force of gravity between the Earth and Sun is 3.54296304519e+27 cm*g/s**2"
|
Add what the example should output.
|
Add what the example should output.
|
Python
|
bsd-2-clause
|
caseywstark/dimensionful
|
---
+++
@@ -22,3 +22,5 @@
print ""
print "The force of gravity between the Earth and Sun is %s" % force_gravity
print ""
+
+# prints "The force of gravity between the Earth and Sun is 3.54296304519e+27 cm*g/s**2"
|
76127c6c7e0ae1271dfecd2a10efd2ccd6148f97
|
setup.py
|
setup.py
|
#!/usr/bin/env python
from setuptools import setup, find_packages
from oddt import __version__ as VERSION
setup(name='oddt',
version=VERSION,
description='Open Drug Discovery Toolkit',
author='Maciej Wojcikowski',
author_email='mwojcikowski@ibb.waw.pl',
url='https://github.com/oddt/oddt',
license='BSD',
packages=find_packages(),
package_data={'oddt.scoring.functions': ['NNScore/*.csv', 'RFScore/*.csv']},
setup_requires=['numpy'],
install_requires=open('requirements.txt', 'r').readlines(),
download_url='https://github.com/oddt/oddt/tarball/%s' % VERSION,
keywords=['cheminformatics', 'qsar', 'virtual screening', 'docking', 'pipeline'],
scripts=['bin/oddt_cli'],
)
|
#!/usr/bin/env python
from setuptools import setup, find_packages
from oddt import __version__ as VERSION
setup(name='oddt',
version=VERSION,
description='Open Drug Discovery Toolkit',
author='Maciej Wojcikowski',
author_email='mwojcikowski@ibb.waw.pl',
url='https://github.com/oddt/oddt',
license='BSD',
packages=find_packages(),
package_data={'oddt.scoring.functions': ['NNScore/*.csv',
'RFScore/*.csv',
'PLECscore/*.json',
]},
setup_requires=['numpy'],
install_requires=open('requirements.txt', 'r').readlines(),
download_url='https://github.com/oddt/oddt/tarball/%s' % VERSION,
keywords=['cheminformatics', 'qsar', 'virtual screening', 'docking', 'pipeline'],
scripts=['bin/oddt_cli'],
)
|
Add plec json to package data
|
Add plec json to package data
|
Python
|
bsd-3-clause
|
oddt/oddt,oddt/oddt,mkukielka/oddt,mkukielka/oddt
|
---
+++
@@ -10,7 +10,10 @@
url='https://github.com/oddt/oddt',
license='BSD',
packages=find_packages(),
- package_data={'oddt.scoring.functions': ['NNScore/*.csv', 'RFScore/*.csv']},
+ package_data={'oddt.scoring.functions': ['NNScore/*.csv',
+ 'RFScore/*.csv',
+ 'PLECscore/*.json',
+ ]},
setup_requires=['numpy'],
install_requires=open('requirements.txt', 'r').readlines(),
download_url='https://github.com/oddt/oddt/tarball/%s' % VERSION,
|
86a35469dd474d09457d31fe6b74a2904e0a8091
|
setup.py
|
setup.py
|
from setuptools import setup, find_packages
import dynamodb_sessions
long_description = open('README.rst').read()
major_ver, minor_ver = dynamodb_sessions.__version__
version_str = '%d.%d' % (major_ver, minor_ver)
setup(
name='django-dynamodb-sessions',
version=version_str,
packages=find_packages(),
description="A Django session backend using Amazon's DynamoDB",
long_description=long_description,
author='Gregory Taylor',
author_email='gtaylor@gc-taylor.com',
license='BSD License',
url='https://github.com/gtaylor/django-dynamodb-sessions',
platforms=["any"],
install_requires=['django', "boto>=2.8.0"],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Environment :: Web Environment',
],
)
|
from setuptools import setup, find_packages
import dynamodb_sessions
long_description = open('README.rst').read()
major_ver, minor_ver = dynamodb_sessions.__version__
version_str = '%d.%d' % (major_ver, minor_ver)
setup(
name='django-dynamodb-sessions',
version=version_str,
packages=find_packages(),
description="A Django session backend using Amazon's DynamoDB",
long_description=long_description,
author='Gregory Taylor',
author_email='gtaylor@gc-taylor.com',
license='BSD License',
url='https://github.com/gtaylor/django-dynamodb-sessions',
platforms=["any"],
install_requires=['django', "boto>=2.2.2"],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Environment :: Web Environment',
],
)
|
Revert "Updated the boto requirement to 2.8.0"
|
Revert "Updated the boto requirement to 2.8.0"
This reverts commit add8a4a7d68b47ed5c24fefa5dde6e8e372804bf.
|
Python
|
bsd-3-clause
|
gtaylor/django-dynamodb-sessions
|
---
+++
@@ -17,7 +17,7 @@
license='BSD License',
url='https://github.com/gtaylor/django-dynamodb-sessions',
platforms=["any"],
- install_requires=['django', "boto>=2.8.0"],
+ install_requires=['django', "boto>=2.2.2"],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
|
adc4575d7261c3047f88e62695445d2a70de4823
|
setup.py
|
setup.py
|
"""Setup script of zinnia-theme-html5"""
from setuptools import setup
from setuptools import find_packages
import zinnia_html5
setup(
name='zinnia-theme-html5',
version=zinnia_html5.__version__,
description='HTML5 theme for django-blog-zinnia',
long_description=open('README.rst').read(),
keywords='django, blog, weblog, zinnia, theme, skin, html5',
author=zinnia_html5.__author__,
author_email=zinnia_html5.__email__,
url=zinnia_html5.__url__,
packages=find_packages(exclude=['demo_zinnia_html5']),
classifiers=[
'Framework :: Django',
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Programming Language :: Python',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'License :: OSI Approved :: BSD License',
'Topic :: Software Development :: Libraries :: Python Modules'],
license=zinnia_html5.__license__,
include_package_data=True,
zip_safe=False
)
|
"""Setup script of zinnia-theme-html5"""
from setuptools import setup
from setuptools import find_packages
import zinnia_html5
setup(
name='zinnia-theme-html5',
version=zinnia_html5.__version__,
description='HTML5 theme for django-blog-zinnia',
long_description=open('README.rst').read(),
keywords='django, blog, weblog, zinnia, theme, skin, html5',
author=zinnia_html5.__author__,
author_email=zinnia_html5.__email__,
url=zinnia_html5.__url__,
packages=find_packages(exclude=['demo_zinnia_html5']),
classifiers=[
'Framework :: Django',
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'License :: OSI Approved :: BSD License',
'Topic :: Software Development :: Libraries :: Python Modules'],
license=zinnia_html5.__license__,
include_package_data=True,
zip_safe=False
)
|
Add classifier for Python 3
|
Add classifier for Python 3
|
Python
|
bsd-3-clause
|
django-blog-zinnia/zinnia-theme-html5
|
---
+++
@@ -23,6 +23,7 @@
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Programming Language :: Python',
+ 'Programming Language :: Python :: 3',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'License :: OSI Approved :: BSD License',
|
c3799230344487a199d75af9df401ab12e2e6cfa
|
setup.py
|
setup.py
|
from distutils.core import setup
setup(
name='data_processing',
version='0.1-pre',
packages=['data_processing'],
url='https://github.com/openego/data_processing',
license='GNU GENERAL PUBLIC LICENSE Version 3',
author='open_eGo development group',
author_email='',
description='Data processing related to the research project open_eGo',
install_requires=[
'pandas',
'workalendar',
'oemof.db',
'demandlib',
'ego.io'
]
)
|
from distutils.core import setup
setup(
name='data_processing',
version='0.1-pre',
packages=['data_processing'],
url='https://github.com/openego/data_processing',
license='GNU GENERAL PUBLIC LICENSE Version 3',
author='open_eGo development group',
author_email='',
description='Data processing related to the research project open_eGo',
install_requires=[
'pandas',
'workalendar',
'oemof.db',
'demandlib',
'ego.io >=0.0.1rc3, <= 0.0.1rc3',
'geoalchemy2'
]
)
|
Fix dependency and update version number
|
Fix dependency and update version number
|
Python
|
agpl-3.0
|
openego/data_processing
|
---
+++
@@ -14,6 +14,8 @@
'workalendar',
'oemof.db',
'demandlib',
- 'ego.io'
+ 'ego.io >=0.0.1rc3, <= 0.0.1rc3',
+ 'geoalchemy2'
]
)
+
|
46a715545e70e04cd56f97ac8d14f325b4439554
|
setup.py
|
setup.py
|
from setuptools import setup, find_packages
# Dynamically calculate the version based on dbsettings.VERSION
version_tuple = (0, 7, None)
if version_tuple[2] is not None:
if type(version_tuple[2]) == int:
version = "%d.%d.%s" % version_tuple
else:
version = "%d.%d_%s" % version_tuple
else:
version = "%d.%d" % version_tuple[:2]
setup(
name='django-dbsettings',
version=version,
description='Application settings whose values can be updated while a project is up and running.',
long_description=open('README.rst').read(),
author='Samuel Cormier-Iijima',
author_email='sciyoshi@gmail.com',
maintainer='Jacek Tomaszewski',
maintainer_email='jacek.tomek@gmail.com',
url='http://github.com/zlorf/django-dbsettings',
packages=find_packages(),
include_package_data=True,
license='BSD',
install_requires=(
),
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Utilities'
],
)
|
from setuptools import setup, find_packages
# Dynamically calculate the version based on dbsettings.VERSION
version_tuple = (0, 7, None)
if version_tuple[2] is not None:
if type(version_tuple[2]) == int:
version = "%d.%d.%s" % version_tuple
else:
version = "%d.%d_%s" % version_tuple
else:
version = "%d.%d" % version_tuple[:2]
setup(
name='django-dbsettings',
version=version,
description='Application settings whose values can be updated while a project is up and running.',
long_description=open('README.rst').read(),
author='Samuel Cormier-Iijima',
author_email='sciyoshi@gmail.com',
maintainer='Jacek Tomaszewski',
maintainer_email='jacek.tomek@gmail.com',
url='http://github.com/zlorf/django-dbsettings',
packages=find_packages(),
include_package_data=True,
license='BSD',
install_requires=(
'six',
),
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Utilities'
],
)
|
Add six module as require package
|
Add six module as require package
The six module is imported at `values.py`
|
Python
|
bsd-3-clause
|
winfieldco/django-dbsettings,DjangoAdminHackers/django-dbsettings,nwaxiomatic/django-dbsettings,zlorf/django-dbsettings,sciyoshi/django-dbsettings,sciyoshi/django-dbsettings,johnpaulett/django-dbsettings,nwaxiomatic/django-dbsettings,johnpaulett/django-dbsettings,winfieldco/django-dbsettings,zlorf/django-dbsettings,helber/django-dbsettings,helber/django-dbsettings,DjangoAdminHackers/django-dbsettings
|
---
+++
@@ -24,6 +24,7 @@
include_package_data=True,
license='BSD',
install_requires=(
+ 'six',
),
classifiers=[
'Development Status :: 4 - Beta',
|
6a7ba2d366424d50b75dd97748c3a94aae96b7dd
|
setup.py
|
setup.py
|
try:
# Try using ez_setup to install setuptools if not already installed.
from ez_setup import use_setuptools
use_setuptools()
except ImportError:
# Ignore import error and assume Python 3 which already has setuptools.
pass
from setuptools import setup
DESC = ('This Python library for Raspberry Pi makes it easy to leverage the '
'complex functionality of the Texas Instruments INA219 '
'sensor to measure voltage, current and power.')
classifiers = ['Development Status :: 4 - Beta',
'Operating System :: POSIX :: Linux',
'License :: OSI Approved :: MIT License',
'Intended Audience :: Developers',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Topic :: System :: Hardware :: Hardware Drivers']
# Define required packages.
requires = ['Adafruit_GPIO', 'mock']
def read_long_description():
try:
import pypandoc
return pypandoc.convert('README.md', 'rst')
except(IOError, ImportError):
return ""
setup(name='pi-ina219',
version='1.2.0',
author='Chris Borrill',
author_email='chris.borrill@gmail.com',
description=DESC,
long_description=read_long_description(),
license='MIT',
url='https://github.com/chrisb2/pi_ina219/',
classifiers=classifiers,
keywords='ina219 raspberrypi',
install_requires=requires,
test_suite='tests',
py_modules=['ina219'])
|
try:
# Try using ez_setup to install setuptools if not already installed.
from ez_setup import use_setuptools
use_setuptools()
except ImportError:
# Ignore import error and assume Python 3 which already has setuptools.
pass
from setuptools import setup
DESC = ('This Python library for Raspberry Pi makes it easy to leverage the '
'complex functionality of the Texas Instruments INA219 '
'sensor to measure voltage, current and power.')
classifiers = ['Development Status :: 4 - Beta',
'Operating System :: POSIX :: Linux',
'License :: OSI Approved :: MIT License',
'Intended Audience :: Developers',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Topic :: System :: Hardware :: Hardware Drivers']
# Define required packages.
requires = ['Adafruit_GPIO', 'mock']
def read_long_description():
try:
import pypandoc
return pypandoc.convert('README.md', 'rst')
except(IOError, ImportError):
return ""
setup(name='pi-ina219',
version='1.3.0',
author='Chris Borrill',
author_email='chris.borrill@gmail.com',
description=DESC,
long_description=read_long_description(),
license='MIT',
url='https://github.com/chrisb2/pi_ina219/',
classifiers=classifiers,
keywords='ina219 raspberrypi',
install_requires=requires,
test_suite='tests',
py_modules=['ina219'])
|
Increment version in preperation for release of version 1.3.0
|
Increment version in preperation for release of version 1.3.0
|
Python
|
mit
|
chrisb2/pi_ina219
|
---
+++
@@ -33,7 +33,7 @@
setup(name='pi-ina219',
- version='1.2.0',
+ version='1.3.0',
author='Chris Borrill',
author_email='chris.borrill@gmail.com',
description=DESC,
|
9c7aedc3b29d823d79409c5246290362a3c7ffdc
|
examples/arabic.py
|
examples/arabic.py
|
#!/usr/bin/env python
"""
Create wordcloud with Arabic
===============
Generating a wordcloud from Arabic text
Other dependencies: bidi.algorithm, arabic_reshaper
"""
from os import path
import codecs
from wordcloud import WordCloud
import arabic_reshaper
from bidi.algorithm import get_display
d = path.dirname(__file__)
# Read the whole text.
f = codecs.open(path.join(d, 'arabicwords.txt'), 'r', 'utf-8')
# Make text readable for a non-Arabic library like wordcloud
text = arabic_reshaper.reshape(f.read())
text = get_display(text)
# Generate a word cloud image
wordcloud = WordCloud(font_path='fonts/NotoNaskhArabic/NotoNaskhArabic-Regular.ttf').generate(text)
# Export to an image
wordcloud.to_file("arabic_example.png")
|
#!/usr/bin/env python
"""
Create wordcloud with Arabic
===============
Generating a wordcloud from Arabic text
Dependencies:
- bidi.algorithm
- arabic_reshaper
Dependencies installation:
pip install python-bidi arabic_reshape
"""
from os import path
import codecs
from wordcloud import WordCloud
import arabic_reshaper
from bidi.algorithm import get_display
d = path.dirname(__file__)
# Read the whole text.
f = codecs.open(path.join(d, 'arabicwords.txt'), 'r', 'utf-8')
# Make text readable for a non-Arabic library like wordcloud
text = arabic_reshaper.reshape(f.read())
text = get_display(text)
# Generate a word cloud image
wordcloud = WordCloud(font_path='fonts/NotoNaskhArabic/NotoNaskhArabic-Regular.ttf').generate(text)
# Export to an image
wordcloud.to_file("arabic_example.png")
|
Add some instructions for downloading the requirements
|
Add some instructions for downloading the requirements
|
Python
|
mit
|
amueller/word_cloud
|
---
+++
@@ -3,7 +3,13 @@
Create wordcloud with Arabic
===============
Generating a wordcloud from Arabic text
-Other dependencies: bidi.algorithm, arabic_reshaper
+
+Dependencies:
+- bidi.algorithm
+- arabic_reshaper
+
+Dependencies installation:
+pip install python-bidi arabic_reshape
"""
from os import path
|
89abf161e670fda99497ecc60aac0df239af5a01
|
setup.py
|
setup.py
|
# encoding: utf-8
from setuptools import setup
setup(
name="Cetacean",
version="0.0.1",
author="Ben Hamill",
author_email="ben@benhamill.com",
url="http://github.com/benhamill/cetacean-python#readme",
licens="MIT",
description="The HAL client that does almost nothing for you.",
long_description="""
The HAL client that does almost nothing for you.
Cetacean is tightly coupled to Requests, but doesn't actually call it. You set
up your own Requests client and use it to make requests. You feed Cetacean
Requests response objects and it helps you figure out if they're HAL documents
and pull useful data out of them if they are.
""",
py_modules=["cetacean"],
classifiers=[],
)
|
# encoding: utf-8
"""
The HAL client that does almost nothing for you.
Cetacean is tightly coupled to Requests, but doesn't actually call it. You set
up your own Requests client and use it to make requests. You feed Cetacean
Requests response objects and it helps you figure out if they're HAL documents
and pull useful data out of them if they are.
"""
from setuptools import setup
setup(
name="Cetacean",
version="0.0.1",
author="Ben Hamill",
author_email="ben@benhamill.com",
url="http://github.com/benhamill/cetacean-python#readme",
licens="MIT",
description="The HAL client that does almost nothing for you.",
long_description=__doc__,
py_modules=["cetacean"],
classifiers=[],
)
|
Move log description to a docstring.
|
Move log description to a docstring.
|
Python
|
mit
|
benhamill/cetacean-python,nanorepublica/cetacean-python
|
---
+++
@@ -1,4 +1,12 @@
# encoding: utf-8
+"""
+The HAL client that does almost nothing for you.
+
+Cetacean is tightly coupled to Requests, but doesn't actually call it. You set
+up your own Requests client and use it to make requests. You feed Cetacean
+Requests response objects and it helps you figure out if they're HAL documents
+and pull useful data out of them if they are.
+"""
from setuptools import setup
@@ -10,14 +18,7 @@
url="http://github.com/benhamill/cetacean-python#readme",
licens="MIT",
description="The HAL client that does almost nothing for you.",
- long_description="""
-The HAL client that does almost nothing for you.
-
-Cetacean is tightly coupled to Requests, but doesn't actually call it. You set
-up your own Requests client and use it to make requests. You feed Cetacean
-Requests response objects and it helps you figure out if they're HAL documents
-and pull useful data out of them if they are.
-""",
+ long_description=__doc__,
py_modules=["cetacean"],
classifiers=[],
)
|
d16267549323c583df7aaf82768b7efef17df564
|
setup.py
|
setup.py
|
#!/usr/bin/python
from setuptools import setup
dependency_links=[
'git+https://github.com/Toblerity/Shapely.git@maint#egg=Shapely',
]
setup(
name = 'hxl-proxy',
packages = ['hxl_proxy'],
version = '0.0.1',
description = 'Flask-based web proxy for HXL',
author='David Megginson',
author_email='contact@megginson.com',
url='https://github.com/HXLStandard/hxl-proxy',
install_requires=['flask', 'libhxl', 'ckanapi'],
test_suite = "tests",
tests_require = {
'test': ['mock']
}
)
|
#!/usr/bin/python
from setuptools import setup
dependency_links=[
'git+https://github.com/Toblerity/Shapely.git@maint#egg=Shapely',
]
setup(
name = 'hxl-proxy',
packages = ['hxl_proxy'],
version = '0.0.1',
description = 'Flask-based web proxy for HXL',
author='David Megginson',
author_email='contact@megginson.com',
url='https://github.com/HXLStandard/hxl-proxy',
install_requires=['flask', 'libhxl', 'ckanapi'],
test_suite = "tests",
tests_require = ['mock']
)
|
Fix dependency on mock for testing.
|
Fix dependency on mock for testing.
|
Python
|
unlicense
|
HXLStandard/hxl-proxy,HXLStandard/hxl-proxy,HXLStandard/hxl-proxy,HXLStandard/hxl-proxy
|
---
+++
@@ -15,7 +15,5 @@
url='https://github.com/HXLStandard/hxl-proxy',
install_requires=['flask', 'libhxl', 'ckanapi'],
test_suite = "tests",
- tests_require = {
- 'test': ['mock']
- }
+ tests_require = ['mock']
)
|
ac73d93b5a29f4f0929551c51da837b45227f3b3
|
setup.py
|
setup.py
|
from setuptools import setup, find_packages
import sys, os
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, 'README.rst')).read()
except IOError:
README = ''
version = "0.0.2"
setup(name='backlash',
version=version,
description="Standalone WebOb port of the Werkzeug Debugger with Python3 support meant to replace WebError in future TurboGears2",
long_description=README,
classifiers=['Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.2',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware',
'Topic :: Internet :: WWW/HTTP :: WSGI'],
keywords='wsgi',
author='Alessandro Molina',
author_email='amol@turbogears.org',
url='https://github.com/TurboGears/backlash',
license='MIT',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
include_package_data=True,
zip_safe=False,
install_requires=[
"WebOb"
# -*- Extra requirements: -*-
],
entry_points="""
# -*- Entry points: -*-
""",
)
|
from setuptools import setup, find_packages
import sys, os
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, 'README.rst')).read()
except IOError:
README = ''
version = "0.0.3"
setup(name='backlash',
version=version,
description="Standalone WebOb port of the Werkzeug Debugger with Python3 support meant to replace WebError in future TurboGears2",
long_description=README,
classifiers=['Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.2',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware',
'Topic :: Internet :: WWW/HTTP :: WSGI'],
keywords='wsgi',
author='Alessandro Molina',
author_email='amol@turbogears.org',
url='https://github.com/TurboGears/backlash',
license='MIT',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
include_package_data=True,
zip_safe=False,
install_requires=[
"WebOb"
# -*- Extra requirements: -*-
],
entry_points="""
# -*- Entry points: -*-
""",
)
|
Increase version due to change in streamed apps management
|
Increase version due to change in streamed apps management
|
Python
|
mit
|
TurboGears/backlash,TurboGears/backlash
|
---
+++
@@ -7,7 +7,7 @@
except IOError:
README = ''
-version = "0.0.2"
+version = "0.0.3"
setup(name='backlash',
version=version,
|
596e850189e8c8590ac4b8c401de5930ce711929
|
puppetboard/default_settings.py
|
puppetboard/default_settings.py
|
import os
PUPPETDB_HOST = 'localhost'
PUPPETDB_PORT = 8080
PUPPETDB_SSL_VERIFY = True
PUPPETDB_KEY = None
PUPPETDB_CERT = None
PUPPETDB_TIMEOUT = 20
DEFAULT_ENVIRONMENT = 'production'
SECRET_KEY = os.urandom(24)
DEV_LISTEN_HOST = '127.0.0.1'
DEV_LISTEN_PORT = 5000
DEV_COFFEE_LOCATION = 'coffee'
UNRESPONSIVE_HOURS = 2
ENABLE_QUERY = True
LOCALISE_TIMESTAMP = True
LOGLEVEL = 'info'
REPORTS_COUNT = 10
OFFLINE_MODE = False
ENABLE_CATALOG = False
GRAPH_FACTS = ['architecture',
'domain',
'lsbcodename',
'lsbdistcodename',
'lsbdistid',
'lsbdistrelease',
'lsbmajdistrelease',
'netmask',
'osfamily',
'puppetversion',
'processorcount']
INVENTORY_FACTS = [ ('Hostname', 'fqdn' ),
('IP Address', 'ipaddress' ),
('OS', 'lsbdistdescription'),
('Architecture', 'hardwaremodel' ),
('Kernel Version', 'kernelrelease' ),
('Puppet Version', 'puppetversion' ), ]
REFRESH_RATE = 30
|
import os
PUPPETDB_HOST = 'localhost'
PUPPETDB_PORT = 8080
PUPPETDB_SSL_VERIFY = True
PUPPETDB_KEY = None
PUPPETDB_CERT = None
PUPPETDB_TIMEOUT = 20
DEFAULT_ENVIRONMENT = 'production'
SECRET_KEY = os.urandom(24)
DEV_LISTEN_HOST = '127.0.0.1'
DEV_LISTEN_PORT = 5000
DEV_COFFEE_LOCATION = 'coffee'
UNRESPONSIVE_HOURS = 2
ENABLE_QUERY = True
LOCALISE_TIMESTAMP = True
LOGLEVEL = 'info'
REPORTS_COUNT = 10
OFFLINE_MODE = False
ENABLE_CATALOG = False
GRAPH_FACTS = ['architecture',
'clientversion',
'domain',
'lsbcodename',
'lsbdistcodename',
'lsbdistid',
'lsbdistrelease',
'lsbmajdistrelease',
'netmask',
'osfamily',
'puppetversion',
'processorcount']
INVENTORY_FACTS = [ ('Hostname', 'fqdn' ),
('IP Address', 'ipaddress' ),
('OS', 'lsbdistdescription'),
('Architecture', 'hardwaremodel' ),
('Kernel Version', 'kernelrelease' ),
('Puppet Version', 'puppetversion' ), ]
REFRESH_RATE = 30
|
Add clientversion to graphing facts
|
Add clientversion to graphing facts
|
Python
|
apache-2.0
|
puppet-community/puppetboard,johnzimm/xx-puppetboard,tparkercbn/puppetboard,mterzo/puppetboard,stoyansbg/puppetboard,mterzo/puppetboard,holstvoogd/puppetboard,johnzimm/xx-puppetboard,johnzimm/puppetboard,tparkercbn/puppetboard,mterzo/puppetboard,stoyansbg/puppetboard,james-powis/puppetboard,tparkercbn/puppetboard,voxpupuli/puppetboard,voxpupuli/puppetboard,voxpupuli/puppetboard,johnzimm/puppetboard,johnzimm/xx-puppetboard,puppet-community/puppetboard,grandich/puppetboard,holstvoogd/puppetboard,grandich/puppetboard,holstvoogd/puppetboard,grandich/puppetboard,james-powis/puppetboard,james-powis/puppetboard,grandich/puppetboard,johnzimm/xx-puppetboard,stoyansbg/puppetboard,johnzimm/puppetboard,mterzo/puppetboard,tparkercbn/puppetboard,puppet-community/puppetboard
|
---
+++
@@ -19,6 +19,7 @@
OFFLINE_MODE = False
ENABLE_CATALOG = False
GRAPH_FACTS = ['architecture',
+ 'clientversion',
'domain',
'lsbcodename',
'lsbdistcodename',
|
fdff962aeb1aa0351fc222e005af3fa9248345fb
|
setup.py
|
setup.py
|
#!/usr/bin/env python
# -*- coding: utf8 -*-
from setuptools import setup, find_packages
setup(
name="Burger",
packages=find_packages(),
version="0.3.0",
description="Extract information from Minecraft bytecode.",
author="Tyler Kennedy",
author_email="tk@tkte.ch",
url="http://github.com/mcdevs/Burger",
keywords=["java", "minecraft"],
install_requires=[
'Jawa>=2.2.0,<3'
],
classifiers=[
"Programming Language :: Python",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Topic :: Software Development :: Disassemblers"
]
)
|
#!/usr/bin/env python
# -*- coding: utf8 -*-
from setuptools import setup, find_packages
setup(
name="Burger",
packages=find_packages(),
version="0.3.0",
description="Extract information from Minecraft bytecode.",
author="Tyler Kennedy",
author_email="tk@tkte.ch",
url="http://github.com/mcdevs/Burger",
keywords=["java", "minecraft"],
install_requires=[
'six>=1.4.0',
'Jawa>=2.2.0,<3'
],
classifiers=[
"Programming Language :: Python",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Topic :: Software Development :: Disassemblers"
]
)
|
Add six as an install requirement
|
Add six as an install requirement
|
Python
|
mit
|
Pokechu22/Burger,mcdevs/Burger
|
---
+++
@@ -12,6 +12,7 @@
url="http://github.com/mcdevs/Burger",
keywords=["java", "minecraft"],
install_requires=[
+ 'six>=1.4.0',
'Jawa>=2.2.0,<3'
],
classifiers=[
|
655db4e1c8aefea1699516339dd80e1c6a75d67d
|
setup.py
|
setup.py
|
from distutils.core import setup
import sys
import os
import re
PACKAGENAME = 'OpSimSummary'
packageDir = os.path.join(os.path.dirname(os.path.abspath(__file__)),
PACKAGENAME)
versionFile = os.path.join(packageDir, 'version.py')
# Obtain the package version
with open(versionFile, 'r') as f:
s = f.read()
# Look up the string value assigned to __version__ in version.py using regexp
versionRegExp = re.compile("__VERSION__ = \"(.*?)\"")
# Assign to __version__
__version__ = versionRegExp.findall(s)[0]
print(__version__)
setup(# package information
name=PACKAGENAME,
version=__version__,
description='simple repo to study OpSim output summaries',
long_description=''' ''',
# What code to include as packages
packages=[PACKAGENAME],
packagedir={PACKAGENAME: 'opsimsummary'},
# What data to include as packages
include_package_data=True,
package_data={PACKAGENAME:['example_data/*.dat', 'example_data/*.simlib']}
)
|
from distutils.core import setup
import sys
import os
import re
PACKAGENAME = 'OpSimSummary'
packageDir = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'opsimsummary')
versionFile = os.path.join(packageDir, 'version.py')
# Obtain the package version
with open(versionFile, 'r') as f:
s = f.read()
# Look up the string value assigned to __version__ in version.py using regexp
versionRegExp = re.compile("__VERSION__ = \"(.*?)\"")
# Assign to __version__
__version__ = versionRegExp.findall(s)[0]
print(__version__)
setup(# package information
name=PACKAGENAME,
version=__version__,
description='simple repo to study OpSim output summaries',
long_description=''' ''',
# What code to include as packages
packages=[PACKAGENAME],
packagedir={PACKAGENAME: 'opsimsummary'},
# What data to include as packages
include_package_data=True,
package_data={PACKAGENAME:['example_data/*.dat', 'example_data/*.simlib']}
)
|
Revert "Revert "Revert "Changed back due to problems, will fix later"""
|
Revert "Revert "Revert "Changed back due to problems, will fix later"""
This reverts commit 4b35247fe384d4b2b206fa7650398511a493253c.
|
Python
|
mit
|
rbiswas4/simlib
|
---
+++
@@ -5,7 +5,7 @@
PACKAGENAME = 'OpSimSummary'
packageDir = os.path.join(os.path.dirname(os.path.abspath(__file__)),
- PACKAGENAME)
+ 'opsimsummary')
versionFile = os.path.join(packageDir, 'version.py')
# Obtain the package version
|
f3c69597410119d2c88beb80a5a0ed3c8b884668
|
setup.py
|
setup.py
|
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name = "OpenFisca-Country-Template",
version = "3.9.1",
author = "OpenFisca Team",
author_email = "contact@openfisca.org",
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Operating System :: POSIX",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Information Analysis",
],
description = "OpenFisca tax and benefit system for Country-Template",
keywords = "benefit microsimulation social tax",
license ="http://www.fsf.org/licensing/licenses/agpl-3.0.html",
url = "https://github.com/openfisca/country-template",
include_package_data = True, # Will read MANIFEST.in
data_files = [
("share/openfisca/openfisca-country-template", ["CHANGELOG.md", "LICENSE", "README.md"]),
],
install_requires = [
"OpenFisca-Core[web-api] >=27.0,<32.0",
],
extras_require = {
"dev": [
"autopep8 == 1.4.0",
"flake8 >= 3.5.0, < 3.6.0",
"flake8-print",
"pycodestyle >= 2.3.0, < 2.4.0", # To avoid incompatibility with flake
]
},
packages=find_packages(),
)
|
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name = "OpenFisca-Country-Template",
version = "3.9.1",
author = "OpenFisca Team",
author_email = "contact@openfisca.org",
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Operating System :: POSIX",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Information Analysis",
],
description = "OpenFisca tax and benefit system for Country-Template",
keywords = "benefit microsimulation social tax",
license ="http://www.fsf.org/licensing/licenses/agpl-3.0.html",
url = "https://github.com/openfisca/country-template",
include_package_data = True, # Will read MANIFEST.in
data_files = [
("share/openfisca/openfisca-country-template", ["CHANGELOG.md", "LICENSE", "README.md"]),
],
install_requires = [
"OpenFisca-Core[web-api] >=27.0,<32.0",
],
extras_require = {
"dev": [
"autopep8 == 1.4.0",
"flake8 >=3.5.0,<3.8.0",
"flake8-print",
"pycodestyle >= 2.3.0, < 2.4.0", # To avoid incompatibility with flake
]
},
packages=find_packages(),
)
|
Update flake8 requirement from <3.6.0,>=3.5.0 to >=3.5.0,<3.8.0
|
Update flake8 requirement from <3.6.0,>=3.5.0 to >=3.5.0,<3.8.0
Updates the requirements on [flake8](https://gitlab.com/pycqa/flake8) to permit the latest version.
- [Release notes](https://gitlab.com/pycqa/flake8/tags)
- [Commits](https://gitlab.com/pycqa/flake8/compare/3.5.0...3.7.7)
Signed-off-by: dependabot[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
|
Python
|
agpl-3.0
|
openfisca/country-template,openfisca/country-template
|
---
+++
@@ -28,7 +28,7 @@
extras_require = {
"dev": [
"autopep8 == 1.4.0",
- "flake8 >= 3.5.0, < 3.6.0",
+ "flake8 >=3.5.0,<3.8.0",
"flake8-print",
"pycodestyle >= 2.3.0, < 2.4.0", # To avoid incompatibility with flake
]
|
290ead5bbc57e526f0fe12d161fa5fb684ab4edf
|
setup.py
|
setup.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import materializecssform
setup(
name='django-materializecss-form',
version=materializecssform.__version__,
packages=find_packages(),
author="Kal Walkden",
author_email="kal@walkden.us",
description="A simple Django form template tag to work with Materializecss",
long_description=open('README.md').read(),
long_description_content_type="text/markdown",
include_package_data=True,
url='https://github.com/kalwalkden/django-materializecss-form',
classifiers=[
"Programming Language :: Python",
"Development Status :: 4 - Beta",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.6",
"Topic :: Documentation :: Sphinx",
],
license="MIT",
zip_safe=False
)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import materializecssform
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='django-materializecss-form',
version=materializecssform.__version__,
packages=find_packages(),
author="Kal Walkden",
author_email="kal@walkden.us",
description="A simple Django form template tag to work with Materializecss",
long_description=long_description,
long_description_content_type="text/markdown",
include_package_data=True,
url='https://github.com/kalwalkden/django-materializecss-form',
classifiers=[
"Programming Language :: Python",
"Development Status :: 4 - Beta",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.6",
],
license="MIT",
zip_safe=False
)
|
Update meta version so that documentation looks good in pypi
|
Update meta version so that documentation looks good in pypi
|
Python
|
mit
|
florent1933/django-materializecss-form,florent1933/django-materializecss-form
|
---
+++
@@ -4,6 +4,9 @@
from setuptools import setup, find_packages
import materializecssform
+
+with open("README.md", "r") as fh:
+ long_description = fh.read()
setup(
@@ -18,7 +21,7 @@
author_email="kal@walkden.us",
description="A simple Django form template tag to work with Materializecss",
- long_description=open('README.md').read(),
+ long_description=long_description,
long_description_content_type="text/markdown",
include_package_data=True,
@@ -33,7 +36,6 @@
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.6",
- "Topic :: Documentation :: Sphinx",
],
license="MIT",
|
3d1e06c6b37431ed4f6c9d426b10682be4ddc5db
|
setup.py
|
setup.py
|
#!/usr/bin/env python
from setuptools import setup
setup(name='s3fs',
version='0.1.5',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
description='Convenient Filesystem interface over S3',
url='http://github.com/dask/s3fs/',
maintainer='Martin Durant',
maintainer_email='mdurant@continuum.io',
license='BSD',
keywords='s3, boto',
packages=['s3fs'],
python_requires='>= 2.7, != 3.0.*, != 3.1.*, != 3.2.*, != 3.3.*',
install_requires=[open('requirements.txt').read().strip().split('\n')],
zip_safe=False)
|
#!/usr/bin/env python
from setuptools import setup
setup(name='s3fs',
version='0.1.5',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
description='Convenient Filesystem interface over S3',
url='http://github.com/dask/s3fs/',
maintainer='Martin Durant',
maintainer_email='mdurant@continuum.io',
license='BSD',
keywords='s3, boto',
packages=['s3fs'],
python_requires='>= 2.7, != 3.0.*, != 3.1.*, != 3.2.*, != 3.3.*, != 3.4.*',
install_requires=[open('requirements.txt').read().strip().split('\n')],
zip_safe=False)
|
Remove 3.4 and 3.7 tags
|
Remove 3.4 and 3.7 tags
|
Python
|
bsd-3-clause
|
fsspec/s3fs
|
---
+++
@@ -10,10 +10,8 @@
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
- 'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
- 'Programming Language :: Python :: 3.7',
],
description='Convenient Filesystem interface over S3',
url='http://github.com/dask/s3fs/',
@@ -22,6 +20,6 @@
license='BSD',
keywords='s3, boto',
packages=['s3fs'],
- python_requires='>= 2.7, != 3.0.*, != 3.1.*, != 3.2.*, != 3.3.*',
+ python_requires='>= 2.7, != 3.0.*, != 3.1.*, != 3.2.*, != 3.3.*, != 3.4.*',
install_requires=[open('requirements.txt').read().strip().split('\n')],
zip_safe=False)
|
ea0094c555b499a2ad77c8b7af02d796dd5b4d92
|
setup.py
|
setup.py
|
"""Config for PyPI."""
from setuptools import find_packages
from setuptools import setup
setup(
author='Kyle P. Johnson',
author_email='kyle@kyle-p-johnson.com',
classifiers=[
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Natural Language :: Chinese (Traditional)',
'Natural Language :: English',
'Natural Language :: Greek',
'Natural Language :: Latin',
'Operating System :: POSIX',
'Programming Language :: Python :: 3.6',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Text Processing',
'Topic :: Text Processing :: General',
'Topic :: Text Processing :: Linguistic',
],
description='NLP for the ancient world',
install_requires=['gitpython',
'nltk',
'python-crfsuite',
'pyuca',
'pyyaml',
'regex',
'whoosh'],
keywords=['nlp', 'nltk', 'greek', 'latin', 'chinese', 'sanskrit', 'pali', 'tibetan', 'arabic'],
license='MIT',
long_description='The Classical Language Toolkit (CLTK) is a framework for natural language processing for Classical languages.', # pylint: disable=C0301,
name='cltk',
packages=find_packages(),
url='https://github.com/cltk/cltk',
version='0.1.85',
zip_safe=True,
test_suite='cltk.tests.test_cltk',
)
|
"""Config for PyPI."""
from setuptools import find_packages
from setuptools import setup
setup(
author='Kyle P. Johnson',
author_email='kyle@kyle-p-johnson.com',
classifiers=[
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Natural Language :: Chinese (Traditional)',
'Natural Language :: English',
'Natural Language :: Greek',
'Natural Language :: Latin',
'Operating System :: POSIX',
'Programming Language :: Python :: 3.6',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Text Processing',
'Topic :: Text Processing :: General',
'Topic :: Text Processing :: Linguistic',
],
description='NLP for the ancient world',
install_requires=['gitpython',
'nltk',
'python-crfsuite',
'pyuca',
'pyyaml',
'regex',
'whoosh'],
keywords=['nlp', 'nltk', 'greek', 'latin', 'chinese', 'sanskrit', 'pali', 'tibetan', 'arabic'],
license='MIT',
long_description='The Classical Language Toolkit (CLTK) is a framework for natural language processing for Classical languages.', # pylint: disable=C0301,
name='cltk',
packages=find_packages(),
url='https://github.com/cltk/cltk',
version='0.1.86',
zip_safe=True,
test_suite='cltk.tests.test_cltk',
)
|
Bump vers for uppercase Beta Code conversion
|
Bump vers for uppercase Beta Code conversion
Fixed with PR https://github.com/cltk/cltk/pull/778 by Eleftheria Chatziargyriou ( @Sedictious ).
|
Python
|
mit
|
kylepjohnson/cltk,LBenzahia/cltk,TylerKirby/cltk,diyclassics/cltk,LBenzahia/cltk,TylerKirby/cltk,D-K-E/cltk,cltk/cltk
|
---
+++
@@ -36,7 +36,7 @@
name='cltk',
packages=find_packages(),
url='https://github.com/cltk/cltk',
- version='0.1.85',
+ version='0.1.86',
zip_safe=True,
test_suite='cltk.tests.test_cltk',
)
|
0579da9a2cc9b8696d8071c4f1e07140d940b386
|
setup.py
|
setup.py
|
# coding:utf-8
import sys
from setuptools import setup, find_packages
setup(name='flanker',
version='0.3.13',
description='Mailgun Parsing Tools',
long_description=open('README.rst').read(),
classifiers=[],
keywords='',
author='Mailgun Inc.',
author_email='admin@mailgunhq.com',
url='http://mailgun.net',
license='Apache 2',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
include_package_data=True,
zip_safe=True,
install_requires=[
'chardet==1.0.1',
'dnsq==1.1',
'expiringdict>=1.1',
'mock>=1.0.1',
'nose>=1.2.1',
'Paste==1.7.5',
'redis==2.7.1',
# IMPORTANT! Newer regex versions are a lot slower for
# mime parsing (100x slower) so keep it as-is for now.
'regex==0.1.20110315',
],
)
|
# coding:utf-8
import sys
from setuptools import setup, find_packages
setup(name='flanker',
version='0.4.13',
description='Mailgun Parsing Tools',
long_description=open('README.rst').read(),
classifiers=[],
keywords='',
author='Mailgun Inc.',
author_email='admin@mailgunhq.com',
url='http://mailgun.net',
license='Apache 2',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
include_package_data=True,
zip_safe=True,
install_requires=[
'chardet>=1.0.1',
'dnsq>=1.1',
'expiringdict>=1.1',
'mock>=1.0.1',
'nose>=1.2.1',
'Paste>=1.7.5',
'redis>=2.7.1',
# IMPORTANT! Newer regex versions are a lot slower for
# mime parsing (100x slower) so keep it as-is for now.
'regex>=0.1.20110315',
],
)
|
Fix (and test coverage) for base64 encoding issue.
|
Fix (and test coverage) for base64 encoding issue.
|
Python
|
apache-2.0
|
ad-m/flanker,EthanBlackburn/flanker,glyph/flanker,alex/flanker,aroberts/flanker,nylas/flanker,EncircleInc/addresslib,mailgun/flanker,xjzhou/flanker,smokymountains/flanker,stefanw/flanker
|
---
+++
@@ -5,7 +5,7 @@
setup(name='flanker',
- version='0.3.13',
+ version='0.4.13',
description='Mailgun Parsing Tools',
long_description=open('README.rst').read(),
classifiers=[],
@@ -18,15 +18,15 @@
include_package_data=True,
zip_safe=True,
install_requires=[
- 'chardet==1.0.1',
- 'dnsq==1.1',
+ 'chardet>=1.0.1',
+ 'dnsq>=1.1',
'expiringdict>=1.1',
'mock>=1.0.1',
'nose>=1.2.1',
- 'Paste==1.7.5',
- 'redis==2.7.1',
+ 'Paste>=1.7.5',
+ 'redis>=2.7.1',
# IMPORTANT! Newer regex versions are a lot slower for
# mime parsing (100x slower) so keep it as-is for now.
- 'regex==0.1.20110315',
+ 'regex>=0.1.20110315',
],
)
|
853481c6c6f6c27e8805c62b77bd85bec0f1535c
|
setup.py
|
setup.py
|
#!/usr/bin/env python
import setuptools
import sys
if not ((sys.version_info.major >= 3 and sys.version_info.minor >= 5)
or sys.version_info.major > 3):
exit("Sorry, Python's version must be later than 3.5.")
import shakyo
setuptools.setup(
name=shakyo.__name__,
version=shakyo.__version__,
description="a tool to learn about something just by copying it by hand",
license="Public Domain",
author="raviqqe",
author_email="raviqqe@gmail.com",
url="http://github.com/raviqqe/shakyo/",
py_modules=[shakyo.__name__],
entry_points={"console_scripts" : ["shakyo=shakyo:main"]},
install_requires=["text_unidecode", "validators"],
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console :: Curses",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: Public Domain",
"Operating System :: POSIX",
"Programming Language :: Python :: 3.5",
"Topic :: Education :: Computer Aided Instruction (CAI)",
"Topic :: Games/Entertainment",
],
)
|
#!/usr/bin/env python
import setuptools
import shutil
import sys
if not ((sys.version_info.major >= 3 and sys.version_info.minor >= 5)
or sys.version_info.major > 3):
exit("Sorry, Python's version must be later than 3.5.")
import shakyo
try:
import pypandoc
with open("README.rst", "w") as f:
f.write(pypandoc.convert("README.md", "rst"))
except ImportError:
shutil.copyfile("README.md", "README")
setuptools.setup(
name=shakyo.__name__,
version=shakyo.__version__,
description="a tool to learn about something just by copying it by hand",
license="Public Domain",
author="raviqqe",
author_email="raviqqe@gmail.com",
url="http://github.com/raviqqe/shakyo/",
py_modules=[shakyo.__name__],
entry_points={"console_scripts" : ["shakyo=shakyo:main"]},
install_requires=["text_unidecode", "validators"],
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console :: Curses",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: Public Domain",
"Operating System :: POSIX",
"Programming Language :: Python :: 3.5",
"Topic :: Education :: Computer Aided Instruction (CAI)",
"Topic :: Games/Entertainment",
],
)
|
Convert README.md file into .rst
|
Convert README.md file into .rst
|
Python
|
unlicense
|
raviqqe/shakyo
|
---
+++
@@ -1,6 +1,7 @@
#!/usr/bin/env python
import setuptools
+import shutil
import sys
if not ((sys.version_info.major >= 3 and sys.version_info.minor >= 5)
@@ -8,6 +9,14 @@
exit("Sorry, Python's version must be later than 3.5.")
import shakyo
+
+
+try:
+ import pypandoc
+ with open("README.rst", "w") as f:
+ f.write(pypandoc.convert("README.md", "rst"))
+except ImportError:
+ shutil.copyfile("README.md", "README")
setuptools.setup(
|
6707acf4c09c6aae6abf78a325a08ddd72377e6f
|
setup.py
|
setup.py
|
#!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='bux-grader-framework',
version='0.4.3',
author='Boston University',
author_email='webteam@bu.edu',
url='https://github.com/bu-ist/bux-grader-framework/',
description='An external grader framework for the edX platform.',
long_description=open('README.md').read(),
packages=['bux_grader_framework', 'bux_grader_test_framework'],
scripts=['bin/grader'],
license='LICENSE',
install_requires=[
'requests>=2.0, <3.0',
'pika>=0.9.12, <0.10',
'statsd>=2.0, <3.0',
'lxml>=3.3, <3.4'
]
)
|
#!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='bux-grader-framework',
version='0.4.3',
author='Boston University',
author_email='webteam@bu.edu',
url='https://github.com/bu-ist/bux-grader-framework/',
description='An external grader framework for the edX platform.',
long_description=open('README.md').read(),
packages=['bux_grader_framework', 'bux_grader_test_framework'],
scripts=['bin/grader'],
license='LICENSE',
install_requires=[
'requests[security]>=2.0, <3.0',
'pika>=0.9.12, <0.10',
'statsd>=2.0, <3.0',
'lxml>=3.3, <3.4'
]
)
|
Add requests[security] extras to install_requires
|
Add requests[security] extras to install_requires
Installs pyopenssl, ndg-httpsclient, and pyasn1 packages to avoid SSL InsecurePlatformWarning messages
|
Python
|
agpl-3.0
|
bu-ist/bux-grader-framework,abduld/bux-grader-framework
|
---
+++
@@ -17,7 +17,7 @@
scripts=['bin/grader'],
license='LICENSE',
install_requires=[
- 'requests>=2.0, <3.0',
+ 'requests[security]>=2.0, <3.0',
'pika>=0.9.12, <0.10',
'statsd>=2.0, <3.0',
'lxml>=3.3, <3.4'
|
cc9d23142be989662c8fedd0124fe6f99de360bb
|
setup.py
|
setup.py
|
import io
import os
import re
from setuptools import setup, find_packages
def find_version():
file_dir = os.path.dirname(__file__)
with io.open(os.path.join(file_dir, 'auth0', '__init__.py')) as f:
version = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]', f.read())
if version:
return version.group(1)
else:
raise RuntimeError("Unable to find version string.")
setup(
name='auth0-python',
version=find_version(),
description='Auth0 Python SDK',
author='Auth0',
author_email='support@auth0.com',
license='MIT',
packages=find_packages(),
install_requires=['requests'],
extras_require={'test': ['mock']},
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
url='https://github.com/auth0/auth0-python',
)
|
import io
import os
import re
from setuptools import setup, find_packages
def find_version():
file_dir = os.path.dirname(__file__)
with io.open(os.path.join(file_dir, 'auth0', '__init__.py')) as f:
version = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]', f.read())
if version:
return version.group(1)
else:
raise RuntimeError("Unable to find version string.")
setup(
name='auth0-python',
version=find_version(),
description='Auth0 Python SDK',
author='Auth0',
author_email='support@auth0.com',
license='MIT',
packages=find_packages(),
install_requires=['requests'],
extras_require={'test': ['mock']},
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
url='https://github.com/auth0/auth0-python',
)
|
Add python_requires to help pip
|
Add python_requires to help pip
|
Python
|
mit
|
auth0/auth0-python,auth0/auth0-python
|
---
+++
@@ -24,6 +24,7 @@
packages=find_packages(),
install_requires=['requests'],
extras_require={'test': ['mock']},
+ python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
|
f607cf2f024c299953a0d3eb523b6be493792d0f
|
tasks.py
|
tasks.py
|
# -*- coding: utf-8 -*-
from invoke import task
@task
def clean(context):
context.run("rm -rf .coverage dist build")
@task(clean, default=True)
def test(context):
context.run("pytest")
@task(test)
def install(context):
context.run("python setup.py develop")
@task(test)
def release(context):
context.run("python setup.py register sdist bdist_wheel")
context.run("twine upload dist/*")
@task(test)
def bump(context, version="patch"):
context.run("bumpversion %s" % version)
context.run("git commit --amend")
|
# -*- coding: utf-8 -*-
from invoke import task
@task
def clean(context):
context.run("rm -rf dist build .coverage .pytest_cache .mypy_cache")
@task(clean, default=True)
def test(context):
context.run("pytest")
@task(test)
def install(context):
context.run("python setup.py develop")
@task(test)
def release(context):
context.run("python setup.py register sdist bdist_wheel")
context.run("twine upload dist/*")
@task(test)
def bump(context, version="patch"):
context.run("bumpversion %s" % version)
context.run("git commit --amend")
|
Clean cache files after pytest & mypy
|
Clean cache files after pytest & mypy
|
Python
|
apache-2.0
|
miso-belica/sumy,miso-belica/sumy
|
---
+++
@@ -5,7 +5,7 @@
@task
def clean(context):
- context.run("rm -rf .coverage dist build")
+ context.run("rm -rf dist build .coverage .pytest_cache .mypy_cache")
@task(clean, default=True)
|
1f545f9e921e10448b4018550620f9dc4d56931c
|
survey/models/__init__.py
|
survey/models/__init__.py
|
# -*- coding: utf-8 -*-
"""
Permit to import everything from survey.models without knowing the details.
"""
import sys
from .answer import Answer
from .category import Category
from .question import Question
from .response import Response
from .survey import Survey
__all__ = ["Category", "Answer", "Category", "Response", "Survey", "Question"]
|
# -*- coding: utf-8 -*-
"""
Permit to import everything from survey.models without knowing the details.
"""
from .answer import Answer
from .category import Category
from .question import Question
from .response import Response
from .survey import Survey
__all__ = ["Category", "Answer", "Category", "Response", "Survey", "Question"]
|
Fix F401 'sys' imported but unused
|
Fix F401 'sys' imported but unused
|
Python
|
agpl-3.0
|
Pierre-Sassoulas/django-survey,Pierre-Sassoulas/django-survey,Pierre-Sassoulas/django-survey
|
---
+++
@@ -1,10 +1,8 @@
# -*- coding: utf-8 -*-
"""
- Permit to import everything from survey.models without knowing the details.
+Permit to import everything from survey.models without knowing the details.
"""
-
-import sys
from .answer import Answer
from .category import Category
|
42964d986a0e86c3c93ad152d99b5a4e5cbc2a8e
|
plots/mapplot/_shelve.py
|
plots/mapplot/_shelve.py
|
'''
Cache results to disk.
'''
import inspect
import os
import shelve
class shelved:
def __init__(self, func):
self._func = func
# Put the cache file in the same directory as the caller.
funcdir = os.path.dirname(inspect.getfile(self._func))
cachedir = os.path.join(funcdir, '_shelve')
if not os.path.exists(cachedir):
os.mkdir(cachedir)
# Name the cache file func.__name__
cachefile = os.path.join(cachedir,
str(self._func.__name__))
self.cache = shelve.open(cachefile)
def __call__(self, *args, **kwargs):
key = str((args, set(kwargs.items())))
try:
# Try to get value from the cache.
val = self.cache[key]
except KeyError:
# Get the value and store it in the cache.
val = self.cache[key] = self._func(*args, **kwargs)
return val
def __del__(self):
self.cache.close()
|
'''
Cache results to disk.
'''
import inspect
import os
import shelve
class shelved:
def __init__(self, func):
self._func = func
# Put the cache file in the same directory as the caller.
funcdir = os.path.dirname(inspect.getfile(self._func))
cachedir = os.path.join(funcdir, '_shelve')
if not os.path.exists(cachedir):
os.mkdir(cachedir)
# Name the cache file func.__name__
cachefile = os.path.join(cachedir,
str(self._func.__name__))
self.cache = shelve.open(cachefile)
def __call__(self, *args, **kwargs):
key = str((args, set(kwargs.items())))
try:
# Try to get value from the cache.
val = self.cache[key]
except KeyError:
# Get the value and store it in the cache.
val = self.cache[key] = self._func(*args, **kwargs)
return val
|
Revert "Maybe fixed weakref error by explicitly closing shelf." This did not fix the weakref error. Maybe it's something in cartopy.
|
Revert "Maybe fixed weakref error by explicitly closing shelf."
This did not fix the weakref error. Maybe it's something in cartopy.
This reverts commit 30d5b38cbc7a771e636e689b281ebc09356c3a49.
|
Python
|
agpl-3.0
|
janmedlock/HIV-95-vaccine
|
---
+++
@@ -32,6 +32,3 @@
# Get the value and store it in the cache.
val = self.cache[key] = self._func(*args, **kwargs)
return val
-
- def __del__(self):
- self.cache.close()
|
3736d7fb32e20a64591f949d6ff431430447d421
|
stock.py
|
stock.py
|
class Stock:
def __init__(self, symbol):
self.symbol = symbol
self.price_history = []
@property
def price(self):
return self.price_history[-1] if self.price_history else None
def update(self, timestamp, price):
if price < 0:
raise ValueError("price should not be negative")
self.price_history.append(price)
def is_increasing_trend(self):
return self.price_history[-3] < self.price_history[-2] < self.price_history[-1]
|
import bisect
import collections
PriceEvent = collections.namedtuple("PriceEvent", ["timestamp", "price"])
class Stock:
def __init__(self, symbol):
self.symbol = symbol
self.price_history = []
@property
def price(self):
return self.price_history[-1].price if self.price_history else None
def update(self, timestamp, price):
if price < 0:
raise ValueError("price should not be negative")
bisect.insort_left(self.price_history, PriceEvent(timestamp, price))
def is_increasing_trend(self):
return self.price_history[-3].price < self.price_history[-2].price < self.price_history[-1].price
|
Add a named tuple PriceEvent sub class and update methods accordingly.
|
Add a named tuple PriceEvent sub class and update methods accordingly.
|
Python
|
mit
|
bsmukasa/stock_alerter
|
---
+++
@@ -1,3 +1,9 @@
+import bisect
+import collections
+
+PriceEvent = collections.namedtuple("PriceEvent", ["timestamp", "price"])
+
+
class Stock:
def __init__(self, symbol):
self.symbol = symbol
@@ -5,12 +11,12 @@
@property
def price(self):
- return self.price_history[-1] if self.price_history else None
+ return self.price_history[-1].price if self.price_history else None
def update(self, timestamp, price):
if price < 0:
raise ValueError("price should not be negative")
- self.price_history.append(price)
+ bisect.insort_left(self.price_history, PriceEvent(timestamp, price))
def is_increasing_trend(self):
- return self.price_history[-3] < self.price_history[-2] < self.price_history[-1]
+ return self.price_history[-3].price < self.price_history[-2].price < self.price_history[-1].price
|
b6c8dd224279ad0258b1130f8105059affa7553f
|
Challenges/chall_04.py
|
Challenges/chall_04.py
|
#!/urs/local/bin/python3
# Python challenge - 4
# http://www.pythonchallenge.com/pc/def/linkedlist.php
import urllib.request
import re
def main():
'''
http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=12345
44827
45439
...
'''
base_url = 'http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing='
nothing = '12345'
# nothing = '66831' # Cheat code
pattern = re.compile(r'next nothing is (\d+)')
for i in range(400):
with urllib.request.urlopen(base_url + nothing) as page:
data = page.read().decode('utf-8')
print(data)
match = re.search(pattern, data)
if match:
nothing = match.group(1)
if nothing == '16044':
nothing = str(16044 / 2)
else:
print('Hit break')
break
print('Last nothing found was: {}'.format(nothing))
return 0
# Keyword: peak
if __name__ == '__main__':
main()
|
#!/usr/local/bin/python3
# Python challenge - 4
# http://www.pythonchallenge.com/pc/def/linkedlist.html
# http://www.pythonchallenge.com/pc/def/linkedlist.php
# Keyword: peak
import urllib.request
import re
def main():
'''
html page shows: linkedlist.php
php page comment: urllib may help. DON'T TRY ALL NOTHINGS, since it will
never end. 400 times is more than enough.
Photo link: linkedlist.php?nothing=12345
http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=12345
44827
45439
...
'''
base_url = 'http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing='
nothing = '12345'
# nothing = '66831' # Cheat code
pattern = re.compile(r'next nothing is (\d+)')
for i in range(400):
with urllib.request.urlopen(base_url + nothing) as page:
data = page.read().decode('utf-8')
print(data)
match = re.search(pattern, data)
if match:
nothing = match.group(1)
if nothing == '16044':
nothing = str(16044 / 2)
else:
print('Hit break')
break
print('Last nothing found was: {}'.format(nothing))
return 0
if __name__ == '__main__':
main()
|
Refactor code, fix shebang path
|
Refactor code, fix shebang path
|
Python
|
mit
|
HKuz/PythonChallenge
|
---
+++
@@ -1,6 +1,8 @@
-#!/urs/local/bin/python3
+#!/usr/local/bin/python3
# Python challenge - 4
+# http://www.pythonchallenge.com/pc/def/linkedlist.html
# http://www.pythonchallenge.com/pc/def/linkedlist.php
+# Keyword: peak
import urllib.request
import re
@@ -8,6 +10,10 @@
def main():
'''
+ html page shows: linkedlist.php
+ php page comment: urllib may help. DON'T TRY ALL NOTHINGS, since it will
+ never end. 400 times is more than enough.
+ Photo link: linkedlist.php?nothing=12345
http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=12345
44827
45439
@@ -15,7 +21,7 @@
'''
base_url = 'http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing='
nothing = '12345'
- # nothing = '66831' # Cheat code
+ # nothing = '66831' # Cheat code
pattern = re.compile(r'next nothing is (\d+)')
for i in range(400):
@@ -34,8 +40,6 @@
print('Last nothing found was: {}'.format(nothing))
return 0
-# Keyword: peak
-
if __name__ == '__main__':
main()
|
b85a92df83563e38b84340574cde2f9dc06b563c
|
rest_framework_docs/api_docs.py
|
rest_framework_docs/api_docs.py
|
from django.conf import settings
from django.core.urlresolvers import RegexURLResolver, RegexURLPattern
from django.utils.module_loading import import_string
from rest_framework.views import APIView
from rest_framework_docs.api_endpoint import ApiEndpoint
class ApiDocumentation(object):
def __init__(self):
self.endpoints = []
root_urlconf = import_string(settings.ROOT_URLCONF)
if hasattr(root_urlconf, 'urls'):
self.get_all_view_names(root_urlconf.urls.urlpatterns)
else:
self.get_all_view_names(root_urlconf.urlpatterns)
def get_all_view_names(self, urlpatterns, parent_pattern=None):
for pattern in urlpatterns:
if isinstance(pattern, RegexURLResolver):
parent_pattern = None if pattern._regex == "^" else pattern
self.get_all_view_names(urlpatterns=pattern.url_patterns, parent_pattern=parent_pattern)
elif isinstance(pattern, RegexURLPattern) and self._is_drf_view(pattern):
api_endpoint = ApiEndpoint(pattern, parent_pattern)
self.endpoints.append(api_endpoint)
def _is_drf_view(self, pattern):
# Should check whether a pattern inherits from DRF's APIView
return hasattr(pattern.callback, 'cls') and issubclass(pattern.callback.cls, APIView)
def get_endpoints(self):
return self.endpoints
|
from django.conf import settings
from django.core.urlresolvers import RegexURLResolver, RegexURLPattern
from django.utils.module_loading import import_string
from rest_framework.views import APIView
from rest_framework_docs.api_endpoint import ApiEndpoint
class ApiDocumentation(object):
def __init__(self):
self.endpoints = []
root_urlconf = import_string(settings.ROOT_URLCONF)
if hasattr(root_urlconf, 'urls'):
self.get_all_view_names(root_urlconf.urls.urlpatterns)
else:
self.get_all_view_names(root_urlconf.urlpatterns)
def get_all_view_names(self, urlpatterns, parent_pattern=None):
for pattern in urlpatterns:
if isinstance(pattern, RegexURLResolver):
parent_pattern = None if pattern._regex == "^" else pattern
self.get_all_view_names(urlpatterns=pattern.url_patterns, parent_pattern=parent_pattern)
elif isinstance(pattern, RegexURLPattern) and self._is_drf_view(pattern) and not self._is_format_endpoint(pattern):
api_endpoint = ApiEndpoint(pattern, parent_pattern)
self.endpoints.append(api_endpoint)
def _is_drf_view(self, pattern):
"""
Should check whether a pattern inherits from DRF's APIView
"""
return hasattr(pattern.callback, 'cls') and issubclass(pattern.callback.cls, APIView)
def _is_format_endpoint(self, pattern):
"""
Exclude endpoints with a "format" parameter
"""
return '?P<format>' in pattern._regex
def get_endpoints(self):
return self.endpoints
|
Exclude Endpoints with a <format> parameter
|
Exclude Endpoints with a <format> parameter
|
Python
|
bsd-2-clause
|
ekonstantinidis/django-rest-framework-docs,manosim/django-rest-framework-docs,ekonstantinidis/django-rest-framework-docs,manosim/django-rest-framework-docs,manosim/django-rest-framework-docs,ekonstantinidis/django-rest-framework-docs
|
---
+++
@@ -20,13 +20,21 @@
if isinstance(pattern, RegexURLResolver):
parent_pattern = None if pattern._regex == "^" else pattern
self.get_all_view_names(urlpatterns=pattern.url_patterns, parent_pattern=parent_pattern)
- elif isinstance(pattern, RegexURLPattern) and self._is_drf_view(pattern):
+ elif isinstance(pattern, RegexURLPattern) and self._is_drf_view(pattern) and not self._is_format_endpoint(pattern):
api_endpoint = ApiEndpoint(pattern, parent_pattern)
self.endpoints.append(api_endpoint)
def _is_drf_view(self, pattern):
- # Should check whether a pattern inherits from DRF's APIView
+ """
+ Should check whether a pattern inherits from DRF's APIView
+ """
return hasattr(pattern.callback, 'cls') and issubclass(pattern.callback.cls, APIView)
+
+ def _is_format_endpoint(self, pattern):
+ """
+ Exclude endpoints with a "format" parameter
+ """
+ return '?P<format>' in pattern._regex
def get_endpoints(self):
return self.endpoints
|
a22b21e4a06525f081c6a7ce92ddc2102d7ddce8
|
5-convert-to-mw.py
|
5-convert-to-mw.py
|
#!/usr/bin/python
from subprocess import call
import os
from os.path import join, getsize
wikiHtml = "/var/www/sp/wiki-html"
LOwikiHtml = "/var/www/sp/5-libre-wiki-html"
wikiFiles = "/var/www/sp/6-wiki-files"
for f in os.listdir(wikiHtml):
if f.endswith(".html"):
# soffice --headless --convert-to html:HTML /path/to/file.html
call(['soffice', '--headless', '--convert-to', 'html:HTML', '-outdir', LOwikiHtml, wikiHtml+'/'+f])
else:
continue
for f in os.listdir(LOwikiHtml):
if f.endswith(".html"):
# html2wiki --dialect MediaWiki /path/to/file.html > /path/to/file.wiki
pathToSource = LOwikiHtml+'/'+f
pathToDestination = wikiFiles+'/'+os.path.splitext(f)[0]+'.wiki'
os.system("html2wiki --dialect MediaWiki \"%s\" > \"%s\"" % (pathToSource, pathToDestination))
print "Created file: %s" % pathToDestination
else:
continue
|
#!/usr/bin/python
from subprocess import call
import os
from os.path import join, getsize
scriptPath = os.path.realpath(__file__)
wikiHtml = scriptPath + "/usr/sharepoint-content"
LibreOfficeOutput = scriptPath + "/usr/LibreOfficeOutput"
WikitextOutput = scriptPath + "/usr/WikitextOutput"
for f in os.listdir(wikiHtml):
if f.endswith(".html"):
# soffice --headless --convert-to html:HTML /path/to/file.html
call(['soffice', '--headless', '--convert-to', 'html:HTML', '-outdir', LibreOfficeOutput, wikiHtml+'/'+f])
else:
continue
for f in os.listdir(LibreOfficeOutput):
if f.endswith(".html"):
# html2wiki --dialect MediaWiki /path/to/file.html > /path/to/file.wiki
pathToSource = LibreOfficeOutput+'/'+f
pathToDestination = WikitextOutput+'/'+os.path.splitext(f)[0]+'.wiki'
os.system("html2wiki --dialect MediaWiki \"%s\" > \"%s\"" % (pathToSource, pathToDestination))
print "Created file: %s" % pathToDestination
else:
continue
|
Fix paths in LibreOffice and Perl converter
|
Fix paths in LibreOffice and Perl converter
|
Python
|
mit
|
jamesmontalvo3/Sharepoint-to-MediaWiki,jamesmontalvo3/Sharepoint-to-MediaWiki
|
---
+++
@@ -4,24 +4,24 @@
import os
from os.path import join, getsize
-
-wikiHtml = "/var/www/sp/wiki-html"
-LOwikiHtml = "/var/www/sp/5-libre-wiki-html"
-wikiFiles = "/var/www/sp/6-wiki-files"
+scriptPath = os.path.realpath(__file__)
+wikiHtml = scriptPath + "/usr/sharepoint-content"
+LibreOfficeOutput = scriptPath + "/usr/LibreOfficeOutput"
+WikitextOutput = scriptPath + "/usr/WikitextOutput"
for f in os.listdir(wikiHtml):
if f.endswith(".html"):
# soffice --headless --convert-to html:HTML /path/to/file.html
- call(['soffice', '--headless', '--convert-to', 'html:HTML', '-outdir', LOwikiHtml, wikiHtml+'/'+f])
+ call(['soffice', '--headless', '--convert-to', 'html:HTML', '-outdir', LibreOfficeOutput, wikiHtml+'/'+f])
else:
continue
-for f in os.listdir(LOwikiHtml):
+for f in os.listdir(LibreOfficeOutput):
if f.endswith(".html"):
# html2wiki --dialect MediaWiki /path/to/file.html > /path/to/file.wiki
- pathToSource = LOwikiHtml+'/'+f
- pathToDestination = wikiFiles+'/'+os.path.splitext(f)[0]+'.wiki'
+ pathToSource = LibreOfficeOutput+'/'+f
+ pathToDestination = WikitextOutput+'/'+os.path.splitext(f)[0]+'.wiki'
os.system("html2wiki --dialect MediaWiki \"%s\" > \"%s\"" % (pathToSource, pathToDestination))
print "Created file: %s" % pathToDestination
else:
|
d7133922de24c6553417eb1e25c65bb51e7451f7
|
airship/__init__.py
|
airship/__init__.py
|
import os
import json
from flask import Flask, render_template
def channels_json(station, escaped=False):
channels = [{"name": channel} for channel in station.channels()]
jsonbody = json.dumps(channels)
if escaped:
jsonbody = jsonbody.replace("</", "<\\/")
return jsonbody
def make_airship(station):
app = Flask(__name__)
@app.route("/")
def index():
return render_template("index.html", channels_json=channels_json(station, True))
@app.route("/channels")
def list_channels():
return channels_json(station)
return app
|
import os
import json
from flask import Flask, render_template
def channels_json(station, escaped=False):
channels = [{"name": channel} for channel in station.channels()]
jsonbody = json.dumps(channels)
if escaped:
jsonbody = jsonbody.replace("</", "<\\/")
return jsonbody
def make_airship(station):
app = Flask(__name__)
@app.route("/")
def index():
return render_template("index.html", channels_json=channels_json(station, True))
@app.route("/channels")
def list_channels():
return channels_json(station)
@app.route("/grefs/<channel>")
def list_grefs(channel):
return
return app
|
Create a route for fetching grefs
|
Create a route for fetching grefs
|
Python
|
mit
|
richo/airship,richo/airship,richo/airship
|
---
+++
@@ -23,4 +23,9 @@
def list_channels():
return channels_json(station)
+ @app.route("/grefs/<channel>")
+ def list_grefs(channel):
+ return
+
+
return app
|
c5683cb2bf8635c6ad26aac807f47c8f1fb4c68a
|
http_prompt/cli.py
|
http_prompt/cli.py
|
import click
from prompt_toolkit import prompt
from prompt_toolkit.history import InMemoryHistory
from prompt_toolkit.layout.lexers import PygmentsLexer
from prompt_toolkit.styles.from_pygments import style_from_pygments
from pygments.styles import get_style_by_name
from .completer import HttpPromptCompleter
from .context import Context
from .execution import execute
from .lexer import HttpPromptLexer
@click.command()
@click.argument('url')
def cli(url):
click.echo("Welcome to HTTP Prompt!")
context = Context(url)
# For prompt-toolkit
history = InMemoryHistory()
lexer = PygmentsLexer(HttpPromptLexer)
completer = HttpPromptCompleter(context)
style = style_from_pygments(get_style_by_name('monokai'))
while True:
try:
text = prompt('%s> ' % context.url, completer=completer,
lexer=lexer, style=style, history=history)
except EOFError:
break # Control-D pressed
else:
execute(text, context)
click.echo("Goodbye!")
|
import click
from prompt_toolkit import prompt
from prompt_toolkit.history import InMemoryHistory
from prompt_toolkit.layout.lexers import PygmentsLexer
from prompt_toolkit.styles.from_pygments import style_from_pygments
from pygments.styles import get_style_by_name
from .completer import HttpPromptCompleter
from .context import Context
from .execution import execute
from .lexer import HttpPromptLexer
def fix_incomplete_url(url):
if url.startswith('s://') or url.startswith('://'):
url = 'http' + url
elif url.startswith('//'):
url = 'http:' + url
elif not url.startswith('http://') and not url.startswith('https://'):
url = 'http://' + url
return url
@click.command()
@click.argument('url', default='http://localhost')
def cli(url):
click.echo("Welcome to HTTP Prompt!")
url = fix_incomplete_url(url)
context = Context(url)
# For prompt-toolkit
history = InMemoryHistory()
lexer = PygmentsLexer(HttpPromptLexer)
completer = HttpPromptCompleter(context)
style = style_from_pygments(get_style_by_name('monokai'))
while True:
try:
text = prompt('%s> ' % context.url, completer=completer,
lexer=lexer, style=style, history=history)
except EOFError:
break # Control-D pressed
else:
execute(text, context)
click.echo("Goodbye!")
|
Fix incomplete URL from command line
|
Fix incomplete URL from command line
|
Python
|
mit
|
eliangcs/http-prompt,Yegorov/http-prompt
|
---
+++
@@ -12,10 +12,22 @@
from .lexer import HttpPromptLexer
+def fix_incomplete_url(url):
+ if url.startswith('s://') or url.startswith('://'):
+ url = 'http' + url
+ elif url.startswith('//'):
+ url = 'http:' + url
+ elif not url.startswith('http://') and not url.startswith('https://'):
+ url = 'http://' + url
+ return url
+
+
@click.command()
-@click.argument('url')
+@click.argument('url', default='http://localhost')
def cli(url):
click.echo("Welcome to HTTP Prompt!")
+
+ url = fix_incomplete_url(url)
context = Context(url)
# For prompt-toolkit
|
3055fa16010a1b855142c2e5b866d76daee17c8f
|
markdown_gen/test/attributes_test.py
|
markdown_gen/test/attributes_test.py
|
import unittest
import markdown_gen.MardownGen as md
class AttributesTests(unittest.TestCase):
def test_italic(self):
expected = "*italic text*"
self.assertEqual(expected, md.gen_italic("italic text"))
expected = "_italic text alternative_"
self.assertEqual(expected, md.gen_italic("italic text alternative", True))
def test_bold(self):
expected = "**bold text**"
self.assertEqual(expected, md.gen_bold("bold text"))
expected = "__bold text alternative__"
self.assertEqual(expected, md.gen_bold("bold text alternative", True))
def test_monspace(self):
expected = "`monospace`"
self.assertEqual(expected, md.gen_monospace("monospace"))
def test_strikethrough(self):
expected = "~~strikethrough~~"
self.assertEqual(expected, md.gen_strikethrough("strikethrough"))
if __name__ == '__main__':
unittest.main()
|
import unittest
import markdown_gen.MardownGen as md
class AttributesTests(unittest.TestCase):
def test_italic(self):
expected = "*italic text*"
self.assertEqual(expected, md.gen_italic("italic text"))
expected = "_italic text alternative_"
self.assertEqual(expected, md.gen_italic("italic text alternative", True))
def test_bold(self):
expected = "**bold text**"
self.assertEqual(expected, md.gen_bold("bold text"))
expected = "__bold text alternative__"
self.assertEqual(expected, md.gen_bold("bold text alternative", True))
def test_bold_and_italic(self):
expected = "***bold and italic text***"
self.assertEqual(expected, md.gen_italic(md.gen_bold("bold text")))
self.assertEqual(expected, md.gen_bold(md.gen_italic("bold text")))
expected = "__bold text alternative__"
self.assertEqual(expected, md.gen_bold("bold text alternative", True))
def test_monspace(self):
expected = "`monospace`"
self.assertEqual(expected, md.gen_monospace("monospace"))
def test_strikethrough(self):
expected = "~~strikethrough~~"
self.assertEqual(expected, md.gen_strikethrough("strikethrough"))
if __name__ == '__main__':
unittest.main()
|
Add test for bold and italic text
|
Add test for bold and italic text
|
Python
|
epl-1.0
|
LukasWoodtli/PyMarkdownGen
|
---
+++
@@ -21,6 +21,14 @@
expected = "__bold text alternative__"
self.assertEqual(expected, md.gen_bold("bold text alternative", True))
+
+ def test_bold_and_italic(self):
+ expected = "***bold and italic text***"
+ self.assertEqual(expected, md.gen_italic(md.gen_bold("bold text")))
+ self.assertEqual(expected, md.gen_bold(md.gen_italic("bold text")))
+
+ expected = "__bold text alternative__"
+ self.assertEqual(expected, md.gen_bold("bold text alternative", True))
def test_monspace(self):
expected = "`monospace`"
|
9c119ec89b79d27b284bb89f2507cc93f32d8d68
|
app/twiggy_setup.py
|
app/twiggy_setup.py
|
import tornado.options
from twiggy import *
def twiggy_setup():
fout = outputs.FileOutput(
tornado.options.options.app_log_file, format=formats.line_format)
sout = outputs.StreamOutput(format=formats.line_format)
addEmitters(
('ipborg', levels.DEBUG, None, fout),
('ipborg', levels.DEBUG, None, sout))
|
import tornado.options
from twiggy import *
def twiggy_setup():
fout = outputs.FileOutput(
tornado.options.options.app_log_file, format=formats.line_format)
sout = outputs.StreamOutput(format=formats.line_format)
addEmitters(
('ipborg.file', levels.DEBUG, None, fout),
('ipborg.std', levels.DEBUG, None, sout))
|
Use unique names for twiggy emitters.
|
Use unique names for twiggy emitters.
|
Python
|
mit
|
jiffyclub/ipythonblocks.org,jiffyclub/ipythonblocks.org
|
---
+++
@@ -8,5 +8,5 @@
sout = outputs.StreamOutput(format=formats.line_format)
addEmitters(
- ('ipborg', levels.DEBUG, None, fout),
- ('ipborg', levels.DEBUG, None, sout))
+ ('ipborg.file', levels.DEBUG, None, fout),
+ ('ipborg.std', levels.DEBUG, None, sout))
|
8ed4d09a9e0c0e16f179185cd3d0e6f2dece360d
|
tutorials/intro/utils.py
|
tutorials/intro/utils.py
|
from snorkel.models import Span, Label
from sqlalchemy.orm.exc import NoResultFound
def add_spouse_label(session, key, cls, person1, person2, value):
try:
person1 = session.query(Span).filter(Span.stable_id == person1).one()
person2 = session.query(Span).filter(Span.stable_id == person2).one()
except NoResultFound as e:
if int(value) == -1:
### Due to variations in the NER output of CoreNLP, some of the included annotations for
### false candidates might cover slightly different text spans when run on some systems,
### so we must skip them.
return
else:
raise e
candidate = session.query(cls).filter(cls.person1 == person1).filter(cls.person2 == person2).first()
if candidate is None:
candidate = session.query(cls).filter(cls.person1 == person2).filter(cls.person2 == person1).one()
label = session.query(Label).filter(Label.candidate == candidate).one_or_none()
if label is None:
label = Label(candidate=candidate, key=key, value=value)
session.add(label)
else:
label.value = int(label)
session.commit()
|
from snorkel.models import Span, Label
from sqlalchemy.orm.exc import NoResultFound
def add_spouse_label(session, key, cls, person1, person2, value):
try:
person1 = session.query(Span).filter(Span.stable_id == person1).one()
person2 = session.query(Span).filter(Span.stable_id == person2).one()
except NoResultFound as e:
if int(value) == -1:
### Due to variations in the NER output of CoreNLP, some of the included annotations for
### false candidates might cover slightly different text spans when run on some systems,
### so we must skip them.
return
else:
raise e
candidate = session.query(cls).filter(cls.person1 == person1).filter(cls.person2 == person2).first()
if candidate is None:
candidate = session.query(cls).filter(cls.person1 == person2).filter(cls.person2 == person1).one()
label = session.query(Label).filter(Label.candidate == candidate).one_or_none()
if label is None:
label = Label(candidate=candidate, key=key, value=value)
session.add(label)
else:
label.value = int(value)
session.commit()
|
Fix for rerunning intro tutorial on previously used database.
|
Fix for rerunning intro tutorial on previously used database.
|
Python
|
apache-2.0
|
HazyResearch/snorkel,HazyResearch/snorkel,jasontlam/snorkel,jasontlam/snorkel,jasontlam/snorkel,HazyResearch/snorkel
|
---
+++
@@ -23,5 +23,5 @@
label = Label(candidate=candidate, key=key, value=value)
session.add(label)
else:
- label.value = int(label)
+ label.value = int(value)
session.commit()
|
23c29c4964286fc2ca8fb3a957a6e7810edb9d17
|
alexia/template/context_processors.py
|
alexia/template/context_processors.py
|
from __future__ import unicode_literals
from alexia.apps.organization.models import Organization
def organization(request):
return {
'organizations': Organization.objects.all(),
'current_organization': request.organization,
}
def permissions(request):
if request.user.is_superuser:
return {'is_tender': True, 'is_planner': True, 'is_manager': True, 'is_foundation_manager': True}
try:
membership = request.user.membership_set.get(organization=request.organization)
return {
'is_tender': membership.is_tender,
'is_planner': membership.is_planner,
'is_manager': membership.is_manager,
'is_foundation_manager': request.user.profile.is_foundation_manager,
}
except Organization.DoesNotExist:
return {
'is_tender': False,
'is_planner': False,
'is_manager': False,
'is_foundation_manager': False,
}
|
from __future__ import unicode_literals
from alexia.apps.organization.models import Organization
def organization(request):
return {
'organizations': Organization.objects.all(),
'current_organization': request.organization,
}
def permissions(request):
if request.user.is_superuser:
return {'is_tender': True, 'is_planner': True, 'is_manager': True, 'is_foundation_manager': True}
try:
if hasattr(request.user, "membership_set"):
membership = request.user.membership_set.get(organization=request.organization)
return {
'is_tender': membership.is_tender,
'is_planner': membership.is_planner,
'is_manager': membership.is_manager,
'is_foundation_manager': request.user.profile.is_foundation_manager,
}
else:
return {
'is_tender': False,
'is_planner': False,
'is_manager': False,
'is_foundation_manager': False,
}
except Organization.DoesNotExist:
return {
'is_tender': False,
'is_planner': False,
'is_manager': False,
'is_foundation_manager': False,
}
|
Fix AttributeError: 'AnonymousUser' object has no attribute 'membership_set'
|
Fix AttributeError: 'AnonymousUser' object has no attribute 'membership_set'
|
Python
|
bsd-3-clause
|
Inter-Actief/alexia,Inter-Actief/alexia,Inter-Actief/alexia,Inter-Actief/alexia
|
---
+++
@@ -15,13 +15,21 @@
return {'is_tender': True, 'is_planner': True, 'is_manager': True, 'is_foundation_manager': True}
try:
- membership = request.user.membership_set.get(organization=request.organization)
- return {
- 'is_tender': membership.is_tender,
- 'is_planner': membership.is_planner,
- 'is_manager': membership.is_manager,
- 'is_foundation_manager': request.user.profile.is_foundation_manager,
- }
+ if hasattr(request.user, "membership_set"):
+ membership = request.user.membership_set.get(organization=request.organization)
+ return {
+ 'is_tender': membership.is_tender,
+ 'is_planner': membership.is_planner,
+ 'is_manager': membership.is_manager,
+ 'is_foundation_manager': request.user.profile.is_foundation_manager,
+ }
+ else:
+ return {
+ 'is_tender': False,
+ 'is_planner': False,
+ 'is_manager': False,
+ 'is_foundation_manager': False,
+ }
except Organization.DoesNotExist:
return {
'is_tender': False,
|
540bffe17ede75bc6afd9b2d45e343e0eac4552b
|
rna-transcription/rna_transcription.py
|
rna-transcription/rna_transcription.py
|
DNA = {"A", "C", "T", "G"}
TRANS = {"G": "C", "C":"G", "T":"A", "A":"U"}
def to_rna(dna):
# Check validity - `difference` returns elements in dna not in DNA
if set(dna).difference(DNA):
return ""
return "".join([TRANS[n] for n in dna])
|
TRANS = {"G": "C", "C":"G", "T":"A", "A":"U"}
def to_rna(dna):
try:
return "".join([TRANS[n] for n in dna])
except KeyError:
return ""
# Old version: it's slightly slower for valid DNA, but slightly faster for invalid DNA
DNA = {"A", "C", "T", "G"}
TRANS = {"G": "C", "C":"G", "T":"A", "A":"U"}
def to_rna_old(dna):
# Check validity - `difference` returns elements in dna not in DNA
if set(dna).difference(DNA):
return ""
return "".join([TRANS[n] for n in dna])
|
Add an exception based version
|
Add an exception based version
|
Python
|
agpl-3.0
|
CubicComet/exercism-python-solutions
|
---
+++
@@ -1,9 +1,20 @@
-DNA = {"A", "C", "T", "G"}
-
TRANS = {"G": "C", "C":"G", "T":"A", "A":"U"}
def to_rna(dna):
+ try:
+ return "".join([TRANS[n] for n in dna])
+ except KeyError:
+ return ""
+
+
+# Old version: it's slightly slower for valid DNA, but slightly faster for invalid DNA
+
+DNA = {"A", "C", "T", "G"}
+TRANS = {"G": "C", "C":"G", "T":"A", "A":"U"}
+
+
+def to_rna_old(dna):
# Check validity - `difference` returns elements in dna not in DNA
if set(dna).difference(DNA):
return ""
|
b7b67a0327feddc977a404178aae03e47947dd20
|
bluebottle/bluebottle_drf2/pagination.py
|
bluebottle/bluebottle_drf2/pagination.py
|
from rest_framework.pagination import PageNumberPagination
class BluebottlePagination(PageNumberPagination):
page_size = 10
|
from rest_framework.pagination import PageNumberPagination
class BluebottlePagination(PageNumberPagination):
page_size = 10
page_size_query_param = 'page_size'
|
Make it possible to send a page_size parameter to all paged endpoints.
|
Make it possible to send a page_size parameter to all paged endpoints.
BB-9512 #resolve
|
Python
|
bsd-3-clause
|
onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle
|
---
+++
@@ -3,3 +3,4 @@
class BluebottlePagination(PageNumberPagination):
page_size = 10
+ page_size_query_param = 'page_size'
|
fba44cbf5f2cf0740e1579d70e79da4ab7d57aa0
|
diana/socket.py
|
diana/socket.py
|
import socket
from . import packet
BLOCKSIZE = 4096
def connect(host, port, connect=socket.create_connection):
sock = connect((host, port))
def tx(pack):
sock.send(packet.encode(pack))
def rx():
buf = b''
while True:
data = sock.recv(BLOCKSIZE)
buf += data
packets, buf = packet.decode(data)
for received_packet in packets:
yield received_packet
return tx, rx()
|
import socket
from . import packet
BLOCKSIZE = 4096
def connect(host, port=2010, connect=socket.create_connection):
sock = connect((host, port))
def tx(pack):
sock.send(packet.encode(pack))
def rx():
buf = b''
while True:
data = sock.recv(BLOCKSIZE)
buf += data
packets, buf = packet.decode(data)
for received_packet in packets:
yield received_packet
return tx, rx()
|
Use a sensible default port
|
Use a sensible default port
|
Python
|
mit
|
prophile/libdiana
|
---
+++
@@ -3,7 +3,7 @@
BLOCKSIZE = 4096
-def connect(host, port, connect=socket.create_connection):
+def connect(host, port=2010, connect=socket.create_connection):
sock = connect((host, port))
def tx(pack):
sock.send(packet.encode(pack))
|
1f5c196796d8f10bc19260c2d353d880b6147be7
|
backend/__init__.py
|
backend/__init__.py
|
#
# Centralized logging setup
#
import os
import logging
from .utils import getLogger
l = getLogger('backend')
logging.basicConfig(
level=logging.DEBUG,
format='[%(asctime)s][%(levelname)s] %(name)s '
'%(filename)s:%(funcName)s:%(lineno)d | %(message)s',
datefmt='%Y-%m-%d %H:%M:%S'
)
sentry_dsn = os.environ.get('AT_SENTRY_DSN')
if sentry_dsn:
from raven import Client
from raven.handlers.logging import SentryHandler
from raven.conf import setup_logging
client = Client(sentry_dsn)
handler = SentryHandler(client)
setup_logging(handler)
l.info("Set up Sentry client")
|
#
# Centralized logging setup
#
import os
import logging
from .utils import getLogger
l = getLogger('backend')
logging.basicConfig(
level=logging.DEBUG,
format='[%(asctime)s][%(levelname)s] %(name)s '
'%(filename)s:%(funcName)s:%(lineno)d | %(message)s',
datefmt='%Y-%m-%d %H:%M:%S'
)
sentry_dsn = os.environ.get('AT_SENTRY_DSN')
if sentry_dsn:
from raven import Client
from raven.handlers.logging import SentryHandler
from raven.conf import setup_logging
client = Client(sentry_dsn)
handler = SentryHandler(client, level='WARNING')
setup_logging(handler)
l.info("Set up Sentry client")
|
Set Sentry log level to warning
|
Set Sentry log level to warning
To prevent every damn thing from being logged...
|
Python
|
mit
|
The-Fonz/adventure-track,The-Fonz/adventure-track,The-Fonz/adventure-track
|
---
+++
@@ -22,6 +22,6 @@
from raven.conf import setup_logging
client = Client(sentry_dsn)
- handler = SentryHandler(client)
+ handler = SentryHandler(client, level='WARNING')
setup_logging(handler)
l.info("Set up Sentry client")
|
d675dbcab18d56ae4c2c2f05d342159c1032b7b4
|
polling_stations/apps/data_importers/management/commands/import_fake_exeter.py
|
polling_stations/apps/data_importers/management/commands/import_fake_exeter.py
|
from data_importers.management.commands import BaseXpressDemocracyClubCsvImporter
from pathlib import Path
def make_base_folder_path():
base_folder_path = Path.cwd() / Path("test_data/pollingstations_data/EXE")
return str(base_folder_path)
class Command(BaseXpressDemocracyClubCsvImporter):
local_files = True
base_folder_path = make_base_folder_path()
council_id = "EXE"
addresses_name = "Democracy_Club__02May2019exe.CSV"
stations_name = "Democracy_Club__02May2019exe.CSV"
|
from django.contrib.gis.geos import Point
from addressbase.models import UprnToCouncil
from data_importers.mixins import AdvanceVotingMixin
from data_importers.management.commands import BaseXpressDemocracyClubCsvImporter
from pathlib import Path
from pollingstations.models import AdvanceVotingStation
def make_base_folder_path():
base_folder_path = Path.cwd() / Path("test_data/pollingstations_data/EXE")
return str(base_folder_path)
class Command(BaseXpressDemocracyClubCsvImporter, AdvanceVotingMixin):
local_files = True
base_folder_path = make_base_folder_path()
council_id = "EXE"
addresses_name = "Democracy_Club__02May2019exe.CSV"
stations_name = "Democracy_Club__02May2019exe.CSV"
def add_advance_voting_stations(self):
advance_station = AdvanceVotingStation(
name="Exeter Guildhall",
address="""Exeter City Council
Civic Centre
Paris Street
Exeter
Devon
""",
postcode="EX1 1JN",
location=Point(-3.5245510056787057, 50.72486002944331, srid=4326),
)
advance_station.save()
UprnToCouncil.objects.filter(lad=self.council.geography.gss).update(
advance_voting_station=advance_station
)
|
Add Advance Voting stations to fake Exeter importer
|
Add Advance Voting stations to fake Exeter importer
|
Python
|
bsd-3-clause
|
DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations
|
---
+++
@@ -1,5 +1,11 @@
+from django.contrib.gis.geos import Point
+
+from addressbase.models import UprnToCouncil
+from data_importers.mixins import AdvanceVotingMixin
from data_importers.management.commands import BaseXpressDemocracyClubCsvImporter
from pathlib import Path
+
+from pollingstations.models import AdvanceVotingStation
def make_base_folder_path():
@@ -7,9 +13,26 @@
return str(base_folder_path)
-class Command(BaseXpressDemocracyClubCsvImporter):
+class Command(BaseXpressDemocracyClubCsvImporter, AdvanceVotingMixin):
local_files = True
base_folder_path = make_base_folder_path()
council_id = "EXE"
addresses_name = "Democracy_Club__02May2019exe.CSV"
stations_name = "Democracy_Club__02May2019exe.CSV"
+
+ def add_advance_voting_stations(self):
+ advance_station = AdvanceVotingStation(
+ name="Exeter Guildhall",
+ address="""Exeter City Council
+ Civic Centre
+ Paris Street
+ Exeter
+ Devon
+ """,
+ postcode="EX1 1JN",
+ location=Point(-3.5245510056787057, 50.72486002944331, srid=4326),
+ )
+ advance_station.save()
+ UprnToCouncil.objects.filter(lad=self.council.geography.gss).update(
+ advance_voting_station=advance_station
+ )
|
7f212a9bacfce6612c6ec435174bf9c3eddd4652
|
pagoeta/apps/events/serializers.py
|
pagoeta/apps/events/serializers.py
|
from hvad.contrib.restframework import TranslatableModelSerializer
from rest_framework import serializers
from rest_framework.reverse import reverse
from .models import Category, TargetGroup, TargetAge, Event
from pagoeta.apps.core.functions import get_absolute_uri
from pagoeta.apps.places.serializers import PlaceListSerializer
class TypeField(serializers.RelatedField):
def to_representation(self, value):
return {
'code': value.code,
'name': value.name
}
class EventSerializer(TranslatableModelSerializer):
category = TypeField(read_only=True)
target_group = TypeField(read_only=True)
targetGroup = target_group
target_age = TypeField(read_only=True)
targetAge = target_age
place = PlaceListSerializer(read_only=True)
# camelCase some field names
startAt = serializers.DateTimeField(source='start_at', read_only=True)
endAt = serializers.DateTimeField(source='end_at', read_only=True)
isFeatured = serializers.BooleanField(source='is_featured', read_only=True)
isVisible = serializers.BooleanField(source='is_visible', read_only=True)
href = serializers.SerializerMethodField()
class Meta(object):
model = Event
exclude = ('start_at', 'end_at', 'is_featured', 'is_visible', 'language_code')
def get_href(self, obj):
return get_absolute_uri(reverse('v1:event-detail', [obj.id]))
|
from hvad.contrib.restframework import TranslatableModelSerializer
from rest_framework import serializers
from rest_framework.reverse import reverse
from .models import Category, TargetGroup, TargetAge, Event
from pagoeta.apps.core.functions import get_absolute_uri
from pagoeta.apps.places.serializers import PlaceListSerializer
class TypeField(serializers.RelatedField):
def to_representation(self, value):
return {
'code': value.code,
'name': value.name
}
class EventSerializer(TranslatableModelSerializer):
category = TypeField(read_only=True)
place = PlaceListSerializer(read_only=True)
# camelCase some field names
targetGroup = TypeField(source='target_group', read_only=True)
targetAge = TypeField(source='target_age', read_only=True)
startAt = serializers.DateTimeField(source='start_at', read_only=True)
endAt = serializers.DateTimeField(source='end_at', read_only=True)
isFeatured = serializers.BooleanField(source='is_featured', read_only=True)
isVisible = serializers.BooleanField(source='is_visible', read_only=True)
href = serializers.SerializerMethodField()
class Meta(object):
model = Event
exclude = ('target_group', 'target_age', 'start_at', 'end_at', 'is_featured', 'is_visible', 'language_code')
def get_href(self, obj):
return get_absolute_uri(reverse('v1:event-detail', [obj.id]))
|
Change camelCasing strategy for `target_age` and `target_group`
|
Change camelCasing strategy for `target_age` and `target_group`
|
Python
|
mit
|
zarautz/pagoeta,zarautz/pagoeta,zarautz/pagoeta
|
---
+++
@@ -17,12 +17,10 @@
class EventSerializer(TranslatableModelSerializer):
category = TypeField(read_only=True)
- target_group = TypeField(read_only=True)
- targetGroup = target_group
- target_age = TypeField(read_only=True)
- targetAge = target_age
place = PlaceListSerializer(read_only=True)
# camelCase some field names
+ targetGroup = TypeField(source='target_group', read_only=True)
+ targetAge = TypeField(source='target_age', read_only=True)
startAt = serializers.DateTimeField(source='start_at', read_only=True)
endAt = serializers.DateTimeField(source='end_at', read_only=True)
isFeatured = serializers.BooleanField(source='is_featured', read_only=True)
@@ -31,7 +29,7 @@
class Meta(object):
model = Event
- exclude = ('start_at', 'end_at', 'is_featured', 'is_visible', 'language_code')
+ exclude = ('target_group', 'target_age', 'start_at', 'end_at', 'is_featured', 'is_visible', 'language_code')
def get_href(self, obj):
return get_absolute_uri(reverse('v1:event-detail', [obj.id]))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.