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
5c5b81312317c1750ea320666b2adc4f74d13366
f8a_jobs/graph_sync.py
f8a_jobs/graph_sync.py
"""Functions to retrieve pending list and invoke Graph Sync.""" import f8a_jobs.defaults as configuration import requests import traceback import logging from urllib.parse import urljoin logger = logging.getLogger(__name__) def _api_call(url, params=None): params = params or {} try: logger.info("API Call for url: %s, params: %s" % (url, params)) r = requests.get(url, params=params) r.raise_for_status() result = {"data": r.json()} except requests.exceptions.HTTPError: logger.error(traceback.format_exc()) result = {"error": "Failed to retrieve data from Data Model Importer backend"} return result def fetch_pending(params=None): params = params or {} """Invoke Pending Graph Sync APIs for given parameters.""" url = urljoin(configuration.DATA_IMPORTER_ENDPOINT, "/api/v1/pending") return _api_call(url, params) def invoke_sync(params=None): params = params or {} """Invoke Graph Sync APIs to sync for given parameters.""" url = urljoin(configuration.DATA_IMPORTER_ENDPOINT, "/api/v1/sync_all") return _api_call(url, params)
"""Functions to retrieve pending list and invoke Graph Sync.""" import f8a_jobs.defaults as configuration import requests import traceback import logging from urllib.parse import urljoin logger = logging.getLogger(__name__) def _api_call(url, params=None): params = params or {} try: logger.info("API Call for url: %s, params: %s" % (url, params)) r = requests.get(url, params=params) r.raise_for_status() result = {"data": r.json()} except requests.exceptions.HTTPError: logger.error(traceback.format_exc()) result = {"error": "Failed to retrieve data from Data Model Importer backend"} return result def fetch_pending(params=None): """Invoke Pending Graph Sync APIs for given parameters.""" params = params or {} url = urljoin(configuration.DATA_IMPORTER_ENDPOINT, "/api/v1/pending") return _api_call(url, params) def invoke_sync(params=None): """Invoke Graph Sync APIs to sync for given parameters.""" params = params or {} url = urljoin(configuration.DATA_IMPORTER_ENDPOINT, "/api/v1/sync_all") return _api_call(url, params)
Fix code for review comments
Fix code for review comments
Python
apache-2.0
fabric8-analytics/fabric8-analytics-jobs,fabric8-analytics/fabric8-analytics-jobs
--- +++ @@ -24,14 +24,14 @@ def fetch_pending(params=None): + """Invoke Pending Graph Sync APIs for given parameters.""" params = params or {} - """Invoke Pending Graph Sync APIs for given parameters.""" url = urljoin(configuration.DATA_IMPORTER_ENDPOINT, "/api/v1/pending") return _api_call(url, params) def invoke_sync(params=None): + """Invoke Graph Sync APIs to sync for given parameters.""" params = params or {} - """Invoke Graph Sync APIs to sync for given parameters.""" url = urljoin(configuration.DATA_IMPORTER_ENDPOINT, "/api/v1/sync_all") return _api_call(url, params)
270a03dc78838137051fec49050f550c44be2359
facebook_auth/views.py
facebook_auth/views.py
import logging from django.contrib.auth import authenticate from django.contrib.auth import login from django import http from django.views import generic from facebook_auth import urls logger = logging.getLogger(__name__) class Handler(generic.View): def get(self, request): try: next_url = urls.Next().decode(request.GET['next']) except urls.InvalidNextUrl: logger.warning('Invalid facebook handler next.', extra={'request': request}) return http.HttpResponseBadRequest() if 'code' in request.GET: self.login(next_url) response = http.HttpResponseRedirect(next_url['next']) response["P3P"] = ('CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi' ' IVDi CONi HIS OUR IND CNT"') else: response = http.HttpResponseRedirect(next_url['close']) return response def login(self, next_url): user = authenticate( code=self.request.GET['code'], redirect_uri=urls.redirect_uri(next_url['next'], next_url['close'])) if user: login(self.request, user) handler = Handler.as_view()
import logging from django.contrib.auth import authenticate from django.contrib.auth import login from django import http from django.views import generic import facepy from facebook_auth import urls logger = logging.getLogger(__name__) class Handler(generic.View): def get(self, request): try: self.next_url = urls.Next().decode(request.GET['next']) except urls.InvalidNextUrl: logger.warning('Invalid facebook handler next.', extra={'request': request}) return http.HttpResponseBadRequest() if 'code' in request.GET: try: self.login() except facepy.FacepyError as e: return self.handle_facebook_error(e) response = http.HttpResponseRedirect(self.next_url['next']) response["P3P"] = ('CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi' ' IVDi CONi HIS OUR IND CNT"') else: response = http.HttpResponseRedirect(self.next_url['close']) return response def login(self): user = authenticate( code=self.request.GET['code'], redirect_uri=urls.redirect_uri(self.next_url['next'], self.next_url['close'])) if user: login(self.request, user) def handle_facebook_error(self, e): return http.HttpResponseRedirect(self.next_url['next']) handler = Handler.as_view()
Add facebook error handler in view.
Add facebook error handler in view. This assumes that there is no other backend which can authenticate user with facebook credentials.
Python
mit
jgoclawski/django-facebook-auth,pozytywnie/django-facebook-auth,pozytywnie/django-facebook-auth,jgoclawski/django-facebook-auth
--- +++ @@ -4,6 +4,9 @@ from django.contrib.auth import login from django import http from django.views import generic + +import facepy + from facebook_auth import urls @@ -13,26 +16,32 @@ class Handler(generic.View): def get(self, request): try: - next_url = urls.Next().decode(request.GET['next']) + self.next_url = urls.Next().decode(request.GET['next']) except urls.InvalidNextUrl: logger.warning('Invalid facebook handler next.', extra={'request': request}) return http.HttpResponseBadRequest() if 'code' in request.GET: - self.login(next_url) - response = http.HttpResponseRedirect(next_url['next']) + try: + self.login() + except facepy.FacepyError as e: + return self.handle_facebook_error(e) + response = http.HttpResponseRedirect(self.next_url['next']) response["P3P"] = ('CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi' ' IVDi CONi HIS OUR IND CNT"') else: - response = http.HttpResponseRedirect(next_url['close']) + response = http.HttpResponseRedirect(self.next_url['close']) return response - def login(self, next_url): + def login(self): user = authenticate( code=self.request.GET['code'], - redirect_uri=urls.redirect_uri(next_url['next'], - next_url['close'])) + redirect_uri=urls.redirect_uri(self.next_url['next'], + self.next_url['close'])) if user: login(self.request, user) + def handle_facebook_error(self, e): + return http.HttpResponseRedirect(self.next_url['next']) + handler = Handler.as_view()
088d76bbe01a9a6dd0a246be8ce703d5b64c540e
Lib/hotshot/__init__.py
Lib/hotshot/__init__.py
"""High-perfomance logging profiler, mostly written in C.""" import _hotshot from _hotshot import ProfilerError class Profile: def __init__(self, logfn, lineevents=0, linetimings=1): self.lineevents = lineevents and 1 or 0 self.linetimings = (linetimings and lineevents) and 1 or 0 self._prof = p = _hotshot.profiler( logfn, self.lineevents, self.linetimings) def close(self): self._prof.close() def start(self): self._prof.start() def stop(self): self._prof.stop() # These methods offer the same interface as the profile.Profile class, # but delegate most of the work to the C implementation underneath. def run(self, cmd): import __main__ dict = __main__.__dict__ return self.runctx(cmd, dict, dict) def runctx(self, cmd, globals, locals): code = compile(cmd, "<string>", "exec") self._prof.runcode(code, globals, locals) return self def runcall(self, func, *args, **kw): return self._prof.runcall(func, args, kw)
"""High-perfomance logging profiler, mostly written in C.""" import _hotshot from _hotshot import ProfilerError class Profile: def __init__(self, logfn, lineevents=0, linetimings=1): self.lineevents = lineevents and 1 or 0 self.linetimings = (linetimings and lineevents) and 1 or 0 self._prof = p = _hotshot.profiler( logfn, self.lineevents, self.linetimings) def close(self): self._prof.close() def start(self): self._prof.start() def stop(self): self._prof.stop() def addinfo(self, key, value): self._prof.addinfo(key, value) # These methods offer the same interface as the profile.Profile class, # but delegate most of the work to the C implementation underneath. def run(self, cmd): import __main__ dict = __main__.__dict__ return self.runctx(cmd, dict, dict) def runctx(self, cmd, globals, locals): code = compile(cmd, "<string>", "exec") self._prof.runcode(code, globals, locals) return self def runcall(self, func, *args, **kw): return self._prof.runcall(func, args, kw)
Allow user code to call the addinfo() method on the profiler object.
Allow user code to call the addinfo() method on the profiler object.
Python
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
--- +++ @@ -21,6 +21,9 @@ def stop(self): self._prof.stop() + def addinfo(self, key, value): + self._prof.addinfo(key, value) + # These methods offer the same interface as the profile.Profile class, # but delegate most of the work to the C implementation underneath.
d89715196ba79da02a997688414dfa283bee5aeb
profiles/tests/test_views.py
profiles/tests/test_views.py
from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client import RequestFactory from utils.factories import UserFactory from profiles.views import ProfileView class ProfileViewTests(TestCase): def setUp(self): request_factory = RequestFactory() request = request_factory.get(reverse('profile')) request.user = UserFactory.create() self.response = ProfileView.as_view()(request) def test_profile_view_200(self): self.assertEqual(self.response.status_code, 200) def test_profile_view_renders(self): self.response.render()
from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client import RequestFactory from utils.factories import UserFactory from profiles.views import ( ProfileView, ReviewUserView, ) class ProfileViewTests(TestCase): def setUp(self): request_factory = RequestFactory() request = request_factory.get(reverse('profile')) request.user = UserFactory.create() self.response = ProfileView.as_view()(request) def test_profile_view_200(self): self.assertEqual(self.response.status_code, 200) def test_profile_view_renders(self): self.response.render() class ReviewUserViewTests(TestCase): def setUp(self): request_factory = RequestFactory() self.request = request_factory.get('/admin/dashboard/') def test_review_user_view_200(self): user = UserFactory.create() user.is_staff = True self.request.user = user response = ReviewUserView.as_view()(self.request) self.assertEqual(response.status_code, 200) def test_review_user_view_200(self): user = UserFactory.create() user.is_staff = True self.request.user = user response = ReviewUserView.as_view()(self.request) response.render() def test_review_user_view_not_staff(self): user = UserFactory.create() self.request.user = user response = ReviewUserView.as_view()(self.request) self.assertEqual(response.status_code, 302)
Add tests for user review view
Add tests for user review view
Python
mit
phildini/logtacts,phildini/logtacts,phildini/logtacts,phildini/logtacts,phildini/logtacts
--- +++ @@ -3,7 +3,10 @@ from django.test.client import RequestFactory from utils.factories import UserFactory -from profiles.views import ProfileView +from profiles.views import ( + ProfileView, + ReviewUserView, +) class ProfileViewTests(TestCase): @@ -19,3 +22,30 @@ def test_profile_view_renders(self): self.response.render() + + +class ReviewUserViewTests(TestCase): + + def setUp(self): + request_factory = RequestFactory() + self.request = request_factory.get('/admin/dashboard/') + + def test_review_user_view_200(self): + user = UserFactory.create() + user.is_staff = True + self.request.user = user + response = ReviewUserView.as_view()(self.request) + self.assertEqual(response.status_code, 200) + + def test_review_user_view_200(self): + user = UserFactory.create() + user.is_staff = True + self.request.user = user + response = ReviewUserView.as_view()(self.request) + response.render() + + def test_review_user_view_not_staff(self): + user = UserFactory.create() + self.request.user = user + response = ReviewUserView.as_view()(self.request) + self.assertEqual(response.status_code, 302)
f2a46687e24d82060b687922de3495111f82e558
geist/backends/fake.py
geist/backends/fake.py
import numpy as np from ..core import Location class GeistFakeBackend(object): def __init__(self, w=800, h=600): self.image = np.zeros((h, w, 3)) self.locations = [Location(0, 0, w=w, h=h, image=self.image)] def create_process(self, command): pass def actions_transaction(self): pass def capture_locations(self): for loc in self.locations: yield loc def key_down(self, name): pass def key_up(self, name): pass def button_down(self, button_num): pass def button_up(self, button_num): pass def move(self, point): pass def close(self): pass
import numpy as np from ..core import Location class GeistFakeBackend(object): def __init__(self, image=None, w=800, h=600): if image is None: self.image = np.zeros((h, w, 3)) self.locations = [Location(0, 0, w=w, h=h, image=self.image)] else: if isinstance(image, basestring): image = np.load(image) self.image = image h, w, _ = image.shape self.locations = [Location(0, 0, w=w, h=h, image=self.image)] def create_process(self, command): pass def actions_transaction(self): pass def capture_locations(self): for loc in self.locations: yield loc def key_down(self, name): pass def key_up(self, name): pass def button_down(self, button_num): pass def button_up(self, button_num): pass def move(self, point): pass def close(self): pass
Allow Fake Backend to take an image as the screen
Allow Fake Backend to take an image as the screen
Python
mit
kebarr/Geist,thetestpeople/Geist
--- +++ @@ -3,9 +3,16 @@ class GeistFakeBackend(object): - def __init__(self, w=800, h=600): - self.image = np.zeros((h, w, 3)) - self.locations = [Location(0, 0, w=w, h=h, image=self.image)] + def __init__(self, image=None, w=800, h=600): + if image is None: + self.image = np.zeros((h, w, 3)) + self.locations = [Location(0, 0, w=w, h=h, image=self.image)] + else: + if isinstance(image, basestring): + image = np.load(image) + self.image = image + h, w, _ = image.shape + self.locations = [Location(0, 0, w=w, h=h, image=self.image)] def create_process(self, command): pass
aded1c825385817dc39d8ff99c169e6620008abf
blivet/populator/helpers/__init__.py
blivet/populator/helpers/__init__.py
from .btrfs import BTRFSFormatPopulator from .boot import AppleBootFormatPopulator, EFIFormatPopulator, MacEFIFormatPopulator from .disk import DiskDevicePopulator from .disklabel import DiskLabelFormatPopulator from .dm import DMDevicePopulator from .dmraid import DMRaidFormatPopulator from .loop import LoopDevicePopulator from .luks import LUKSFormatPopulator from .lvm import LVMDevicePopulator, LVMFormatPopulator from .mdraid import MDDevicePopulator, MDFormatPopulator from .multipath import MultipathDevicePopulator from .optical import OpticalDevicePopulator from .partition import PartitionDevicePopulator
import inspect as _inspect from .devicepopulator import DevicePopulator from .formatpopulator import FormatPopulator from .btrfs import BTRFSFormatPopulator from .boot import AppleBootFormatPopulator, EFIFormatPopulator, MacEFIFormatPopulator from .disk import DiskDevicePopulator from .disklabel import DiskLabelFormatPopulator from .dm import DMDevicePopulator from .dmraid import DMRaidFormatPopulator from .loop import LoopDevicePopulator from .luks import LUKSFormatPopulator from .lvm import LVMDevicePopulator, LVMFormatPopulator from .mdraid import MDDevicePopulator, MDFormatPopulator from .multipath import MultipathDevicePopulator from .optical import OpticalDevicePopulator from .partition import PartitionDevicePopulator __all__ = ["get_device_helper", "get_format_helper"] _device_helpers = [] _format_helpers = [] def _build_helper_lists(): """Build lists of known device and format helper classes.""" global _device_helpers # pylint: disable=global-variable-undefined global _format_helpers # pylint: disable=global-variable-undefined _device_helpers = [] _format_helpers = [] for obj in globals().values(): if not _inspect.isclass(obj): continue elif issubclass(obj, DevicePopulator): _device_helpers.append(obj) elif issubclass(obj, FormatPopulator): _format_helpers.append(obj) _device_helpers.sort(key=lambda h: h.priority, reverse=True) _format_helpers.sort(key=lambda h: h.priority, reverse=True) _build_helper_lists() def get_device_helper(data): """ Return the device helper class appropriate for the specified data. The helper lists are sorted according to priorities defined within each class. This function returns the first matching class. """ return next((h for h in _device_helpers if h.match(data)), None) def get_format_helper(data, device): """ Return the device helper class appropriate for the specified data. The helper lists are sorted according to priorities defined within each class. This function returns the first matching class. """ return next((h for h in _format_helpers if h.match(data, device=device)), None)
Add functions to return a helper class based on device data.
Add functions to return a helper class based on device data. This is intended to be the complete API of populator.helpers.
Python
lgpl-2.1
vojtechtrefny/blivet,jkonecny12/blivet,vojtechtrefny/blivet,rhinstaller/blivet,rhinstaller/blivet,rvykydal/blivet,AdamWill/blivet,rvykydal/blivet,vpodzime/blivet,AdamWill/blivet,jkonecny12/blivet,vpodzime/blivet
--- +++ @@ -1,3 +1,8 @@ +import inspect as _inspect + +from .devicepopulator import DevicePopulator +from .formatpopulator import FormatPopulator + from .btrfs import BTRFSFormatPopulator from .boot import AppleBootFormatPopulator, EFIFormatPopulator, MacEFIFormatPopulator from .disk import DiskDevicePopulator @@ -11,3 +16,46 @@ from .multipath import MultipathDevicePopulator from .optical import OpticalDevicePopulator from .partition import PartitionDevicePopulator + +__all__ = ["get_device_helper", "get_format_helper"] + +_device_helpers = [] +_format_helpers = [] + + +def _build_helper_lists(): + """Build lists of known device and format helper classes.""" + global _device_helpers # pylint: disable=global-variable-undefined + global _format_helpers # pylint: disable=global-variable-undefined + _device_helpers = [] + _format_helpers = [] + for obj in globals().values(): + if not _inspect.isclass(obj): + continue + elif issubclass(obj, DevicePopulator): + _device_helpers.append(obj) + elif issubclass(obj, FormatPopulator): + _format_helpers.append(obj) + + _device_helpers.sort(key=lambda h: h.priority, reverse=True) + _format_helpers.sort(key=lambda h: h.priority, reverse=True) + +_build_helper_lists() + + +def get_device_helper(data): + """ Return the device helper class appropriate for the specified data. + + The helper lists are sorted according to priorities defined within each + class. This function returns the first matching class. + """ + return next((h for h in _device_helpers if h.match(data)), None) + + +def get_format_helper(data, device): + """ Return the device helper class appropriate for the specified data. + + The helper lists are sorted according to priorities defined within each + class. This function returns the first matching class. + """ + return next((h for h in _format_helpers if h.match(data, device=device)), None)
d6759d0abec637753d93cd407fad5e7abc6ec86d
astropy/tests/plugins/display.py
astropy/tests/plugins/display.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst # This plugin now lives in pytest-astropy, but we keep the code below during # a deprecation phase. import warnings from astropy.utils.exceptions import AstropyDeprecationWarning try: from pytest_astropy_header.display import PYTEST_HEADER_MODULES, TESTED_VERSIONS except ImportError: PYTEST_HEADER_MODULES = {} TESTED_VERSIONS = {} warnings.warn('The astropy.tests.plugins.display plugin has been deprecated. ' 'See the pytest-astropy documentation for information on ' 'migrating to using pytest-astropy to customize the pytest ' 'header.', AstropyDeprecationWarning)
# Licensed under a 3-clause BSD style license - see LICENSE.rst # This plugin now lives in pytest-astropy, but we keep the code below during # a deprecation phase. import warnings from astropy.utils.exceptions import AstropyDeprecationWarning try: from pytest_astropy_header.display import (PYTEST_HEADER_MODULES, TESTED_VERSIONS) except ImportError: PYTEST_HEADER_MODULES = {} TESTED_VERSIONS = {} warnings.warn('The astropy.tests.plugins.display plugin has been deprecated. ' 'See the pytest-astropy-header documentation for information on ' 'migrating to using pytest-astropy-header to customize the ' 'pytest header.', AstropyDeprecationWarning)
Fix typo in deprecation warning
TST: Fix typo in deprecation warning [ci skip]
Python
bsd-3-clause
stargaser/astropy,dhomeier/astropy,saimn/astropy,saimn/astropy,larrybradley/astropy,astropy/astropy,StuartLittlefair/astropy,lpsinger/astropy,dhomeier/astropy,lpsinger/astropy,StuartLittlefair/astropy,larrybradley/astropy,lpsinger/astropy,MSeifert04/astropy,astropy/astropy,astropy/astropy,MSeifert04/astropy,larrybradley/astropy,larrybradley/astropy,StuartLittlefair/astropy,StuartLittlefair/astropy,mhvk/astropy,StuartLittlefair/astropy,saimn/astropy,aleksandr-bakanov/astropy,dhomeier/astropy,mhvk/astropy,astropy/astropy,astropy/astropy,mhvk/astropy,aleksandr-bakanov/astropy,MSeifert04/astropy,mhvk/astropy,lpsinger/astropy,dhomeier/astropy,stargaser/astropy,pllim/astropy,dhomeier/astropy,saimn/astropy,saimn/astropy,pllim/astropy,larrybradley/astropy,pllim/astropy,pllim/astropy,aleksandr-bakanov/astropy,lpsinger/astropy,mhvk/astropy,pllim/astropy,aleksandr-bakanov/astropy,stargaser/astropy,MSeifert04/astropy,stargaser/astropy
--- +++ @@ -7,12 +7,13 @@ from astropy.utils.exceptions import AstropyDeprecationWarning try: - from pytest_astropy_header.display import PYTEST_HEADER_MODULES, TESTED_VERSIONS + from pytest_astropy_header.display import (PYTEST_HEADER_MODULES, + TESTED_VERSIONS) except ImportError: PYTEST_HEADER_MODULES = {} TESTED_VERSIONS = {} warnings.warn('The astropy.tests.plugins.display plugin has been deprecated. ' - 'See the pytest-astropy documentation for information on ' - 'migrating to using pytest-astropy to customize the pytest ' - 'header.', AstropyDeprecationWarning) + 'See the pytest-astropy-header documentation for information on ' + 'migrating to using pytest-astropy-header to customize the ' + 'pytest header.', AstropyDeprecationWarning)
e3bac9c0a655ae49d6e15b16894712f4edbc994b
campus02/web/views/primarykey.py
campus02/web/views/primarykey.py
#!/usr/bin/python # -*- coding: utf-8 -*- from rest_framework import viewsets from rest_framework.filters import DjangoObjectPermissionsFilter from .. import ( models, permissions, ) from ..serializers import ( primarykey as serializers ) class MovieViewSet(viewsets.ReadOnlyModelViewSet): queryset = models.Movie.objects.all() serializer_class = serializers.MovieSerializer class GenreViewSet(viewsets.ReadOnlyModelViewSet): queryset = models.Genre.objects.all() serializer_class = serializers.GenreSerializer class WatchlistViewSet(viewsets.ModelViewSet): queryset = models.Watchlist.objects.all() serializer_class = serializers.WatchlistSerializer filter_backends = [ DjangoObjectPermissionsFilter, ] permission_classes = [ permissions.DjangoObjectPermissions, ] class ResumeViewSet(viewsets.ModelViewSet): queryset = models.Resume.objects.all() serializer_class = serializers.ResumeSerializer filter_backends = [ DjangoObjectPermissionsFilter, ] permission_classes = [ permissions.DjangoObjectPermissions, ] class RatingViewSet(viewsets.ModelViewSet): queryset = models.Rating.objects.all() serializer_class = serializers.RatingSerializer
#!/usr/bin/python # -*- coding: utf-8 -*- from rest_framework import viewsets, filters from .. import ( models, permissions, ) from ..serializers import ( primarykey as serializers ) class MovieViewSet(viewsets.ReadOnlyModelViewSet): queryset = models.Movie.objects.all() serializer_class = serializers.MovieSerializer filter_backends = ( filters.OrderingFilter, ) ordering_fields = ( 'title', 'released', 'runtime', ) class GenreViewSet(viewsets.ReadOnlyModelViewSet): queryset = models.Genre.objects.all() serializer_class = serializers.GenreSerializer filter_backends = ( filters.OrderingFilter, ) ordering_fields = ( 'name', ) class WatchlistViewSet(viewsets.ModelViewSet): queryset = models.Watchlist.objects.all() serializer_class = serializers.WatchlistSerializer filter_backends = ( filters.DjangoObjectPermissionsFilter, ) permission_classes = ( permissions.DjangoObjectPermissions, ) class ResumeViewSet(viewsets.ModelViewSet): queryset = models.Resume.objects.all() serializer_class = serializers.ResumeSerializer filter_backends = ( filters.DjangoObjectPermissionsFilter, ) permission_classes = ( permissions.DjangoObjectPermissions, ) class RatingViewSet(viewsets.ModelViewSet): queryset = models.Rating.objects.all() serializer_class = serializers.RatingSerializer
Add ordering filters for primary key based api.
Add ordering filters for primary key based api.
Python
mit
fladi/django-campus02,fladi/django-campus02
--- +++ @@ -1,8 +1,7 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -from rest_framework import viewsets -from rest_framework.filters import DjangoObjectPermissionsFilter +from rest_framework import viewsets, filters from .. import ( models, @@ -16,33 +15,47 @@ class MovieViewSet(viewsets.ReadOnlyModelViewSet): queryset = models.Movie.objects.all() serializer_class = serializers.MovieSerializer + filter_backends = ( + filters.OrderingFilter, + ) + ordering_fields = ( + 'title', + 'released', + 'runtime', + ) class GenreViewSet(viewsets.ReadOnlyModelViewSet): queryset = models.Genre.objects.all() serializer_class = serializers.GenreSerializer + filter_backends = ( + filters.OrderingFilter, + ) + ordering_fields = ( + 'name', + ) class WatchlistViewSet(viewsets.ModelViewSet): queryset = models.Watchlist.objects.all() serializer_class = serializers.WatchlistSerializer - filter_backends = [ - DjangoObjectPermissionsFilter, - ] - permission_classes = [ + filter_backends = ( + filters.DjangoObjectPermissionsFilter, + ) + permission_classes = ( permissions.DjangoObjectPermissions, - ] + ) class ResumeViewSet(viewsets.ModelViewSet): queryset = models.Resume.objects.all() serializer_class = serializers.ResumeSerializer - filter_backends = [ - DjangoObjectPermissionsFilter, - ] - permission_classes = [ + filter_backends = ( + filters.DjangoObjectPermissionsFilter, + ) + permission_classes = ( permissions.DjangoObjectPermissions, - ] + ) class RatingViewSet(viewsets.ModelViewSet):
06645a637c0d34270f88f9a6b96133da5c415dd7
froide/publicbody/admin.py
froide/publicbody/admin.py
from django.contrib import admin from froide.publicbody.models import PublicBody, FoiLaw class PublicBodyAdmin(admin.ModelAdmin): prepopulated_fields = {"slug": ("geography", "name",)} list_display = ('name', 'classification', 'geography') list_filter = ('classification',) search_fields = ['name', "description"] exclude = ('confirmed',) class FoiLawAdmin(admin.ModelAdmin): prepopulated_fields = {"slug": ("jurisdiction", "name",)} admin.site.register(PublicBody, PublicBodyAdmin) admin.site.register(FoiLaw, FoiLawAdmin)
from django.contrib import admin from froide.publicbody.models import PublicBody, FoiLaw class PublicBodyAdmin(admin.ModelAdmin): prepopulated_fields = {"slug": ("geography", "name",)} list_display = ('name', 'classification', 'topic', 'geography') list_filter = ('classification', 'topic',) search_fields = ['name', "description"] exclude = ('confirmed',) class FoiLawAdmin(admin.ModelAdmin): prepopulated_fields = {"slug": ("jurisdiction", "name",)} admin.site.register(PublicBody, PublicBodyAdmin) admin.site.register(FoiLaw, FoiLawAdmin)
Add topic to PublicBodyAdmin list_filter and list_display
Add topic to PublicBodyAdmin list_filter and list_display
Python
mit
catcosmo/froide,ryankanno/froide,stefanw/froide,catcosmo/froide,fin/froide,CodeforHawaii/froide,fin/froide,okfse/froide,LilithWittmann/froide,okfse/froide,stefanw/froide,ryankanno/froide,LilithWittmann/froide,LilithWittmann/froide,CodeforHawaii/froide,fin/froide,catcosmo/froide,catcosmo/froide,okfse/froide,ryankanno/froide,okfse/froide,catcosmo/froide,CodeforHawaii/froide,ryankanno/froide,LilithWittmann/froide,fin/froide,LilithWittmann/froide,stefanw/froide,stefanw/froide,stefanw/froide,ryankanno/froide,CodeforHawaii/froide,CodeforHawaii/froide,okfse/froide
--- +++ @@ -3,8 +3,8 @@ class PublicBodyAdmin(admin.ModelAdmin): prepopulated_fields = {"slug": ("geography", "name",)} - list_display = ('name', 'classification', 'geography') - list_filter = ('classification',) + list_display = ('name', 'classification', 'topic', 'geography') + list_filter = ('classification', 'topic',) search_fields = ['name', "description"] exclude = ('confirmed',)
621d285c05ce3a6257edcffec03c8a96507b6179
name/feeds.py
name/feeds.py
from django.contrib.syndication.views import Feed from django.core.urlresolvers import reverse_lazy from django.utils.feedgenerator import Atom1Feed from . import app_settings from .models import Name, Location class NameAtomFeedType(Atom1Feed): """Create an Atom feed that sets the Content-Type response header to application/xml. """ mime_type = 'application/xml' class NameAtomFeed(Feed): feed_type = NameAtomFeedType link = reverse_lazy("name_feed") title = "Name App" subtitle = "New Name Records" author_name = app_settings.NAME_FEED_AUTHOR_NAME author_email = app_settings.NAME_FEED_AUTHOR_EMAIL author_link = app_settings.NAME_FEED_AUTHOR_LINK def items(self): # last 5 added items return Name.objects.order_by('-date_created')[:20] def item_title(self, item): return item.name def item_location(self, item): """ Returns an extra keyword arguments dictionary that is used with the `add_item` call of the feed generator. Add the 'content' field of the 'Entry' item, to be used by the custom feed generator. """ location_set = [] for l in Location.objects.filter(belong_to_name=item): location_set.append( 'georss:point', "%s %s" % (l.latitude, l.longitude) ) return location_set def item_description(self, item): return "Name Type: %s" % item.get_name_type_label() def item_link(self, item): return item.get_absolute_url()
from django.contrib.syndication.views import Feed from django.core.urlresolvers import reverse_lazy from django.utils.feedgenerator import Atom1Feed from . import app_settings from .models import Name class NameAtomFeedType(Atom1Feed): """Create an Atom feed that sets the Content-Type response header to application/xml. """ mime_type = 'application/xml' class NameAtomFeed(Feed): feed_type = NameAtomFeedType link = reverse_lazy("name_feed") title = "Name App" subtitle = "New Name Records" author_name = app_settings.NAME_FEED_AUTHOR_NAME author_email = app_settings.NAME_FEED_AUTHOR_EMAIL author_link = app_settings.NAME_FEED_AUTHOR_LINK def items(self): # last 5 added items return Name.objects.order_by('-date_created')[:20] def item_title(self, obj): return obj.name def item_description(self, obj): return 'Name Type: {0}'.format(obj.get_name_type_label()) def item_link(self, obj): return obj.get_absolute_url()
Change the formating of item_description. Remove item_location because it was not used.
Change the formating of item_description. Remove item_location because it was not used.
Python
bsd-3-clause
unt-libraries/django-name,damonkelley/django-name,unt-libraries/django-name,unt-libraries/django-name,damonkelley/django-name,damonkelley/django-name
--- +++ @@ -3,7 +3,7 @@ from django.utils.feedgenerator import Atom1Feed from . import app_settings -from .models import Name, Location +from .models import Name class NameAtomFeedType(Atom1Feed): @@ -26,25 +26,11 @@ # last 5 added items return Name.objects.order_by('-date_created')[:20] - def item_title(self, item): - return item.name + def item_title(self, obj): + return obj.name - def item_location(self, item): - """ - Returns an extra keyword arguments dictionary that is used - with the `add_item` call of the feed generator. Add the - 'content' field of the 'Entry' item, to be used by the custom - feed generator. - """ - location_set = [] - for l in Location.objects.filter(belong_to_name=item): - location_set.append( - 'georss:point', "%s %s" % (l.latitude, l.longitude) - ) - return location_set + def item_description(self, obj): + return 'Name Type: {0}'.format(obj.get_name_type_label()) - def item_description(self, item): - return "Name Type: %s" % item.get_name_type_label() - - def item_link(self, item): - return item.get_absolute_url() + def item_link(self, obj): + return obj.get_absolute_url()
002dd6fa4af36bd722b3f194c93f1e2e628ad561
inboxen/app/model/email.py
inboxen/app/model/email.py
from inboxen.models import Alias, Attachment, Email, Header from config.settings import datetime_format, recieved_header_name from datetime import datetime def make_email(message, alias, domain): inbox = Alias.objects.filter(alias=alias, domain__domain=domain)[0] user = inbox.user body = message.base.body recieved_date = datetime.strptime(message[recieved_header_name], datetime_format) del message[recieved_header_name] email = Email(inbox=inbox, user=user, body=body, recieved_date=recieved_date) email.save() for name in message.keys(): email.headers.create(name=name, data=message[name]) for part in message.walk(): if not part.body: part.body = u'' email.attachments.create( content_type=part.content_encoding['Content-Type'][0], content_disposition=part.content_encoding['Content-Disposition'][0], data=part.body ) email.save()
from inboxen.models import Alias, Attachment, Email, Header from config.settings import datetime_format, recieved_header_name from datetime import datetime def make_email(message, alias, domain): inbox = Alias.objects.filter(alias=alias, domain__domain=domain)[0] user = inbox.user body = message.base.body recieved_date = datetime.strptime(message[recieved_header_name], datetime_format) del message[recieved_header_name] email = Email(inbox=inbox, user=user, body=body, recieved_date=recieved_date) email.save() head_list = [] for name in message.keys(): header = Header(name=name, data=message[name]) header.save() head_list.append(header) # add all the headers at once should save us some queries email.headers.add(*head_list) attach_list = [] for part in message.walk(): if not part.body: part.body = u'' attachment = Attachment( content_type=part.content_encoding['Content-Type'][0], content_disposition=part.content_encoding['Content-Disposition'][0], data=part.body ) attachment.save() attach_list.append(attachment) # as with headers above email.attachments.add(*attach_list)
Reduce number of queries to DB
Reduce number of queries to DB
Python
agpl-3.0
Inboxen/router,Inboxen/Inboxen,Inboxen/Inboxen,Inboxen/Inboxen,Inboxen/Inboxen
--- +++ @@ -12,16 +12,24 @@ email = Email(inbox=inbox, user=user, body=body, recieved_date=recieved_date) email.save() + head_list = [] for name in message.keys(): - email.headers.create(name=name, data=message[name]) + header = Header(name=name, data=message[name]) + header.save() + head_list.append(header) + # add all the headers at once should save us some queries + email.headers.add(*head_list) + attach_list = [] for part in message.walk(): if not part.body: part.body = u'' - email.attachments.create( + attachment = Attachment( content_type=part.content_encoding['Content-Type'][0], content_disposition=part.content_encoding['Content-Disposition'][0], data=part.body ) - - email.save() + attachment.save() + attach_list.append(attachment) + # as with headers above + email.attachments.add(*attach_list)
1ecd6cacac15bff631b958ee6773b2ad8659df50
opps/images/widgets.py
opps/images/widgets.py
from django import forms from django.conf import settings from django.template.loader import render_to_string class MultipleUpload(forms.FileInput): def render(self, name, value, attrs=None): _value = "" if value: _value = "{0}{1}".format(settings.MEDIA_URL, value) return render_to_string("admin/opps/images/multiupload.html", {"name": name, "value": _value, "STATIC_URL": settings.STATIC_URL})
from django import forms from django.conf import settings from django.template.loader import render_to_string class MultipleUpload(forms.FileInput): def render(self, name, value, attrs=None): _value = "" if value: _value = "{0}{1}".format(settings.MEDIA_URL, value) return render_to_string("admin/opps/images/multiupload.html", {"name": name, "value": _value, "STATIC_URL": settings.STATIC_URL}) class CropExample(forms.TextInput): def render(self, name, value, attrs=None): return render_to_string( "admin/opps/images/cropexample.html", {"name": name, "value": value, "THUMBOR_SERVER": settings.THUMBOR_SERVER, "THUMBOR_MEDIA_URL": settings.THUMBOR_MEDIA_URL})
Create widget CropExample on images
Create widget CropExample on images
Python
mit
jeanmask/opps,williamroot/opps,opps/opps,jeanmask/opps,opps/opps,YACOWS/opps,jeanmask/opps,opps/opps,williamroot/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,opps/opps,YACOWS/opps,williamroot/opps,YACOWS/opps
--- +++ @@ -12,3 +12,12 @@ return render_to_string("admin/opps/images/multiupload.html", {"name": name, "value": _value, "STATIC_URL": settings.STATIC_URL}) + +class CropExample(forms.TextInput): + + def render(self, name, value, attrs=None): + return render_to_string( + "admin/opps/images/cropexample.html", + {"name": name, "value": value, + "THUMBOR_SERVER": settings.THUMBOR_SERVER, + "THUMBOR_MEDIA_URL": settings.THUMBOR_MEDIA_URL})
1a03fbbb612d8faa5a6733fe7d4920f3ca158a69
acme/utils/observers.py
acme/utils/observers.py
# Copyright 2018 DeepMind Technologies Limited. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Metrics observers.""" import abc from typing import Dict, Union import dm_env import numpy as np Number = Union[int, float] class EnvLoopObserver(abc.ABC): """An interface for collecting metrics/counters in EnvironmentLoop.""" def observe_first(self, env: dm_env.Environment, timestep: dm_env.TimeStep ) -> None: """Observes the initial state.""" @abc.abstractmethod def observe(self, env: dm_env.Environment, timestep: dm_env.TimeStep, action: np.ndarray) -> None: """Records one environment step.""" @abc.abstractmethod def get_metrics(self) -> Dict[str, Number]: """Returns metrics collected for the current episode."""
# Copyright 2018 DeepMind Technologies Limited. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Metrics observers.""" import abc from typing import Dict, Union import dm_env import numpy as np Number = Union[int, float] class EnvLoopObserver(abc.ABC): """An interface for collecting metrics/counters in EnvironmentLoop.""" @abc.abstractmethod def observe_first(self, env: dm_env.Environment, timestep: dm_env.TimeStep ) -> None: """Observes the initial state.""" @abc.abstractmethod def observe(self, env: dm_env.Environment, timestep: dm_env.TimeStep, action: np.ndarray) -> None: """Records one environment step.""" @abc.abstractmethod def get_metrics(self) -> Dict[str, Number]: """Returns metrics collected for the current episode."""
Add a missing @abc.abstractmethod declaration
Add a missing @abc.abstractmethod declaration PiperOrigin-RevId: 424036906 Change-Id: I3979c35ec30caa4b684d43376b2a36d21f7e79df
Python
apache-2.0
deepmind/acme,deepmind/acme
--- +++ @@ -27,6 +27,7 @@ class EnvLoopObserver(abc.ABC): """An interface for collecting metrics/counters in EnvironmentLoop.""" + @abc.abstractmethod def observe_first(self, env: dm_env.Environment, timestep: dm_env.TimeStep ) -> None: """Observes the initial state."""
018d062f2ed9ca9acd3d555d439dd81b89c88a6f
parse_push/managers.py
parse_push/managers.py
from django.db import models class DeviceManager(models.Manager): def latest(self): """ Returns latest Device instance """ return self.latest('created_at')
from django.db import models class DeviceManager(models.Manager): def get_latest(self): """ Returns latest Device instance """ return self.get_queryset().latest('created_at')
Use .get_latest() instead so that we do not override built-in .latest()
Use .get_latest() instead so that we do not override built-in .latest()
Python
bsd-3-clause
willandskill/django-parse-push
--- +++ @@ -4,7 +4,7 @@ class DeviceManager(models.Manager): - def latest(self): + def get_latest(self): """ Returns latest Device instance """ - return self.latest('created_at') + return self.get_queryset().latest('created_at')
ab2f4aaf9546787a269a3d0ec5b3b83c86a43bde
Languages.py
Languages.py
#!/usr/bin/env python3 import requests import re def findAllLanguages(): "Find a list of Crowdin language codes to which KA is translated to" response = requests.get("https://crowdin.com/project/khanacademy") txt = response.text for match in re.findall(r"https?://[a-z0-9]*\.cloudfront\.net/images/flags/([^\.]+)\.png", txt): yield match if __name__ == "__main__": print(list(findAllLanguages()))
#!/usr/bin/env python3 import requests import re def findAllLanguages(): "Find a list of Crowdin language codes to which KA is translated to" response = requests.get("https://crowdin.com/project/khanacademy") txt = response.text langs = set() for match in re.findall(r"https?://[a-z0-9]*\.cloudfront\.net/images/flags/([^\.]+)\.png", txt): langs.add(match) return langs if __name__ == "__main__": print(findAllLanguages())
Return language set instead of language generator
Return language set instead of language generator
Python
apache-2.0
ulikoehler/KATranslationCheck,ulikoehler/KATranslationCheck,KA-Advocates/KATranslationCheck,KA-Advocates/KATranslationCheck,ulikoehler/KATranslationCheck,KA-Advocates/KATranslationCheck,ulikoehler/KATranslationCheck,ulikoehler/KATranslationCheck,KA-Advocates/KATranslationCheck
--- +++ @@ -6,8 +6,10 @@ "Find a list of Crowdin language codes to which KA is translated to" response = requests.get("https://crowdin.com/project/khanacademy") txt = response.text + langs = set() for match in re.findall(r"https?://[a-z0-9]*\.cloudfront\.net/images/flags/([^\.]+)\.png", txt): - yield match + langs.add(match) + return langs if __name__ == "__main__": - print(list(findAllLanguages())) + print(findAllLanguages())
8d313884a52b06e2fdf9a3c0d152b9e711ff02c2
kkbox/trac/secretticket.py
kkbox/trac/secretticket.py
from trac.core import Component, implements from trac.perm import IPermissionRequestor class KKBOXSecretTicketsPolicy(Component): implements(IPermissionRequestor) def get_permission_actions(self): return ['SECRET_VIEW']
from trac.ticket.model import Ticket from trac.core import Component, implements, TracError from trac.perm import IPermissionPolicy class KKBOXSecretTicketsPolicy(Component): implements(IPermissionPolicy) def __init__(self): config = self.env.config self.sensitive_keyword = config.get('kkbox', 'sensitive_keyword').strip() def check_permission(self, action, user, resource, perm): while resource: if 'ticket' == resource.realm: break resource = resource.parent if resource and 'ticket' == resource.realm and resource.id: return self.check_ticket_access(perm, resource) def check_ticket_access(self, perm, res): if not self.sensitive_keyword: return None try: ticket = Ticket(self.env, res.id) keywords = [k.strip() for k in ticket['keywords'].split(',')] if self.sensitive_keyword in keywords: cc_list = [cc.strip() for cc in ticket['cc'].split(',')] if perm.username == ticket['reporter'] or \ perm.username == ticket['owner'] or \ perm.username in cc_list: return None else: return False except TracError as e: self.log.error(e.message) return None
Mark ticket as sensitive by keyword
Mark ticket as sensitive by keyword Set sensitive_keyword in trac.ini as following example, These ticket has "secret" keyword are viewable by reporter, owner and cc. [kkbox] sensitive_keyword = secret
Python
bsd-3-clause
KKBOX/trac-keyword-secret-ticket-plugin
--- +++ @@ -1,8 +1,39 @@ -from trac.core import Component, implements -from trac.perm import IPermissionRequestor +from trac.ticket.model import Ticket +from trac.core import Component, implements, TracError +from trac.perm import IPermissionPolicy class KKBOXSecretTicketsPolicy(Component): - implements(IPermissionRequestor) + implements(IPermissionPolicy) - def get_permission_actions(self): - return ['SECRET_VIEW'] + def __init__(self): + config = self.env.config + self.sensitive_keyword = config.get('kkbox', 'sensitive_keyword').strip() + + def check_permission(self, action, user, resource, perm): + while resource: + if 'ticket' == resource.realm: + break + resource = resource.parent + + if resource and 'ticket' == resource.realm and resource.id: + return self.check_ticket_access(perm, resource) + + def check_ticket_access(self, perm, res): + if not self.sensitive_keyword: + return None + + try: + ticket = Ticket(self.env, res.id) + keywords = [k.strip() for k in ticket['keywords'].split(',')] + if self.sensitive_keyword in keywords: + cc_list = [cc.strip() for cc in ticket['cc'].split(',')] + + if perm.username == ticket['reporter'] or \ + perm.username == ticket['owner'] or \ + perm.username in cc_list: + return None + else: + return False + except TracError as e: + self.log.error(e.message) + return None
01516489dbf9ee78128d653b3ebc46730d466425
apps/api/serializers.py
apps/api/serializers.py
# -*- coding: utf-8 -*- from rest_framework import serializers from apps.broadcasts.models import Broadcast, Host, Raid, Series from apps.games.models import Game, Platform from apps.subscribers.models import Ticket class HostSerializer(serializers.ModelSerializer): class Meta: fields = ('id', 'timestamp', 'username', 'broadcast') model = Host class RaidSerializer(serializers.ModelSerializer): class Meta: fields = ('id', 'timestamp', 'username', 'broadcast', 'game') model = Raid class SeriesSerializer(serializers.ModelSerializer): class Meta: model = Series class GameSerializer(serializers.ModelSerializer): class Meta: model = Game class PlatformSerializer(serializers.ModelSerializer): class Meta: model = Platform class TicketSerializer(serializers.ModelSerializer): class Meta: model = Ticket class BroadcastSerializer(serializers.ModelSerializer): hosts = serializers.PrimaryKeyRelatedField(many=True, read_only=True) raids = serializers.PrimaryKeyRelatedField(many=True, read_only=True) class Meta: model = Broadcast
# -*- coding: utf-8 -*- from rest_framework import serializers from apps.broadcasts.models import Broadcast, Host, Raid, Series from apps.games.models import Game, Platform from apps.subscribers.models import Ticket class HostSerializer(serializers.ModelSerializer): class Meta: fields = ('id', 'timestamp', 'username', 'broadcast') model = Host class RaidSerializer(serializers.ModelSerializer): class Meta: fields = ('id', 'timestamp', 'username', 'broadcast', 'game') model = Raid class SeriesSerializer(serializers.ModelSerializer): class Meta: model = Series class GameSerializer(serializers.ModelSerializer): appearances = serializers.IntegerField(source='appears_on.count', read_only=True) class Meta: model = Game class PlatformSerializer(serializers.ModelSerializer): class Meta: model = Platform class TicketSerializer(serializers.ModelSerializer): class Meta: model = Ticket class BroadcastSerializer(serializers.ModelSerializer): hosts = serializers.PrimaryKeyRelatedField(many=True, read_only=True) raids = serializers.PrimaryKeyRelatedField(many=True, read_only=True) class Meta: model = Broadcast
Add appearance count to the API.
Add appearance count to the API.
Python
apache-2.0
bryanveloso/avalonstar-tv,bryanveloso/avalonstar-tv,bryanveloso/avalonstar-tv
--- +++ @@ -24,6 +24,8 @@ class GameSerializer(serializers.ModelSerializer): + appearances = serializers.IntegerField(source='appears_on.count', read_only=True) + class Meta: model = Game
8ee38953a9f8bdbd95ace4ea45e3673cc260bb4b
scripts/cronRefreshEdxQualtrics.py
scripts/cronRefreshEdxQualtrics.py
import getopt import sys import os ### Script for scheduling regular EdxQualtrics updates ### Usage for cron should be "cronRefreshEdxQualtrics.py -m -s -r" # Append directory for dependencies to PYTHONPATH # sys.path.append("/home/dataman/Code/qualtrics_etl/src/qualtrics_etl/") source_dir = [os.path.join(os.path.dirname(os.path.abspath(__file__)), "../json_to_relation/")] source_dir.extend(sys.path) sys.path = source_dir from surveyextractor import QualtricsExtractor qe = QualtricsExtractor() opts, args = getopt.getopt(sys.argv[1:], 'amsr', ['--reset', '--loadmeta', '--loadsurveys', '--loadresponses']) for opt, arg in opts: if opt in ('-a', '--reset'): qe.resetMetadata() qe.resetSurveys() qe.resetResponses() elif opt in ('-m', '--loadmeta'): qe.loadSurveyMetadata() elif opt in ('-s', '--loadsurvey'): qe.resetSurveys() qe.loadSurveyData() elif opt in ('-r', '--loadresponses'): qe.loadResponseData()
#!/usr/bin/env python import getopt import sys import os ### Script for scheduling regular EdxQualtrics updates ### Usage for cron should be "cronRefreshEdxQualtrics.py -m -s -r" # Append directory for dependencies to PYTHONPATH # sys.path.append("/home/dataman/Code/qualtrics_etl/src/qualtrics_etl/") source_dir = [os.path.join(os.path.dirname(os.path.abspath(__file__)), "../json_to_relation/")] source_dir.extend(sys.path) sys.path = source_dir from surveyextractor import QualtricsExtractor qe = QualtricsExtractor() opts, args = getopt.getopt(sys.argv[1:], 'amsr', ['--reset', '--loadmeta', '--loadsurveys', '--loadresponses']) for opt, arg in opts: if opt in ('-a', '--reset'): qe.resetMetadata() qe.resetSurveys() qe.resetResponses() elif opt in ('-m', '--loadmeta'): qe.loadSurveyMetadata() elif opt in ('-s', '--loadsurvey'): qe.resetSurveys() qe.loadSurveyData() elif opt in ('-r', '--loadresponses'): qe.loadResponseData()
Add python environment to cron qualtrics script
Add python environment to cron qualtrics script
Python
bsd-3-clause
paepcke/json_to_relation,paepcke/json_to_relation,paepcke/json_to_relation,paepcke/json_to_relation
--- +++ @@ -1,3 +1,5 @@ +#!/usr/bin/env python + import getopt import sys import os
6ac1c09422e82d97e3a9e9bc8d52c8814c33bc27
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('bids_writer', '_metadata.py')) setup( name="bids-json-writer", 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': [ ]} )
#!/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('markdown_to_json', '_metadata.py')) setup( name="markdown-to-json", 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': [ 'md_to_json = markdown_to_json.scripts.md_to_json:main' ]} )
Rename package, add script to manifest
Rename package, add script to manifest
Python
mit
njvack/markdown-to-json
--- +++ @@ -28,10 +28,10 @@ execfile(filename, {}, l) return l -metadata = get_locals(os.path.join('bids_writer', '_metadata.py')) +metadata = get_locals(os.path.join('markdown_to_json', '_metadata.py')) setup( - name="bids-json-writer", + name="markdown-to-json", version=metadata['version'], author=metadata['author'], author_email=metadata['author_email'], @@ -41,5 +41,6 @@ cmdclass={'test': PyTest}, entry_points={ 'console_scripts': [ + 'md_to_json = markdown_to_json.scripts.md_to_json:main' ]} )
91ad52d6d47ce12966e5fb23913a8c5b600b2c13
setup.py
setup.py
from buckle.version import VERSION from setuptools import setup, find_packages setup( name='buckle', version=VERSION, description='Buckle: It ties your toolbelt together', author='Nextdoor', author_email='eng@nextdoor.com', packages=find_packages(exclude=['ez_setup']), scripts=['bin/buckle', 'bin/buckle-init', 'bin/buckle-help', 'bin/buckle-_help-helper', 'bin/buckle-readme', 'bin/buckle-version', ], test_suite="tests", install_requires=[ 'future>=0.15.2', ], tests_require=[ 'pytest', ], extras_require={ ':python_version <= "3.2"': [ 'subprocess32', ], }, url='https://github.com/Nextdoor/buckle', include_package_data=True )
from buckle.version import VERSION from setuptools import setup, find_packages setup( name='buckle', version=VERSION, description='Buckle: It ties your toolbelt together', author='Nextdoor', author_email='eng@nextdoor.com', packages=find_packages(exclude=['ez_setup']), scripts=['bin/buckle', 'bin/buckle-init', 'bin/buckle-help', 'bin/buckle-_help-helper', 'bin/buckle-readme', 'bin/buckle-version', ], test_suite="tests", install_requires=[ 'future>=0.15.2', ], tests_require=[ 'pytest', ], extras_require={ ':python_version < "3.3"': [ 'subprocess32', ], }, url='https://github.com/Nextdoor/buckle', include_package_data=True )
Use < instead of <= in environment markers.
Use < instead of <= in environment markers.
Python
bsd-2-clause
Nextdoor/buckle,Nextdoor/buckle
--- +++ @@ -24,7 +24,7 @@ 'pytest', ], extras_require={ - ':python_version <= "3.2"': [ + ':python_version < "3.3"': [ 'subprocess32', ], },
ff0468f51b6a5cebd00f2cea8d2abd5f74e925d6
ometa/tube.py
ometa/tube.py
from ometa.interp import TrampolinedGrammarInterpreter, _feed_me class TrampolinedParser: """ A parser that incrementally parses incoming data. """ def __init__(self, grammar, receiver, bindings): """ Initializes the parser. @param grammar: The grammar used to parse the incoming data. @param receiver: Responsible for logic operation on the parsed data. Typically, the logic operation will be invoked inside the grammar, e.g., rule = expr1 expr2 (-> receiver.doSomeStuff()) @param bindings: The namespace that can be accessed inside the grammar. """ self.grammar = grammar self.bindings = dict(bindings) self.bindings['receiver'] = self.receiver = receiver self._setupInterp() def _setupInterp(self): """ Resets the parser. The parser will begin parsing with the rule named 'initial'. """ self._interp = TrampolinedGrammarInterpreter( grammar=self.grammar, ruleName='initial', callback=None, globals=self.bindings) def receive(self, data): """ Receive the incoming data and begin parsing. The parser will parse the data incrementally according to the 'initial' rule in the grammar. @param data: The raw data received. """ while data: try: status = self._interp.receive(data) except Exception as e: # maybe we should raise it? raise e else: if status is _feed_me: return data = ''.join(self._interp.input.data[self._interp.input.position:]) self._setupInterp()
from ometa.interp import TrampolinedGrammarInterpreter, _feed_me class TrampolinedParser: """ A parser that incrementally parses incoming data. """ def __init__(self, grammar, receiver, bindings): """ Initializes the parser. @param grammar: The grammar used to parse the incoming data. @param receiver: Responsible for logic operation on the parsed data. Typically, the logic operation will be invoked inside the grammar, e.g., rule = expr1 expr2 (-> receiver.doSomeStuff()) @param bindings: The namespace that can be accessed inside the grammar. """ self.grammar = grammar self.bindings = dict(bindings) self.bindings['receiver'] = self.receiver = receiver self._setupInterp() def _setupInterp(self): """ Resets the parser. The parser will begin parsing with the rule named 'initial'. """ self._interp = TrampolinedGrammarInterpreter( grammar=self.grammar, ruleName=self.receiver.currentRule, callback=None, globals=self.bindings) def receive(self, data): """ Receive the incoming data and begin parsing. The parser will parse the data incrementally according to the 'initial' rule in the grammar. @param data: The raw data received. """ while data: status = self._interp.receive(data) if status is _feed_me: return data = ''.join(self._interp.input.data[self._interp.input.position:]) self._setupInterp()
Update TrampolinedParser a little for my purposes.
Update TrampolinedParser a little for my purposes.
Python
mit
rbtcollins/parsley,python-parsley/parsley,python-parsley/parsley,rbtcollins/parsley
--- +++ @@ -26,8 +26,8 @@ 'initial'. """ self._interp = TrampolinedGrammarInterpreter( - grammar=self.grammar, ruleName='initial', callback=None, - globals=self.bindings) + grammar=self.grammar, ruleName=self.receiver.currentRule, + callback=None, globals=self.bindings) def receive(self, data): @@ -38,13 +38,8 @@ @param data: The raw data received. """ while data: - try: - status = self._interp.receive(data) - except Exception as e: - # maybe we should raise it? - raise e - else: - if status is _feed_me: - return + status = self._interp.receive(data) + if status is _feed_me: + return data = ''.join(self._interp.input.data[self._interp.input.position:]) self._setupInterp()
3955d10f5dd905610c9621046069ae8dacbb1c1e
setup.py
setup.py
try: from setuptools import setup except ImportError: from distutils.core import setup config = { 'description': 'A simple python LOC count tool', 'author': 'Tihomir Saulic', 'url': 'http://github.com/tsaulic/pycount', 'download_url': 'http://github.com/tsaulic/pycount', 'author_email': 'tihomir[DOT]saulic[AT]gmail[DOT]com', 'version': '0.6.1', 'install_requires': ['binaryornot'], 'packages': ['pycount'], 'scripts': ['bin/pycount'], 'name': 'pycount' } setup(**config)
try: from setuptools import setup except ImportError: from distutils.core import setup config = { 'description': 'A simple python LOC count tool', 'author': 'Tihomir Saulic', 'url': 'http://github.com/tsaulic/pycount', 'download_url': 'http://github.com/tsaulic/pycount', 'author_email': 'tihomir[DOT]saulic[AT]gmail[DOT]com', 'version': '0.6.2', 'install_requires': ['binaryornot', 'pygal'], 'packages': ['pycount'], 'scripts': ['bin/pycount'], 'name': 'pycount' } setup(**config)
Add dependency and bump version.
Add dependency and bump version.
Python
mit
tsaulic/pycount
--- +++ @@ -10,8 +10,8 @@ 'url': 'http://github.com/tsaulic/pycount', 'download_url': 'http://github.com/tsaulic/pycount', 'author_email': 'tihomir[DOT]saulic[AT]gmail[DOT]com', - 'version': '0.6.1', - 'install_requires': ['binaryornot'], + 'version': '0.6.2', + 'install_requires': ['binaryornot', 'pygal'], 'packages': ['pycount'], 'scripts': ['bin/pycount'], 'name': 'pycount'
c1def9580859eb97368aa49a2e26aab483785b35
setup.py
setup.py
from setuptools import setup, find_packages import biobox_cli setup( name = 'biobox_cli', version = biobox_cli.__version__, description = 'Run biobox Docker containers on the command line', author = 'bioboxes', author_email = 'mail@bioboxes.org', url = 'http://bioboxes.org', packages = ['biobox_cli'], scripts = ['bin/biobox'], install_requires = open('requirements.txt').read().splitlines(), classifiers = [ 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Scientific/Engineering :: Bio-Informatics', 'Intended Audience :: Science/Research', 'Operating System :: POSIX' ], )
from setuptools import setup, find_packages import biobox_cli setup( name = 'biobox-cli', version = biobox_cli.__version__, description = 'Run biobox Docker containers on the command line', author = 'bioboxes', author_email = 'mail@bioboxes.org', url = 'http://bioboxes.org', packages = ['biobox_cli'], scripts = ['bin/biobox'], install_requires = open('requirements.txt').read().splitlines(), classifiers = [ 'Natural Language :: English', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Scientific/Engineering :: Bio-Informatics', 'Intended Audience :: Science/Research', 'Operating System :: POSIX' ], )
Use hyphen in package name
Use hyphen in package name Signed-off-by: Michael Barton <1d6e1cf70ec6f9ab28d3ea4b27a49a77654d370e@michaelbarton.me.uk>
Python
mit
pbelmann/command-line-interface,michaelbarton/command-line-interface,fungs/bbx-cli,michaelbarton/command-line-interface,bioboxes/command-line-interface,pbelmann/command-line-interface,bioboxes/command-line-interface,fungs/bbx-cli
--- +++ @@ -2,7 +2,7 @@ import biobox_cli setup( - name = 'biobox_cli', + name = 'biobox-cli', version = biobox_cli.__version__, description = 'Run biobox Docker containers on the command line', author = 'bioboxes', @@ -14,7 +14,6 @@ classifiers = [ 'Natural Language :: English', - 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6',
dee908d28734f5dba0a98e19edc39bc35c9bb062
setup.py
setup.py
#! /usr/bin/env python from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup(name='permamodel', version='0.1.0', author='Elchin Jafarov and Scott Stewart', author_email='james.stewart@colorado.edu', description='Permamodel', long_description=open('README.md').read(), packages=find_packages(), #install_requires=('numpy', 'nose', 'gdal', 'pyproj'), install_requires=('numpy', 'nose',), package_data={'': ['examples/*.cfg', 'examples/*.dat']} )
#! /usr/bin/env python from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup(name='permamodel', version='0.1.0', author='Elchin Jafarov and Scott Stewart', author_email='james.stewart@colorado.edu', description='Permamodel', long_description=open('README.md').read(), packages=find_packages(), #install_requires=('numpy', 'nose', 'gdal', 'pyproj'), install_requires=('affine', 'netCDF4', 'scipy', 'numpy', 'nose',), package_data={'': ['examples/*.cfg', 'examples/*.dat']} )
Include packages needed on install
Include packages needed on install
Python
mit
permamodel/permamodel,permamodel/permamodel
--- +++ @@ -12,6 +12,6 @@ long_description=open('README.md').read(), packages=find_packages(), #install_requires=('numpy', 'nose', 'gdal', 'pyproj'), - install_requires=('numpy', 'nose',), + install_requires=('affine', 'netCDF4', 'scipy', 'numpy', 'nose',), package_data={'': ['examples/*.cfg', 'examples/*.dat']} )
d2b4e85fd0b3c44a460bc843eb480dd82f216f6e
setup.py
setup.py
from setuptools import setup from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'flask_swagger_ui/README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='flask-swagger-ui', version='3.0.12', description='Swagger UI blueprint for Flask', long_description=long_description, url='https://github.com/sveint/flask-swagger-ui', author='Svein Tore Koksrud Seljebotn', author_email='sveint@gmail.com', license='MIT', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords='flask swagger', packages=['flask_swagger_ui'], package_data={ 'flask_swagger_ui': [ 'README.md', 'templates/*.html', 'dist/VERSION', 'dist/LICENSE', 'dist/README.md', 'dist/*.html', 'dist/*.js', 'dist/*/*.js', 'dist/*/*.css', 'dist/*/*.gif', 'dist/*/*.png', 'dist/*/*.ico', 'dist/*/*.ttf', ], } )
from setuptools import setup from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'flask_swagger_ui/README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='flask-swagger-ui', version='3.0.12a', description='Swagger UI blueprint for Flask', long_description=long_description, url='https://github.com/sveint/flask-swagger-ui', author='Svein Tore Koksrud Seljebotn', author_email='sveint@gmail.com', license='MIT', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords='flask swagger', packages=['flask_swagger_ui'], package_data={ 'flask_swagger_ui': [ 'README.md', 'templates/*.html', 'dist/VERSION', 'dist/LICENSE', 'dist/README.md', 'dist/*.html', 'dist/*.js', 'dist/*.css', 'dist/*.png' ], } )
Fix file inclusion and make new release.
Fix file inclusion and make new release.
Python
mit
sveint/flask-swagger-ui,sveint/flask-swagger-ui,sveint/flask-swagger-ui
--- +++ @@ -10,7 +10,7 @@ setup( name='flask-swagger-ui', - version='3.0.12', + version='3.0.12a', description='Swagger UI blueprint for Flask', long_description=long_description, @@ -44,12 +44,8 @@ 'dist/README.md', 'dist/*.html', 'dist/*.js', - 'dist/*/*.js', - 'dist/*/*.css', - 'dist/*/*.gif', - 'dist/*/*.png', - 'dist/*/*.ico', - 'dist/*/*.ttf', + 'dist/*.css', + 'dist/*.png' ], } )
3263a691db55ed72c4f98096748ad930c7ecdd68
setup.py
setup.py
#!/usr/bin/env python import os.path from distutils.core import setup README = open(os.path.join(os.path.dirname(__file__), "README.rst")).read() CLASSIFIERS = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules", ] import ptch VERSION = ptch.__version__ setup( name = "python-ptch", py_modules = ["ptch"], author = "Jerome Leclanche", author_email = "jerome.leclanche+python-ptch@gmail.com", classifiers = CLASSIFIERS, description = "Blizzard BSDIFF-based PTCH file format support", download_url = "http://github.com/Adys/python-ptch/tarball/master", long_description = README, url = "http://github.com/Adys/python-ptch", version = VERSION, )
#!/usr/bin/env python import os.path from distutils.core import setup README = open(os.path.join(os.path.dirname(__file__), "README.rst")).read() CLASSIFIERS = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules", ] import ptch VERSION = ptch.__version__ setup( name = "python-ptch", py_modules = ["ptch"], author = "Jerome Leclanche", author_email = "jerome@leclan.ch", classifiers = CLASSIFIERS, description = "Blizzard BSDIFF-based PTCH file format support", download_url = "https://github.com/jleclanche/python-ptch/tarball/master", long_description = README, url = "https://github.com/jleclanche/python-ptch", version = VERSION, )
Update repository addresses and emails
Update repository addresses and emails
Python
mit
jleclanche/python-ptch
--- +++ @@ -20,11 +20,11 @@ name = "python-ptch", py_modules = ["ptch"], author = "Jerome Leclanche", - author_email = "jerome.leclanche+python-ptch@gmail.com", + author_email = "jerome@leclan.ch", classifiers = CLASSIFIERS, description = "Blizzard BSDIFF-based PTCH file format support", - download_url = "http://github.com/Adys/python-ptch/tarball/master", + download_url = "https://github.com/jleclanche/python-ptch/tarball/master", long_description = README, - url = "http://github.com/Adys/python-ptch", + url = "https://github.com/jleclanche/python-ptch", version = VERSION, )
48701a9f582d65f8086b2bdefe02315d6aca1e77
setup.py
setup.py
import os from setuptools import setup, find_packages def read(filename): return open(os.path.join(os.path.dirname(__file__), filename)).read() setup( name='gears-stylus', version='0.1.1', url='https://github.com/gears/gears-stylus', license='ISC', author='Mike Yumatov', author_email='mike@yumatov.org', description='Stylus compiler for Gears', long_description=read('README.rst'), packages=find_packages(), include_package_data=True, classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: ISC License (ISCL)', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.5', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], )
import os from setuptools import setup, find_packages def read(filename): return open(os.path.join(os.path.dirname(__file__), filename)).read() setup( name='gears-stylus', version='0.1.1', url='https://github.com/gears/gears-stylus', license='ISC', author='Mike Yumatov', author_email='mike@yumatov.org', description='Stylus compiler for Gears', long_description=read('README.rst'), packages=find_packages(), include_package_data=True, classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: ISC License (ISCL)', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.2', ], )
Drop Python 2.5 support, add support for Python 3.2
Drop Python 2.5 support, add support for Python 3.2
Python
isc
gears/gears-stylus,gears/gears-stylus
--- +++ @@ -23,8 +23,8 @@ 'License :: OSI Approved :: ISC License (ISCL)', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 2.5', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.2', ], )
9abbb0b79da1466d2719496b479e43a74e798b97
setup.py
setup.py
from setuptools import setup, find_packages setup( name="librobinson", version="0.1", packages=find_packages(), scripts=['robinson'], # Project uses reStructuredText, so ensure that the docutils get # installed or upgraded on the target machine #install_requires=['docutils>=0.3'], package_data={ # If any package contains *.txt or *.md files, include them: '': ['*.txt', '*.md'], # And include any *.msg files found in the 'hello' package, too: #'hello': ['*.msg'], }, # metadata for upload to PyPI author="Ulrik Sandborg-Petersen", author_email="ulrikp@scripturesys.com", description="A library to parse and convert the New Testament Greek files of Dr. Maurice A. Robinson", license="MIT", keywords="Maurice A. Robinson, New Testament Greek, parse, convert", url="http://github.com/byztxt/librobinson" # could also include long_description, download_url, classifiers, etc. )
from setuptools import setup, find_packages setup( name="librobinson", version="0.2.0", packages=find_packages(), scripts=[ 'robinson/booknames.py', 'robinson/book.py', 'robinson/chapter.py', 'robinson/convert.py', 'robinson/__init__.py', 'robinson/kind.py', 'robinson/reader.py', 'robinson/readwhat.py', 'robinson/robinson.py', 'robinson/robinsontags.py', 'robinson/variant.py', 'robinson/verse.py', 'robinson/word.py', ], # Project uses reStructuredText, so ensure that the docutils get # installed or upgraded on the target machine #install_requires=['docutils>=0.3'], package_data={ # If any package contains *.txt or *.md files, include them: '': ['*.txt', '*.md'], # And include any *.msg files found in the 'hello' package, too: #'hello': ['*.msg'], }, # metadata for upload to PyPI author="Ulrik Sandborg-Petersen", author_email="ulrikp@scripturesys.com", description="A library to parse and convert the New Testament Greek files of Dr. Maurice A. Robinson", license="MIT", keywords="Maurice A. Robinson, New Testament Greek, parse, convert", url="http://github.com/byztxt/librobinson" # could also include long_description, download_url, classifiers, etc. )
Add all python files explicitly, and bump to version 0.2.0
Add all python files explicitly, and bump to version 0.2.0
Python
mit
byztxt/librobinson
--- +++ @@ -1,9 +1,23 @@ from setuptools import setup, find_packages setup( name="librobinson", - version="0.1", + version="0.2.0", packages=find_packages(), - scripts=['robinson'], + scripts=[ + 'robinson/booknames.py', + 'robinson/book.py', + 'robinson/chapter.py', + 'robinson/convert.py', + 'robinson/__init__.py', + 'robinson/kind.py', + 'robinson/reader.py', + 'robinson/readwhat.py', + 'robinson/robinson.py', + 'robinson/robinsontags.py', + 'robinson/variant.py', + 'robinson/verse.py', + 'robinson/word.py', + ], # Project uses reStructuredText, so ensure that the docutils get # installed or upgraded on the target machine
b90553ddc7a27d2b594fcc88130d999c70ae6f5b
setup.py
setup.py
import os from setuptools import setup README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).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 = 'RecordExpress', version = '0.0', packages = ['collection_record'], include_package_data = True, dependency_links = ['https://github.com/cdlib/RecordExpress.git'], license = 'BSD License - see LICENSE file', description = 'A lightweight EAD creator', long_description = README, author = 'Mark Redar', author_email = 'mark.redar@ucop.edu', classifiers = [ 'Environment :: Web Environment', 'Development Status :: 3 - Alpha', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], install_requires = [ 'django>=1.4', 'django-dublincore>=0.1', 'django-sortable', 'BeautifulSoup', 'webtest', 'django-webtest' ], )
import os from setuptools import setup README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).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 = 'RecordExpress', version = '0.0', packages = ['collection_record'], include_package_data = True, dependency_links = ['https://github.com/cdlib/RecordExpress.git', 'https://github.com/drewyeaton/django-sortable/archive/master.zip#egg=django-sortable', #pypi package currently broken - 2013/09 ], license = 'BSD License - see LICENSE file', description = 'A lightweight EAD creator', long_description = README, author = 'Mark Redar', author_email = 'mark.redar@ucop.edu', classifiers = [ 'Environment :: Web Environment', 'Development Status :: 3 - Alpha', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], install_requires = [ 'django>=1.4', 'django-dublincore>=0.1', 'django-sortable', 'BeautifulSoup', 'webtest', 'django-webtest' ], )
Make django-sortable install, pypi package is broken.
Make django-sortable install, pypi package is broken.
Python
bsd-3-clause
cdlib/RecordExpress,cdlib/RecordExpress,cdlib/RecordExpress,cdlib/RecordExpress
--- +++ @@ -11,7 +11,9 @@ version = '0.0', packages = ['collection_record'], include_package_data = True, - dependency_links = ['https://github.com/cdlib/RecordExpress.git'], + dependency_links = ['https://github.com/cdlib/RecordExpress.git', + 'https://github.com/drewyeaton/django-sortable/archive/master.zip#egg=django-sortable', #pypi package currently broken - 2013/09 + ], license = 'BSD License - see LICENSE file', description = 'A lightweight EAD creator', long_description = README,
2fa8b2f4a63579633272b1cc8d972baf27c661f2
pmg/models/__init__.py
pmg/models/__init__.py
from .users import * from .resources import * from .emails import * from .pages import * from .soundcloud_track import *
from .users import * from .resources import * from .emails import * from .pages import * from .soundcloud_track import SoundcloudTrack
Fix error on admin user_report view
Fix error on admin user_report view
Python
apache-2.0
Code4SA/pmg-cms-2,Code4SA/pmg-cms-2,Code4SA/pmg-cms-2
--- +++ @@ -2,4 +2,4 @@ from .resources import * from .emails import * from .pages import * -from .soundcloud_track import * +from .soundcloud_track import SoundcloudTrack
6a9193fdc43361ca12b7f22d18954d17c2049ba1
setup.py
setup.py
from setuptools import setup, find_packages setup( name = 'CommonModules', packages = find_packages(where = '.'), # this must be the same as the name above version = '0.1.11', description = 'Common Python modules/functionalities used in practice.', author = 'Wang Hewen', author_email = 'wanghewen2@sina.com', url = 'https://github.com/wanghewen/CommonModules', # use the URL to the github repo keywords = ['library'], # arbitrary keywords license='MIT', install_requires=[], extras_require = { 'Advance DataStructureOperations': ['scipy', 'numpy'], 'Advance DataStructure IO': ['networkx', 'numpy', 'scipy'] } )
from setuptools import setup, find_packages setup( name = 'CommonModules', packages = find_packages(where = '.'), # this must be the same as the name above version = '0.1.13', description = 'Common Python modules/functionalities used in practice.', author = 'Wang Hewen', author_email = 'wanghewen2@sina.com', url = 'https://github.com/wanghewen/CommonModules', # use the URL to the github repo keywords = ['library'], # arbitrary keywords license='MIT', install_requires=[], extras_require = { 'Advance DataStructureOperations': ['scipy', 'numpy'], 'Advance DataStructure IO': ['networkx', 'numpy', 'scipy'] } )
Fix version number. Will check the file in another machine and fix the conflict
Fix version number. Will check the file in another machine and fix the conflict
Python
mit
wanghewen/CommonModules
--- +++ @@ -2,7 +2,7 @@ setup( name = 'CommonModules', packages = find_packages(where = '.'), # this must be the same as the name above - version = '0.1.11', + version = '0.1.13', description = 'Common Python modules/functionalities used in practice.', author = 'Wang Hewen', author_email = 'wanghewen2@sina.com',
ad0f91e9d120e4c6b34aabf13fa3c68f0d7f5611
setup.py
setup.py
#!/usr/bin/env python from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name = "cobe", version = "0.5", author = "Peter Teichman", author_email = "peter@teichman.org", packages = ["cobe"], test_suite = "tests.cobe_suite", install_requires = ["cmdparse>=0.9"], classifiers = [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Scientific/Engineering :: Artificial Intelligence" ], entry_points = { "console_scripts" : [ "cobe-control = cobe.control:main" ] } )
#!/usr/bin/env python from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name = "cobe", version = "0.5", author = "Peter Teichman", author_email = "peter@teichman.org", packages = ["cobe"], test_suite = "tests.cobe_suite", install_requires = ["cmdparse>=0.9"], classifiers = [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Scientific/Engineering :: Artificial Intelligence" ], entry_points = { "console_scripts" : [ "cobe = cobe.control:main" ] } )
Rename the control script to "cobe"
Rename the control script to "cobe"
Python
mit
pteichman/cobe,wodim/cobe-ng,tiagochiavericosta/cobe,LeMagnesium/cobe,DarkMio/cobe,meska/cobe,pteichman/cobe,meska/cobe,DarkMio/cobe,wodim/cobe-ng,tiagochiavericosta/cobe,LeMagnesium/cobe
--- +++ @@ -24,7 +24,7 @@ ], entry_points = { "console_scripts" : [ - "cobe-control = cobe.control:main" + "cobe = cobe.control:main" ] } )
518cafbd053843b0aee48ac75eccb6a05ff237f5
setup.py
setup.py
from setuptools import setup import proxyprefix setup( name='proxyprefix', version=proxyprefix.__version__, description=proxyprefix.__doc__, url='https://github.com/yola/proxyprefix', packages=['proxyprefix'], )
from setuptools import setup import proxyprefix setup( name='proxyprefix', version=proxyprefix.__version__, description='Prefix SCRIPT_NAME with X-Forwarded-Prefix header', long_description=proxyprefix.__doc__, url='https://github.com/yola/proxyprefix', packages=['proxyprefix'], )
Use module doc as long_description not description
Use module doc as long_description not description It's too long for description. See https://github.com/yola/proxyprefix/pull/3#issuecomment-75107125
Python
mit
yola/proxyprefix
--- +++ @@ -6,7 +6,8 @@ setup( name='proxyprefix', version=proxyprefix.__version__, - description=proxyprefix.__doc__, + description='Prefix SCRIPT_NAME with X-Forwarded-Prefix header', + long_description=proxyprefix.__doc__, url='https://github.com/yola/proxyprefix', packages=['proxyprefix'], )
678e872de192b09c1bafc7a26dc67d7737a14e20
altair/examples/us_population_over_time.py
altair/examples/us_population_over_time.py
""" US Population Over Time ======================= This chart visualizes the age distribution of the US population over time. It uses a slider widget that is bound to the year to visualize the age distribution over time. """ # category: case studies import altair as alt from vega_datasets import data source = data.population.url pink_blue = alt.Scale(domain=('Male', 'Female'), range=["steelblue", "salmon"]) slider = alt.binding_range(min=1900, max=2000, step=10) select_year = alt.selection_single(name="year", fields=['year'], bind=slider, init={'year': 2000}) alt.Chart(source).mark_bar().encode( x=alt.X('sex:N', title=None), y=alt.Y('people:Q', scale=alt.Scale(domain=(0, 12000000))), color=alt.Color('sex:N', scale=pink_blue), column='age:O' ).properties( width=20 ).add_selection( select_year ).transform_calculate( "sex", alt.expr.if_(alt.datum.sex == 1, "Male", "Female") ).transform_filter( select_year ).configure_facet( spacing=8 )
""" US Population by Age and Sex ============================ This chart visualizes the age distribution of the US population over time. It uses a slider widget that is bound to the year to visualize the age distribution over time. """ # category: case studies import altair as alt from vega_datasets import data source = data.population.url select_year = alt.selection_single( name="Year", fields=["year"], bind=alt.binding_range(min=1900, max=2000, step=10, name="Year"), init={"year": 2000}, ) alt.Chart(source).mark_bar().encode( x=alt.X("sex:N", axis=alt.Axis(labels=False, title=None, ticks=False)), y=alt.Y("people:Q", scale=alt.Scale(domain=(0, 12000000)), title="Population"), color=alt.Color( "sex:N", scale=alt.Scale(domain=("Male", "Female"), range=["steelblue", "salmon"]), title="Sex", ), column=alt.Column("age:O", title="Age"), ).properties(width=20, title="U.S. Population by Age and Sex").add_selection( select_year ).transform_calculate( "sex", alt.expr.if_(alt.datum.sex == 1, "Male", "Female") ).transform_filter( select_year ).configure_facet( spacing=8 )
Tidy up U.S. Population by Age and Sex
Tidy up U.S. Population by Age and Sex
Python
bsd-3-clause
altair-viz/altair
--- +++ @@ -1,6 +1,6 @@ """ -US Population Over Time -======================= +US Population by Age and Sex +============================ This chart visualizes the age distribution of the US population over time. It uses a slider widget that is bound to the year to visualize the age distribution over time. @@ -11,21 +11,23 @@ source = data.population.url -pink_blue = alt.Scale(domain=('Male', 'Female'), - range=["steelblue", "salmon"]) - -slider = alt.binding_range(min=1900, max=2000, step=10) -select_year = alt.selection_single(name="year", fields=['year'], - bind=slider, init={'year': 2000}) +select_year = alt.selection_single( + name="Year", + fields=["year"], + bind=alt.binding_range(min=1900, max=2000, step=10, name="Year"), + init={"year": 2000}, +) alt.Chart(source).mark_bar().encode( - x=alt.X('sex:N', title=None), - y=alt.Y('people:Q', scale=alt.Scale(domain=(0, 12000000))), - color=alt.Color('sex:N', scale=pink_blue), - column='age:O' -).properties( - width=20 -).add_selection( + x=alt.X("sex:N", axis=alt.Axis(labels=False, title=None, ticks=False)), + y=alt.Y("people:Q", scale=alt.Scale(domain=(0, 12000000)), title="Population"), + color=alt.Color( + "sex:N", + scale=alt.Scale(domain=("Male", "Female"), range=["steelblue", "salmon"]), + title="Sex", + ), + column=alt.Column("age:O", title="Age"), +).properties(width=20, title="U.S. Population by Age and Sex").add_selection( select_year ).transform_calculate( "sex", alt.expr.if_(alt.datum.sex == 1, "Male", "Female")
1ff696abdee762303dfc79e23e0cdabc6e411270
setup.py
setup.py
#!/usr/bin/env python #from distutils.core import setup from setuptools import setup, find_packages setup( name="imaplib2", version="2.28.3", description="A threaded Python IMAP4 client.", author="Piers Lauder", url="http://github.com/bcoe/imaplib2", classifiers = [ "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7" ], packages = find_packages() )
#!/usr/bin/env python # from distutils.core import setup from setuptools import setup, find_packages try: from distutils.command.build_py import build_py_2to3 as build_py except ImportError: from distutils.command.build_py import build_py setup( name="imaplib2", version="2.28.4", description="A threaded Python IMAP4 client.", author="Piers Lauder", url="http://github.com/bcoe/imaplib2", classifiers=[ "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], packages=find_packages(), cmdclass={'build_py': build_py} )
Add support for Python 3 by doing 2to3 conversion when installing the package with distutils. This way we don't have to maintain two separate repositories to support Python 2.x and Python 3.x.
Add support for Python 3 by doing 2to3 conversion when installing the package with distutils. This way we don't have to maintain two separate repositories to support Python 2.x and Python 3.x.
Python
mit
mbmccoy/smtp_to_tcp
--- +++ @@ -1,16 +1,23 @@ #!/usr/bin/env python -#from distutils.core import setup +# from distutils.core import setup from setuptools import setup, find_packages + +try: + from distutils.command.build_py import build_py_2to3 as build_py +except ImportError: + from distutils.command.build_py import build_py setup( name="imaplib2", - version="2.28.3", + version="2.28.4", description="A threaded Python IMAP4 client.", author="Piers Lauder", url="http://github.com/bcoe/imaplib2", - classifiers = [ + classifiers=[ "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7" + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3" ], - packages = find_packages() + packages=find_packages(), + cmdclass={'build_py': build_py} )
71b68c990977e78abf8dbaf6562719f39492657f
setup.py
setup.py
from setuptools import setup, find_packages # First update the version in loompy/_version.py, then: # cd loompy (the root loompy folder, not the one inside!) # rm -r dist (otherwise twine will upload the oldest build!) # python setup.py sdist # twine upload dist/* # NOTE: Don't forget to update the release version at loompy.github.io (index.html)! # pylint: disable=exec-used __version__ = '0.0.0' exec(open('loompy/_version.py').read()) setup( name="loompy", version=__version__, packages=find_packages(), install_requires=['h5py', 'numpy', 'scipy', "typing", "setuptools"], # metadata for upload to PyPI author="Linnarsson Lab", author_email="sten.linnarsson@ki.se", description="Work with .loom files for single-cell RNA-seq data", license="BSD", keywords="loom omics transcriptomics bioinformatics", url="https://github.com/linnarsson-lab/loompy", download_url=f"https://github.com/linnarsson-lab/loompy/archive/{__version__}.tar.gz", )
from setuptools import setup, find_packages # First update the version in loompy/_version.py, then: # cd loompy (the root loompy folder, not the one inside!) # rm -r dist (otherwise twine will upload the oldest build!) # python setup.py sdist # twine upload dist/* # NOTE: Don't forget to update the release version at loompy.github.io (index.html)! # pylint: disable=exec-used __version__ = '0.0.0' exec(open('loompy/_version.py').read()) setup( name="loompy", version=__version__, packages=find_packages(), install_requires=['h5py', 'numpy', 'scipy', "typing", "setuptools"], python_requires='>=3.6', # metadata for upload to PyPI author="Linnarsson Lab", author_email="sten.linnarsson@ki.se", description="Work with .loom files for single-cell RNA-seq data", license="BSD", keywords="loom omics transcriptomics bioinformatics", url="https://github.com/linnarsson-lab/loompy", download_url=f"https://github.com/linnarsson-lab/loompy/archive/{__version__}.tar.gz", )
Make clear we need Python 3.6
Make clear we need Python 3.6
Python
bsd-2-clause
linnarsson-lab/loompy,linnarsson-lab/loompy
--- +++ @@ -20,6 +20,7 @@ version=__version__, packages=find_packages(), install_requires=['h5py', 'numpy', 'scipy', "typing", "setuptools"], + python_requires='>=3.6', # metadata for upload to PyPI author="Linnarsson Lab", author_email="sten.linnarsson@ki.se",
1d686d4e5cd4ff610dda2b8be9fc747d6314a4b4
setup.py
setup.py
#!/usr/bin/env python from ez_setup import use_setuptools use_setuptools() import os from setuptools import setup, find_packages here = os.path.dirname(__file__) version_file = os.path.join(here, 'src/iptools/__init__.py') d = {} execfile(version_file, d) version = d['__version__'] setup( name = 'iptools', version = version, description = 'Python utilites for manipulating IP addresses', long_description = "Utilities for manipulating IP addresses including a class that can be used to include CIDR network blocks in Django's INTERNAL_IPS setting.", url = 'http://python-iptools.googlecode.com', author = 'Bryan Davis', author_email = 'casadebender+iptools@gmail.com', license = 'BSD', platforms = ['any',], package_dir = {'': 'src'}, packages = find_packages('src'), include_package_data = True, test_suite='iptools.test_iptools', classifiers = [ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Topic :: Utilities', 'Topic :: Internet', ], zip_safe=False, )
#!/usr/bin/env python from ez_setup import use_setuptools use_setuptools() import os from setuptools import setup, find_packages here = os.path.dirname(__file__) version_file = os.path.join(here, 'src/iptools/__init__.py') d = {} execfile(version_file, d) version = d['__version__'] setup( name = 'iptools', version = version, description = 'Python utilites for manipulating IP addresses', long_description = "Utilities for manipulating IP addresses including a class that can be used to include CIDR network blocks in Django's INTERNAL_IPS setting.", url = 'http://python-iptools.googlecode.com', download_url = 'http://pypi.python.org/packages/source/i/iptools/', author = 'Bryan Davis', author_email = 'casadebender+iptools@gmail.com', license = 'BSD', platforms = ['any',], package_dir = {'': 'src'}, packages = find_packages('src'), include_package_data = True, test_suite='iptools.test_iptools', classifiers = [ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Topic :: Utilities', 'Topic :: Internet', ], zip_safe=False, )
Set download_url to pypi directory.
Set download_url to pypi directory. git-svn-id: c8188841f5432f3fe42d04dee4f87e556eb5cf84@23 99efc558-b41a-11dd-8714-116ca565c52f
Python
bsd-2-clause
bd808/python-iptools
--- +++ @@ -19,6 +19,7 @@ description = 'Python utilites for manipulating IP addresses', long_description = "Utilities for manipulating IP addresses including a class that can be used to include CIDR network blocks in Django's INTERNAL_IPS setting.", url = 'http://python-iptools.googlecode.com', + download_url = 'http://pypi.python.org/packages/source/i/iptools/', author = 'Bryan Davis', author_email = 'casadebender+iptools@gmail.com', license = 'BSD',
0d4fe588023869044755644dfa162c488a7fdea8
setup.py
setup.py
from setuptools import setup, find_packages setup( name='raimon49.guestbook', version='1.0.0', packages=find_packages(), include_package_data=True, install_requires=[ 'Flask', ], entry_points=""" [console_scripts] guestbook = guestbook:main """ )
import os from setuptools import setup, find_packages def read_file(filename): basepath = os.path.dirname(os.path.dirname(__file__)) filepath = os.path.join(basepath, filename) if os.path.exists(filepath): return open(filepath.read()) else: return '' setup( name='raimon49.guestbook', version='1.0.0', description='A guestbook web application.', long_description=read_file('README.rst'), author='raimon49', author_email='raimon49@hotmail.com', url='https://github.com/raimon49/pypro2-guestbook-webapp', classifiers=[ 'Development Status :: 4 - Beta', 'Framework :: Flask', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', ] packages=find_packages(), include_package_data=True, keywords=['web', 'guestbook'], License='BSD License', install_requires=[ 'Flask', ], entry_points=""" [console_scripts] guestbook = guestbook:main """ )
Update meta data for distributed PyPI
Update meta data for distributed PyPI
Python
bsd-3-clause
raimon49/pypro2-guestbook-webapp,raimon49/pypro2-guestbook-webapp
--- +++ @@ -1,11 +1,35 @@ +import os from setuptools import setup, find_packages + + +def read_file(filename): + basepath = os.path.dirname(os.path.dirname(__file__)) + filepath = os.path.join(basepath, filename) + if os.path.exists(filepath): + return open(filepath.read()) + else: + return '' setup( name='raimon49.guestbook', version='1.0.0', + description='A guestbook web application.', + long_description=read_file('README.rst'), + author='raimon49', + author_email='raimon49@hotmail.com', + url='https://github.com/raimon49/pypro2-guestbook-webapp', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Framework :: Flask', + 'License :: OSI Approved :: BSD License', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2.7', + ] packages=find_packages(), include_package_data=True, + keywords=['web', 'guestbook'], + License='BSD License', install_requires=[ 'Flask', ],
42418b638a581b0243182e8a4e24662c7e7cc003
setup.py
setup.py
#!/usr/bin/python import setuptools from setuptools import find_packages setuptools.setup( name = 'js.handlebars', version = '1.0.rc.1', license = 'BSD', description = 'Fanstatic package for Handlebars.js', long_description = open('README.txt').read(), author = 'Matt Good', author_email = 'matt@matt-good.net', url = 'http://github.com/mgood/js.handlebars/', platforms = 'any', packages=find_packages(), namespace_packages=['js'], zip_safe = False, install_requires=[ 'fanstatic', ], entry_points={ 'fanstatic.libraries': [ 'handlebars = js.handlebars:library', ], }, )
#!/usr/bin/python import setuptools from setuptools import find_packages setuptools.setup( name = 'js.handlebars', version = '1.0.rc.1-1', license = 'BSD', description = 'Fanstatic package for Handlebars.js', long_description = open('README.txt').read(), author = 'Matt Good', author_email = 'matt@matt-good.net', url = 'http://github.com/mgood/js.handlebars/', platforms = 'any', packages=find_packages(), namespace_packages=['js'], include_package_data=True, zip_safe = False, install_requires=[ 'fanstatic', ], entry_points={ 'fanstatic.libraries': [ 'handlebars = js.handlebars:library', ], }, )
Fix including JS resources as package data
Fix including JS resources as package data
Python
bsd-2-clause
mgood/js.handlebars,mgood/js.handlebars
--- +++ @@ -5,7 +5,7 @@ setuptools.setup( name = 'js.handlebars', - version = '1.0.rc.1', + version = '1.0.rc.1-1', license = 'BSD', description = 'Fanstatic package for Handlebars.js', long_description = open('README.txt').read(), @@ -15,6 +15,7 @@ platforms = 'any', packages=find_packages(), namespace_packages=['js'], + include_package_data=True, zip_safe = False, install_requires=[ 'fanstatic',
a7f24ba803c13bf7b263aed4d974ad604d53df2f
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages __author__ = "Nitrax <nitrax@lokisec.fr>" __copyright__ = "Copyright 2017, Legobot" description = 'Lego providing networking tools' name = 'legos.nettools' setup( name=name, version='0.1.0', namespace_packages=name.split('.')[:-1], license='MIT', description=description, author='Nitrax', url='https://github.com/Legobot/' + name, install_requires=['legobot>=1.1.4,<=2.0.0', 'python-whois', 'urllib3', 'bandit==1.3.0', 'flake8==3.2.1', 'pytest==3.0.5' ], classifiers=[ 'License :: MIT', 'Programming Language :: Python :: 3' ], packages=find_packages() )
#!/usr/bin/env python from setuptools import setup, find_packages __author__ = "Nitrax <nitrax@lokisec.fr>" __copyright__ = "Copyright 2017, Legobot" description = 'Lego providing networking tools' name = 'legos.nettools' setup( name=name, version='0.1.0', namespace_packages=name.split('.')[:-1], license='MIT', description=description, author='Nitrax', url='https://github.com/Legobot/' + name, install_requires=['legobot>=1.1.4,<=2.0.0', 'python-whois', 'urllib3', 'bandit==1.3.0', 'flake8==3.2.1', 'pytest==3.0.5' ], classifiers=[ 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3' ], packages=find_packages() )
Fix trove classifier for pypi
Fix trove classifier for pypi
Python
mit
Legobot/legos.nettools
--- +++ @@ -23,8 +23,7 @@ 'pytest==3.0.5' ], classifiers=[ - 'License :: MIT', - + 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3' ], packages=find_packages()
f7784f2023e8f351c539586c56d2f9ec3a9086e1
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup install_requires = [ 'argparse', 'jsonschema', 'mock', 'M2Crypto', 'pycrypto', 'python-augeas', 'python2-pythondialog', 'requests', ] docs_extras = [ 'Sphinx', ] testing_extras = [ 'coverage', 'nose', 'nosexcover', 'pylint', 'tox', ] setup( name="letsencrypt", version="0.1", description="Let's Encrypt", author="Let's Encrypt Project", license="", url="https://letsencrypt.org", packages=[ 'letsencrypt', 'letsencrypt.client', 'letsencrypt.scripts', ], install_requires=install_requires, tests_require=install_requires, test_suite='letsencrypt', extras_require={ 'docs': docs_extras, 'testing': testing_extras, }, entry_points={ 'console_scripts': [ 'letsencrypt = letsencrypt.scripts.main:main', ], }, zip_safe=False, include_package_data=True, )
#!/usr/bin/env python from setuptools import setup install_requires = [ 'argparse', 'jsonschema', 'M2Crypto', 'mock', 'pycrypto', 'python-augeas', 'python2-pythondialog', 'requests', ] docs_extras = [ 'Sphinx', ] testing_extras = [ 'coverage', 'nose', 'nosexcover', 'pylint', 'tox', ] setup( name="letsencrypt", version="0.1", description="Let's Encrypt", author="Let's Encrypt Project", license="", url="https://letsencrypt.org", packages=[ 'letsencrypt', 'letsencrypt.client', 'letsencrypt.scripts', ], install_requires=install_requires, tests_require=install_requires, test_suite='letsencrypt', extras_require={ 'docs': docs_extras, 'testing': testing_extras, }, entry_points={ 'console_scripts': [ 'letsencrypt = letsencrypt.scripts.main:main', ], }, zip_safe=False, include_package_data=True, )
Fix lexicographic order in install_requires
Fix lexicographic order in install_requires
Python
apache-2.0
Jadaw1n/letsencrypt,TheBoegl/letsencrypt,Sveder/letsencrypt,tdfischer/lets-encrypt-preview,letsencrypt/letsencrypt,hsduk/lets-encrypt-preview,mrb/letsencrypt,bsmr-misc-forks/letsencrypt,mrb/letsencrypt,beermix/letsencrypt,PeterMosmans/letsencrypt,lbeltrame/letsencrypt,wteiken/letsencrypt,bsmr-misc-forks/letsencrypt,TheBoegl/letsencrypt,martindale/letsencrypt,goofwear/letsencrypt,letsencrypt/letsencrypt,riseofthetigers/letsencrypt,sjerdo/letsencrypt,rlustin/letsencrypt,diracdeltas/lets-encrypt-preview,jtl999/certbot,tdfischer/lets-encrypt-preview,luorenjin/letsencrypt,lmcro/letsencrypt,deserted/letsencrypt,rutsky/letsencrypt,dietsche/letsencrypt,BillKeenan/lets-encrypt-preview,VladimirTyrin/letsencrypt,stewnorriss/letsencrypt,sapics/letsencrypt,BillKeenan/lets-encrypt-preview,beermix/letsencrypt,lmcro/letsencrypt,Sveder/letsencrypt,skynet/letsencrypt,sjerdo/letsencrypt,sapics/letsencrypt,hsduk/lets-encrypt-preview,Hasimir/letsencrypt,deserted/letsencrypt,stewnorriss/letsencrypt,brentdax/letsencrypt,tyagi-prashant/letsencrypt,mitnk/letsencrypt,VladimirTyrin/letsencrypt,ghyde/letsencrypt,solidgoldbomb/letsencrypt,jmaurice/letsencrypt,stweil/letsencrypt,armersong/letsencrypt,modulexcite/letsencrypt,vcavallo/letsencrypt,goofwear/letsencrypt,jmaurice/letsencrypt,hlieberman/letsencrypt,kevinlondon/letsencrypt,g1franc/lets-encrypt-preview,Jadaw1n/letsencrypt,ahojjati/letsencrypt,jmhodges/letsencrypt,bestwpw/letsencrypt,luorenjin/letsencrypt,jtl999/certbot,twstrike/le_for_patching,fmarier/letsencrypt,tyagi-prashant/letsencrypt,piru/letsencrypt,modulexcite/letsencrypt,jsha/letsencrypt,solidgoldbomb/letsencrypt,kevinlondon/letsencrypt,jmhodges/letsencrypt,rugk/letsencrypt,xgin/letsencrypt,brentdax/letsencrypt,digideskio/lets-encrypt-preview,ruo91/letsencrypt,thanatos/lets-encrypt-preview,Jonadabe/letsencrypt,jsha/letsencrypt,stweil/letsencrypt,Bachmann1234/letsencrypt,riseofthetigers/letsencrypt,kuba/letsencrypt,Jonadabe/letsencrypt,xgin/letsencrypt,Hasimir/letsencrypt,BKreisel/letsencrypt,lbeltrame/letsencrypt,DavidGarciaCat/letsencrypt,ruo91/letsencrypt,Bachmann1234/letsencrypt,piru/letsencrypt,bestwpw/letsencrypt,g1franc/lets-encrypt-preview,twstrike/le_for_patching,PeterMosmans/letsencrypt,skynet/letsencrypt,hlieberman/letsencrypt,digideskio/lets-encrypt-preview,martindale/letsencrypt,mitnk/letsencrypt,wteiken/letsencrypt,diracdeltas/lets-encrypt-preview,vcavallo/letsencrypt,dietsche/letsencrypt,ahojjati/letsencrypt,thanatos/lets-encrypt-preview,fmarier/letsencrypt,ghyde/letsencrypt,kuba/letsencrypt,DavidGarciaCat/letsencrypt,rutsky/letsencrypt,armersong/letsencrypt,rugk/letsencrypt,BKreisel/letsencrypt,rlustin/letsencrypt
--- +++ @@ -5,8 +5,8 @@ install_requires = [ 'argparse', 'jsonschema', + 'M2Crypto', 'mock', - 'M2Crypto', 'pycrypto', 'python-augeas', 'python2-pythondialog',
84ded02cba3caee164e848c1200e46b08011f93f
setup.py
setup.py
from setuptools import setup, find_packages version = '1.0.17' requires = [ 'neo4j-driver<1.2.0', 'six>=1.10.0', ] testing_requires = [ 'nose', 'coverage', 'nosexcover', ] setup( name='norduniclient', version=version, url='https://github.com/NORDUnet/python-norduniclient', license='Apache License, Version 2.0', author='Johan Lundberg', author_email='lundberg@nordu.net', description='Neo4j (>=3.2.2) database client using bolt for NORDUnet network inventory', packages=find_packages(), zip_safe=False, install_requires=requires, tests_require=testing_requires, test_suite='nose.collector', extras_require={ 'testing': testing_requires } )
from setuptools import setup, find_packages version = '1.0.17' requires = [ 'neo4j-driver<1.5,0', 'six>=1.10.0', ] testing_requires = [ 'nose', 'coverage', 'nosexcover', ] setup( name='norduniclient', version=version, url='https://github.com/NORDUnet/python-norduniclient', license='Apache License, Version 2.0', author='Johan Lundberg', author_email='lundberg@nordu.net', description='Neo4j (>=3.2.2) database client using bolt for NORDUnet network inventory', packages=find_packages(), zip_safe=False, install_requires=requires, tests_require=testing_requires, test_suite='nose.collector', extras_require={ 'testing': testing_requires } )
Update requirement neo4j-driver to <1.5.0
Update requirement neo4j-driver to <1.5.0
Python
apache-2.0
NORDUnet/python-norduniclient,NORDUnet/python-norduniclient
--- +++ @@ -3,7 +3,7 @@ version = '1.0.17' requires = [ - 'neo4j-driver<1.2.0', + 'neo4j-driver<1.5,0', 'six>=1.10.0', ]
8476597698e6f21404e784b43f21f01d93c5b576
setup.py
setup.py
#!/usr/bin/env python import nirvana try: from setuptools import setup except ImportError: from distutils.core import setup with open('README.rst') as readme: long_description = readme.read() setup( name='nirvana', version=nirvana.__version__, description=('Library for interacting with the Nirvana task manager ' '(nirvanahq.com)'), long_description=long_description, author='Nick Wilson', author_email='nick@njwilson.net', url='http://github.com/njwilson/nirvana-python', license='MIT', packages=['nirvana'], classifiers=[ 'Development Status :: 1 - Planning', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', ], )
#!/usr/bin/env python import nirvana try: from setuptools import setup except ImportError: from distutils.core import setup with open('README.rst') as readme: long_description = readme.read() setup( name='nirvana', version=nirvana.__version__, description=('Library for interacting with the Nirvana task manager ' '(nirvanahq.com)'), long_description=long_description, author='Nick Wilson', author_email='nick@njwilson.net', url='http://nirvana-python.readthedocs.org', license='MIT', packages=['nirvana'], classifiers=[ 'Development Status :: 1 - Planning', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', ], )
Update project URL to readthedocs
Update project URL to readthedocs
Python
mit
njwilson/nirvana-python,njwilson/nirvana-python
--- +++ @@ -18,7 +18,7 @@ long_description=long_description, author='Nick Wilson', author_email='nick@njwilson.net', - url='http://github.com/njwilson/nirvana-python', + url='http://nirvana-python.readthedocs.org', license='MIT', packages=['nirvana'], classifiers=[
dd063b68311209c51018cad7e9c91d2c6b4eef3c
setup.py
setup.py
# coding:utf-8 from setuptools import setup, find_packages from qingstor.qsctl import __version__ setup( name='qsctl', version=__version__, description='Advanced command line tool for QingStor.', long_description=open('README.rst', 'rb').read().decode('utf-8'), keywords='yunify qingcloud qingstor qsctl object_storage', author='QingStor Dev Team', author_email='qs-devel@yunify.com', url='https://www.qingstor.com', scripts=['bin/qsctl', 'bin/qsctl.cmd'], packages=find_packages('.'), package_dir={'qsctl': 'qingstor'}, namespace_packages=['qingstor'], include_package_data=True, install_requires=[ 'argparse >= 1.1', 'PyYAML >= 3.1', 'qingstor-sdk >= 2.1.0', 'docutils >= 0.10', 'tqdm >= 4.0.0' ])
# coding:utf-8 from sys import version_info from setuptools import setup, find_packages from qingstor.qsctl import __version__ install_requires = [ 'argparse >= 1.1', 'PyYAML >= 3.1', 'qingstor-sdk >= 2.1.0', 'docutils >= 0.10', 'tqdm >= 4.0.0' ] if version_info[:3] < (2, 7, 9): install_requires.append("requests[security]") setup( name='qsctl', version=__version__, description='Advanced command line tool for QingStor.', long_description=open('README.rst', 'rb').read().decode('utf-8'), keywords='yunify qingcloud qingstor qsctl object_storage', author='QingStor Dev Team', author_email='qs-devel@yunify.com', url='https://www.qingstor.com', scripts=['bin/qsctl', 'bin/qsctl.cmd'], packages=find_packages('.'), package_dir={'qsctl': 'qingstor'}, namespace_packages=['qingstor'], include_package_data=True, install_requires=install_requires )
Fix SSL Warnings with old python versions
Fix SSL Warnings with old python versions Signed-off-by: Xuanwo <9d9ffaee821234cdfed458cf06eb6f407f8dbe47@yunify.com>
Python
apache-2.0
yunify/qsctl,Fiile/qsctl
--- +++ @@ -1,7 +1,19 @@ # coding:utf-8 +from sys import version_info from setuptools import setup, find_packages from qingstor.qsctl import __version__ + +install_requires = [ + 'argparse >= 1.1', + 'PyYAML >= 3.1', + 'qingstor-sdk >= 2.1.0', + 'docutils >= 0.10', + 'tqdm >= 4.0.0' +] + +if version_info[:3] < (2, 7, 9): + install_requires.append("requests[security]") setup( name='qsctl', @@ -17,10 +29,5 @@ package_dir={'qsctl': 'qingstor'}, namespace_packages=['qingstor'], include_package_data=True, - install_requires=[ - 'argparse >= 1.1', - 'PyYAML >= 3.1', - 'qingstor-sdk >= 2.1.0', - 'docutils >= 0.10', - 'tqdm >= 4.0.0' - ]) + install_requires=install_requires +)
8692eef51cf9b77aa0d6d09eec4bc4f36850d902
setup.py
setup.py
from setuptools import setup, find_packages setup( name='django-force-logout', url="https://chris-lamb.co.uk/projects/django-force-logout", version='2.0.0', description="Framework to be able to forcibly log users out of Django projects", author="Chris Lamb", author_email='chris@chris-lamb.co.uk', license="BSD", packages=find_packages(), )
from setuptools import setup, find_packages setup( name='django-force-logout', url="https://chris-lamb.co.uk/projects/django-force-logout", version='2.0.0', description="Framework to be able to forcibly log users out of Django projects", author="Chris Lamb", author_email='chris@chris-lamb.co.uk', license="BSD", packages=find_packages(), install_requires=( 'Django>=1.8', ), )
Update Django requirement to latest LTS
Update Django requirement to latest LTS
Python
bsd-3-clause
lamby/django-force-logout
--- +++ @@ -12,4 +12,8 @@ license="BSD", packages=find_packages(), + + install_requires=( + 'Django>=1.8', + ), )
15e66e00be22d7177fcba292720f55f548839469
packages/dependencies/intel_quicksync_mfx.py
packages/dependencies/intel_quicksync_mfx.py
{ 'repo_type' : 'git', 'url' : 'https://github.com/lu-zero/mfx_dispatch.git', 'conf_system' : 'cmake', 'source_subfolder' : '_build', 'configure_options' : '.. {cmake_prefix_options} -DCMAKE_INSTALL_PREFIX={target_prefix} -DBUILD_SHARED_LIBS=0 -DCMAKE_BUILD_TYPE=Release', '_info' : { 'version' : None, 'fancy_name' : 'intel_quicksync_mfx' }, }
{ 'repo_type' : 'git', 'do_not_bootstrap' : True, 'run_post_patch' : [ 'autoreconf -fiv', ], 'patches' : [ ( 'mfx/mfx-0001-mingwcompat-disable-va.patch', '-p1' ), ], 'url' : 'https://github.com/lu-zero/mfx_dispatch.git', 'configure_options' : '{autoconf_prefix_options} --without-libva_drm --without-libva_x11', '_info' : { 'version' : None, 'fancy_name' : 'intel_quicksync_mfx' }, }
Revert "packages/quicksync-mfx: switch to cmake"
Revert "packages/quicksync-mfx: switch to cmake" This reverts commit b3db211b42f26480fe817d26d7515ec8bd6e5c9e.
Python
mpl-2.0
DeadSix27/python_cross_compile_script
--- +++ @@ -1,8 +1,13 @@ { 'repo_type' : 'git', + 'do_not_bootstrap' : True, + 'run_post_patch' : [ + 'autoreconf -fiv', + ], + 'patches' : [ + ( 'mfx/mfx-0001-mingwcompat-disable-va.patch', '-p1' ), + ], 'url' : 'https://github.com/lu-zero/mfx_dispatch.git', - 'conf_system' : 'cmake', - 'source_subfolder' : '_build', - 'configure_options' : '.. {cmake_prefix_options} -DCMAKE_INSTALL_PREFIX={target_prefix} -DBUILD_SHARED_LIBS=0 -DCMAKE_BUILD_TYPE=Release', + 'configure_options' : '{autoconf_prefix_options} --without-libva_drm --without-libva_x11', '_info' : { 'version' : None, 'fancy_name' : 'intel_quicksync_mfx' }, }
5ffdfd7eb103d6974c3fb782eecaf457f53c972f
setup.py
setup.py
import os from distutils.core import setup version = '0.9.3' def read_file(name): return open(os.path.join(os.path.dirname(__file__), name)).read() readme = read_file('README.rst') changes = read_file('CHANGES') setup( name='django-maintenancemode', version=version, description='Django-maintenancemode allows you to temporary shutdown your site for maintenance work', long_description='\n\n'.join([readme, changes]), author='Remco Wendt', author_email='remco@maykinmedia.nl', license="BSD", platforms=["any"], url='https://github.com/shanx/django-maintenancemode', packages=[ 'maintenancemode', 'maintenancemode.conf', 'maintenancemode.conf.settings', 'maintenancemode.conf.urls', 'maintenancemode.tests', 'maintenancemode.views', ], package_data={ 'maintenancemode': [ 'tests/templates/503.html', ], }, 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', ], )
import os from distutils.core import setup version = '0.9.3' here = os.path.abspath(os.path.dirname(__file__)) def read_file(name): return open(os.path.join(here, name)).read() readme = read_file('README.rst') changes = read_file('CHANGES') setup( name='django-maintenancemode', version=version, description='Django-maintenancemode allows you to temporary shutdown your site for maintenance work', long_description='\n\n'.join([readme, changes]), author='Remco Wendt', author_email='remco@maykinmedia.nl', license="BSD", platforms=["any"], url='https://github.com/shanx/django-maintenancemode', packages=[ 'maintenancemode', 'maintenancemode.conf', 'maintenancemode.conf.settings', 'maintenancemode.conf.urls', 'maintenancemode.tests', 'maintenancemode.views', ], package_data={ 'maintenancemode': [ 'tests/templates/503.html', ], }, 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', ], )
Use the absolute path for the long description to work around CI issues.
Use the absolute path for the long description to work around CI issues.
Python
bsd-3-clause
aarsan/django-maintenancemode,shanx/django-maintenancemode,aarsan/django-maintenancemode,21strun/django-maintenancemode,shanx/django-maintenancemode,21strun/django-maintenancemode
--- +++ @@ -3,10 +3,10 @@ version = '0.9.3' +here = os.path.abspath(os.path.dirname(__file__)) def read_file(name): - return open(os.path.join(os.path.dirname(__file__), - name)).read() + return open(os.path.join(here, name)).read() readme = read_file('README.rst') changes = read_file('CHANGES')
1224552892d1d459864d5ab2dada328a20cc66e7
jobs/spiders/tvinna.py
jobs/spiders/tvinna.py
import dateutil.parser import scrapy.spiders from jobs.items import JobsItem class TvinnaSpider(scrapy.spiders.XMLFeedSpider): name = "tvinna" start_urls = ['http://www.tvinna.is/feed/?post_type=job_listing'] itertag = 'item' namespaces = [ ('atom', 'http://www.w3.org/2005/Atom'), ('content', 'http://purl.org/rss/1.0/modules/content/'), ('dc', 'http://purl.org/dc/elements/1.1/'), ('slash', 'http://purl.org/rss/1.0/modules/slash/'), ('sy', 'http://purl.org/rss/1.0/modules/syndication/'), ('wfw', 'http://wellformedweb.org/CommentAPI/'), ] def parse_node(self, response, node): item = JobsItem() item['spider'] = self.name item['title'] = node.xpath('title/text()').extract_first() item['company'] = node.xpath('dc:creator/text()').extract_first() item['url'] = node.xpath('link/text()').extract_first() time_posted = node.xpath('pubDate/text()').extract_first() item['posted'] = dateutil.parser.parse(time_posted).isoformat() return item
import dateutil.parser import scrapy import scrapy.spiders from jobs.items import JobsItem class TvinnaSpider(scrapy.spiders.XMLFeedSpider): name = "tvinna" start_urls = ['http://www.tvinna.is/feed/?post_type=job_listing'] itertag = 'item' namespaces = [ ('atom', 'http://www.w3.org/2005/Atom'), ('content', 'http://purl.org/rss/1.0/modules/content/'), ('dc', 'http://purl.org/dc/elements/1.1/'), ('slash', 'http://purl.org/rss/1.0/modules/slash/'), ('sy', 'http://purl.org/rss/1.0/modules/syndication/'), ('wfw', 'http://wellformedweb.org/CommentAPI/'), ] def parse_node(self, response, node): item = JobsItem() item['spider'] = self.name item['title'] = node.xpath('title/text()').extract_first() item['url'] = url = node.xpath('link/text()').extract_first() time_posted = node.xpath('pubDate/text()').extract_first() item['posted'] = dateutil.parser.parse(time_posted).isoformat() request = scrapy.Request(url, callback=self.parse_specific_job) request.meta['item'] = item yield request def parse_specific_job(self, response): item = response.meta['item'] item['company'] = response.css('.company a::text').extract_first() yield item
Fix the extraction of the company name.
Fix the extraction of the company name. There's an apparent bug in the Tvinna rss feed, such that the username of the person creating the listing is used in place of a company name in the `<cd:creator>` field. As a work around, we need to visit the job listing page, and extract it from that instead. It requires more requests, but yields more accurate results.
Python
apache-2.0
multiplechoice/workplace
--- +++ @@ -1,4 +1,5 @@ import dateutil.parser +import scrapy import scrapy.spiders from jobs.items import JobsItem @@ -21,8 +22,15 @@ item = JobsItem() item['spider'] = self.name item['title'] = node.xpath('title/text()').extract_first() - item['company'] = node.xpath('dc:creator/text()').extract_first() - item['url'] = node.xpath('link/text()').extract_first() + item['url'] = url = node.xpath('link/text()').extract_first() time_posted = node.xpath('pubDate/text()').extract_first() item['posted'] = dateutil.parser.parse(time_posted).isoformat() - return item + + request = scrapy.Request(url, callback=self.parse_specific_job) + request.meta['item'] = item + yield request + + def parse_specific_job(self, response): + item = response.meta['item'] + item['company'] = response.css('.company a::text').extract_first() + yield item
166015e9b4cad5b9d00df31e0d242c335c93ab79
setup.py
setup.py
#!/usr/bin/env python # Standard library modules. import os # Third party modules. from setuptools import setup, find_packages # Local modules. import versioneer # Globals and constants variables. BASEDIR = os.path.abspath(os.path.dirname(__file__)) # Get the long description from the relevant file with open(os.path.join(BASEDIR, 'README.rst'), 'r') as f: long_description = f.read() setup(name='matplotlib-scalebar', version=versioneer.get_version(), description='Artist for matplotlib to display a scale bar', long_description=long_description, author='Philippe Pinard', author_email='philippe.pinard@gmail.com', maintainer='Philippe Pinard', maintainer_email='philippe.pinard@gmail.com', url='https://github.com/ppinard/matplotlib-scalebar', license='BSD', keywords='matplotlib scale micron bar', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3', 'Topic :: Scientific/Engineering :: Visualization' ], packages=find_packages(), package_data={}, install_requires=['matplotlib'], zip_safe=True, test_suite='nose.collector', cmdclass=versioneer.get_cmdclass(), )
#!/usr/bin/env python # Standard library modules. from pathlib import Path # Third party modules. from setuptools import setup, find_packages # Local modules. import versioneer # Globals and constants variables. BASEDIR = Path(__file__).parent.resolve() # Get the long description from the relevant file with open(BASEDIR.joinpath("README.rst"), "r") as f: long_description = f.read() setup( name="matplotlib-scalebar", version=versioneer.get_version(), description="Artist for matplotlib to display a scale bar", long_description=long_description, author="Philippe Pinard", author_email="philippe.pinard@gmail.com", maintainer="Philippe Pinard", maintainer_email="philippe.pinard@gmail.com", url="https://github.com/ppinard/matplotlib-scalebar", license="BSD", keywords="matplotlib scale micron bar", classifiers=[ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Visualization", ], packages=find_packages(), package_data={}, install_requires=["matplotlib"], zip_safe=True, test_suite="nose.collector", cmdclass=versioneer.get_cmdclass(), )
Use pathlib instead of os.path
Use pathlib instead of os.path
Python
bsd-2-clause
ppinard/matplotlib-scalebar
--- +++ @@ -1,7 +1,7 @@ #!/usr/bin/env python # Standard library modules. -import os +from pathlib import Path # Third party modules. from setuptools import setup, find_packages @@ -10,44 +10,36 @@ import versioneer # Globals and constants variables. -BASEDIR = os.path.abspath(os.path.dirname(__file__)) +BASEDIR = Path(__file__).parent.resolve() # Get the long description from the relevant file -with open(os.path.join(BASEDIR, 'README.rst'), 'r') as f: +with open(BASEDIR.joinpath("README.rst"), "r") as f: long_description = f.read() -setup(name='matplotlib-scalebar', - version=versioneer.get_version(), - description='Artist for matplotlib to display a scale bar', - long_description=long_description, - - author='Philippe Pinard', - author_email='philippe.pinard@gmail.com', - maintainer='Philippe Pinard', - maintainer_email='philippe.pinard@gmail.com', - - url='https://github.com/ppinard/matplotlib-scalebar', - license='BSD', - keywords='matplotlib scale micron bar', - - classifiers=[ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Topic :: Scientific/Engineering :: Visualization' - ], - - packages=find_packages(), - package_data={}, - - install_requires=['matplotlib'], - - zip_safe=True, - - test_suite='nose.collector', - - cmdclass=versioneer.get_cmdclass(), - - ) +setup( + name="matplotlib-scalebar", + version=versioneer.get_version(), + description="Artist for matplotlib to display a scale bar", + long_description=long_description, + author="Philippe Pinard", + author_email="philippe.pinard@gmail.com", + maintainer="Philippe Pinard", + maintainer_email="philippe.pinard@gmail.com", + url="https://github.com/ppinard/matplotlib-scalebar", + license="BSD", + keywords="matplotlib scale micron bar", + classifiers=[ + "Development Status :: 4 - Beta", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering :: Visualization", + ], + packages=find_packages(), + package_data={}, + install_requires=["matplotlib"], + zip_safe=True, + test_suite="nose.collector", + cmdclass=versioneer.get_cmdclass(), +)
def2ab4a860a48222fa26ede36c9a47622aa5209
setup.py
setup.py
#!/usr/bin/env python # # Setup script for Django Evolution from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages from setuptools.command.test import test from django_evolution import get_package_version, VERSION def run_tests(*args): import os os.system('tests/runtests.py') test.run_tests = run_tests PACKAGE_NAME = 'django_evolution' download_url = ( 'http://downloads.reviewboard.org/releases/django-evolution/%s.%s/' % (VERSION[0], VERSION[1])) # Build the package setup( name=PACKAGE_NAME, version=get_package_version(), description='A database schema evolution tool for the Django web framework.', url='http://code.google.com/p/django-evolution/', author='Ben Khoo', author_email='khoobks@westnet.com.au', maintainer='Christian Hammond', maintainer_email='christian@beanbaginc.com', download_url=download_url, packages=find_packages(exclude=['tests']), install_requires=[ 'Django>=1.4.10,<1.7.0', ], include_package_data=True, classifiers=[ 'Development Status :: 4 - Beta', 'Framework :: Django', 'Intended Audience :: Developers', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development', 'Topic :: Software Development :: Libraries :: Python Modules', ] )
#!/usr/bin/env python # # Setup script for Django Evolution from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages from setuptools.command.test import test from django_evolution import get_package_version, VERSION def run_tests(*args): import os os.system('tests/runtests.py') test.run_tests = run_tests PACKAGE_NAME = 'django_evolution' download_url = ( 'http://downloads.reviewboard.org/releases/django-evolution/%s.%s/' % (VERSION[0], VERSION[1])) # Build the package setup( name=PACKAGE_NAME, version=get_package_version(), description='A database schema evolution tool for the Django web framework.', url='http://code.google.com/p/django-evolution/', author='Ben Khoo', author_email='khoobks@westnet.com.au', maintainer='Christian Hammond', maintainer_email='christian@beanbaginc.com', download_url=download_url, packages=find_packages(exclude=['tests']), install_requires=[ 'Django>=1.4.10', ], include_package_data=True, classifiers=[ 'Development Status :: 4 - Beta', 'Framework :: Django', 'Intended Audience :: Developers', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development', 'Topic :: Software Development :: Libraries :: Python Modules', ] )
Allow Django Evolution to install along with Django >= 1.7.
Allow Django Evolution to install along with Django >= 1.7. As we're working toward some degree of compatibility with newer versions of Django, we need to ease up on the version restriction. Now's a good time to do so. Django Evolution no longer has an upper bounds on the version range.
Python
bsd-3-clause
beanbaginc/django-evolution
--- +++ @@ -38,7 +38,7 @@ download_url=download_url, packages=find_packages(exclude=['tests']), install_requires=[ - 'Django>=1.4.10,<1.7.0', + 'Django>=1.4.10', ], include_package_data=True, classifiers=[
aa4498eea07bd3a0c09a11782f881312020d725d
setup.py
setup.py
import os from setuptools import setup def read(*paths): """Build a file path from *paths* and return the contents.""" with open(os.path.join(*paths), 'r') as f: return f.read() setup( name='chrome-webstore-deploy', version='0.0.1', description='Automate deployment of Chrome extensions/apps to Chrome Web Store.', long_description=(read('README.rst') + '\n\n'), url='http://github.com/jonnor/chrome-webstore-deploy/', license='MIT', author='Jon Nordby', author_email='jononor@gmail.com', # py_modules=['foo'], scripts=['bin/chrome-webstore.py'], install_requires=[ "oauth2client >= 1.2", "httplib2 >= 0.9", ], include_package_data=True, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Natural Language :: English', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', ], )
import os from setuptools import setup def read(*paths): """Build a file path from *paths* and return the contents.""" with open(os.path.join(*paths), 'r') as f: return f.read() setup( name='chrome-webstore-deploy', version='0.0.2', description='Automate deployment of Chrome extensions/apps to Chrome Web Store.', long_description=(read('README.rst') + '\n\n'), url='http://github.com/jonnor/chrome-webstore-deploy/', license='MIT', author='Jon Nordby', author_email='jononor@gmail.com', # py_modules=['foo'], scripts=['bin/chrome-web-store.py'], install_requires=[ "oauth2client >= 1.2", "httplib2 >= 0.9", ], include_package_data=True, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Natural Language :: English', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', ], )
Fix typo in script packaging
Fix typo in script packaging
Python
mit
jonnor/chrome-webstore-deploy
--- +++ @@ -9,7 +9,7 @@ setup( name='chrome-webstore-deploy', - version='0.0.1', + version='0.0.2', description='Automate deployment of Chrome extensions/apps to Chrome Web Store.', long_description=(read('README.rst') + '\n\n'), url='http://github.com/jonnor/chrome-webstore-deploy/', @@ -17,7 +17,7 @@ author='Jon Nordby', author_email='jononor@gmail.com', # py_modules=['foo'], - scripts=['bin/chrome-webstore.py'], + scripts=['bin/chrome-web-store.py'], install_requires=[ "oauth2client >= 1.2", "httplib2 >= 0.9",
838d83df29b905110f8bd317e08eaaa64e97f402
setup.py
setup.py
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.18', packages=['todoist', 'todoist.managers'], author='Doist Team', author_email='info@todoist.com', license='BSD', description='todoist-python - The official Todoist Python API library', long_description = read('README.md'), install_requires=[ 'requests', ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', ), )
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.19', packages=['todoist', 'todoist.managers'], author='Doist Team', author_email='info@todoist.com', license='BSD', description='todoist-python - The official Todoist Python API library', long_description = read('README.md'), install_requires=[ 'requests', ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', ), )
Update the PyPI version to 0.2.19.
Update the PyPI version to 0.2.19.
Python
mit
Doist/todoist-python
--- +++ @@ -10,7 +10,7 @@ setup( name='todoist-python', - version='0.2.18', + version='0.2.19', packages=['todoist', 'todoist.managers'], author='Doist Team', author_email='info@todoist.com',
d56f3d77b8e9883df0b9c4199f74ca36b39f44ef
setup.py
setup.py
from setuptools import find_packages from setuptools import setup def get_long_description(): with open('README.md') as readme_file: return readme_file.read() setup( name="RouterOS-api", version='0.16.1.dev0', description='Python API to RouterBoard devices produced by MikroTik.', long_description=get_long_description(), long_description_content_type='text/markdown', author='Social WiFi', author_email='it@socialwifi.com', url='https://github.com/socialwifi/RouterOS-api', packages=find_packages(), test_suite="tests", license="MIT", install_requires=['six'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: MIT 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', 'Programming Language :: Python :: 3.7', ], )
import sys from setuptools import find_packages from setuptools import setup requirements = ['six'] if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and sys.version_info[1] < 3): requirements.append('ipaddress') def get_long_description(): with open('README.md') as readme_file: return readme_file.read() setup( name="RouterOS-api", version='0.16.1.dev0', description='Python API to RouterBoard devices produced by MikroTik.', long_description=get_long_description(), long_description_content_type='text/markdown', author='Social WiFi', author_email='it@socialwifi.com', url='https://github.com/socialwifi/RouterOS-api', packages=find_packages(), test_suite="tests", license="MIT", install_requires=requirements, classifiers=[ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: MIT 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', 'Programming Language :: Python :: 3.7', ], )
Add ipaddress requirement to python older than 3.3
Add ipaddress requirement to python older than 3.3
Python
mit
socialwifi/RouterOS-api,pozytywnie/RouterOS-api
--- +++ @@ -1,6 +1,12 @@ +import sys + from setuptools import find_packages from setuptools import setup +requirements = ['six'] + +if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and sys.version_info[1] < 3): + requirements.append('ipaddress') def get_long_description(): with open('README.md') as readme_file: @@ -19,7 +25,7 @@ packages=find_packages(), test_suite="tests", license="MIT", - install_requires=['six'], + install_requires=requirements, classifiers=[ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: MIT License',
5e3253217a971a996aa182f199c8f1413aa7bc40
setup.py
setup.py
from setuptools import find_packages, setup VERSION = '1.0.0' setup( name='django-fakery', version=VERSION, url='https://github.com/fcurella/django-factory/', author='Flavio Curella', author_email='flavio.curella@gmail.com', description='A model instances generator for Django', license='MIT', packages=find_packages(exclude=['*.tests']), platforms=["any"], classifiers=[ 'Development Status :: 4 - Beta', 'Framework :: Django', 'License :: OSI Approved :: MIT 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', ], install_requires=[ "fake-factory==0.5.3", "Django>=1.7", ], test_suite='django_fakery.tests.runtests.runtests', )
from setuptools import find_packages, setup VERSION = '1.0.0' setup( name='django-fakery', version=VERSION, url='https://github.com/fcurella/django-factory/', author='Flavio Curella', author_email='flavio.curella@gmail.com', description='A model instances generator for Django', license='MIT', packages=find_packages(exclude=['*.tests']), platforms=["any"], classifiers=[ 'Development Status :: 4 - Beta', 'Framework :: Django', 'License :: OSI Approved :: MIT 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', ], install_requires=[ "fake-factory==0.5.3", "Django>=1.7", ], test_suite='django_fakery.tests.runtests.runtests', )
Remove trove classifier for python 3.5
Remove trove classifier for python 3.5
Python
mit
fcurella/django-fakery
--- +++ @@ -23,7 +23,6 @@ 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', ], install_requires=[ "fake-factory==0.5.3",
7e0c61aa54dd26760aba0d78926b599d5b8f6d5f
tests/__init__.py
tests/__init__.py
# This file needs to exist in order for pytest-cov to work. # See this: https://bitbucket.org/memedough/pytest-cov/issues/4/no-coverage-unless-test-directory-has-an
Add explanation of what was not working before.
Add explanation of what was not working before.
Python
mit
praveenv253/sht,praveenv253/sht
--- +++ @@ -0,0 +1,2 @@ +# This file needs to exist in order for pytest-cov to work. +# See this: https://bitbucket.org/memedough/pytest-cov/issues/4/no-coverage-unless-test-directory-has-an
1c4e929e0a915a5a2610862ee2ef1c57495392c5
setup.py
setup.py
#!/usr/bin/env python #pandoc -f rst -t markdown README.mkd -o README import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='mass', version='0.1.2', description='Merge and Simplify Scripts: an automated tool for managing, combining and minifying javascript assets for web projects.', long_description=read('README'), author='jack boberg alex padgett', author_email='info@codedbyhand.com', url='https://github.com/coded-by-hand/mass', license='BSD License', platforms=['Mac OSX'], packages=['mass'], install_requires=['distribute','jsmin','macfsevents'], zip_safe = False, entry_points = { 'console_scripts': [ "mass = mass.monitor:main" ], } )
#!/usr/bin/env python #pandoc -t rst -f markdown README.mkd -o README import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='mass', version='0.1.3', description='Merge and Simplify Scripts: an automated tool for managing, combining and minifying javascript assets for web projects.', long_description=read('README'), author='jack boberg alex padgett', author_email='info@codedbyhand.com', url='https://github.com/coded-by-hand/mass', license='BSD License', platforms=['Mac OSX'], packages=['mass'], install_requires=['distribute','jsmin','macfsevents'], zip_safe = False, entry_points = { 'console_scripts': [ "mass = mass.monitor:main" ], } )
Fix pandoc statement Update version number
Fix pandoc statement Update version number
Python
bsd-2-clause
coded-by-hand/mass,coded-by-hand/mass
--- +++ @@ -1,6 +1,6 @@ #!/usr/bin/env python -#pandoc -f rst -t markdown README.mkd -o README +#pandoc -t rst -f markdown README.mkd -o README import os from setuptools import setup @@ -10,7 +10,7 @@ setup( name='mass', - version='0.1.2', + version='0.1.3', description='Merge and Simplify Scripts: an automated tool for managing, combining and minifying javascript assets for web projects.', long_description=read('README'), author='jack boberg alex padgett',
ef471f80412d49456725565349bd0e5a09e6e721
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import codecs from setuptools import setup try: # Python 3 from os import dirname except ImportError: # Python 2 from os.path import dirname here = os.path.abspath(dirname(__file__)) with codecs.open(os.path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = '\n' + f.read() if sys.argv[-1] == "publish": os.system("python setup.py sdist bdist_wheel upload") sys.exit() required = [ 'humanize', 'pytz', 'dateparser', 'ruamel.yaml', 'tzlocal', 'pendulum' ] setup( name='maya', version='0.3.1', description='Datetimes for Humans.', long_description=long_description, author='Kenneth Reitz', author_email='me@kennethreitz.org', url='https://github.com/kennethreitz/maya', packages=['maya'], install_requires=required, license='MIT', classifiers=( ), )
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import codecs from setuptools import setup try: # Python 3 from os import dirname except ImportError: # Python 2 from os.path import dirname here = os.path.abspath(dirname(__file__)) with codecs.open(os.path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = '\n' + f.read() if sys.argv[-1] == "publish": os.system("python setup.py sdist bdist_wheel upload") sys.exit() required = [ 'humanize', 'pytz', 'dateparser', 'ruamel.yaml', 'tzlocal', 'pendulum' ] setup( name='maya', version='0.3.1', description='Datetimes for Humans.', long_description=long_description, author='Kenneth Reitz', author_email='me@kennethreitz.org', url='https://github.com/kennethreitz/maya', packages=['maya'], install_requires=required, license='MIT', classifiers=( 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: Implementation', 'Programming Language :: Python :: Implementation :: CPython', 'Topic :: Software Development :: Libraries :: Python Modules' ), )
Add some reasonable trove classifiers
Add some reasonable trove classifiers
Python
mit
kennethreitz/maya,timofurrer/maya,emattiza/maya
--- +++ @@ -45,6 +45,17 @@ install_requires=required, license='MIT', classifiers=( - + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Natural Language :: English', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: Implementation', + 'Programming Language :: Python :: Implementation :: CPython', + 'Topic :: Software Development :: Libraries :: Python Modules' ), )
2800e2cf0a7a998a5081929e6750265f30b09130
tests/test_bql.py
tests/test_bql.py
# -*- coding: utf-8 -*- # Copyright (c) 2010-2014, MIT Probabilistic Computing Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import StringIO import bayeslite.bql as bql import bayeslite.parse as parse import test_smoke def bql2sql(string): with test_smoke.t1() as bdb: phrases = parse.parse_bql_string(string) out = StringIO.StringIO() bql.compile_bql(bdb, phrases, out) return out.getvalue() def test_select_trivial(): assert bql2sql('select 0;') == 'select 0;'
# -*- coding: utf-8 -*- # Copyright (c) 2010-2014, MIT Probabilistic Computing Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import StringIO import bayeslite.bql as bql import bayeslite.parse as parse import test_smoke def bql2sql(string): with test_smoke.t1() as bdb: phrases = parse.parse_bql_string(string) out = StringIO.StringIO() bql.compile_bql(bdb, phrases, out) return out.getvalue() def test_select_trivial(): assert bql2sql('select 0;') == 'select 0;' assert bql2sql('select 0 as z;') == 'select 0 as "z";' assert bql2sql('select * from t;') == 'select * from "t";' assert bql2sql('select t.* from t;') == 'select "t".* from "t";' assert bql2sql('select c from t;') == 'select "c" from "t";' assert bql2sql('select c as d from t;') == 'select "c" as "d" from "t";'
Add some more trivial bql2sql tests.
Add some more trivial bql2sql tests.
Python
apache-2.0
probcomp/bayeslite,probcomp/bayeslite
--- +++ @@ -30,3 +30,8 @@ def test_select_trivial(): assert bql2sql('select 0;') == 'select 0;' + assert bql2sql('select 0 as z;') == 'select 0 as "z";' + assert bql2sql('select * from t;') == 'select * from "t";' + assert bql2sql('select t.* from t;') == 'select "t".* from "t";' + assert bql2sql('select c from t;') == 'select "c" from "t";' + assert bql2sql('select c as d from t;') == 'select "c" as "d" from "t";'
2d6e0710dbc781f54295e18299be6f4c1bb0ec43
jsonmerge/jsonvalue.py
jsonmerge/jsonvalue.py
# vim:ts=4 sw=4 expandtab softtabstop=4 class JSONValue(object): def __init__(self, val=None, ref='#', undef=False): assert not isinstance(val, JSONValue) self.val = val self.ref = ref self.undef = undef def is_undef(self): return self.undef def _subval(self, key, **kwargs): return JSONValue(ref=self.ref+'/'+str(key), **kwargs) def __getitem__(self, key): return self._subval(key, val=self.val[key]) def get(self, key, *args): r = self.val.get(key, *args) if r is None: return self._subval(key, undef=True) else: return self._subval(key, val=r) def __repr__(self): if self.is_undef(): return 'JSONValue(undef=True)' else: return 'JSONValue(%r,%r)' % (self.val, self.ref) def iteritems(self): for k, v in self.val.iteritems(): yield (k, self._subval(k, val=v)) def items(self): return list(self.iteritems()) def __iter__(self): assert isinstance(self.val, list) for i, v in enumerate(self.val): yield self._subval(i, val=v)
# vim:ts=4 sw=4 expandtab softtabstop=4 class JSONValue(object): def __init__(self, val=None, ref='#', undef=False): assert not isinstance(val, JSONValue) self.val = val self.ref = ref self.undef = undef def is_undef(self): return self.undef def _subval(self, key, **kwargs): return JSONValue(ref=self.ref+'/'+str(key), **kwargs) def __getitem__(self, key): return self._subval(key, val=self.val[key]) def get(self, key, *args): r = self.val.get(key, *args) if r is None: return self._subval(key, undef=True) else: return self._subval(key, val=r) def __repr__(self): if self.is_undef(): return 'JSONValue(undef=True)' else: return 'JSONValue(%r,%r)' % (self.val, self.ref) def items(self): for k, v in self.val.items(): yield (k, self._subval(k, val=v)) def __iter__(self): assert isinstance(self.val, list) for i, v in enumerate(self.val): yield self._subval(i, val=v)
Fix Python3 support: remove iteritems
Fix Python3 support: remove iteritems
Python
mit
avian2/jsonmerge
--- +++ @@ -29,12 +29,9 @@ else: return 'JSONValue(%r,%r)' % (self.val, self.ref) - def iteritems(self): - for k, v in self.val.iteritems(): + def items(self): + for k, v in self.val.items(): yield (k, self._subval(k, val=v)) - - def items(self): - return list(self.iteritems()) def __iter__(self): assert isinstance(self.val, list)
707e0be6f7e750e580aecc9bced2cc19b9ccf906
lib/windspharm/__init__.py
lib/windspharm/__init__.py
"""Spherical harmonic vector wind analysis.""" # Copyright (c) 2012-2014 Andrew Dawson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. from __future__ import absolute_import from . import standard from . import tools # List to define the behaviour of imports of the form: # from windspharm import * __all__ = [] # Package version number. __version__ = '1.3.2' try: from . import cdms __all__.append('cdms') metadata = cdms except ImportError: pass try: from . import iris __all__.append('iris') except ImportError: pass
"""Spherical harmonic vector wind analysis.""" # Copyright (c) 2012-2014 Andrew Dawson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. from __future__ import absolute_import from . import standard from . import tools # List to define the behaviour of imports of the form: # from windspharm import * __all__ = [] # Package version number. __version__ = '1.3.x' try: from . import cdms __all__.append('cdms') metadata = cdms except ImportError: pass try: from . import iris __all__.append('iris') except ImportError: pass
Revert version number on release branch.
Revert version number on release branch.
Python
mit
nicolasfauchereau/windspharm,ajdawson/windspharm
--- +++ @@ -29,7 +29,7 @@ __all__ = [] # Package version number. -__version__ = '1.3.2' +__version__ = '1.3.x' try: from . import cdms
188f0ac84e041259585172f5cffc21828ac534e3
setup.py
setup.py
from setuptools import setup setup( name='daffodil', version='0.3.8', author='James Robert', description='A Super-simple DSL for filtering datasets', license='MIT', keywords='data filtering', url='https://github.com/mediapredict/daffodil', packages=['daffodil'], install_requires=[ "parsimonious", ], long_description='A Super-simple DSL for filtering datasets', classifiers=[ 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Topic :: Utilities' ] )
from setuptools import setup setup( name='daffodil', version='0.3.9', author='James Robert', description='A Super-simple DSL for filtering datasets', license='MIT', keywords='data filtering', url='https://github.com/mediapredict/daffodil', packages=['daffodil'], install_requires=[ "parsimonious", ], long_description='A Super-simple DSL for filtering datasets', classifiers=[ 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Topic :: Utilities' ] )
Upgrade version for new optimization
Upgrade version for new optimization (for real this time)
Python
mit
igorkramaric/daffodil,mediapredict/daffodil
--- +++ @@ -2,7 +2,7 @@ setup( name='daffodil', - version='0.3.8', + version='0.3.9', author='James Robert', description='A Super-simple DSL for filtering datasets', license='MIT',
99d3e7972e642050c4586968ba704d46d469e27c
setup.py
setup.py
from setuptools import setup, find_packages setup( # packaging information that is likely to be updated between versions name='icecake', version='0.6.0', packages=['icecake'], py_modules=['cli', 'templates', 'livejs'], entry_points=''' [console_scripts] icecake=icecake.cli:cli ''', install_requires=[ 'Click', 'Jinja2', 'Markdown', 'Pygments', 'python-dateutil', 'watchdog', 'Werkzeug', ], # pypy stuff that is not likely to change between versions url="https://github.com/cbednarski/icecake", author="Chris Bednarski", author_email="banzaimonkey@gmail.com", description="An easy and cool static site generator", license="MIT", long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.5', ], keywords="static site generator builder icecake" )
from setuptools import setup, find_packages from codec import open setup( # packaging information that is likely to be updated between versions name='icecake', version='0.6.0', packages=['icecake'], py_modules=['cli', 'templates', 'livejs'], entry_points=''' [console_scripts] icecake=icecake.cli:cli ''', install_requires=[ 'Click', 'Jinja2', 'Markdown', 'Pygments', 'python-dateutil', 'watchdog', 'Werkzeug', ], # pypy stuff that is not likely to change between versions url="https://github.com/cbednarski/icecake", author="Chris Bednarski", author_email="banzaimonkey@gmail.com", description="An easy and cool static site generator", license="MIT", long_description=open('README.rst', encoding="utf-8").read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.5', ], keywords="static site generator builder icecake" )
Fix encoding error preventing install
Fix encoding error preventing install While running tox the installation of icecake would succeed under Python 2.7.13 but fail under 3.5.2 with an encoding error while trying to read the long description from README.rst. py35 inst-nodeps: /icecake/.tox/dist/icecake-0.6.0.zip ERROR: invocation failed (exit code 1), logfile: /icecake/.tox/py35/log/py35-16.log ERROR: actionid: py35 msg: installpkg cmdargs: ['/icecake/.tox/py35/bin/pip', 'install', '-U', '--no-deps', '/icecake/.tox/dist/icecake-0.6.0.zip'] env: {'TERM': 'xterm', 'VIRTUAL_ENV': '/icecake/.tox/py35', 'SHLVL': '1', 'PYENV_HOOK_PATH': '/.pyenv/pyenv.d:/usr/local/etc/pyenv.d:/etc/pyenv.d:/usr/lib/pyenv/hooks:/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d', 'HOSTNAME': 'cdbe5b1470a0', 'PYENV_VERSION': '2.7.13:3.5.2', 'PYENV_DIR': '/icecake', 'PWD': '/icecake', 'PYTHONHASHSEED': '1135274721', 'PATH': '/icecake/.tox/py35/bin:/.pyenv/versions/2.7.13/bin:/.pyenv/libexec:/.pyenv/plugins/python-build/bin:/.pyenv/plugins/pyenv-virtualenv/bin:/.pyenv/shims:/.pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'HOME': '/root', 'PYENV_ROOT': '/.pyenv'} Processing ./.tox/dist/icecake-0.6.0.zip Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-x3boup3_-build/setup.py", line 29, in <module> long_description=open('README.rst').read(), File "/icecake/.tox/py35/lib/python3.5/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1462: ordinal not in range(128) ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-x3boup3_-build/
Python
mit
cbednarski/icecake,cbednarski/icecake
--- +++ @@ -1,4 +1,5 @@ from setuptools import setup, find_packages +from codec import open setup( # packaging information that is likely to be updated between versions @@ -26,7 +27,7 @@ author_email="banzaimonkey@gmail.com", description="An easy and cool static site generator", license="MIT", - long_description=open('README.rst').read(), + long_description=open('README.rst', encoding="utf-8").read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers',
6d8b2453a77008acb6f6cde002c6bfaea2a75621
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup setup( name='rinse', version='0.0.3', description='Python3 SOAP client built with lxml and requests.', author='Tyson Clugg', author_email='tyson@clugg.net', url='http://github.com/tysonclugg/rinse', license='MIT', packages=['rinse'], classifiers=[ "Programming Language :: Python :: 3", "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", ], )
#!/usr/bin/env python from distutils.core import setup setup( name='rinse', version='0.0.4', description='Python3 SOAP client built with lxml and requests.', author='Tyson Clugg', author_email='tyson@clugg.net', url='http://github.com/tysonclugg/rinse', license='MIT', packages=['rinse'], classifiers=[ "Programming Language :: Python :: 3", "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", ], )
Remove reference to stale source (client.py).
Remove reference to stale source (client.py).
Python
mit
simudream/rinse,thedrow/rinse,MarkusH/rinse,tysonclugg/rinse,funkybob/rinse,MarkusH/rinse,simudream/rinse,tysonclugg/rinse
--- +++ @@ -3,7 +3,7 @@ setup( name='rinse', - version='0.0.3', + version='0.0.4', description='Python3 SOAP client built with lxml and requests.', author='Tyson Clugg', author_email='tyson@clugg.net',
bc0895f318a9297144e31da3647d6fc5716aafc4
setup.py
setup.py
''' Setup script that: /pyquic: - compiles pyquic - copies py_quic into base directory so that we can use the module directly ''' import os import shutil class temp_cd(): def __init__(self, temp_dir): self._temp_dir = temp_dir self._return_dir = os.path.dirname(os.path.realpath(__file__)) def __enter__(self): os.chdir(self._temp_dir) def __exit__(self, type, value, traceback): os.chdir(self._return_dir) def setup_pyquic(): with temp_cd('pyquic/py_quic'): os.system('make') shutil.rmtree('quic/py_quic') shutil.copytree('pyquic/py_quic', 'quic/py_quic') def clean_pyquic(): shutil.rmtree('py_quic') os.system('git submodule update --checkout --remote -f') if __name__ == "__main__": setup_pyquic()
''' Setup script that: /pyquic: - compiles pyquic - copies py_quic into base directory so that we can use the module directly ''' import os import shutil class temp_cd(): def __init__(self, temp_dir): self._temp_dir = temp_dir self._return_dir = os.path.dirname(os.path.realpath(__file__)) def __enter__(self): os.chdir(self._temp_dir) def __exit__(self, type, value, traceback): os.chdir(self._return_dir) def setup_pyquic(): with temp_cd('pyquic/py_quic'): os.system('make') if os.path.exists('quic/py_quic'): shutil.rmtree('quic/py_quic') shutil.copytree('pyquic/py_quic', 'quic/py_quic') def clean_pyquic(): shutil.rmtree('py_quic') os.system('git submodule update --checkout --remote -f') if __name__ == "__main__": setup_pyquic()
Make sure this works the first time you run it
Make sure this works the first time you run it
Python
mit
skggm/skggm,skggm/skggm
--- +++ @@ -22,7 +22,9 @@ with temp_cd('pyquic/py_quic'): os.system('make') - shutil.rmtree('quic/py_quic') + if os.path.exists('quic/py_quic'): + shutil.rmtree('quic/py_quic') + shutil.copytree('pyquic/py_quic', 'quic/py_quic') def clean_pyquic():
e3e0c8dbce7f3c6fb8887f2f9cc2332020d7480b
setup.py
setup.py
from setuptools import setup setup( name='tangled.sqlalchemy', version='0.1a4.dev0', description='Tangled SQLAlchemy integration', long_description=open('README.rst').read(), url='http://tangledframework.org/', download_url='https://github.com/TangledWeb/tangled.sqlalchemy/tags', author='Wyatt Baldwin', author_email='self@wyattbaldwin.com', packages=[ 'tangled', 'tangled.sqlalchemy', ], install_requires=[ 'tangled>=0.1a7', 'SQLAlchemy', ], extras_require={ 'dev': [ 'tangled[dev]>=0.1a7', ], }, 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', ], )
from setuptools import setup setup( name='tangled.sqlalchemy', version='0.1a4.dev0', description='Tangled SQLAlchemy integration', long_description=open('README.rst').read(), url='http://tangledframework.org/', download_url='https://github.com/TangledWeb/tangled.sqlalchemy/tags', author='Wyatt Baldwin', author_email='self@wyattbaldwin.com', packages=[ 'tangled', 'tangled.sqlalchemy', ], install_requires=[ 'tangled>=0.1a9', 'SQLAlchemy', ], extras_require={ 'dev': [ 'tangled[dev]>=0.1a9', ], }, 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', ], )
Upgrade tangled 0.1a7 => 0.1a9
Upgrade tangled 0.1a7 => 0.1a9
Python
mit
TangledWeb/tangled.sqlalchemy
--- +++ @@ -15,12 +15,12 @@ 'tangled.sqlalchemy', ], install_requires=[ - 'tangled>=0.1a7', + 'tangled>=0.1a9', 'SQLAlchemy', ], extras_require={ 'dev': [ - 'tangled[dev]>=0.1a7', + 'tangled[dev]>=0.1a9', ], }, classifiers=[
35c3f9a339a199226b34efae9e78d15e85e5f184
setup.py
setup.py
from setuptools import setup # type: ignore[import] with open("README.md", "r") as fh: long_description = fh.read() setup( name="objname", version="0.11.0", packages=["objname"], package_data={ "objname": ["__init__.py", "py.typed", "_module.py", "test_objname.py"], }, zip_safe=False, author="Alan Cristhian Ruiz", author_email="alan.cristh@gmail.com", description="A library with a base class that " "stores the assigned name of an object.", long_description=long_description, long_description_content_type="text/markdown", classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Software Development', 'Topic :: Software Development :: Object Brokering', 'Typing :: Typed' ], license="MIT", keywords="data structure debug", url="https://github.com/AlanCristhian/objname", )
from setuptools import setup # type: ignore[import] with open("README.md", "r") as fh: long_description = fh.read() setup( name="objname", version="0.12.0", packages=["objname"], package_data={ "objname": ["__init__.py", "py.typed", "_module.py", "test_objname.py"], }, zip_safe=False, author="Alan Cristhian Ruiz", author_email="alan.cristh@gmail.com", description="A library with a base class that " "stores the assigned name of an object.", long_description=long_description, long_description_content_type="text/markdown", classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Software Development', 'Topic :: Software Development :: Object Brokering', 'Typing :: Typed' ], license="MIT", keywords="data structure debug", url="https://github.com/AlanCristhian/objname", )
Document that python 3.10 is supported and update version number.
Document that python 3.10 is supported and update version number.
Python
mit
AlanCristhian/namedobject,AlanCristhian/named
--- +++ @@ -6,7 +6,7 @@ setup( name="objname", - version="0.11.0", + version="0.12.0", packages=["objname"], package_data={ "objname": ["__init__.py", "py.typed", "_module.py", @@ -28,6 +28,7 @@ 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Software Development',
7e341014059c98bdd91a1c876982b8caa47a5586
setup.py
setup.py
from __future__ import with_statement from distutils.core import setup def readme(): try: with open('README.rst') as f: return f.read() except IOError: return setup( name='encodingcontext', version='0.9.0', description='A bad idea about the default encoding', long_description=readme(), py_modules=['encodingcontext'], author='Hong Minhee', author_email='minhee' '@' 'dahlia.kr', url='https://github.com/dahlia/encodingcontext', license='MIT License', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.5', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Programming Language :: Python :: Implementation :: Stackless', 'Topic :: Text Processing' ] )
from __future__ import with_statement from distutils.core import setup import re def readme(): try: with open('README.rst') as f: readme = f.read() except IOError: return return re.sub( r''' (?P<colon> : \n{2,})? \.\. [ ] code-block:: \s+ [^\n]+ \n [^ \t]* \n (?P<block> (?: (?: (?: \t | [ ]{3}) [^\n]* | [ \t]* ) \n)+ ) ''', lambda m: (':' + m.group('colon') if m.group('colon') else '') + '\n'.join(' ' + l for l in m.group('block').splitlines()) + '\n\n', readme, 0, re.VERBOSE ) setup( name='encodingcontext', version='0.9.0', description='A bad idea about the default encoding', long_description=readme(), py_modules=['encodingcontext'], author='Hong Minhee', author_email='minhee' '@' 'dahlia.kr', url='https://github.com/dahlia/encodingcontext', license='MIT License', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.5', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Programming Language :: Python :: Implementation :: Stackless', 'Topic :: Text Processing' ] )
Transform readme into PyPI compliant reST
Transform readme into PyPI compliant reST
Python
mit
dahlia/encodingcontext
--- +++ @@ -1,14 +1,29 @@ from __future__ import with_statement from distutils.core import setup +import re def readme(): try: with open('README.rst') as f: - return f.read() + readme = f.read() except IOError: return + return re.sub( + r''' + (?P<colon> : \n{2,})? + \.\. [ ] code-block:: \s+ [^\n]+ \n + [^ \t]* \n + (?P<block> + (?: (?: (?: \t | [ ]{3}) [^\n]* | [ \t]* ) \n)+ + ) + ''', + lambda m: (':' + m.group('colon') if m.group('colon') else '') + + '\n'.join(' ' + l for l in m.group('block').splitlines()) + + '\n\n', + readme, 0, re.VERBOSE + ) setup(
31fde6b38329252313c40549b9188c584a2eadd7
setup.py
setup.py
from __future__ import print_function try: from setuptools import setup # try first in case it's already there. except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup setup( name='vpython', packages=['vpython'], version='0.2.0b15', description='VPython for Jupyter Notebook', long_description=open('README.md').read(), author='John Coady / Ruth Chabay / Bruce Sherwood / Steve Spicklemire', author_email='bruce.sherwood@gmail.com', url='http://pypi.python.org/pypi/vpython/', license='LICENSE.txt', keywords='vpython', classifiers=[ 'Framework :: IPython', 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Intended Audience :: End Users/Desktop', 'Natural Language :: English', 'Programming Language :: Python', 'Topic :: Multimedia :: Graphics :: 3D Modeling', 'Topic :: Multimedia :: Graphics :: 3D Rendering', 'Topic :: Scientific/Engineering :: Visualization', ], install_requires=['jupyter', 'vpnotebook'], package_data={'vpython': ['data/*']}, )
from __future__ import print_function try: from setuptools import setup # try first in case it's already there. except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup setup( name='vpython', packages=['vpython'], version='0.2.0b16', description='VPython for Jupyter Notebook', long_description=open('README.md').read(), author='John Coady / Ruth Chabay / Bruce Sherwood / Steve Spicklemire', author_email='bruce.sherwood@gmail.com', url='http://pypi.python.org/pypi/vpython/', license='LICENSE.txt', keywords='vpython', classifiers=[ 'Framework :: IPython', 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Intended Audience :: End Users/Desktop', 'Natural Language :: English', 'Programming Language :: Python', 'Topic :: Multimedia :: Graphics :: 3D Modeling', 'Topic :: Multimedia :: Graphics :: 3D Rendering', 'Topic :: Scientific/Engineering :: Visualization', ], install_requires=['jupyter', 'vpnotebook'], package_data={'vpython': ['data/*']}, )
Update version number to 0.2.0b16
Update version number to 0.2.0b16
Python
mit
BruceSherwood/vpython-jupyter,BruceSherwood/vpython-jupyter,BruceSherwood/vpython-jupyter,mwcraig/vpython-jupyter,mwcraig/vpython-jupyter,mwcraig/vpython-jupyter,BruceSherwood/vpython-jupyter,sspickle/vpython-jupyter,mwcraig/vpython-jupyter,sspickle/vpython-jupyter
--- +++ @@ -10,7 +10,7 @@ setup( name='vpython', packages=['vpython'], - version='0.2.0b15', + version='0.2.0b16', description='VPython for Jupyter Notebook', long_description=open('README.md').read(), author='John Coady / Ruth Chabay / Bruce Sherwood / Steve Spicklemire',
5fb38bfb6eae77b7024bf4d9990472f60d576826
setup.py
setup.py
import pathlib from crc import LIBRARY_VERSION from setuptools import setup current = pathlib.Path(__file__).parent.resolve() def readme(): return (current / 'README.md').read_text(encoding='utf-8') if __name__ == '__main__': setup( name='crc', version=LIBRARY_VERSION, py_modules=['crc'], classifiers=[ 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', ], url='https://github.com/Nicoretti/crc', license='BSD', python_requires='>=3.7', author='Nicola Coretti', author_email='nico.coretti@gmail.com', description='Library and CLI to calculate and verify all kinds of CRC checksums.', keywords=['CRC', 'CRC8', 'CRC16', 'CRC32', 'CRC64'], long_description=readme(), long_description_content_type='text/markdown', entry_points={ 'console_scripts': [ 'crc=crc:main', ], } )
import pathlib from crc import LIBRARY_VERSION from setuptools import setup current = pathlib.Path(__file__).parent.resolve() def readme(): return (current / 'README.md').read_text(encoding='utf-8') if __name__ == '__main__': setup( name='crc', version=LIBRARY_VERSION, py_modules=['crc'], classifiers=[ 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', ], url='https://github.com/Nicoretti/crc', license='BSD', python_requires='>=3.7', author='Nicola Coretti', author_email='nico.coretti@gmail.com', description='Library and CLI to calculate and verify all kinds of CRC checksums.', keywords=['CRC', 'CRC8', 'CRC16', 'CRC32', 'CRC64'], long_description=readme(), long_description_content_type='text/markdown', entry_points={ 'console_scripts': [ 'crc=crc:main', ], } )
Update package information about supported python versions
Update package information about supported python versions
Python
bsd-2-clause
Nicoretti/crc
--- +++ @@ -17,6 +17,7 @@ classifiers=[ 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', ], url='https://github.com/Nicoretti/crc', license='BSD',
40a2a4ace817f3f237d87d802d5bd286eb2bf09e
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='syndicate', version='0.99.6', description='A wrapper for REST APIs', author='Justin Mayfield', author_email='tooker@gmail.com', url='https://github.com/mayfield/syndicate/', license='MIT', long_description=open('README.rst').read(), packages=find_packages(), install_requires=[ 'requests', 'python-dateutil', 'tornado', ], test_suite='test', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries', ] )
#!/usr/bin/env python from setuptools import setup, find_packages README = 'README.md' def long_desc(): try: import pypandoc except ImportError: with open(README) as f: return f.read() else: return pypandoc.convert(README, 'rst') setup( name='syndicate', version='0.99.7', description='A wrapper for REST APIs', author='Justin Mayfield', author_email='tooker@gmail.com', url='https://github.com/mayfield/syndicate/', license='MIT', long_description=long_desc(), packages=find_packages(), install_requires=[ 'requests', 'python-dateutil', 'tornado', ], test_suite='test', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries', ] )
Make PyPi long_description look pretty with pandoc (if available).
Make PyPi long_description look pretty with pandoc (if available).
Python
mit
mayfield/syndicate
--- +++ @@ -2,15 +2,26 @@ from setuptools import setup, find_packages +README = 'README.md' + +def long_desc(): + try: + import pypandoc + except ImportError: + with open(README) as f: + return f.read() + else: + return pypandoc.convert(README, 'rst') + setup( name='syndicate', - version='0.99.6', + version='0.99.7', description='A wrapper for REST APIs', author='Justin Mayfield', author_email='tooker@gmail.com', url='https://github.com/mayfield/syndicate/', license='MIT', - long_description=open('README.rst').read(), + long_description=long_desc(), packages=find_packages(), install_requires=[ 'requests',
ae280f4f837a23608749e8a8de1cbba98bafc621
examples/mhs_atmosphere/mhs_atmosphere_plot.py
examples/mhs_atmosphere/mhs_atmosphere_plot.py
# -*- coding: utf-8 -*- """ Created on Fri Jan 9 12:52:31 2015 @author: stuart """ import os import glob import yt model = 'spruit' datadir = os.path.expanduser('~/mhs_atmosphere/'+model+'/') files = glob.glob(datadir+'/*') files.sort() print(files) ds = yt.load(files[0]) slc = yt.SlicePlot(ds, fields='density_bg', normal='x') slc.save('~/yt.png')
# -*- coding: utf-8 -*- """ Created on Fri Jan 9 12:52:31 2015 @author: stuart """ import os import glob import yt model = 'spruit' datadir = os.path.expanduser('~/mhs_atmosphere/'+model+'/') files = glob.glob(datadir+'/*') files.sort() print(files) ds = yt.load(files[0]) # Axes flip for normal='y' #ds.coordinates.x_axis = {0: 2, 1: 0, 2: 1, 'x': 2, 'y': 0, 'z': 1} #ds.coordinates.y_axis = {0: 1, 1: 2, 2: 0, 'x': 1, 'y': 2, 'z': 0} slc = yt.SlicePlot(ds, fields='density_bg', normal='x') slc.save('~/yt.png')
Add x-y flipping code for SlicePlot
Add x-y flipping code for SlicePlot
Python
bsd-2-clause
SWAT-Sheffield/pysac,Cadair/pysac
--- +++ @@ -20,5 +20,9 @@ ds = yt.load(files[0]) +# Axes flip for normal='y' +#ds.coordinates.x_axis = {0: 2, 1: 0, 2: 1, 'x': 2, 'y': 0, 'z': 1} +#ds.coordinates.y_axis = {0: 1, 1: 2, 2: 0, 'x': 1, 'y': 2, 'z': 0} + slc = yt.SlicePlot(ds, fields='density_bg', normal='x') slc.save('~/yt.png')
db362bd50c7b8aa6a40a809346eff70df846f82d
setup.py
setup.py
# coding: utf-8 from setuptools import setup setup( name='pysuru', version='0.0.1', description='Python library to interact with Tsuru API', long_description=open('README.rst', 'r').read(), keywords='tsuru', author='Rodrigo Machado', author_email='rcmachado@gmail.com', url='https://github.com/rcmachado/pysuru', license='MIT', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers' 'Topic :: Software Development :: Libraries', ], install_requires=[ 'urllib3>=1.15' ] packages=['pysuru'], platforms=['linux', 'osx'] )
# coding: utf-8 from setuptools import setup setup( name='pysuru', version='0.0.1', description='Python library to interact with Tsuru API', long_description=open('README.rst', 'r').read(), keywords='tsuru', author='Rodrigo Machado', author_email='rcmachado@gmail.com', url='https://github.com/rcmachado/pysuru', license='MIT', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers' 'Topic :: Software Development :: Libraries', ], install_requires=[ 'urllib3>=1.15', 'certifi' ] packages=['pysuru'], platforms=['linux', 'osx'] )
Add certifi to required packages
Add certifi to required packages
Python
mit
rcmachado/pysuru
--- +++ @@ -18,7 +18,8 @@ 'Topic :: Software Development :: Libraries', ], install_requires=[ - 'urllib3>=1.15' + 'urllib3>=1.15', + 'certifi' ] packages=['pysuru'], platforms=['linux', 'osx']
38a13415fc4c126c1e115d5af0d0ffde5bcdf08d
setup.py
setup.py
# https://jeffknupp.com/blog/2013/08/16/open-sourcing-a-python-project-the-right-way/ # http://peterdowns.com/posts/first-time-with-pypi.html # Upload to PyPI Live # python setup.py sdist upload -r pypi from setuptools import setup setup( name='axis', packages=['axis'], version='9', description='A python library for communicating with devices from Axis Communications', author='Robert Svensson', author_email='Kane610@users.noreply.github.com', license='MIT', url='https://github.com/Kane610/axis', download_url='https://github.com/Kane610/axis/archive/v9.tar.gz', install_requires=['requests'], keywords=['axis', 'vapix', 'onvif', 'event stream', 'homeassistant'], classifiers=[], )
# https://jeffknupp.com/blog/2013/08/16/open-sourcing-a-python-project-the-right-way/ # http://peterdowns.com/posts/first-time-with-pypi.html # Upload to PyPI Live # python setup.py sdist upload -r pypi from setuptools import setup setup( name='axis', packages=['axis'], version='10', description='A python library for communicating with devices from Axis Communications', author='Robert Svensson', author_email='Kane610@users.noreply.github.com', license='MIT', url='https://github.com/Kane610/axis', download_url='https://github.com/Kane610/axis/archive/v10.tar.gz', install_requires=['requests'], keywords=['axis', 'vapix', 'onvif', 'event stream', 'homeassistant'], classifiers=[], )
Bump version number to 10
Bump version number to 10
Python
mit
Kane610/axis
--- +++ @@ -8,13 +8,13 @@ setup( name='axis', packages=['axis'], - version='9', + version='10', description='A python library for communicating with devices from Axis Communications', author='Robert Svensson', author_email='Kane610@users.noreply.github.com', license='MIT', url='https://github.com/Kane610/axis', - download_url='https://github.com/Kane610/axis/archive/v9.tar.gz', + download_url='https://github.com/Kane610/axis/archive/v10.tar.gz', install_requires=['requests'], keywords=['axis', 'vapix', 'onvif', 'event stream', 'homeassistant'], classifiers=[],
64d4bcf0862e2715dc0de92a0621adf23dff5818
source/harmony/schema/collector.py
source/harmony/schema/collector.py
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. from abc import ABCMeta, abstractmethod class Collector(object): '''Collect and return schemas.''' __metaclass__ = ABCMeta @abstractmethod def collect(self): '''Yield collected schemas. Each schema should be a Python dictionary. '''
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import os from abc import ABCMeta, abstractmethod try: import json except ImportError: try: import simplejson as json except ImportError: raise ImportError('Could not import json or simplejson') class Collector(object): '''Collect and return schemas.''' __metaclass__ = ABCMeta @abstractmethod def collect(self): '''Yield collected schemas. Each schema should be a Python dictionary. ''' class FilesystemCollector(Collector): def __init__(self, paths=None, recursive=True): '''Initialise with *paths* to search. If *recursive* is True then all subdirectories of *paths* will also be searched. ''' self.paths = paths self.recursive = recursive if self.paths is None: self.paths = [] super(FilesystemCollector, self).__init__() def collect(self): '''Yield collected schemas.''' for path in self.paths: for base, directories, filenames in os.walk(path): for filename in filenames: _, extension = os.path.splitext(filename) if extension != '.json': continue filepath = os.path.join(base, filename) with open(filepath, 'r') as file_handler: schema = json.load(file_handler) yield schema if not self.recursive: del directories[:]
Support collecting schemas from filesystem.
Support collecting schemas from filesystem.
Python
apache-2.0
4degrees/harmony
--- +++ @@ -2,7 +2,16 @@ # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. +import os from abc import ABCMeta, abstractmethod + +try: + import json +except ImportError: + try: + import simplejson as json + except ImportError: + raise ImportError('Could not import json or simplejson') class Collector(object): @@ -18,3 +27,37 @@ ''' + +class FilesystemCollector(Collector): + + def __init__(self, paths=None, recursive=True): + '''Initialise with *paths* to search. + + If *recursive* is True then all subdirectories of *paths* will also be + searched. + + ''' + self.paths = paths + self.recursive = recursive + if self.paths is None: + self.paths = [] + super(FilesystemCollector, self).__init__() + + def collect(self): + '''Yield collected schemas.''' + for path in self.paths: + for base, directories, filenames in os.walk(path): + for filename in filenames: + + _, extension = os.path.splitext(filename) + if extension != '.json': + continue + + filepath = os.path.join(base, filename) + with open(filepath, 'r') as file_handler: + schema = json.load(file_handler) + yield schema + + if not self.recursive: + del directories[:] +
fa4ef8d171faaf89e81bcd36dfeec082cd86a9e8
setup.py
setup.py
from distutils.core import setup setup( name = "Cytoplasm", version = "0.04.5", author = "startling", author_email = "tdixon51793@gmail.com", url = "http://cytoplasm.somethingsido.com", keywords = ["blogging", "site compiler", "blog compiler"], description = "A static, blog-aware website generator written in python.", packages = ['cytoplasm'], scripts = ['scripts/cytoplasm'], install_requires = ['Mako'], classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Topic :: Internet :: WWW/HTTP :: Site Management", "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: News/Diary", ] )
from distutils.core import setup setup( name = "Cytoplasm", version = "0.05.0", author = "startling", author_email = "tdixon51793@gmail.com", url = "http://cytoplasm.somethingsido.com", keywords = ["blogging", "site compiler", "blog compiler"], description = "A static, blog-aware website generator written in python.", packages = ['cytoplasm'], scripts = ['scripts/cytoplasm'], install_requires = ['Mako'], classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Topic :: Internet :: WWW/HTTP :: Site Management", "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: News/Diary", ] )
Change version string to "0.05.0".
Change version string to "0.05.0". This is a medium-ish change because we kind of break compatibility with older sites.
Python
mit
startling/cytoplasm
--- +++ @@ -2,7 +2,7 @@ setup( name = "Cytoplasm", - version = "0.04.5", + version = "0.05.0", author = "startling", author_email = "tdixon51793@gmail.com", url = "http://cytoplasm.somethingsido.com",
5e9f41eae1d53cec5c90a104c249b11bfe292225
setup.py
setup.py
#!/usr/bin/env python3 from setuptools import setup, find_packages setup( name='django-slack', url="https://chris-lamb.co.uk/projects/django-slack", version='5.16.0', description="Provides easy-to-use integration between Django projects and " "the Slack group chat and IM tool.", author="Chris Lamb", author_email="chris@chris-lamb.co.uk", license="BSD-3-Clause", packages=find_packages(), include_package_data=True, python_requires=">=3.5", install_requires=('Django>=2', 'requests'), )
#!/usr/bin/env python3 from setuptools import setup, find_packages setup( name='django-slack', url="https://chris-lamb.co.uk/projects/django-slack", version='5.16.0', description="Provides easy-to-use integration between Django projects and " "the Slack group chat and IM tool.", author="Chris Lamb", author_email="chris@chris-lamb.co.uk", license="BSD-3-Clause", packages=find_packages(), include_package_data=True, python_requires=">=3.6", install_requires=('Django>=2', 'requests'), )
Make Python 3.6+ a hard requirement
Make Python 3.6+ a hard requirement Support for Python 3.5 was dropped in https://github.com/lamby/django-slack/commit/cd8cce9360fdceb0cb1b4228ef71c0b80a212a4b. Python 3.5 reached its EOL in September 2020, see https://www.python.org/dev/peps/pep-0478/.
Python
bsd-3-clause
lamby/django-slack
--- +++ @@ -13,6 +13,6 @@ license="BSD-3-Clause", packages=find_packages(), include_package_data=True, - python_requires=">=3.5", + python_requires=">=3.6", install_requires=('Django>=2', 'requests'), )
c33038a85f41c2056630897c2b1b8ce590301e62
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-swiftbrowser', version='0.1', packages=['swiftbrowser'], include_package_data=True, license='Apache License (2.0)', description='A simple Django app to access Openstack Swift', long_description=README, url='http://www.cschwede.com/', author='Christian Schwede', author_email='info@cschwede.de', install_requires=['django', 'python-swiftclient'], classifiers=[ 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache License (2.0)', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', '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-swiftbrowser', version='0.1', packages=['swiftbrowser'], include_package_data=True, license='Apache License (2.0)', description='A simple Django app to access Openstack Swift', long_description=README, url='http://www.cschwede.com/', author='Christian Schwede', author_email='info@cschwede.de', install_requires=['django>=1.5', 'python-swiftclient'], classifiers=[ 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache License (2.0)', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], )
Add Django >= 1.5 requirement
Add Django >= 1.5 requirement
Python
apache-2.0
honza801/django-swiftbrowser,hbhdytf/django-swiftbrowser,hbhdytf/django-swiftbrowser,bkawula/django-swiftbrowser,honza801/django-swiftbrowser,cschwede/django-swiftbrowser,cschwede/django-swiftbrowser,bkawula/django-swiftbrowser,sunhongtao/django-swiftbrowser,bkawula/django-swiftbrowser,honza801/django-swiftbrowser,bkawula/django-swiftbrowser,sunhongtao/django-swiftbrowser
--- +++ @@ -17,7 +17,7 @@ url='http://www.cschwede.com/', author='Christian Schwede', author_email='info@cschwede.de', - install_requires=['django', 'python-swiftclient'], + install_requires=['django>=1.5', 'python-swiftclient'], classifiers=[ 'Environment :: Web Environment', 'Framework :: Django',
2349fa984e584fbfb022d01ce3d3e349dbe7870c
setup.py
setup.py
import textwrap from setuptools import setup setup(name='dip', version='1.0.0b0', author='amancevice', author_email='smallweirdnum@gmail.com', packages=['dip'], url='http://www.smallweirdnumber.com', description='Install CLIs using docker-compose', long_description=textwrap.dedent( '''See GitHub_ for documentation. .. _GitHub: https://github.com/amancevice/dip'''), classifiers=['Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Topic :: Utilities', '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'], install_requires=['click>=6.7.0', 'colored>=1.3.4', 'docker-compose>=1.10.0', 'gitpython>=2.1.3'], entry_points={'console_scripts': ['dip=dip.main:dip']})
import textwrap from setuptools import setup setup(name='dip', version='1.0.0b0', author='amancevice', author_email='smallweirdnum@gmail.com', packages=['dip'], url='http://www.smallweirdnumber.com', description='Install CLIs using docker-compose', long_description=textwrap.dedent( '''See GitHub_ for documentation. .. _GitHub: https://github.com/amancevice/dip'''), classifiers=['Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Topic :: Utilities', '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'], install_requires=['click>=6.7.0', 'colored>=1.3.4', 'docker-compose>=1.10.0', 'gitpython>=2.1.3'], entry_points={'console_scripts': ['dip=dip.main:dip']})
Remove Alpha from dev status.
Remove Alpha from dev status.
Python
mit
amancevice/dip
--- +++ @@ -12,8 +12,7 @@ long_description=textwrap.dedent( '''See GitHub_ for documentation. .. _GitHub: https://github.com/amancevice/dip'''), - classifiers=['Development Status :: 3 - Alpha', - 'Intended Audience :: Developers', + classifiers=['Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Topic :: Utilities',
c7e726744b28ee0d502b51cdf8f7d6f0d9ef24e1
setup.py
setup.py
from setuptools import setup url = "" version = "0.1.0" readme = open('README.rst').read() setup( name="dtool-create", packages=["dtool_create"], version=version, description="Dtool plugin for creating datasets and collections", long_description=readme, include_package_data=True, author="Tjelvar Olsson", author_email="tjelvar.olsson@jic.ac.uk", url=url, install_requires=[ "Click", "click-plugins", ], download_url="{}/tarball/{}".format(url, version), license="MIT" )
from setuptools import setup url = "" version = "0.1.0" readme = open('README.rst').read() setup( name="dtool-create", packages=["dtool_create"], version=version, description="Dtool plugin for creating datasets and collections", long_description=readme, include_package_data=True, author="Tjelvar Olsson", author_email="tjelvar.olsson@jic.ac.uk", url=url, install_requires=[ "Click", "dtoolcore", ], entry_points={ "dtool.dataset": [ "create=dtool_create.dataset:create", ], }, download_url="{}/tarball/{}".format(url, version), license="MIT" )
Remove redundant click-plugins and add dtoolcore dependency; add entry point for dataset create
Remove redundant click-plugins and add dtoolcore dependency; add entry point for dataset create
Python
mit
jic-dtool/dtool-create
--- +++ @@ -16,8 +16,13 @@ url=url, install_requires=[ "Click", - "click-plugins", + "dtoolcore", ], + entry_points={ + "dtool.dataset": [ + "create=dtool_create.dataset:create", + ], + }, download_url="{}/tarball/{}".format(url, version), license="MIT" )
e42dc9fe06bad4eff195d64f031d5a2445a15cc8
setup.py
setup.py
#!/usr/bin/env python from __future__ import absolute_import, division, print_function import six from setuptools import setup, Command import logging logging.basicConfig(level=logging.DEBUG) logging.getLogger("nose").setLevel(logging.DEBUG) setup_requires=["nose>=1.0", "coverage>=4.0", "Sphinx>=1.3"] if six.PY2: setup_requires.append("Sphinx-PyPI-upload>=0.2") setup( name="awssig", version="0.2", packages=['awssig'], install_requires=["six>=1.0"], setup_requires=setup_requires, # PyPI information author="David Cuthbert", author_email="dacut@kanga.org", description="AWS signature verification routines", license="Apache 2.0", url="https://github.com/dacut/python-aws-sig", classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', ], keywords = ['aws', 'signature'], zip_safe=False, )
#!/usr/bin/env python from __future__ import absolute_import, division, print_function import six from setuptools import setup, Command import logging logging.basicConfig(level=logging.DEBUG) logging.getLogger("nose").setLevel(logging.DEBUG) setup_requires=["nose>=1.0", "coverage>=4.0", "Sphinx>=1.3"] if six.PY2: setup_requires.append("Sphinx-PyPI-upload>=0.2") setup( name="awssig", version="0.2.1", packages=['awssig'], install_requires=["six>=1.0"], setup_requires=setup_requires, # PyPI information author="David Cuthbert", author_email="dacut@kanga.org", description="AWS signature verification routines", license="Apache 2.0", url="https://github.com/dacut/python-aws-sig", classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Libraries :: Python Modules', ], keywords = ['aws', 'signature'], zip_safe=False, )
Update supported languages to indicate Python 3+ support.
Update supported languages to indicate Python 3+ support.
Python
apache-2.0
dacut/python-aws-sig
--- +++ @@ -13,7 +13,7 @@ setup( name="awssig", - version="0.2", + version="0.2.1", packages=['awssig'], install_requires=["six>=1.0"], setup_requires=setup_requires, @@ -29,6 +29,8 @@ 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Libraries :: Python Modules', ], keywords = ['aws', 'signature'],
3e403ed0962b62b19247dd1021f672507d003f07
labware/microplates.py
labware/microplates.py
from .grid import GridContainer, GridItem from .liquids import LiquidContainer, LiquidWell class Microplate(GridContainer): rows = 8 cols = 12 volume = 100 min_vol = 50 max_vol = 90 height = 14.45 length = 127.76 width = 85.47 diameter = 7.15 depth = 3.25 a1_x = 14.38 a1_y = 11.24 spacing = 9 child_class = LiquidWell def well(self, position): return self.get_child(position) def calibrate(self, **kwargs): """ Coordinates should represent the center and near-bottom of well A1 with the pipette tip in place. """ super(Microplate, self).calibrate(**kwargs) class Microplate_96(Microplate): pass class Microplate_96_deepwell(Microplate_96): volume = 400 min_vol = 50 max_vol = 380 height = 14.6 depth = 10.8
from .grid import GridContainer, GridItem from .liquids import LiquidContainer, LiquidWell class Microplate(GridContainer, LiquidContainer): rows = 8 cols = 12 volume = 100 min_vol = 50 max_vol = 90 height = 14.45 length = 127.76 width = 85.47 diameter = 7.15 depth = 3.25 a1_x = 14.38 a1_y = 11.24 spacing = 9 def well(self, position): return self.get_child(position) def calibrate(self, **kwargs): """ Coordinates should represent the center and near-bottom of well A1 with the pipette tip in place. """ super(Microplate, self).calibrate(**kwargs) class Microplate_96(Microplate): pass class Microplate_96_deepwell(Microplate_96): volume = 400 min_vol = 50 max_vol = 380 height = 14.6 depth = 10.8
Refactor of LiquidContainer vs. GridContainer to support grids which don't contain liquids.
Refactor of LiquidContainer vs. GridContainer to support grids which don't contain liquids.
Python
apache-2.0
OpenTrons/opentrons-api,OpenTrons/opentrons-api,OpenTrons/opentrons_sdk,OpenTrons/opentrons-api,OpenTrons/opentrons-api,OpenTrons/opentrons-api,Opentrons/labware
--- +++ @@ -2,7 +2,7 @@ from .liquids import LiquidContainer, LiquidWell -class Microplate(GridContainer): +class Microplate(GridContainer, LiquidContainer): rows = 8 cols = 12 volume = 100 @@ -16,8 +16,6 @@ a1_x = 14.38 a1_y = 11.24 spacing = 9 - - child_class = LiquidWell def well(self, position): return self.get_child(position)
605af19623b2536752304275f2403ce2b4fa52f8
bluebottle/test/factory_models/projects.py
bluebottle/test/factory_models/projects.py
import factory import logging from django.conf import settings from bluebottle.projects.models import ( Project, ProjectTheme, ProjectDetailField, ProjectBudgetLine) from .accounts import BlueBottleUserFactory # Suppress debug information for Factory Boy logging.getLogger('factory').setLevel(logging.WARN) class ProjectFactory(factory.DjangoModelFactory): FACTORY_FOR = Project owner = factory.SubFactory(BlueBottleUserFactory) phase = settings.PROJECT_PHASES[0][1][0][0] title = factory.Sequence(lambda n: 'Project_{0}'.format(n)) class ProjectThemeFactory(factory.DjangoModelFactory): FACTORY_FOR = ProjectTheme name = factory.Sequence(lambda n: 'Theme_{0}'.format(n)) name_nl = name slug = name description = 'ProjectTheme factory model' class ProjectDetailFieldFactory(factory.DjangoModelFactory): FACTORY_FOR = ProjectDetailField name = factory.Sequence(lambda n: 'Field_{0}'.format(n)) description = 'DetailField factory model' slug = name type = 'text' class ProjectBudgetLineFactory(factory.DjangoModelFactory): FACTORY_FOR = ProjectBudgetLine project = factory.SubFactory(ProjectFactory) amount = 100000
import factory import logging from django.conf import settings from bluebottle.projects.models import ( Project, ProjectTheme, ProjectDetailField, ProjectBudgetLine) from .accounts import BlueBottleUserFactory # Suppress debug information for Factory Boy logging.getLogger('factory').setLevel(logging.WARN) class ProjectFactory(factory.DjangoModelFactory): FACTORY_FOR = Project owner = factory.SubFactory(BlueBottleUserFactory) title = factory.Sequence(lambda n: 'Project_{0}'.format(n)) class ProjectThemeFactory(factory.DjangoModelFactory): FACTORY_FOR = ProjectTheme name = factory.Sequence(lambda n: 'Theme_{0}'.format(n)) name_nl = name slug = name description = 'ProjectTheme factory model' class ProjectDetailFieldFactory(factory.DjangoModelFactory): FACTORY_FOR = ProjectDetailField name = factory.Sequence(lambda n: 'Field_{0}'.format(n)) description = 'DetailField factory model' slug = name type = 'text' class ProjectBudgetLineFactory(factory.DjangoModelFactory): FACTORY_FOR = ProjectBudgetLine project = factory.SubFactory(ProjectFactory) amount = 100000
Remove phase from project factory
Remove phase from project factory
Python
bsd-3-clause
onepercentclub/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,jfterpstra/bluebottle
--- +++ @@ -15,7 +15,6 @@ FACTORY_FOR = Project owner = factory.SubFactory(BlueBottleUserFactory) - phase = settings.PROJECT_PHASES[0][1][0][0] title = factory.Sequence(lambda n: 'Project_{0}'.format(n))
3cc8dc8de4fe75f0abf92f89979b0b7e48d9c137
splearn/ensemble/tests/__init__.py
splearn/ensemble/tests/__init__.py
import numpy as np from nose.tools import assert_true from sklearn.ensemble import RandomForestClassifier from splearn.ensemble import SparkRandomForestClassifier from splearn.utils.testing import SplearnTestCase from splearn.utils.validation import check_rdd_dtype class TestSparkRandomForest(SplearnTestCase): def test_same_predictions(self): X, y, Z = self.make_classification(2, 10000) local = RandomForestClassifier() dist = SparkRandomForestClassifier() y_local = local.fit(X, y).predict(X) y_dist = dist.fit(Z, classes=np.unique(y)).predict(Z[:, 'X']) y_conv = dist.to_scikit().predict(X) assert_true(check_rdd_dtype(y_dist, (np.ndarray,))) assert(sum(y_local != y_dist.toarray()) < len(y_local) * 2./100.) assert(sum(y_local != y_conv) < len(y_local) * 2./100.)
import numpy as np from nose.tools import assert_true from sklearn.ensemble import RandomForestClassifier from splearn.ensemble import SparkRandomForestClassifier from splearn.utils.testing import SplearnTestCase from splearn.utils.validation import check_rdd_dtype class TestSparkRandomForest(SplearnTestCase): def test_same_predictions(self): X, y, Z = self.make_classification(2, 10000) local = RandomForestClassifier() dist = SparkRandomForestClassifier() y_local = local.fit(X, y).predict(X) y_dist = dist.fit(Z, classes=np.unique(y)).predict(Z[:, 'X']) y_conv = dist.to_scikit().predict(X) assert_true(check_rdd_dtype(y_dist, (np.ndarray,))) assert(sum(y_local != y_dist.toarray()) < len(y_local) * 5./100.) assert(sum(y_local != y_conv) < len(y_local) * 5./100.)
Raise allowed difference for RandomForest
Raise allowed difference for RandomForest
Python
apache-2.0
lensacom/sparkit-learn,taynaud/sparkit-learn,taynaud/sparkit-learn,lensacom/sparkit-learn
--- +++ @@ -19,5 +19,5 @@ y_conv = dist.to_scikit().predict(X) assert_true(check_rdd_dtype(y_dist, (np.ndarray,))) - assert(sum(y_local != y_dist.toarray()) < len(y_local) * 2./100.) - assert(sum(y_local != y_conv) < len(y_local) * 2./100.) + assert(sum(y_local != y_dist.toarray()) < len(y_local) * 5./100.) + assert(sum(y_local != y_conv) < len(y_local) * 5./100.)
451951b311ef6e2bb76348a116dc0465f735348e
pytest_watch/config.py
pytest_watch/config.py
try: from configparser import ConfigParser except ImportError: from ConfigParser import ConfigParser import pytest CLI_OPTION_PREFIX = '--' class CollectConfig(object): """ A pytest plugin to gets the configuration file. """ def __init__(self): self.path = None def pytest_cmdline_main(self, config): self.path = str(config.inifile) def merge_config(args): collect_config = CollectConfig() pytest.main(['--collect-only'], plugins=[collect_config]) if not collect_config.path: return config = ConfigParser() config.read(collect_config.path) if not config.has_section('pytest-watch'): return for cli_name in args: if not cli_name.startswith(CLI_OPTION_PREFIX): continue config_name = cli_name[len(CLI_OPTION_PREFIX):] # Let CLI options take precedence if args[cli_name]: continue # Find config option if not config.has_option('pytest-watch', config_name): continue # Merge config option using the expected type if isinstance(args[cli_name], bool): args[cli_name] = config.getboolean('pytest-watch', config_name) else: args[cli_name] = config.get('pytest-watch', config_name)
try: from configparser import ConfigParser except ImportError: from ConfigParser import ConfigParser import pytest CLI_OPTION_PREFIX = '--' class CollectConfig(object): """ A pytest plugin to gets the configuration file. """ def __init__(self): self.path = None def pytest_cmdline_main(self, config): if config.inifile: self.path = str(config.inifile) def merge_config(args): collect_config = CollectConfig() pytest.main(['--collect-only'], plugins=[collect_config]) if not collect_config.path: return config = ConfigParser() config.read(collect_config.path) if not config.has_section('pytest-watch'): return for cli_name in args: if not cli_name.startswith(CLI_OPTION_PREFIX): continue config_name = cli_name[len(CLI_OPTION_PREFIX):] # Let CLI options take precedence if args[cli_name]: continue # Find config option if not config.has_option('pytest-watch', config_name): continue # Merge config option using the expected type if isinstance(args[cli_name], bool): args[cli_name] = config.getboolean('pytest-watch', config_name) else: args[cli_name] = config.get('pytest-watch', config_name)
Fix running when pytest.ini is not present.
Fix running when pytest.ini is not present.
Python
mit
joeyespo/pytest-watch
--- +++ @@ -17,7 +17,8 @@ self.path = None def pytest_cmdline_main(self, config): - self.path = str(config.inifile) + if config.inifile: + self.path = str(config.inifile) def merge_config(args):
b690d4be60d9c72eb805b779c61f6d3001881bd2
raven/conf/__init__.py
raven/conf/__init__.py
""" raven.conf ~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import urlparse def load(dsn, scope): """ Parses a Sentry compatible DSN and loads it into the given scope. >>> import raven >>> dsn = 'https://public_key:secret_key@sentry.local/project_id' >>> raven.load(dsn, locals()) """ url = urlparse.urlparse(dsn) if url.scheme not in ('http', 'https'): raise ValueError('Unsupported Sentry DSN scheme: %r' % url.scheme) netloc = url.hostname if url.port and url.port != 80: netloc += ':%s' % url.port path_bits = url.path.rsplit('/', 1) if len(path_bits) > 1: path = path_bits[0] else: path = '' project = path_bits[-1] scope.update({ 'SENTRY_SERVERS': ['%s://%s%s/api/store/' % (url.scheme, netloc, path)], 'SENTRY_PROJECT': project, 'SENTRY_PUBLIC_KEY': url.username, 'SENTRY_SECRET_KEY': url.password, })
""" raven.conf ~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import urlparse def load(dsn, scope): """ Parses a Sentry compatible DSN and loads it into the given scope. >>> import raven >>> dsn = 'https://public_key:secret_key@sentry.local/project_id' >>> raven.load(dsn, locals()) """ url = urlparse.urlparse(dsn) if url.scheme not in ('http', 'https', 'udp'): raise ValueError('Unsupported Sentry DSN scheme: %r' % url.scheme) netloc = url.hostname if url.port and url.port != 80: netloc += ':%s' % url.port path_bits = url.path.rsplit('/', 1) if len(path_bits) > 1: path = path_bits[0] else: path = '' project = path_bits[-1] scope.update({ 'SENTRY_SERVERS': ['%s://%s%s/api/store/' % (url.scheme, netloc, path)], 'SENTRY_PROJECT': project, 'SENTRY_PUBLIC_KEY': url.username, 'SENTRY_SECRET_KEY': url.password, })
Support udp scheme in raven.load
Support udp scheme in raven.load
Python
bsd-3-clause
Goldmund-Wyldebeast-Wunderliebe/raven-python,someonehan/raven-python,dbravender/raven-python,jbarbuto/raven-python,ticosax/opbeat_python,akheron/raven-python,smarkets/raven-python,getsentry/raven-python,patrys/opbeat_python,jmp0xf/raven-python,jmagnusson/raven-python,recht/raven-python,hzy/raven-python,akalipetis/raven-python,danriti/raven-python,tarkatronic/opbeat_python,recht/raven-python,nikolas/raven-python,ewdurbin/raven-python,nikolas/raven-python,ewdurbin/raven-python,jbarbuto/raven-python,Photonomie/raven-python,tarkatronic/opbeat_python,arthurlogilab/raven-python,danriti/raven-python,smarkets/raven-python,johansteffner/raven-python,ewdurbin/raven-python,lepture/raven-python,ronaldevers/raven-python,akheron/raven-python,nikolas/raven-python,openlabs/raven,recht/raven-python,Goldmund-Wyldebeast-Wunderliebe/raven-python,inspirehep/raven-python,Goldmund-Wyldebeast-Wunderliebe/raven-python,beniwohli/apm-agent-python,inspirehep/raven-python,johansteffner/raven-python,akalipetis/raven-python,inspirehep/raven-python,nikolas/raven-python,ticosax/opbeat_python,johansteffner/raven-python,lopter/raven-python-old,lepture/raven-python,jbarbuto/raven-python,someonehan/raven-python,ronaldevers/raven-python,Goldmund-Wyldebeast-Wunderliebe/raven-python,dbravender/raven-python,smarkets/raven-python,icereval/raven-python,percipient/raven-python,dbravender/raven-python,percipient/raven-python,lepture/raven-python,hzy/raven-python,collective/mr.poe,akheron/raven-python,jmp0xf/raven-python,icereval/raven-python,dirtycoder/opbeat_python,Photonomie/raven-python,jmagnusson/raven-python,daikeren/opbeat_python,beniwohli/apm-agent-python,daikeren/opbeat_python,arthurlogilab/raven-python,inspirehep/raven-python,icereval/raven-python,danriti/raven-python,jbarbuto/raven-python,hzy/raven-python,akalipetis/raven-python,daikeren/opbeat_python,patrys/opbeat_python,getsentry/raven-python,someonehan/raven-python,ronaldevers/raven-python,smarkets/raven-python,dirtycoder/opbeat_python,beniwohli/apm-agent-python,patrys/opbeat_python,jmp0xf/raven-python,beniwohli/apm-agent-python,ticosax/opbeat_python,alex/raven,percipient/raven-python,icereval/raven-python,arthurlogilab/raven-python,arthurlogilab/raven-python,dirtycoder/opbeat_python,jmagnusson/raven-python,tarkatronic/opbeat_python,getsentry/raven-python,Photonomie/raven-python,patrys/opbeat_python
--- +++ @@ -19,7 +19,7 @@ >>> raven.load(dsn, locals()) """ url = urlparse.urlparse(dsn) - if url.scheme not in ('http', 'https'): + if url.scheme not in ('http', 'https', 'udp'): raise ValueError('Unsupported Sentry DSN scheme: %r' % url.scheme) netloc = url.hostname if url.port and url.port != 80:
0f40869157ef56df0ff306fb510be4401b5cbe5d
test/low_level/test_frame_identifiers.py
test/low_level/test_frame_identifiers.py
import inspect from pyinstrument.low_level import stat_profile as stat_profile_c from pyinstrument.low_level import stat_profile_python class AClass: def get_frame_identfier_for_a_method(self, getter_function): frame = inspect.currentframe() assert frame return getter_function(frame) @classmethod def get_frame_identfier_for_a_class_method(cls, getter_function): frame = inspect.currentframe() assert frame return getter_function(frame) def test_frame_identifier(): frame = inspect.currentframe() assert frame assert stat_profile_c.get_frame_identifier(frame) == stat_profile_python.get_frame_identifier( frame ) def test_frame_identifier_for_method(): instance = AClass() assert instance.get_frame_identfier_for_a_method( stat_profile_c.get_frame_identifier ) == instance.get_frame_identfier_for_a_method(stat_profile_python.get_frame_identifier)
import inspect from pyinstrument.low_level import stat_profile as stat_profile_c from pyinstrument.low_level import stat_profile_python class AClass: def get_frame_identifier_for_a_method(self, getter_function): frame = inspect.currentframe() assert frame return getter_function(frame) def get_frame_identifier_with_cell_variable(self, getter_function): frame = inspect.currentframe() assert frame def an_inner_function(): # reference self to make it a cell variable if self: pass return getter_function(frame) @classmethod def get_frame_identifier_for_a_class_method(cls, getter_function): frame = inspect.currentframe() assert frame return getter_function(frame) def test_frame_identifier(): frame = inspect.currentframe() assert frame assert stat_profile_c.get_frame_identifier(frame) == stat_profile_python.get_frame_identifier( frame ) def test_frame_identifiers(): instance = AClass() test_functions = [ instance.get_frame_identifier_for_a_method, AClass.get_frame_identifier_for_a_class_method, instance.get_frame_identifier_with_cell_variable, ] for test_function in test_functions: assert test_function(stat_profile_c.get_frame_identifier) == test_function( stat_profile_python.get_frame_identifier )
Add test for a cell variable
Add test for a cell variable
Python
bsd-3-clause
joerick/pyinstrument,joerick/pyinstrument,joerick/pyinstrument,joerick/pyinstrument,joerick/pyinstrument,joerick/pyinstrument
--- +++ @@ -5,13 +5,24 @@ class AClass: - def get_frame_identfier_for_a_method(self, getter_function): + def get_frame_identifier_for_a_method(self, getter_function): frame = inspect.currentframe() assert frame return getter_function(frame) + def get_frame_identifier_with_cell_variable(self, getter_function): + frame = inspect.currentframe() + assert frame + + def an_inner_function(): + # reference self to make it a cell variable + if self: + pass + + return getter_function(frame) + @classmethod - def get_frame_identfier_for_a_class_method(cls, getter_function): + def get_frame_identifier_for_a_class_method(cls, getter_function): frame = inspect.currentframe() assert frame return getter_function(frame) @@ -26,8 +37,16 @@ ) -def test_frame_identifier_for_method(): +def test_frame_identifiers(): instance = AClass() - assert instance.get_frame_identfier_for_a_method( - stat_profile_c.get_frame_identifier - ) == instance.get_frame_identfier_for_a_method(stat_profile_python.get_frame_identifier) + + test_functions = [ + instance.get_frame_identifier_for_a_method, + AClass.get_frame_identifier_for_a_class_method, + instance.get_frame_identifier_with_cell_variable, + ] + + for test_function in test_functions: + assert test_function(stat_profile_c.get_frame_identifier) == test_function( + stat_profile_python.get_frame_identifier + )
8a607ab7c064f3f593b4cecaa8e4262bec9326fa
corehq/apps/es/forms.py
corehq/apps/es/forms.py
from .es_query import HQESQuery from . import filters class FormES(HQESQuery): index = 'forms' default_filters = { 'is_xform_instance': {"term": {"doc_type": "xforminstance"}}, 'has_xmlns': {"not": {"missing": {"field": "xmlns"}}}, 'has_user': {"not": {"missing": {"field": "form.meta.userID"}}}, } @property def builtin_filters(self): return [ xmlns, app, submitted, completed, user_id, ] + super(FormES, self).builtin_filters def user_facet(self): return self.terms_facet('form.meta.userID', 'user') def domain_facet(self): return self.terms_facet('domain', 'domain') def xmlns(xmlns): return filters.term('xmlns.exact', xmlns) def app(app_id): return filters.term('app_id', app_id) def submitted(gt=None, gte=None, lt=None, lte=None): return filters.date_range('received_on', gt, gte, lt, lte) def completed(gt=None, gte=None, lt=None, lte=None): return filters.date_range('form.meta.timeEnd', gt, gte, lt, lte) def user_id(user_ids): return filters.term('form.meta.userID', list(user_ids))
from .es_query import HQESQuery from . import filters class FormES(HQESQuery): index = 'forms' default_filters = { 'is_xform_instance': {"term": {"doc_type": "xforminstance"}}, 'has_xmlns': {"not": {"missing": {"field": "xmlns"}}}, 'has_user': {"not": {"missing": {"field": "form.meta.userID"}}}, } @property def builtin_filters(self): return [ xmlns, app, submitted, completed, user_id, ] + super(FormES, self).builtin_filters def user_facet(self): return self.terms_facet('form.meta.userID', 'user') def domain_facet(self): return self.terms_facet('domain', 'domain', 1000000) def xmlns(xmlns): return filters.term('xmlns.exact', xmlns) def app(app_id): return filters.term('app_id', app_id) def submitted(gt=None, gte=None, lt=None, lte=None): return filters.date_range('received_on', gt, gte, lt, lte) def completed(gt=None, gte=None, lt=None, lte=None): return filters.date_range('form.meta.timeEnd', gt, gte, lt, lte) def user_id(user_ids): return filters.term('form.meta.userID', list(user_ids))
Return more than 10 domains
Return more than 10 domains
Python
bsd-3-clause
qedsoftware/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq
--- +++ @@ -23,7 +23,7 @@ return self.terms_facet('form.meta.userID', 'user') def domain_facet(self): - return self.terms_facet('domain', 'domain') + return self.terms_facet('domain', 'domain', 1000000) def xmlns(xmlns):
0d3ae906a9382aca5e00ff403986591223e3a1a7
pic/flash.py
pic/flash.py
class ProgramMemory(object): def __init__(self, size: int, programCounter): self._operations = [None] * size self._programCounter = programCounter @property def operations(self) -> list: return self._operations @property def programCounter(self): return self._programCounter def nextOp(self): return self.operations[self.programCounter.value]
class ProgramMemory(object): def __init__(self, size: int, programCounter): self._operations = [None] * size self._programCounter = programCounter @property def operations(self) -> list: return self._operations @property def programCounter(self): return self._programCounter def nextOp(self): return self.operations[self.programCounter.address]
Change program counter current address reference.
Change program counter current address reference.
Python
mit
SuperOxigen/pic16f917-simulator
--- +++ @@ -14,4 +14,4 @@ return self._programCounter def nextOp(self): - return self.operations[self.programCounter.value] + return self.operations[self.programCounter.address]
d1da03b40e9a10a07b67eeb76a0bef8cc704a40c
utils/exporter.py
utils/exporter.py
import plotly as py from os import makedirs from utils.names import output_file_name _out_dir = 'graphs/' def export(fig, module, dates): graph_dir = '{}{}/'.format(_out_dir, str(module)) makedirs(graph_dir, exist_ok=True) py.offline.plot(fig, filename=graph_dir + output_file_name(module, dates))
import plotly as py from os import makedirs from utils.names import output_file_name _out_dir = 'graphs/' def export(fig, module, dates): graph_dir = '{}{}/'.format(_out_dir, str(module))[:-3] # remove .py extension from dir names makedirs(graph_dir, exist_ok=True) py.offline.plot(fig, filename=graph_dir + output_file_name(module, dates))
Remove .py extension from graph dir names
Remove .py extension from graph dir names
Python
mit
f-jiang/sleep-pattern-grapher
--- +++ @@ -6,7 +6,7 @@ _out_dir = 'graphs/' def export(fig, module, dates): - graph_dir = '{}{}/'.format(_out_dir, str(module)) + graph_dir = '{}{}/'.format(_out_dir, str(module))[:-3] # remove .py extension from dir names makedirs(graph_dir, exist_ok=True) py.offline.plot(fig, filename=graph_dir + output_file_name(module, dates))
2f0d71024ab9fb3ab4b97e086741b0dd8564d29e
dadd/master/handlers.py
dadd/master/handlers.py
from flask import send_file, request, redirect, url_for from dadd.master import app from dadd.master.files import FileStorage @app.route('/') def index(): return redirect(url_for('admin.index')) @app.route('/files/<path>', methods=['PUT', 'GET']) def files(path): storage = FileStorage(app.config['STORAGE_DIR']) if request.method == 'PUT': storage.save(path, request.stream) resp = app.make_response('Updated %s' % path) resp.status_code = 202 return resp return send_file(storage.read(path))
from flask import send_file, request, redirect, url_for from dadd.master import app from dadd.master.files import FileStorage @app.route('/') def index(): return redirect(url_for('admin.index')) @app.route('/files/<path:path>', methods=['PUT', 'GET']) def files(path): storage = FileStorage(app.config['STORAGE_DIR']) if request.method == 'PUT': storage.save(path, request.stream) resp = app.make_response('Updated %s' % path) resp.status_code = 202 return resp return send_file(storage.read(path))
Fix files path argument type.
Fix files path argument type.
Python
bsd-3-clause
ionrock/dadd,ionrock/dadd,ionrock/dadd,ionrock/dadd
--- +++ @@ -9,7 +9,7 @@ return redirect(url_for('admin.index')) -@app.route('/files/<path>', methods=['PUT', 'GET']) +@app.route('/files/<path:path>', methods=['PUT', 'GET']) def files(path): storage = FileStorage(app.config['STORAGE_DIR'])
8f753ba1bc3f17146841d1f83f493adb8ea480e1
voteit/stancer.py
voteit/stancer.py
def generate_stances(blocs=[], filters={}): return "banana!"
from bson.code import Code from voteit.core import votes REDUCE = Code(""" function(obj, prev) { if (!prev.votes.hasOwnProperty(obj.option)) { prev.votes[obj.option] = 1; } else { prev.votes[obj.option]++; } //prev.count++; }; """) def generate_stances(blocs=[], filters={}): data = votes.group(blocs, filters, {"votes": {}}, REDUCE) print data return data
Replace “banana” with business logic (kind of).
Replace “banana” with business logic (kind of).
Python
mit
tmtmtmtm/voteit-api,pudo/voteit-server,pudo-attic/voteit-server
--- +++ @@ -1,7 +1,20 @@ +from bson.code import Code +from voteit.core import votes +REDUCE = Code(""" +function(obj, prev) { + if (!prev.votes.hasOwnProperty(obj.option)) { + prev.votes[obj.option] = 1; + } else { + prev.votes[obj.option]++; + } + //prev.count++; +}; +""") def generate_stances(blocs=[], filters={}): - - return "banana!" + data = votes.group(blocs, filters, {"votes": {}}, REDUCE) + print data + return data
55069f1635a32c57faf7c8afcbfc9b88df093601
bin/monitor/find_invalid_pipeline_state.py
bin/monitor/find_invalid_pipeline_state.py
import arrow import logging import argparse import emission.core.wrapper.pipelinestate as ecwp import emission.core.get_database as edb # Run in containers using: # sudo docker exec $CONTAINER bash -c 'cd e-mission-server; source setup/activate.sh; ./e-mission-py.bash bin/debug/find_invalid_pipeline_state.py' def print_all_invalid_state(): all_invalid_states = edb.get_pipeline_state_db().find({"curr_run_ts": {"$ne": None}}) for invalid_state in all_invalid_states: print(f"{invalid_state.user_id}: {ecwp.PipelineStage(invalid_state.pipeline_stage)} set to {arrow.get(invalid_state.curr_run_ts)}") if __name__ == '__main__': logging.basicConfig(level=logging.DEBUG) parser = argparse.ArgumentParser(prog="find_invalid_pipeline_state") args = parser.parse_args() print_all_invalid_state()
import arrow import logging import argparse import emission.core.wrapper.pipelinestate as ecwp import emission.core.get_database as edb # Run in containers using: # sudo docker exec $CONTAINER bash -c 'cd e-mission-server; source setup/activate.sh; ./e-mission-py.bash bin/debug/find_invalid_pipeline_state.py' def print_all_invalid_state(): all_invalid_states = [ecwp.PipelineState(p) for p in edb.get_pipeline_state_db().find({"curr_run_ts": {"$ne": None}})] for invalid_state in all_invalid_states: print(f"{invalid_state.user_id}: {ecwp.PipelineStages(invalid_state.pipeline_stage)} set to {arrow.get(invalid_state.curr_run_ts)}") if __name__ == '__main__': logging.basicConfig(level=logging.DEBUG) parser = argparse.ArgumentParser(prog="find_invalid_pipeline_state") args = parser.parse_args() print_all_invalid_state()
Convert entries to PipelineState objects
Convert entries to PipelineState objects + typo in wrapper class name
Python
bsd-3-clause
shankari/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,shankari/e-mission-server
--- +++ @@ -8,9 +8,9 @@ # sudo docker exec $CONTAINER bash -c 'cd e-mission-server; source setup/activate.sh; ./e-mission-py.bash bin/debug/find_invalid_pipeline_state.py' def print_all_invalid_state(): - all_invalid_states = edb.get_pipeline_state_db().find({"curr_run_ts": {"$ne": None}}) + all_invalid_states = [ecwp.PipelineState(p) for p in edb.get_pipeline_state_db().find({"curr_run_ts": {"$ne": None}})] for invalid_state in all_invalid_states: - print(f"{invalid_state.user_id}: {ecwp.PipelineStage(invalid_state.pipeline_stage)} set to {arrow.get(invalid_state.curr_run_ts)}") + print(f"{invalid_state.user_id}: {ecwp.PipelineStages(invalid_state.pipeline_stage)} set to {arrow.get(invalid_state.curr_run_ts)}") if __name__ == '__main__': logging.basicConfig(level=logging.DEBUG)
a689ce5e38c4d4a5ce982037c5c15396f361c7d6
contrib/examples/sensors/echo_flask_app.py
contrib/examples/sensors/echo_flask_app.py
from flask import request, Flask from st2reactor.sensor.base import Sensor class EchoFlaskSensor(Sensor): def __init__(self, sensor_service, config): super(EchoFlaskSensor, self).__init__( sensor_service=sensor_service, config=config ) self._host = '127.0.0.1' self._port = 5000 self._path = '/echo' self._log = self._sensor_service.get_logger(__name__) self._app = Flask(__name__) def setup(self): pass def run(self): @self._app.route(self._path, methods=['POST']) def echo(): payload = request.get_json(force=True) self._sensor_service.dispatch(trigger="examples.echo_flask", payload=payload) return request.data self._log.info('Listening for payload on http://{}:{}{}'.format( self._host, self._port, self._path)) self._app.run(host=self._host, port=self._port, threaded=True) def cleanup(self): pass def add_trigger(self, trigger): # This method is called when trigger is created pass def update_trigger(self, trigger): # This method is called when trigger is updated pass def remove_trigger(self, trigger): # This method is called when trigger is deleted pass
from flask import request, Flask from st2reactor.sensor.base import Sensor class EchoFlaskSensor(Sensor): def __init__(self, sensor_service, config): super(EchoFlaskSensor, self).__init__( sensor_service=sensor_service, config=config ) self._host = '127.0.0.1' self._port = 5000 self._path = '/echo' self._log = self._sensor_service.get_logger(__name__) self._app = Flask(__name__) def setup(self): pass def run(self): @self._app.route(self._path, methods=['POST']) def echo(): payload = request.get_json(force=True) self._sensor_service.dispatch(trigger="examples.echoflasksensor", payload=payload) return request.data self._log.info('Listening for payload on http://{}:{}{}'.format( self._host, self._port, self._path)) self._app.run(host=self._host, port=self._port, threaded=True) def cleanup(self): pass def add_trigger(self, trigger): # This method is called when trigger is created pass def update_trigger(self, trigger): # This method is called when trigger is updated pass def remove_trigger(self, trigger): # This method is called when trigger is deleted pass
Make trigger name in .py match .yaml
Make trigger name in .py match .yaml
Python
apache-2.0
StackStorm/st2,nzlosh/st2,StackStorm/st2,StackStorm/st2,nzlosh/st2,Plexxi/st2,Plexxi/st2,nzlosh/st2,Plexxi/st2,Plexxi/st2,nzlosh/st2,StackStorm/st2
--- +++ @@ -24,7 +24,7 @@ @self._app.route(self._path, methods=['POST']) def echo(): payload = request.get_json(force=True) - self._sensor_service.dispatch(trigger="examples.echo_flask", + self._sensor_service.dispatch(trigger="examples.echoflasksensor", payload=payload) return request.data
6e8e7a067419166afd632aa63ecb743dd6c3a162
geokey_dataimports/tests/test_model_helpers.py
geokey_dataimports/tests/test_model_helpers.py
# coding=utf-8 from io import BytesIO from django.test import TestCase from geokey_dataimports.helpers.model_helpers import import_from_csv class ImportFromCSVTest(TestCase): """Tests to check that characters can be imported from CSV files. Notes that these tests are probably not possible or relevant under Python 3. """ def test_import_csv_basic_chars(self): """Basic ASCII characters can be imported.""" mock_csv = BytesIO("abc,cde,efg\n123,456,789") features = [] import_from_csv(features=features, fields=[], file=mock_csv) print(features) self.assertEquals(features[0]['properties'], {'cde': '456', 'abc': '123', 'efg': '789'}) def test_import_csv_non_ascii_chars(self): """Non-ASCII unicode characters can be imported.""" mock_csv = BytesIO("abc,àde,e£g\n¡23,45Ç,Æ8é") features = [] import_from_csv(features=features, fields=[], file=mock_csv) print(features) self.assertEquals(features[0]['properties'], {'àde': '45Ç', 'abc': '¡23', 'e£g': 'Æ8é'})
# coding=utf-8 from cStringIO import StringIO from django.test import TestCase from geokey_dataimports.helpers.model_helpers import import_from_csv class ImportFromCSVTest(TestCase): """Tests to check that characters can be imported from CSV files. Notes that these tests are probably not possible or relevant under Python 3. """ def test_import_csv_basic_chars(self): """Basic ASCII characters can be imported.""" input_dict = {u'abc': u'123', u'cde': u'456', u'efg': u'789'} mock_csv = StringIO("abc,cde,efg\n123,456,789") features = [] import_from_csv(features=features, fields=[], file_obj=mock_csv) for k, v in input_dict.items(): self.assertEquals(v, features[0]['properties'][k]) def test_import_csv_non_ascii_chars(self): """Non-ASCII unicode characters can be imported.""" input_dict = {u'à': u'¡', u'£': u'Ç'} mock_csv = StringIO("à,£\n¡,Ç") features = [] import_from_csv(features=features, fields=[], file_obj=mock_csv) for k, v in input_dict.items(): self.assertEquals(v, features[0]['properties'][k])
Simplify test data for easier comparison.
Simplify test data for easier comparison.
Python
mit
ExCiteS/geokey-dataimports,ExCiteS/geokey-dataimports,ExCiteS/geokey-dataimports
--- +++ @@ -1,5 +1,5 @@ # coding=utf-8 -from io import BytesIO +from cStringIO import StringIO from django.test import TestCase @@ -13,16 +13,19 @@ """ def test_import_csv_basic_chars(self): """Basic ASCII characters can be imported.""" - mock_csv = BytesIO("abc,cde,efg\n123,456,789") + input_dict = {u'abc': u'123', u'cde': u'456', u'efg': u'789'} + mock_csv = StringIO("abc,cde,efg\n123,456,789") features = [] - import_from_csv(features=features, fields=[], file=mock_csv) - print(features) - self.assertEquals(features[0]['properties'], {'cde': '456', 'abc': '123', 'efg': '789'}) + import_from_csv(features=features, fields=[], file_obj=mock_csv) + for k, v in input_dict.items(): + self.assertEquals(v, features[0]['properties'][k]) def test_import_csv_non_ascii_chars(self): """Non-ASCII unicode characters can be imported.""" - mock_csv = BytesIO("abc,àde,e£g\n¡23,45Ç,Æ8é") + input_dict = {u'à': u'¡', u'£': u'Ç'} + mock_csv = StringIO("à,£\n¡,Ç") features = [] - import_from_csv(features=features, fields=[], file=mock_csv) - print(features) - self.assertEquals(features[0]['properties'], {'àde': '45Ç', 'abc': '¡23', 'e£g': 'Æ8é'}) + import_from_csv(features=features, fields=[], file_obj=mock_csv) + for k, v in input_dict.items(): + self.assertEquals(v, features[0]['properties'][k]) +
b8e23194ff0c24bd9460629aff18f69d7a868f6d
likelihood.py
likelihood.py
import math #Log-likelihood def ll(ciphertext,perm,mat,k): s=0.0 for i in range(len(ciphertext)-(k-1)): kmer = tuple([perm[c] for c in ciphertext[i:i+k]]) s = s + math.log(mat[kmer]) return s
import math #Log-likelihood def ll(ciphertext,perm,mat,k): if k==1: return ll_k1(ciphertext,perm,mat) if k==2: return ll_k2(ciphertext,perm,mat) if k==3: return ll_k3(ciphertext,perm,mat) s=0.0 for i in range(len(ciphertext)-(k-1)): kmer = tuple([perm[c] for c in ciphertext[i:i+k]]) s = s + math.log(mat[kmer]) return s ##Log-likelihood - hard-coded version for k=1 def ll_k1(ciphertext,perm,mat): s=0.0 for i in range(len(ciphertext)): uple = (perm[ciphertext[i]],) s = s + math.log(mat[uple]) return s ##Log-likelihood - hard-coded version for k=2 def ll_k2(ciphertext,perm,mat): s=0.0 for i in range(len(ciphertext)-1): pair = (perm[ciphertext[i]],perm[ciphertext[i+1]]) s = s + math.log(mat[pair]) return s ##Log-likelihood - hard-coded version for k=3 def ll_k3(ciphertext,perm,mat): s=0.0 for i in range(len(ciphertext)-2): triplet = (perm[ciphertext[i]],perm[ciphertext[i+1]],perm[ciphertext[i+2]]) s = s + math.log(mat[triplet]) return s
Add hard-coded versions of ll function for k=1,2,3 for speed
Add hard-coded versions of ll function for k=1,2,3 for speed
Python
mit
gputzel/decode
--- +++ @@ -1,8 +1,38 @@ import math #Log-likelihood def ll(ciphertext,perm,mat,k): + if k==1: + return ll_k1(ciphertext,perm,mat) + if k==2: + return ll_k2(ciphertext,perm,mat) + if k==3: + return ll_k3(ciphertext,perm,mat) s=0.0 for i in range(len(ciphertext)-(k-1)): kmer = tuple([perm[c] for c in ciphertext[i:i+k]]) s = s + math.log(mat[kmer]) return s + +##Log-likelihood - hard-coded version for k=1 +def ll_k1(ciphertext,perm,mat): + s=0.0 + for i in range(len(ciphertext)): + uple = (perm[ciphertext[i]],) + s = s + math.log(mat[uple]) + return s + +##Log-likelihood - hard-coded version for k=2 +def ll_k2(ciphertext,perm,mat): + s=0.0 + for i in range(len(ciphertext)-1): + pair = (perm[ciphertext[i]],perm[ciphertext[i+1]]) + s = s + math.log(mat[pair]) + return s + +##Log-likelihood - hard-coded version for k=3 +def ll_k3(ciphertext,perm,mat): + s=0.0 + for i in range(len(ciphertext)-2): + triplet = (perm[ciphertext[i]],perm[ciphertext[i+1]],perm[ciphertext[i+2]]) + s = s + math.log(mat[triplet]) + return s
50596484c1214a73d3722af116ccea7fa258fb11
direnaj/direnaj_api/celery_app/server_endpoint.py
direnaj/direnaj_api/celery_app/server_endpoint.py
__author__ = 'onur' from celery import Celery import direnaj_api.config.server_celeryconfig as celeryconfig app_object = Celery() app_object.config_from_object(celeryconfig) @app_object.task def deneme(x, seconds): print "Sleeping for printing %s for %s seconds.." % (x, seconds) import time time.sleep(seconds) print x #from celery.schedules import crontab #from celery.task import periodic_task from direnaj_api.utils.direnajmongomanager import create_batch_from_watchlist #@periodic_task(run_every=crontab(minute='*/1')) @app_object.task def check_watchlist_and_dispatch_tasks(): batch_size = 10 res_array = create_batch_from_watchlist(app_object, batch_size) if __name__ == "__main__": app_object.start()
__author__ = 'onur' from celery import Celery import direnaj_api.config.server_celeryconfig as celeryconfig app_object = Celery() app_object.config_from_object(celeryconfig) @app_object.task def deneme(x, seconds): print "Sleeping for printing %s for %s seconds.." % (x, seconds) import time time.sleep(seconds) print x #from celery.schedules import crontab #from celery.task import periodic_task from direnaj_api.utils.direnajmongomanager import create_batch_from_watchlist #@periodic_task(run_every=crontab(minute='*/1')) @app_object.task(name='check_watchlist_and_dispatch_tasks') def check_watchlist_and_dispatch_tasks(): batch_size = 10 res_array = create_batch_from_watchlist(app_object, batch_size) if __name__ == "__main__": app_object.start()
Fix for periodic task scheduler (4)
Fix for periodic task scheduler (4)
Python
mit
boun-cmpe-soslab/drenaj,boun-cmpe-soslab/drenaj,boun-cmpe-soslab/drenaj,boun-cmpe-soslab/drenaj
--- +++ @@ -20,7 +20,7 @@ from direnaj_api.utils.direnajmongomanager import create_batch_from_watchlist #@periodic_task(run_every=crontab(minute='*/1')) -@app_object.task +@app_object.task(name='check_watchlist_and_dispatch_tasks') def check_watchlist_and_dispatch_tasks(): batch_size = 10 res_array = create_batch_from_watchlist(app_object, batch_size)
6d2118a87dfb811015727970b1eda74c15769e06
distutilazy/__init__.py
distutilazy/__init__.py
""" distutilazy ----------- Extra distutils command classes. :license: MIT, see LICENSE for more details. """ from os.path import dirname, abspath import sys __version__ = '0.4.0' __all__ = ['clean', 'pyinstaller', 'command'] base_dir = abspath(dirname(dirname(__file__))) if base_dir not in sys.path: if len(sys.path): sys.path.insert(1, base_dir) else: sys.path.append(base_dir)
""" distutilazy ----------- Extra distutils command classes. :license: MIT, see LICENSE for more details. """ from os.path import dirname, abspath import sys __version__ = "0.4.0" __all__ = ("clean", "pyinstaller", "command") base_dir = abspath(dirname(dirname(__file__))) if base_dir not in sys.path: if len(sys.path): sys.path.insert(1, base_dir) else: sys.path.append(base_dir)
Replace ' with " to keep it consistant with other modules
Replace ' with " to keep it consistant with other modules
Python
mit
farzadghanei/distutilazy
--- +++ @@ -10,8 +10,8 @@ from os.path import dirname, abspath import sys -__version__ = '0.4.0' -__all__ = ['clean', 'pyinstaller', 'command'] +__version__ = "0.4.0" +__all__ = ("clean", "pyinstaller", "command") base_dir = abspath(dirname(dirname(__file__))) if base_dir not in sys.path:
8ffe217fe512296d41ae474c9d145ee2de599eac
src/constants.py
src/constants.py
class AppUrl: """Class for storing all the URLs used in the application""" BASE = "http://www.thehindu.com/" OP_BASE = BASE + "opinion/" OPINION = OP_BASE + "?service=rss" EDITORIAL = OP_BASE + "editorial/?service=rss" SAMPLE = BASE + "op-ed/a-super-visit-in-the-season-of-hope/article7214799.ece" RSS_ARGS = "?utm_source=RSS_Feed&utm_medium=RSS&utm_campaign=RSS_Syndication" class Kind: #BLOGS = 'blogs' #CARTOON = 'cartoon' COLUMNS = 'columns' EDITORIAL = 'editorial' INTERVIEW = 'interview' LEAD = 'lead' #LETTERS = 'letters' OP_ED = 'op-ed' OPEN_PAGE = 'open-page' #READERS_ED = 'Readers-Editor' #SUNDAY_ANCHOR = 'sunday-anchor' class Tags: accepted = ['a', 'b', 'i', 'p']
class AppUrl: """Class for storing all the URLs used in the application""" BASE = "http://www.thehindu.com/" OP_BASE = BASE + "opinion/" OPINION = OP_BASE + "?service=rss" EDITORIAL = OP_BASE + "editorial/?service=rss" SAMPLE = BASE + "op-ed/a-super-visit-in-the-season-of-hope/article7214799.ece" RSS_ARGS = "?utm_source=RSS_Feed&utm_medium=RSS&utm_campaign=RSS_Syndication" class Kind: BLOGS = 'blogs' CARTOON = 'cartoon' COLUMNS = 'columns' EDITORIAL = 'editorial' INTERVIEW = 'interview' LEAD = 'lead' LETTERS = 'letters' OP_ED = 'op-ed' OPEN_PAGE = 'open-page' READERS_ED = 'Readers-Editor' SUNDAY_ANCHOR = 'sunday-anchor' SUPPORTED = [COLUMNS, EDITORIAL, INTERVIEW, LEAD, OP_ED, OPEN_PAGE] class Tags: accepted = ['a', 'b', 'i', 'p']
Include all but have a supported set
Include all but have a supported set Rather than commenting out the values, this seems more sensible. And pretty.. of course. Signed-off-by: Venkatesh Shukla <8349e50bec2939976da648e286d7e261bcd17fa3@iitbhu.ac.in>
Python
mit
venkateshshukla/th-editorials-server
--- +++ @@ -8,17 +8,19 @@ RSS_ARGS = "?utm_source=RSS_Feed&utm_medium=RSS&utm_campaign=RSS_Syndication" class Kind: - #BLOGS = 'blogs' - #CARTOON = 'cartoon' + BLOGS = 'blogs' + CARTOON = 'cartoon' COLUMNS = 'columns' EDITORIAL = 'editorial' INTERVIEW = 'interview' LEAD = 'lead' - #LETTERS = 'letters' + LETTERS = 'letters' OP_ED = 'op-ed' OPEN_PAGE = 'open-page' - #READERS_ED = 'Readers-Editor' - #SUNDAY_ANCHOR = 'sunday-anchor' + READERS_ED = 'Readers-Editor' + SUNDAY_ANCHOR = 'sunday-anchor' + SUPPORTED = [COLUMNS, EDITORIAL, INTERVIEW, LEAD, OP_ED, + OPEN_PAGE] class Tags: accepted = ['a', 'b', 'i', 'p']
1fabf53957c4951e36f756c94bea4007cd6a5d6e
run_server.py
run_server.py
#!/usr/bin/env python3 import subprocess import sys def main(): ip = '127.0.0.1' port = 5000 workers_count = 4 if len(sys.argv) > 1: for arg in sys.argv[1:]: if ':' in arg: ip, port = arg.split(':') port = int(port) break if '.' in arg: ip = arg if arg.isdigit(): port = int(arg) print('FluCalc started on {ip}:{port}'.format(ip=ip, port=port)) subprocess.run('gunicorn -w {workers_count} -b {ip}:{port} flucalc.server:app'.format( workers_count=workers_count, ip=ip, port=port ), shell=True) if __name__ == '__main__': main()
#!/usr/bin/env python3 import subprocess import sys def main(): ip = '127.0.0.1' port = 5000 workers_count = 4 if len(sys.argv) > 1: for arg in sys.argv[1:]: if ':' in arg: ip, port = arg.split(':') port = int(port) break if '.' in arg: ip = arg if arg.isdigit(): port = int(arg) print('FluCalc started on http://{ip}:{port}'.format(ip=ip, port=port)) subprocess.run('gunicorn -w {workers_count} -b {ip}:{port} flucalc.server:app'.format( workers_count=workers_count, ip=ip, port=port ), shell=True) if __name__ == '__main__': main()
Improve print message for the server address
Improve print message for the server address
Python
mit
bondarevts/flucalc,bondarevts/flucalc,bondarevts/flucalc
--- +++ @@ -18,7 +18,7 @@ if arg.isdigit(): port = int(arg) - print('FluCalc started on {ip}:{port}'.format(ip=ip, port=port)) + print('FluCalc started on http://{ip}:{port}'.format(ip=ip, port=port)) subprocess.run('gunicorn -w {workers_count} -b {ip}:{port} flucalc.server:app'.format( workers_count=workers_count, ip=ip, port=port ), shell=True)
af4bdd9339e3905f6489577afe7fac33475e3884
src/services/listener_bot.py
src/services/listener_bot.py
from logging import info, basicConfig, INFO from time import sleep from src.slack.slack_bot import Bot def main(): basicConfig(level=INFO) bot = Bot() info('Connection Slack') if not bot.slack_client.rtm_connect(): info('Could not connect in web_socket') exit() else: info('Connected') while True: sleep(0.5) for message in bot.get_direct_messages(): info(message) bot.send_message_in_channel(message.message, message.channel) if __name__ == '__main__': main()
from logging import info, basicConfig, INFO from time import sleep from src.slack.slack_bot import Bot def main(): basicConfig(level=INFO) bot = Bot() info('Connection Slack') if not bot.slack_client.rtm_connect(): info('Could not connect in web_socket') exit() else: info('Connected') while True: sleep(1) for message in bot.get_direct_messages(): info(message) bot.send_message_in_channel(message.message, message.channel) if __name__ == '__main__': main()
Improve waiting time to bot listener
Improve waiting time to bot listener
Python
bsd-3-clause
otherpirate/dbaas-slack-bot
--- +++ @@ -15,7 +15,7 @@ info('Connected') while True: - sleep(0.5) + sleep(1) for message in bot.get_direct_messages(): info(message) bot.send_message_in_channel(message.message, message.channel)