diff
stringlengths
139
3.65k
message
stringlengths
8
627
diff_languages
stringclasses
1 value
diff --git a/invenio_kwalitee/kwalitee.py b/invenio_kwalitee/kwalitee.py index <HASH>..<HASH> 100644 --- a/invenio_kwalitee/kwalitee.py +++ b/invenio_kwalitee/kwalitee.py @@ -249,6 +249,7 @@ def pull_request(pull_request_url, status_url, config): check_pep8 = config.get("CHECK_PEP8", True) check_pyflakes = config.get("CHECK_PYFLAKES", True) kwargs["pep8_pyflakes"] = check_pyflakes + kwargs["pep8_ignore"] = config.get("PEP8_IGNORE", []) if check and check_commit_messages: errs, messages = _check_commits(commits_url, **kwargs)
Read PEP8 ignore from config
py
diff --git a/thumbor/engines/extensions/pil.py b/thumbor/engines/extensions/pil.py index <HASH>..<HASH> 100644 --- a/thumbor/engines/extensions/pil.py +++ b/thumbor/engines/extensions/pil.py @@ -429,7 +429,7 @@ class GifWriter: # Gather info data = getdata(im) - imdes, data = data[0], data[1:] + imdes, data = b''.join(data[:-2]), data[-2:] graphext = self.getGraphicsControlExt(durations[frames], disposes[frames]) # Make image descriptor suitable for using 256 local color palette lid = self.getImageDescriptor(im, xys[frames])
Fix broken gif output with pillow <I>.x They changed number of elements output in getdata function: <URL>
py
diff --git a/buildutils/bundle.py b/buildutils/bundle.py index <HASH>..<HASH> 100644 --- a/buildutils/bundle.py +++ b/buildutils/bundle.py @@ -35,8 +35,8 @@ pjoin = os.path.join # Constants #----------------------------------------------------------------------------- -bundled_version = (0,5,2) -libcapnp = "capnproto-c++-%i.%i.%i.tar.gz" % (bundled_version) +bundled_version = (0,5,3,1) +libcapnp = "capnproto-c++-%i.%i.%i.%i.tar.gz" % (bundled_version) libcapnp_url = "https://capnproto.org/" + libcapnp HERE = os.path.dirname(__file__)
Bump bundled capnp version to <I>
py
diff --git a/pandas/tests/indexes/datetimes/test_tools.py b/pandas/tests/indexes/datetimes/test_tools.py index <HASH>..<HASH> 100644 --- a/pandas/tests/indexes/datetimes/test_tools.py +++ b/pandas/tests/indexes/datetimes/test_tools.py @@ -1035,6 +1035,12 @@ class TestToDatetime: result = pd.to_datetime(expected).to_datetime64() assert result == expected + @pytest.mark.parametrize("dt_str", ["00010101", "13000101", "30000101", "99990101"]) + def test_to_datetime_with_format_out_of_bounds(self, dt_str): + # GH 9107 + with pytest.raises(OutOfBoundsDatetime): + pd.to_datetime(dt_str, format="%Y%m%d") + class TestToDatetimeUnit: @pytest.mark.parametrize("cache", [True, False])
TST: add test for #<I> (#<I>)
py
diff --git a/PyFunceble/cli/utils/testing.py b/PyFunceble/cli/utils/testing.py index <HASH>..<HASH> 100644 --- a/PyFunceble/cli/utils/testing.py +++ b/PyFunceble/cli/utils/testing.py @@ -236,6 +236,9 @@ def get_subjects_from_line( if checker_type.lower() != "syntax": for index, subject in enumerate(result): + if not subject: + continue + netloc = url2netloc.set_data_to_convert(subject).get_converted() result[index] = subject.replace(netloc, netloc.lower())
Fix issue when a subject in the list is empty. This patch fixes #<I>. Indeed, before this patch, we assumed that the list was perfectly formatted. Contributors: * @spirillen
py
diff --git a/mygeotab/api.py b/mygeotab/api.py index <HASH>..<HASH> 100644 --- a/mygeotab/api.py +++ b/mygeotab/api.py @@ -243,7 +243,10 @@ class MyGeotabException(Exception): self.stack_trace = main_error['stackTrace'] def __str__(self): - return '{0}\n{1}\n\nStacktrace:\n{2}'.format(self.name, self.message, self.stack_trace) + error_str = '{0}\n{1}'.format(self.name, self.message) + if self.stack_trace: + error_str = error_str + '\n\nStacktrace:\n{2}'.format(self.stack_trace) + return error_str class AuthenticationException(Exception):
Don't show stacktrace heading if there isn't a stacktrace
py
diff --git a/perceval/backends/core/bugzillarest.py b/perceval/backends/core/bugzillarest.py index <HASH>..<HASH> 100644 --- a/perceval/backends/core/bugzillarest.py +++ b/perceval/backends/core/bugzillarest.py @@ -60,7 +60,7 @@ class BugzillaREST(Backend): :param tag: label used to mark the data :param archive: archive to store/retrieve items """ - version = '0.8.1' + version = '0.8.2' CATEGORIES = [CATEGORY_BUG] @@ -95,8 +95,14 @@ class BugzillaREST(Backend): return items - def fetch_items(self, **kwargs): - """Fetch bugs""" + def fetch_items(self, category, **kwargs): + """Fetch the bugs + + :param category: the category of items to fetch + :param kwargs: backend arguments + + :returns: a generator of items + """ from_date = kwargs['from_date']
[bugzillarest] Set category when calling fetch and fetch_from_archive This patch adds to the params of the fetch_items method the category. Thus, it allows to handle fetching operations (fetch and fetch_from_archive) with multiple categories
py
diff --git a/alot/db/utils.py b/alot/db/utils.py index <HASH>..<HASH> 100644 --- a/alot/db/utils.py +++ b/alot/db/utils.py @@ -57,7 +57,7 @@ def add_signature_headers(mail, sigs, error_msg): ) -def get_params(mail, failobj=None, header='content-type', unquote=True): +def get_params(mail, failobj=list(), header='content-type', unquote=True): '''Get Content-Type parameters as dict. RFC 2045 specifies that parameter names are case-insensitive, so
Fix the default failobj of get_params Formerly None was used as failobj, but None is not iterable and that is all that get_params does. Use list() instead which is iterable. Closes #<I>.
py
diff --git a/pythainlp/tokenize/__init__.py b/pythainlp/tokenize/__init__.py index <HASH>..<HASH> 100644 --- a/pythainlp/tokenize/__init__.py +++ b/pythainlp/tokenize/__init__.py @@ -122,17 +122,25 @@ def sent_tokenize(text: str, engine: str = "whitespace+newline") -> List[str]: def subword_tokenize(text: str, engine: str = "tcc") -> List[str]: """ :param str text: text to be tokenized - :param str engine: choosing 'tcc' uses the Thai Character Cluster rule to segment words into the smallest unique units. + :param str engine: subword tokenizer + :Parameters for engine: + * tcc (default) - Thai Character Cluster (Theeramunkong et al. 2000) + * etcc - Enhanced Thai Character Cluster (Inrut et al. 2001) [In development] :return: a list of tokenized strings. """ if not text: return "" from .tcc import tcc + from .etcc import etcc + if engine == "tcc": + return tcc(text) + elif engine == "etcc": + return etcc(text).split("/") + #default return tcc(text) - def syllable_tokenize(text: str) -> List[str]: """ :param str text: input string to be tokenized
include etcc in subword_tokenize module as advertised on README.md
py
diff --git a/tests/test_parts/test_pandabox/test_pandaboxchildpart.py b/tests/test_parts/test_pandabox/test_pandaboxchildpart.py index <HASH>..<HASH> 100644 --- a/tests/test_parts/test_pandabox/test_pandaboxchildpart.py +++ b/tests/test_parts/test_pandabox/test_pandaboxchildpart.py @@ -26,7 +26,8 @@ class PandABoxChildPartTest(unittest.TestCase): self.child["encoderValue3Capture"] = Mock(value="capture") self.child["encoderValue3DatasetName"] = Mock(value="x2") - self.params = MagicMock(mri="P:INENC1", name="INENC1") + self.params = MagicMock(mri="P:INENC1") + self.params.name="INENC1" self.process.get_block.return_value = self.child self.o = PandABoxChildPart(self.process, self.params) list(self.o.create_attributes())
Update test_pandaboxchildpart.py Forgot that Mocks have a special meaning for "name"
py
diff --git a/mordred/_base/result.py b/mordred/_base/result.py index <HASH>..<HASH> 100644 --- a/mordred/_base/result.py +++ b/mordred/_base/result.py @@ -118,7 +118,7 @@ class Result(object): >>> from rdkit import Chem >>> result = Calculator(descriptors)(Chem.MolFromSmiles("C1CCCCC1")) >>> result.name["C2SP3"] - 1 + 6 """ return GetValueByName(self._values, self._name_to_index)
fix doctest of Result.name
py
diff --git a/wkhtmltopdf/views.py b/wkhtmltopdf/views.py index <HASH>..<HASH> 100644 --- a/wkhtmltopdf/views.py +++ b/wkhtmltopdf/views.py @@ -66,7 +66,7 @@ class PDFTemplateResponse(TemplateResponse, PDFResponse): self.override_settings = override_settings def render_to_temporary_file(self, template_name, mode='w+b', bufsize=-1, - suffix='', prefix='tmp', dir=None, + suffix='.html', prefix='tmp', dir=None, delete=True): template = self.resolve_template(template_name)
.html default suffix for render_to_temporary_file It's expected by wkhtmltopdf that the files should end in .html, so it may as well be the default.
py
diff --git a/spacy/tests/vocab/test_intern.py b/spacy/tests/vocab/test_intern.py index <HASH>..<HASH> 100644 --- a/spacy/tests/vocab/test_intern.py +++ b/spacy/tests/vocab/test_intern.py @@ -96,7 +96,7 @@ def test_pickle_string_store(sstore): def test_dump_load(sstore): id_ = sstore[u'qqqqq'] - with tempfile.TemporaryFile('tw') as file_: + with tempfile.TemporaryFile('wt') as file_: sstore.dump(file_) file_.seek(0) new_store = StringStore()
* Fix mode on text file for Python3 in strings test
py
diff --git a/stanza/utils/training/run_mwt.py b/stanza/utils/training/run_mwt.py index <HASH>..<HASH> 100644 --- a/stanza/utils/training/run_mwt.py +++ b/stanza/utils/training/run_mwt.py @@ -33,7 +33,7 @@ def check_mwt(filename): """ Checks whether or not there are MWTs in the given conll file """ - doc = Document(CoNLL.conll2doc(filename)) + doc = CoNLL.conll2doc(filename) data = doc.get_mwt_expansions(False) return len(data) > 0
Fix MWT training from the earlier doc writing changes
py
diff --git a/parsl/tests/test_providers/test_local_provider.py b/parsl/tests/test_providers/test_local_provider.py index <HASH>..<HASH> 100644 --- a/parsl/tests/test_providers/test_local_provider.py +++ b/parsl/tests/test_providers/test_local_provider.py @@ -1,5 +1,6 @@ import os import pathlib +import pytest import random import shutil import socket @@ -54,6 +55,7 @@ def _run_tests(p: LocalProvider): assert status.stderr == 'magic' +@pytest.mark.local def test_local_channel(): with tempfile.TemporaryDirectory() as script_dir: script_dir = tempfile.mkdtemp() @@ -75,6 +77,7 @@ Subsystem sftp {sftp_path} # It would probably be better, when more formalized site testing comes into existence, to # use a site-testing provided server/configuration instead of the current scheme +@pytest.mark.local def test_ssh_channel(): with tempfile.TemporaryDirectory() as config_dir: sshd_thread, priv_key, server_port = _start_sshd(config_dir)
Make provider tests run in local mode (#<I>)
py
diff --git a/amqpstorm/channel0.py b/amqpstorm/channel0.py index <HASH>..<HASH> 100644 --- a/amqpstorm/channel0.py +++ b/amqpstorm/channel0.py @@ -150,5 +150,5 @@ class Channel0(object): 'consumer_cancel_notify': True, 'authentication_failure_close': True, }, - 'information': 'AMQP-Storm', + 'information': 'See https://github.com/eandersson/amqp-storm', 'version': __version__}
Updated channel0 information with a link to github
py
diff --git a/pyvisa/ctwrapper/functions.py b/pyvisa/ctwrapper/functions.py index <HASH>..<HASH> 100644 --- a/pyvisa/ctwrapper/functions.py +++ b/pyvisa/ctwrapper/functions.py @@ -796,7 +796,10 @@ def lock(library, session, lock_type, timeout, requested_key=None): else: access_key = create_string_buffer(256) ret = library.viLock(session, lock_type, timeout, requested_key, access_key) - return access_key.value, ret + if access_key is None: + return None, ret + else: + return access_key.value, ret def map_address(library, session, map_space, map_base, map_size,
lock_excl bug fix (ctwrapper/functions lock was failing when access_key was None)
py
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,12 +22,6 @@ import sys open(os.path.join('..', '__init__.py'), 'a') sys.path.insert(0, os.path.abspath(os.path.join('..'))) sys.path.insert(0, os.path.abspath(os.path.join('..', 'controller'))) -# create local_settings.py for SECRET_KEY if necessary -local_settings_path = os.path.abspath( - os.path.join('..', 'controller', 'deis', 'local_settings.py')) -if not os.path.exists(local_settings_path): - with open(local_settings_path, 'w') as local_settings: - local_settings.write("SECRET_KEY = 'DummySecretKey'\n") # set up Django os.environ['DJANGO_SETTINGS_MODULE'] = 'deis.settings' from django.conf import settings # noqa
ref(docs): remove local_settings.py hack for secret key Doc generation creates a local_settings.py file, because at one time having SECRET_KEY unset caused an error when importing Django code. That was essentially a temp file that was never cleaned up, and it no longer seems to be necessary.
py
diff --git a/backtrader/broker.py b/backtrader/broker.py index <HASH>..<HASH> 100644 --- a/backtrader/broker.py +++ b/backtrader/broker.py @@ -126,6 +126,19 @@ class BrokerBase(with_metaclass(MetaBroker, object)): fundvalue = property(get_fundvalue) + def set_fundmode(self, fundmode, fundstartval=None): + '''Set the actual fundmode (True or False) + + If the argument fundstartval is not ``None``, it will used + ''' + pass # do nothing, not all brokers can support this + + def get_fundmode(self): + '''Returns the actual fundmode (True or False)''' + return False + + fundmode = property(get_fundmode, set_fundmode) + def getposition(self, data): raise NotImplementedError
Provide default fundmode methods for all brokers
py
diff --git a/tests/tests.py b/tests/tests.py index <HASH>..<HASH> 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -120,6 +120,8 @@ class ConnectionTests(TestCase): obj = conn.get('cn=External Anonymous', base_dn='ou=Groups,dc=ucdavis,dc=edu') self.assertTrue(conn.compare(obj.dn, 'cn', 'External Anonymous')) + self.assertFalse(conn.compare(obj.dn, 'cn', 'foo')) + class AuthenticateTests(TestCase):
Added a test for compare that returns False, refs #4.
py
diff --git a/auto/src/rabird/auto/window/win32.py b/auto/src/rabird/auto/window/win32.py index <HASH>..<HASH> 100644 --- a/auto/src/rabird/auto/window/win32.py +++ b/auto/src/rabird/auto/window/win32.py @@ -29,6 +29,7 @@ class Window(common.Window): def get_title(cls, handle): return win32gui.GetWindowText(handle).decode(locale.getpreferredencoding()) + @classmethod def exists(cls, **kwargs): return len(cls.find(**kwargs)) > 0 @@ -73,8 +74,8 @@ class Window(common.Window): counter = 0.0 handle = None while True: - handle = cls.find(**kwargs) - if (handle is None) and (timeout > 0.0) and (counter > timeout): + handles = cls.find(**kwargs) + if (len(handles) <= 0) and (timeout > 0.0) and (counter > timeout): time.sleep(sleep_interval) counter += sleep_interval else:
Fixed all functions that related with find(), because the return value type changed by find().
py
diff --git a/tests/test_repo_interactions.py b/tests/test_repo_interactions.py index <HASH>..<HASH> 100644 --- a/tests/test_repo_interactions.py +++ b/tests/test_repo_interactions.py @@ -3,11 +3,18 @@ import os import chartpress def test_git_repo_fixture(git_repo): + # assert we use the git repo as our current working directory assert git_repo.working_dir == os.getcwd() + + # assert we have copied files assert os.path.isfile("chartpress.yaml") assert os.path.isfile("testchart/Chart.yaml") assert os.path.isfile("testchart/values.yaml") + # assert there is another branch to contain published content as well + git_repo.git.checkout("gh-pages") + assert os.path.isfile("index.yaml") + def test_chartpress_run(git_repo, capfd): """Run chartpress and inspect the output.""" @@ -81,6 +88,7 @@ def test_chartpress_run(git_repo, capfd): assert f"Updating testchart/values.yaml: list.0: test-prefix/testimage:{tag}" in out assert f"Updating testchart/values.yaml: list.1.image: test-prefix/testimage:{tag}" in out + def _capture_output(args, capfd): _, _ = capfd.readouterr() chartpress.main(args)
Test successful gh-pages branch setup
py
diff --git a/django_q/tasks.py b/django_q/tasks.py index <HASH>..<HASH> 100644 --- a/django_q/tasks.py +++ b/django_q/tasks.py @@ -449,6 +449,7 @@ class Iter(object): self.args.append(args) if self.started: self.started = False + return self.length() def run(self): """ @@ -511,6 +512,7 @@ class Chain(object): if self.started: delete_group(self.group) self.started = False + return self.length() def run(self): """
returns the size of the chain or iter on append
py
diff --git a/fcn/datasets/pascal.py b/fcn/datasets/pascal.py index <HASH>..<HASH> 100644 --- a/fcn/datasets/pascal.py +++ b/fcn/datasets/pascal.py @@ -4,6 +4,7 @@ from __future__ import print_function import cPickle as pickle import os.path as osp +import shutil import tempfile import chainer @@ -44,7 +45,8 @@ class PascalVOC2012SegmentationDataset(chainer.dataset.DatasetMixin): def __init__(self, data_type): # set db - self.db = plyvel.DB(tempfile.mktemp(), create_if_missing=True) + self.db_path = tempfile.mktemp() + self.db = plyvel.DB(self.db_path, create_if_missing=True) # get ids for the data_type dataset_dir = chainer.dataset.get_dataset_directory( 'pascal/VOCdevkit/VOC2012') @@ -66,6 +68,9 @@ class PascalVOC2012SegmentationDataset(chainer.dataset.DatasetMixin): def __len__(self): return len(self.files) + def __del__(self): + shutil.rmtree(self.db_path, ignore_errors=True) + def get_example(self, i): data_file = self.files[i] # load cache
Remove db_path at deletion
py
diff --git a/peewee_async.py b/peewee_async.py index <HASH>..<HASH> 100644 --- a/peewee_async.py +++ b/peewee_async.py @@ -328,6 +328,12 @@ class AsyncQueryResult: def __iter__(self): return iter(self._result) + def __getitem__(self, key): + return self._result[key] + + def __len__(self): + return len(self._result) + @asyncio.coroutine def fetchone(self): row = yield from self._cursor.fetchone()
some facilities for AsyncQueryResult
py
diff --git a/agents/tools/wrappers.py b/agents/tools/wrappers.py index <HASH>..<HASH> 100644 --- a/agents/tools/wrappers.py +++ b/agents/tools/wrappers.py @@ -118,7 +118,7 @@ class FrameHistory(object): self._past_indices = past_indices self._step = 0 self._buffer = None - self._capacity = max(past_indices) + self._capacity = max(past_indices) + 1 self._flatten = flatten def __getattr__(self, name):
Fix off-by-one bug in FrameHistory environment wrapper (#<I>)
py
diff --git a/src/scriptworker/cot/verify.py b/src/scriptworker/cot/verify.py index <HASH>..<HASH> 100644 --- a/src/scriptworker/cot/verify.py +++ b/src/scriptworker/cot/verify.py @@ -2070,13 +2070,13 @@ SCRIPTWORKER_GITHUB_OAUTH_TOKEN to an OAUTH token with read permissions to the r log.setLevel(level) logging.basicConfig(level=level) event_loop = event_loop or asyncio.get_event_loop() + if not opts.cleanup: + log.info("Artifacts will be in {}".format(tmp)) try: event_loop.run_until_complete(_async_verify_cot_cmdln(opts, tmp)) finally: if opts.cleanup: rm(tmp) - else: - log.info("Artifacts are in {}".format(tmp)) # create_test_workdir {{{1
Log tmpdir path before running cot verify In theory we should log where the files are in the `finally` block, but for some reason this wasn't working for me. Working around this by logging the path before we run cot verify.
py
diff --git a/mongoframes/frames.py b/mongoframes/frames.py index <HASH>..<HASH> 100644 --- a/mongoframes/frames.py +++ b/mongoframes/frames.py @@ -1,5 +1,4 @@ from blinker import signal -from bson.code import Code from bson.objectid import ObjectId from copy import deepcopy from datetime import date, datetime, time, timezone
Removed import of bson Code as this was breaking in latest version of pymongo
py
diff --git a/dustmaps/sfd.py b/dustmaps/sfd.py index <HASH>..<HASH> 100644 --- a/dustmaps/sfd.py +++ b/dustmaps/sfd.py @@ -30,7 +30,7 @@ import astropy.io.fits as fits from scipy.ndimage import map_coordinates from .std_paths import * -from .map_base import DustMap, ensure_flat_galactic +from .map_base import DustMap, WebDustMap, ensure_flat_galactic from . import fetch_utils from . import dustexceptions @@ -95,6 +95,22 @@ class SFDQuery(DustMap): return out +class SFDWebQuery(WebDustMap): + """ + Remote query over the web for the Schlegel, Finkbeiner & Davis (1998) dust + map. + + This query object does not require a local version of the data, but rather + an internet connection to contact the web API. The query functions have the + same inputs and outputs as their counterparts in ``SFDQuery``. + """ + + def __init__(self, api_url=None): + super(SFDWebQuery, self).__init__( + api_url=api_url, + map_name='sfd') + + def fetch(): """ Downloads the Schlegel, Finkbeiner & Davis (1998) dust map, placing it in
Added web query for SFD.
py
diff --git a/chatterbot/adapters/logic/closest_meaning.py b/chatterbot/adapters/logic/closest_meaning.py index <HASH>..<HASH> 100644 --- a/chatterbot/adapters/logic/closest_meaning.py +++ b/chatterbot/adapters/logic/closest_meaning.py @@ -8,8 +8,8 @@ from nltk import word_tokenize class ClosestMeaningAdapter(LogicAdapter): - def __init__(self): - super(ClosestMeaningAdapter, self).__init__() + def __init__(self, **kwargs): + super(ClosestMeaningAdapter, self).__init__(**kwargs) from nltk.data import find from nltk import download
ClosestMeaningAdapter wasn't useable TypeError: __init__() got an unexpected keyword argument 'logic_adapter because chatterbot.py initializes the logic adapters with his kwargs. The Closestmatch adapter uses the __init__() from logic.py
py
diff --git a/pyked/chemked.py b/pyked/chemked.py index <HASH>..<HASH> 100644 --- a/pyked/chemked.py +++ b/pyked/chemked.py @@ -227,6 +227,22 @@ class DataPoint(object): setattr(self, prop.replace('-', '_'), None) self.composition = properties['composition'] + self.composition_type = set([q for q in ['mole-fraction', 'mass-fraction', 'mole-percent'] + for species in self.composition if q in species]) + if len(self.composition_type) > 1: + raise TypeError('More than one of mole-fraction, mass-fraction, or mole-percent ' + 'were specified in the data point.\n{}'.format(self.composition)) + self.composition_type = self.composition_type.pop() + comp_sum = np.sum([species.get(self.composition_type) for species in self.composition]) + if self.composition_type == 'mole-percent': + if not np.isclose(comp_sum, 100.0): + raise ValueError('mole-percent for the data point do not sum to ' + '100.0.\n{}'.format(self.composition)) + else: + if not np.isclose(comp_sum, 1.0): + raise ValueError('{} for the data point do not sum to ' + '1.0.\n{}'.format(self.composition_type, self.composition)) + self.equivalence_ratio = properties.get('equivalence-ratio') if 'volume-history' in properties:
:sparkles: Check that composition is properly specified Each DataPoint should use one of mole-fraction, mass-fraction or mole-percent for each of the species, and not mix within a DataPoint. In addition, the sum of the values should be <I> or <I>, depending on the choice
py
diff --git a/Lib/glyphs2ufo/interpolation.py b/Lib/glyphs2ufo/interpolation.py index <HASH>..<HASH> 100644 --- a/Lib/glyphs2ufo/interpolation.py +++ b/Lib/glyphs2ufo/interpolation.py @@ -57,6 +57,7 @@ def interpolate(rfonts, master_dir, out_dir, designspace_path, ufo = OpenFont(path) set_custom_params(ufo, data=data) set_redundant_data(ufo) + ufo.save() instance_ufos.append(ufo) if debug:
Save instance UFOs after setting custom params This way, the UFOs returned by the interpolate function are consistent with what's saved on disk.
py
diff --git a/xray/plot/plot.py b/xray/plot/plot.py index <HASH>..<HASH> 100644 --- a/xray/plot/plot.py +++ b/xray/plot/plot.py @@ -285,9 +285,10 @@ def _color_palette(cmap, n_colors): try: from seaborn.apionly import color_palette pal = color_palette(cmap, n_colors=n_colors) - except (TypeError, ImportError): + except (TypeError, ImportError, ValueError): # TypeError is raised when LinearSegmentedColormap (viridis) is used - # Import Error is raised when seaborn is not installed + # ImportError is raised when seaborn is not installed + # ValueError is raised when seaborn doesn't like a colormap (e.g. jet) # Use homegrown solution if you don't have seaborn or are using viridis if isinstance(cmap, basestring): cmap = plt.get_cmap(cmap)
begrudgingly handle seaborn exception when jet is used as colormap
py
diff --git a/pyjarowinkler/distance.py b/pyjarowinkler/distance.py index <HASH>..<HASH> 100644 --- a/pyjarowinkler/distance.py +++ b/pyjarowinkler/distance.py @@ -12,7 +12,7 @@ __author__ = 'Jean-Bernard Ratte - jean.bernard.ratte@unary.ca' """ -def get_jaro_distance(first, second): +def get_jaro_distance(first, second, winkler_ajustment=True): if not first or not second: raise JaroDistanceException("Cannot calculate distance from NoneType ({0}, {1})".format( first.__class__.__name__, @@ -21,7 +21,10 @@ def get_jaro_distance(first, second): jaro = _score(first, second) cl = min(len(_get_prefix(first, second)), 4) - return round((jaro + (0.1 * cl * (1.0 - jaro))) * 100.0) / 100.0 + if winkler_ajustment: + return round((jaro + (0.1 * cl * (1.0 - jaro))) * 100.0) / 100.0 + + return jaro def _score(first, second):
added ability to unable or disable winkler ajustment
py
diff --git a/squad/settings.py b/squad/settings.py index <HASH>..<HASH> 100644 --- a/squad/settings.py +++ b/squad/settings.py @@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os +import sys # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -33,6 +34,8 @@ SECRET_KEY = open(secret_key_file).read() DEBUG = os.getenv('ENV') != 'production' +TESTING = sys.argv[1:2] == ['test'] + ALLOWED_HOSTS = ['*'] @@ -148,7 +151,8 @@ USE_TZ = True # http://whitenoise.evans.io/en/stable/django.html STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static') -STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' +if not TESTING: + STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' # Always use IPython for shell_plus SHELL_PLUS = "ipython"
settings: don't use whitenoise when running tests it seems that whitenoise would require collectstatic to be run before running the tests, which is somewhat inconvenient in development
py
diff --git a/example/app.py b/example/app.py index <HASH>..<HASH> 100644 --- a/example/app.py +++ b/example/app.py @@ -30,9 +30,14 @@ def create_users(): ('joe@lp.com', 'password', ['editor'], True), ('jill@lp.com', 'password', ['author'], True), ('tiya@lp.com', 'password', [], False)): - current_app.security.datastore.create_user( - email=u[0], password=u[1], roles=u[2], active=u[3], - authentication_token='123abc') + current_app.security.datastore.create_user(**{ + 'email': u[0], + 'password': u[1], + 'roles': u[2], + 'active': u[3], + 'authentication_token': + '123abc' + }) def populate_data():
Try and fix an issue with python <I>
py
diff --git a/test/test_big_phi.py b/test/test_big_phi.py index <HASH>..<HASH> 100644 --- a/test/test_big_phi.py +++ b/test/test_big_phi.py @@ -114,5 +114,5 @@ def test_big_mip_big_network(big_subsys_all): assert len(mip.partitioned_constellation) == 17 options.PRECISION = initial_precision -def test_complexes(standard): - assert (list(compute.complexes(standard)) == [0]) +# def test_complexes(standard): +# assert (list(compute.complexes(standard)) == [0])
Comment-out test_complexes for now
py
diff --git a/setup3.py b/setup3.py index <HASH>..<HASH> 100755 --- a/setup3.py +++ b/setup3.py @@ -13,7 +13,7 @@ from distutils.unixccompiler import UnixCCompiler def updateDocHeader(input, output): docstrings = {} - execfile(input, docstrings) + exec(compile(open(input, "rb").read(), input, 'exec'), docstrings) stream = open(output, "w") print("#ifndef TIMBL_DOC_H",file=stream)
execfile is deprecated in python 3
py
diff --git a/microdrop/feedback.py b/microdrop/feedback.py index <HASH>..<HASH> 100755 --- a/microdrop/feedback.py +++ b/microdrop/feedback.py @@ -2271,8 +2271,8 @@ class FeedbackCalibrationController(): ind = mlab.find(np.logical_and(V_hv[:, i], V_fb[:, i])) if len(ind): legend.append("R$_{fb,%d}$" % i) - a.semilogx(frequencies[ind], 1/(Z_1[ind, i]*frequencies[ind]*2*np.pi), 'o') - a.plot(frequencies, 1e12*C_device*np.ones(frequencies.shape), 'k--') + a.semilogx(frequencies[ind], 1e12/(Z_1[ind, i]*frequencies[ind]*2*np.pi), 'o') + a.plot(frequencies, C_device*np.ones(frequencies.shape), 'k--') a.legend(legend) a.set_xlabel('Frequency (Hz)') a.set_ylabel('C$_{device}$ (pF)')
Fix scaling of device capacitance (FB calibration)
py
diff --git a/tests/test_querysetsequence.py b/tests/test_querysetsequence.py index <HASH>..<HASH> 100644 --- a/tests/test_querysetsequence.py +++ b/tests/test_querysetsequence.py @@ -139,10 +139,17 @@ class TestQuerySequence(TestBase): self.assertTrue( options.app_label.startswith('queryset_sequence.')) self.assertEquals(options.model_name, 'querysequencemodel') - self.assertTrue( - options.label.startswith('queryset_sequence')) - self.assertTrue( - options.label.endswith('QuerySequenceModel')) + self.assertEquals(options.object_name, 'QuerySequenceModel') + + # Django >= 1.9 the label attribute exists. Otherwise, cast to a string. + object_name = 'QuerySequenceModel' + try: + label = options.label + except AttributeError: + label = str(options) + object_name = object_name.lower() + self.assertTrue(label.startswith('queryset_sequence')) + self.assertTrue(label.endswith(object_name)) def test_queryset_number(self): """Ensure that the QuerySet number is correct on the model."""
Fix tests for Django <I>.
py
diff --git a/holoviews/core/layout.py b/holoviews/core/layout.py index <HASH>..<HASH> 100644 --- a/holoviews/core/layout.py +++ b/holoviews/core/layout.py @@ -338,6 +338,7 @@ class Layout(AttrTree, Dimensioned): path = path[:2] pl = len(path) count = counts[path[:-1]] + counts[path[:-1]] += 1 if (pl == 1 and not item.label) or (pl == 2 and item.label): new_path = path + (int_to_roman(count-1),) if path in paths: @@ -345,7 +346,6 @@ class Layout(AttrTree, Dimensioned): path = path + (int_to_roman(count),) else: path = path[:-1] + (int_to_roman(count),) - counts[path[:-1]] += 1 return path @@ -374,10 +374,10 @@ class Layout(AttrTree, Dimensioned): Recursively unpacks lists and Layout-like objects, accumulating into the supplied list of items. """ - if isinstance(objs, cls): + if type(objs) is cls: objs = objs.values() for v in objs: - if isinstance(v, cls): + if type(v) is cls: cls._unpack_paths(v, paths, items, counts) continue group = group_sanitizer(v.group)
Fixes for Layout/Overlay path resolution
py
diff --git a/utils/Sfile_util.py b/utils/Sfile_util.py index <HASH>..<HASH> 100644 --- a/utils/Sfile_util.py +++ b/utils/Sfile_util.py @@ -141,7 +141,7 @@ def readheader(sfilename): sfilename_header.time=UTCDateTime(int(topline[1:5]),int(topline[6:8]), int(topline[8:10]),int(topline[11:13]), int(topline[13:15]),sfile_seconds - ,int(topline[19:20])*10)+add_seconds + ,int(topline[19:20])*100000)+add_seconds except: warnings.warn("Couldn't read a date from sfile: "+sfilename) sfilename_header.time=UTCDateTime(0)
Correct timing in header Former-commit-id: <I>b<I>f1c<I>ae3fa<I>de6e<I>fc<I>e
py
diff --git a/pysat/_meta.py b/pysat/_meta.py index <HASH>..<HASH> 100644 --- a/pysat/_meta.py +++ b/pysat/_meta.py @@ -51,6 +51,20 @@ class Meta(object): return True return False + def __repr__(self): + # cover 1D parameters + output_str = 'Metadata for 1D parameters\n' + # print('Metadata for 1D parameters') + # print(self.data) + output_str += self.data.__repr__() + output_str += '\n' + for item_name in self.ho_data.keys(): + output_str += '\n\n' + output_str += 'Metadata for '+item_name+'\n' + # print(self.ho_data[item_name].data) + output_str += self.ho_data[item_name].data.__repr__() + return output_str + def copy(self): from copy import deepcopy as deepcopy """Deep copy of the meta object."""
Added __repr__ to Meta object.
py
diff --git a/openpnm/topotools/_plottools.py b/openpnm/topotools/_plottools.py index <HASH>..<HASH> 100644 --- a/openpnm/topotools/_plottools.py +++ b/openpnm/topotools/_plottools.py @@ -142,6 +142,7 @@ def plot_connections(network, color = mcolors.to_rgb(color) + tuple([alpha]) # Override colors with color_by if given if color_by is not None: + color_by = color_by[Ts] color = cm.get_cmap(name=cmap)(color_by / color_by.max()) color[:, 3] = alpha if size_by is not None: @@ -289,6 +290,7 @@ def plot_coordinates(network, if 's' in kwargs.keys(): markersize = kwargs.pop('s') if color_by is not None: + color_by = color_by[Ps] color = cm.get_cmap(name=cmap)(color_by / color_by.max()) if size_by is not None: markersize = size_by / size_by.max() * markersize
added automatic assignment of colors based on throats indices (instead of raising error)
py
diff --git a/holoviews/core/settings.py b/holoviews/core/settings.py index <HASH>..<HASH> 100644 --- a/holoviews/core/settings.py +++ b/holoviews/core/settings.py @@ -223,6 +223,8 @@ class SettingsTree(AttrTree): raise AttributeError("Settings object needs to have a group name specified.") elif isinstance(val, Settings): group_items = {val.key: val} + elif isinstance(val, SettingsTree): + group_items = val.groups current_node = self[identifier] if identifier in self.children else self for group_name in current_node.groups: @@ -238,6 +240,10 @@ class SettingsTree(AttrTree): raise ValueError('SettingsTree only accepts a dictionary of Settings.') super(SettingsTree, self).__setattr__(identifier, new_node) + if isinstance(val, SettingsTree): + for subtree in val: + self[identifier].__setattr__(subtree.identifier, subtree) + def find(self, path, mode='node'): """
Allowed setting subtrees on SettingsTree
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,14 +2,14 @@ from setuptools import setup, find_packages setup( name='edx-opaque-keys', - version='0.3.0', + version='0.3.1', author='edX', url='https://github.com/edx/opaque-keys', packages=find_packages(), install_requires=[ - 'six', - 'stevedore', - 'pymongo' + 'six>=1.10.0,<2.0.0', + 'stevedore>=0.14.1,<2.0.0', + 'pymongo>=2.7.2,<4.0.0' ], entry_points={ 'opaque_keys.testing': [
Pinning requirements We definitely need a later version of six to support python_2_unicode_compatible. Pinning the other requirements to avoid potential issues with major version bumps breaking this library. ECOM-<I>
py
diff --git a/salt/modules/bsd_shadow.py b/salt/modules/bsd_shadow.py index <HASH>..<HASH> 100644 --- a/salt/modules/bsd_shadow.py +++ b/salt/modules/bsd_shadow.py @@ -50,10 +50,14 @@ def info(name): 'name': '', 'passwd': ''} - # Get password aging info on FreeBSD - # TODO: Implement this for NetBSD, OpenBSD + cmd = "" if __salt__['cmd.has_exec']('pw'): - cmd = 'pw user show {0} | cut -f6,7 -d:'.format(name) + cmd = 'pw user show {0}'.format(name) + elif __grains__['kernel'] in ('NetBSD', 'OpenBSD'): + cmd = 'grep "^{0}:" /etc/master.passwd'.format(name) + + if cmd: + cmd += '| cut -f6,7 -d:' try: change, expire = __salt__['cmd.run_all'](cmd)['stdout'].split(':') except ValueError:
Implement password aging info for all BSDs.
py
diff --git a/ratcave/graphics/window.py b/ratcave/graphics/window.py index <HASH>..<HASH> 100644 --- a/ratcave/graphics/window.py +++ b/ratcave/graphics/window.py @@ -54,11 +54,9 @@ class Window(visual.Window): # Assign data to window after OpenGL context initialization self.active_scene = active_scene # For normal rendering. - self.resize() - - self._virtual_scene = None if virtual_scene: self.virtual_scene = virtual_scene + self.resize() self.autoCam = autoCam # Convenience attribute for moving virtual scene's light to the active scene's position. @@ -87,16 +85,9 @@ class Window(visual.Window): def resize(self): self.active_scene.camera.aspect = float(self.size[0]) / self.size[1] # Camera aspect ratio should match screen size, at least for the active scene. - - @property - def virtual_scene(self): - return self._virtual_scene - - @virtual_scene.setter - def virtual_scene(self, scene): - scene.camera.fov_y = 90. - scene.camera.aspect = 1. - self._virtual_scene = scene + if self.virtual_scene: + self.virtual_scene.camera.fov_y = 90. + self.virtual_scene.camera.aspect = 1. @property def shadow_fov_y(self):
extended Window.resize() to operate on virtual_scene as well, removing that property, too.
py
diff --git a/batchpath.py b/batchpath.py index <HASH>..<HASH> 100644 --- a/batchpath.py +++ b/batchpath.py @@ -30,7 +30,7 @@ class GeneratePaths: if os.path.isfile(path): if isvalid(path, self.access, self.extensions, minsize=self.minsize): - yield path + yield os.path.abspath(path) elif os.path.isdir(path): # pylint: disable=W0612 for root, dnames, fnames in self._walker(path):
Ensure GeneratePaths() methods always return absolute paths
py
diff --git a/salt/states/esxcluster.py b/salt/states/esxcluster.py index <HASH>..<HASH> 100644 --- a/salt/states/esxcluster.py +++ b/salt/states/esxcluster.py @@ -60,12 +60,29 @@ try: except ImportError: HAS_JSONSCHEMA = False +try: + from pyVmomi import VmomiSupport + HAS_PYVMOMI = True +except ImportError: + HAS_PYVMOMI = False + # Get Logging Started log = logging.getLogger(__name__) def __virtual__(): - return HAS_JSONSCHEMA + if not HAS_JSONSCHEMA: + return False, 'State module did not load: jsonschema not found' + if not HAS_PYVMOMI: + return False, 'State module did not load: pyVmomi not found' + + # We check the supported vim versions to infer the pyVmomi version + if 'vim25/6.0' in VmomiSupport.versionMap and \ + sys.version_info > (2, 7) and sys.version_info < (2, 7, 9): + + return False, ('State module did not load: Incompatible versions ' + 'of Python and pyVmomi present. See Issue #29537.') + return True def mod_init(low):
Added python/pyvmomi compatibility check to salt.states.esxcluster
py
diff --git a/lib/external_authentication_robot.py b/lib/external_authentication_robot.py index <HASH>..<HASH> 100644 --- a/lib/external_authentication_robot.py +++ b/lib/external_authentication_robot.py @@ -1,20 +1,20 @@ # -*- coding: utf-8 -*- ## -## This file is part of CDS Invenio. +## This file is part of Invenio. ## Copyright (C) 2010, 2011 CERN. ## -## CDS Invenio is free software; you can redistribute it and/or +## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## -## CDS Invenio is distributed in the hope that it will be useful, but +## Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License -## along with CDS Invenio; if not, write to the Free Software Foundation, Inc., +## along with Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. """External user authentication for simple robots
WebAccess: replace CDS Invenio by Invenio
py
diff --git a/ignite/contrib/engines/common.py b/ignite/contrib/engines/common.py index <HASH>..<HASH> 100644 --- a/ignite/contrib/engines/common.py +++ b/ignite/contrib/engines/common.py @@ -117,7 +117,7 @@ def _setup_common_training_handlers( if to_save is not None: if output_path is None: raise ValueError("If to_save argument is provided then output_path argument should be also defined") - checkpoint_handler = ModelCheckpoint(dirname=output_path, filename_prefix="training") + checkpoint_handler = ModelCheckpoint(dirname=output_path, filename_prefix="training", require_empty=False) trainer.add_event_handler(Events.ITERATION_COMPLETED(every=save_every_iters), checkpoint_handler, to_save) if with_gpu_stats: @@ -195,7 +195,7 @@ def _setup_common_distrib_training_handlers( if to_save is not None: if output_path is None: raise ValueError("If to_save argument is provided then output_path argument should be also defined") - checkpoint_handler = ModelCheckpoint(dirname=output_path, filename_prefix="training") + checkpoint_handler = ModelCheckpoint(dirname=output_path, filename_prefix="training", require_empty=False) trainer.add_event_handler(Events.ITERATION_COMPLETED(every=save_every_iters), checkpoint_handler, to_save)
Update common.py (#<I>) Set require_empty=False to ModelCheckpoint in `setup_common_training_handlers`. Thus, we can restore from a checkpoint in a folder and continue write in the same folder
py
diff --git a/phy/cluster/default_settings.py b/phy/cluster/default_settings.py index <HASH>..<HASH> 100644 --- a/phy/cluster/default_settings.py +++ b/phy/cluster/default_settings.py @@ -149,8 +149,13 @@ cluster_manual_config = [ def _select_clusters(gui, args): - args = list(map(int, args.split(' '))) - gui.select(args) + # Range: '5-12' + if '-' in args: + clusters = range(*map(int, args.split('-'))) + # List of ids: '5 6 9 12' + else: + clusters = list(map(int, args.split(' '))) + gui.select(clusters) cluster_manual_snippets = {
Added range support in select-cluster snippet.
py
diff --git a/pyes/es.py b/pyes/es.py index <HASH>..<HASH> 100644 --- a/pyes/es.py +++ b/pyes/es.py @@ -142,7 +142,6 @@ class ES(object): self.bulk_items = 0 self.info = {} #info about the current server - self.mappings = None #track mapping self.encoder = encoder if self.encoder is None: self.encoder = ESJsonEncoder @@ -543,8 +542,6 @@ class ES(object): else: path = self._make_path([','.join(indexes), "_mapping"]) result = self._send_request('GET', path) - #processing indexes - self.mappings = Mapper(result) return result
Mapper does not work for all mappings and is not used by the ES class. Remove so that the break get_mapping. It can always be created explicitly.
py
diff --git a/treetime/wrappers.py b/treetime/wrappers.py index <HASH>..<HASH> 100644 --- a/treetime/wrappers.py +++ b/treetime/wrappers.py @@ -817,14 +817,14 @@ def estimate_clock_model(params): res = myTree.reroot(params.reroot, force_positive=not params.allow_negative_rate) - myTree.get_clock_model(covariation=(params.reroot!='least-squares')) + myTree.get_clock_model(covariation=params.covariation) if res==ttconf.ERROR: print("ERROR: unknown root or rooting mechanism!\n" "\tvalid choices are 'least-squares', 'ML', and 'ML-rough'") return 1 else: - myTree.get_clock_model(covariation=True) + myTree.get_clock_model(covariation=params.covariation) d2d = utils.DateConversion.from_regression(myTree.clock_model) print('\n',d2d)
update clock command to handle covariance
py
diff --git a/shinken/modules/livestatus_broker/livestatus.py b/shinken/modules/livestatus_broker/livestatus.py index <HASH>..<HASH> 100644 --- a/shinken/modules/livestatus_broker/livestatus.py +++ b/shinken/modules/livestatus_broker/livestatus.py @@ -5117,6 +5117,7 @@ class LiveStatus: return sum(float(obj[attribute]) for obj in ref) / len(ref) return 0 + def std_postproc(ref): return 0
Oups: bad commit line (bad bash :) ), was max, min and cod functions in lviestatus return 0 for a void entry.
py
diff --git a/distributions.py b/distributions.py index <HASH>..<HASH> 100644 --- a/distributions.py +++ b/distributions.py @@ -3352,7 +3352,7 @@ class GammaCompoundDirichlet(CRP): if counts.sum() == 0: return 0, 0 else: - m = sample_crp_tablecounts(self.concentration,counts,weighted_cols) + m = sample_crp_tablecounts(self.concentration,counts,self.weighted_cols) return counts.sum(1), m.sum() def _get_statistics_python(self,data):
fix typo in concentration resampling code
py
diff --git a/rest_api/api.py b/rest_api/api.py index <HASH>..<HASH> 100644 --- a/rest_api/api.py +++ b/rest_api/api.py @@ -554,6 +554,8 @@ def get_evidence_for_stmts(): return stmts stmts_out = _get_matching_stmts(stmt) + agent_name_list = [ag.name for ag in stmt.agent_list()] + stmts_out = stmts = ac.filter_concept_names(stmts_out, agent_name_list, 'all') if stmts_out: stmts_json = stmts_to_json(stmts_out) res = {'statements': stmts_json}
rudimentary filter using agent name for database statements - previously returned statements containing at least one of the agents - changed so now we only get back statements containing both agents from the source statement for which we are seeking evidence in the db
py
diff --git a/pyinaturalist/formatters.py b/pyinaturalist/formatters.py index <HASH>..<HASH> 100644 --- a/pyinaturalist/formatters.py +++ b/pyinaturalist/formatters.py @@ -44,6 +44,7 @@ from pyinaturalist.models import ( User, get_lazy_attrs, ) +from pyinaturalist.pagination import Paginator def enable_logging(level: str = 'INFO'): @@ -151,6 +152,9 @@ def ensure_model_list(values: ResponseOrObjects) -> List[BaseModel]: """If the given values are raw JSON responses, attempt to detect their type and convert to model objects """ + if isinstance(values, Paginator): + return values.all() + values = ensure_list(values) if isinstance(values, BaseModelCollection) or isinstance(values[0], BaseModel): return values # type: ignore
Update pprint() to handle Paginator objects
py
diff --git a/astroid/test_utils.py b/astroid/test_utils.py index <HASH>..<HASH> 100644 --- a/astroid/test_utils.py +++ b/astroid/test_utils.py @@ -29,7 +29,7 @@ def require_version(minver: str = "0.0.0", maxver: str = "4.0.0") -> Callable: Skip the test if older. """ - def parse(python_version: str) -> Tuple[int]: + def parse(python_version: str) -> Tuple[int, ...]: try: return tuple(int(v) for v in python_version.split(".")) except ValueError as e:
Fix got "Tuple[int, ...]", expected "Tuple[int]"
py
diff --git a/salt/modules/win_useradd.py b/salt/modules/win_useradd.py index <HASH>..<HASH> 100644 --- a/salt/modules/win_useradd.py +++ b/salt/modules/win_useradd.py @@ -319,10 +319,10 @@ def _get_userprofile_from_registry(user, sid): we can get it from the registry ''' profile_dir = __salt__['reg.read_key']( - 'HKEY_LOCAL_MACHINE', 'SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\{0}'.format(sid), + 'HKEY_LOCAL_MACHINE', u'SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\{0}'.format(sid), 'ProfileImagePath' ) - log.debug('user {0} with sid={2} profile is located at "{1}"'.format(user, profile_dir, sid)) + log.debug(u'user {0} with sid={2} profile is located at "{1}"'.format(user, profile_dir, sid)) return profile_dir
fix error when Windows users has unicode character
py
diff --git a/aioconsole/stream.py b/aioconsole/stream.py index <HASH>..<HASH> 100644 --- a/aioconsole/stream.py +++ b/aioconsole/stream.py @@ -210,7 +210,7 @@ async def ainput(prompt="", *, streams=None, use_stderr=False, loop=None): async def aprint( - *values, sep=None, end="\n", flush=False, streams=None, use_stderr=False, loop=None + *values, sep=None, end="\n", flush=True, streams=None, use_stderr=False, loop=None ): """Asynchronous equivalent to *print*.""" # Get standard streams
Update default: `aprint(flush=False)` for `aprint(flush=True)` Before the update, `writer.drain()` was being called implicitly despite of value passed with `flush` parameter. It was reasonable in most of cases, so now `flush=True` by default
py
diff --git a/src/translate/generator.py b/src/translate/generator.py index <HASH>..<HASH> 100644 --- a/src/translate/generator.py +++ b/src/translate/generator.py @@ -62,8 +62,14 @@ class CTypesGenerator(object): # Load library if platform.system() == 'Windows': - # Add current directory to PATH, so we can load the DLL from right here. - os.environ['PATH'] += os.pathsep + os.path.dirname(__file__) + # in Python >= 3.8.0, new logic is used to load Windows DLL + # see (https://docs.python.org/3/whatsnew/3.8.html#ctypes) + # and (https://docs.python.org/3/library/os.html#os.add_dll_directory) + if hasattr(os, 'add_dll_directory'): + os.add_dll_directory(os.path.dirname(__file__)) + else: + # Add current directory to PATH, so we can load the DLL from right here. + os.environ['PATH'] += os.pathsep + os.path.dirname(__file__) else: _openvr_lib_name = os.path.join(os.path.dirname(__file__), _openvr_lib_name)
Fixed DLL loading in Python >= <I>. Python <I> introduces a new handling of the DLL loading on Windows, which basically means it no longer respects the PATH env. variable, but uses only system path. New function `os.add_dll_directory` has been added to support the DLL load path change. <URL>
py
diff --git a/MicroTokenizer/train/train_crf.py b/MicroTokenizer/train/train_crf.py index <HASH>..<HASH> 100644 --- a/MicroTokenizer/train/train_crf.py +++ b/MicroTokenizer/train/train_crf.py @@ -8,17 +8,19 @@ from tqdm import tqdm def train_crf(input_files_list, output_dir): crf_trainer = CRFTrainer() + output_file = os.path.join(output_dir, 'model.crfsuite') + for data_file in input_files_list: with open(data_file) as fd: for line in tqdm(fd): crf_trainer.train_one_raw_line(line) - crf_trainer.train(output_dir) + crf_trainer.train(output_file) if __name__ == "__main__": current_dir = os.path.dirname(os.path.abspath(__file__)) train_crf( [os.path.join(current_dir, "./data.txt")], - os.path.join(current_dir, "./model.crfsuite") + os.path.join(current_dir, "./") )
Fix: should using model_dir instead of model_file
py
diff --git a/pywal/export.py b/pywal/export.py index <HASH>..<HASH> 100644 --- a/pywal/export.py +++ b/pywal/export.py @@ -48,7 +48,7 @@ def every(colors, output_dir=CACHE_DIR): for file in os.scandir(MODULE_DIR / "templates"): template(all_colors, file.path, output_dir / file.name) - print(f"export: Exported all files.") + print("export: Exported all files.") def color(colors, export_type, output_file=None):
general: Remove pointless f-string
py
diff --git a/screamshot/__init__.py b/screamshot/__init__.py index <HASH>..<HASH> 100644 --- a/screamshot/__init__.py +++ b/screamshot/__init__.py @@ -6,4 +6,5 @@ app_settings = dict({ 'CAPTURE_ALLOWED_IPS': ('127.0.0.1',), 'CLI_ARGS': [], 'CASPERJS_CMD': None, + 'PHANTOMJS_CMD': None, }, **getattr(settings, 'SCREAMSHOT_CONFIG', {}))
ref #<I> submodule django-streamshot as a tool for screen capture with customization of PHANTOMJS_CMD as configuration
py
diff --git a/pypi_download_stats/dataquery.py b/pypi_download_stats/dataquery.py index <HASH>..<HASH> 100644 --- a/pypi_download_stats/dataquery.py +++ b/pypi_download_stats/dataquery.py @@ -143,6 +143,11 @@ Resource-class.html>`_ datasetId=self._DATASET_ID) while request is not None: response = request.execute() + # if the number of results is evenly divisible by the page size, + # we may end up with a last response that has no 'tables' key, + # and is empty. + if 'tables' not in response: + response['tables'] = [] for table in response['tables']: if table['type'] != 'TABLE': logger.debug('Skipping %s (type=%s)',
fix KeyError when number of results is evenly divisible by page size, and 'tables' key is missing
py
diff --git a/haproxy/tests/test_haproxy_log_line.py b/haproxy/tests/test_haproxy_log_line.py index <HASH>..<HASH> 100644 --- a/haproxy/tests/test_haproxy_log_line.py +++ b/haproxy/tests/test_haproxy_log_line.py @@ -212,3 +212,14 @@ class HaproxyLogLineTest(unittest.TestCase): self.assertTrue(log_line.valid) self.assertEqual('/', log_line.http_request_path) + + def test_haproxy_log_line_strip_syslog_valid_hostname_slug(self): + """Checks that if the hostname added to syslog slug is still valid + line + """ + self.http_request = 'GET / HTTP/1.1' + self.process_name_and_pid = 'ip-192-168-1-1 haproxy[28029]:' + raw_line = self._build_test_string() + log_line = HaproxyLogLine(raw_line) + + self.assertTrue(log_line.valid)
added unittest to check for host name
py
diff --git a/lib/autokey/gtkui/__main__.py b/lib/autokey/gtkui/__main__.py index <HASH>..<HASH> 100644 --- a/lib/autokey/gtkui/__main__.py +++ b/lib/autokey/gtkui/__main__.py @@ -8,3 +8,6 @@ def main(): a = Application() a.main() + +if __name__ == '__main__': + main()
Allow autokey-gtk to be run directly from the source directory. It can be launched from lib/ using 'python3 -m autokey.gtkui [-lc]'
py
diff --git a/trepan/processor/command/deparse.py b/trepan/processor/command/deparse.py index <HASH>..<HASH> 100644 --- a/trepan/processor/command/deparse.py +++ b/trepan/processor/command/deparse.py @@ -88,7 +88,6 @@ See also: text = out.getvalue() pass except: - raise self.errmsg("error in deparsing code") return
Remove debug stmt
py
diff --git a/py/code/frame.py b/py/code/frame.py index <HASH>..<HASH> 100644 --- a/py/code/frame.py +++ b/py/code/frame.py @@ -50,6 +50,9 @@ class Frame(object): """ retval = [] for arg in self.code.getargs(): - retval.append((arg, self.f_locals[arg])) + try: + retval.append((arg, self.f_locals[arg])) + except KeyError: + pass # this can occur when using Psyco return retval
[svn r<I>] Fix for a corner case: when the arguments are 'del'-eted from the local scope. This can also occur when using Psyco because f_locals is then empty. --HG-- branch : trunk
py
diff --git a/pyghmi/ipmi/console.py b/pyghmi/ipmi/console.py index <HASH>..<HASH> 100644 --- a/pyghmi/ipmi/console.py +++ b/pyghmi/ipmi/console.py @@ -285,6 +285,7 @@ class Console(object): while not (self.connected or self.broken): session.Session.wait_for_rsp(timeout=10) if not self.ipmi_session.logged: + self._print_error('Session no longer connected') raise exc.IpmiException('Session no longer connected') self.ipmi_session.send_payload(payload, payload_type=payload_type,
Print SOL error on broken ipmi session If we detect a broken ipmi session on send, induce calling code to do error handling. Change-Id: I<I>a6fc6bf<I>e<I>f6c<I>b<I>e<I>b<I>a2ca
py
diff --git a/cmsplugin_cascade/plugin_base.py b/cmsplugin_cascade/plugin_base.py index <HASH>..<HASH> 100644 --- a/cmsplugin_cascade/plugin_base.py +++ b/cmsplugin_cascade/plugin_base.py @@ -226,8 +226,8 @@ class CascadePluginBase(six.with_metaclass(CascadePluginBaseMetaclass, CMSPlugin This differs from get_previous_sibling() which returns an instance of the same kind. """ try: - if obj and obj.parent: - previnst = obj.parent.get_children().get(position=obj.position - 1) + if obj and obj.parent and obj.position > 0: + previnst = obj.parent.get_children()[obj.position - 1] return previnst.get_plugin_instance() except ObjectDoesNotExist: pass @@ -240,9 +240,9 @@ class CascadePluginBase(six.with_metaclass(CascadePluginBaseMetaclass, CMSPlugin """ try: if obj and obj.parent: - nextinst = obj.parent.get_children().get(position=obj.position + 1) + nextinst = obj.parent.get_children()[obj.position + 1] return nextinst.get_plugin_instance() - except ObjectDoesNotExist: + except (IndexError, ObjectDoesNotExist): pass return None, None
Access plugin children by list index rather than by get()
py
diff --git a/tests/myapp/__main__.py b/tests/myapp/__main__.py index <HASH>..<HASH> 100644 --- a/tests/myapp/__main__.py +++ b/tests/myapp/__main__.py @@ -1,4 +1,7 @@ import sys from .cli import main + +from hupper.compat import PY64, OS64 +print('PY64=%s\nOS64=%s' % (PY64, OS64)) sys.exit(main(sys.argv[1:]) or 0)
dummy to discover what appveyor is running
py
diff --git a/nodeconductor/cost_tracking/models.py b/nodeconductor/cost_tracking/models.py index <HASH>..<HASH> 100644 --- a/nodeconductor/cost_tracking/models.py +++ b/nodeconductor/cost_tracking/models.py @@ -303,13 +303,6 @@ class ConsumptionDetails(core_models.UuidMixin, TimeStampedModel): _consumed[consumable_item] = after_update + before_update return _consumed - def _get_month_end(self): - year, month = self.price_estimate.year, self.price_estimate.month - days_in_month = calendar.monthrange(year, month)[1] - last_day_of_month = datetime.date(month=month, year=year, day=days_in_month) - last_second_of_month = datetime.datetime.combine(last_day_of_month, datetime.time.max) - return timezone.make_aware(last_second_of_month, timezone.get_current_timezone()) - def _get_minutes_from_last_update(self, time): """ How much minutes passed from last update to given time """ time_from_last_update = time - self.last_update_time
Delete unused method - nc-<I>
py
diff --git a/discord/member.py b/discord/member.py index <HASH>..<HASH> 100644 --- a/discord/member.py +++ b/discord/member.py @@ -264,6 +264,22 @@ class Member(discord.abc.Messageable): return False + def permissions_in(self, channel): + """An alias for :meth:`Channel.permissions_for`. + + Basically equivalent to: + + .. code-block:: python + + channel.permissions_for(self) + + Parameters + ----------- + channel + The channel to check your permissions for. + """ + return channel.permissions_for(self) + @property def top_role(self): """Returns the member's highest role.
Fix Member.permissions_in passing in the wrong self parameter.
py
diff --git a/delorean/dates.py b/delorean/dates.py index <HASH>..<HASH> 100644 --- a/delorean/dates.py +++ b/delorean/dates.py @@ -15,7 +15,7 @@ utc = timezone("UTC") def get_total_second(td): """ This method takes a timedelta and return the number of seconds it - represents with the resolution of 10 **6 + represents with the resolution of 10**6 """ return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 1e6) / 1e6
Removes weird link generated by Sphinx This commit fixes issue #<I>
py
diff --git a/tests/test_graph_api.py b/tests/test_graph_api.py index <HASH>..<HASH> 100644 --- a/tests/test_graph_api.py +++ b/tests/test_graph_api.py @@ -145,10 +145,7 @@ def test_get_with_retries(): } }) - try: - graph.get('me', retry=3) - except GraphAPI.FacebookError: - pass + assert_raises(GraphAPI.FacebookError, graph.get, 'me', retry=3) assert mock_request.call_args_list == [ call('GET', 'https://graph.facebook.com/me',
Refactor test_get_with_retries with assert_raises
py
diff --git a/pandas/tests/series/indexing/test_setitem.py b/pandas/tests/series/indexing/test_setitem.py index <HASH>..<HASH> 100644 --- a/pandas/tests/series/indexing/test_setitem.py +++ b/pandas/tests/series/indexing/test_setitem.py @@ -405,6 +405,18 @@ class TestSetitemWithExpansion: tm.assert_series_equal(series, expected) assert series.index.freq == expected.index.freq + def test_setitem_empty_series_timestamp_preserves_dtype(self): + # GH 21881 + timestamp = Timestamp(1412526600000000000) + series = Series([timestamp], index=["timestamp"], dtype=object) + expected = series["timestamp"] + + series = Series([], dtype=object) + series["anything"] = 300.0 + series["timestamp"] = timestamp + result = series["timestamp"] + assert result == expected + def test_setitem_scalar_into_readonly_backing_data(): # GH#14359: test that you cannot mutate a read only buffer
Series with dtype=object does unexpected type conversion (#<I>)
py
diff --git a/neo.py b/neo.py index <HASH>..<HASH> 100755 --- a/neo.py +++ b/neo.py @@ -407,7 +407,7 @@ class Repo(object): print self.name, 'unmodified' return - with open(self.lib, 'w') as f: + with open(self.lib, 'wb') as f: f.write(self.url + '\n') print self.name, '->', self.url
Standardized to \n for newlines in lib files
py
diff --git a/emma2/__init__.py b/emma2/__init__.py index <HASH>..<HASH> 100644 --- a/emma2/__init__.py +++ b/emma2/__init__.py @@ -7,11 +7,6 @@ import msm import pmm import util -""" global logging support. See documentation of python library -logging module for more information""" -from util.log import log - - # scipy.sparse.diags function introduced in scipy 0.11, provide a fallback for # users of older versions import scipy.sparse
removed global log instance, use getLogger instead
py
diff --git a/raiden/network/transport/matrix/transport.py b/raiden/network/transport/matrix/transport.py index <HASH>..<HASH> 100644 --- a/raiden/network/transport/matrix/transport.py +++ b/raiden/network/transport/matrix/transport.py @@ -1366,6 +1366,10 @@ class MatrixTransport(Runnable): for user_id in self._address_mgr.get_userids_for_address(receiver_address) if self._address_mgr.get_userid_presence(user_id) in USER_PRESENCE_REACHABLE_STATES } + if not online_userids: + self.log.debug("No online user_ids", online_userids=online_userids) + return + body = { user_id: {"*": {"msgtype": "m.text", "body": data}} for user_id in online_userids }
Check that at least one userid is online
py
diff --git a/pynlpir/__init__.py b/pynlpir/__init__.py index <HASH>..<HASH> 100644 --- a/pynlpir/__init__.py +++ b/pynlpir/__init__.py @@ -145,7 +145,7 @@ def segment(s, pos_tagging=True, pos_names='parent', pos_english=True): logger.debug("Segmenting text with%s POS tagging: %s." % ('' if pos_tagging else 'out', s)) result = nlpir.ParagraphProcess(_encode(s), pos_tagging) - result = result.decode('utf_8') + result = _decode(result) logger.debug("Finished segmenting text: %s." % result) logger.debug("Formatting segmented text.") tokens = result.strip().split(' ') @@ -182,7 +182,7 @@ def get_key_words(s, max_words=50, weighted=False): logger.debug("Searching for up to %s%s key words in: %s." % (max_words, ' weighted' if weighted else '', s)) result = nlpir.GetKeyWords(_encode(s), max_words, weighted) - result = result.decode('utf_8') + result = _decode(result) logger.debug("Finished key word search: %s." % result) logger.debug("Formatting key word search results.") fresult = result.strip('#').split('#')
Fixes decoding problem in helper functions.
py
diff --git a/bcbio/utils.py b/bcbio/utils.py index <HASH>..<HASH> 100644 --- a/bcbio/utils.py +++ b/bcbio/utils.py @@ -113,7 +113,14 @@ def s3_handle(fname): bucket, key = s3_bucket_key(fname) s3 = boto.connect_s3() - s3b = s3.get_bucket(bucket) + try: + s3b = s3.get_bucket(bucket) + except boto.exception.S3ResponseError, e: + # if we don't have bucket permissions but folder permissions, try without validation + if e.status == 403: + s3b = s3.get_bucket(bucket, validate=False) + else: + raise s3key = s3b.get_key(key) return S3Handle(s3key)
Enable streaming of files from buckets without access permissions. Fix for getting HiSeq X Ten data
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -55,6 +55,9 @@ if sys.version_info < (2, 7) or ( # module (appears in Python 2.7 and Python 3.1) test_requirements.append('unittest2') +if sys.version_info < (2, 6): + test_requirements.append('simplejson') + if sys.version_info >= (3, 0): # the fs lib doesn't currently install on Python 3. Omit it for now. # See http://code.google.com/p/pyfilesystem/issues/detail?id=135
Simplejson is required for some backends on Python <I>
py
diff --git a/delphin/mrs/xmrs.py b/delphin/mrs/xmrs.py index <HASH>..<HASH> 100644 --- a/delphin/mrs/xmrs.py +++ b/delphin/mrs/xmrs.py @@ -316,11 +316,12 @@ class Xmrs(LnkMixin): def __hash__(self): # isomorphic MRSs should hash to the same thing, but # calculating isomorphism is expensive. Approximate it. - return hash(' '.join(sorted( - '{}:{}'.format(ep.pred.short_form(), - len(ep.argdict) + return hash(' '.join( + sorted( + '{}:{}'.format(ep.pred.short_form(), len(ep.argdict)) + for ep in self.eps ) - ))) + )) def __eq__(self, other): # actual equality is more than isomorphism, all variables and
Fix bug in Xmrs hash function.
py
diff --git a/httpretty/core.py b/httpretty/core.py index <HASH>..<HASH> 100644 --- a/httpretty/core.py +++ b/httpretty/core.py @@ -123,7 +123,7 @@ class HTTPrettyRequest(BaseHTTPRequestHandler, BaseClass): internal `parse_request` method. It also replaces the `rfile` and `wfile` attributes with StringIO - instances so that we garantee that it won't make any I/O, neighter + instances so that we guarantee that it won't make any I/O, neighter for writing nor reading. It has some convenience attributes:
correct spelling mistake (#<I>)
py
diff --git a/irco/scripts/data_import.py b/irco/scripts/data_import.py index <HASH>..<HASH> 100644 --- a/irco/scripts/data_import.py +++ b/irco/scripts/data_import.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import argparse from sqlalchemy import create_engine @@ -27,6 +29,7 @@ def import_records(engine, records): .first()) if publication: + session.close() ignored += 1 continue @@ -65,7 +68,8 @@ def import_records(engine, records): affiliated_author = models.AffiliatedAuthor( order=1, - is_corresponding=(record.get('corresponding_author', None) == i), + is_corresponding=( + record.get('corresponding_author', None) == i), unparsed_institution_name=raw, institution=institution, unparsed_person_name=name, @@ -75,6 +79,7 @@ def import_records(engine, records): session.add(affiliated_author) session.commit() + session.close() imported += 1 return imported, ignored @@ -116,5 +121,5 @@ def main(): count_before) pipeline.add_metric('after_import', 'Records count after import', count_after) - print - print pipeline.report() + print() + print(pipeline.report())
PEP8, python3 and cleanup sessions.
py
diff --git a/elifetools/parseJATS.py b/elifetools/parseJATS.py index <HASH>..<HASH> 100644 --- a/elifetools/parseJATS.py +++ b/elifetools/parseJATS.py @@ -920,9 +920,9 @@ def format_contributor(contrib_tag, soup, detail="brief"): elif rid.startswith('fn'): add_to_list_dictionary(contrib_refs, 'foot-note', rid) elif ref_type == "other": - if rid.startswith('par-'): + if rid.startswith('par-') or rid.startswith('fund'): add_to_list_dictionary(contrib_refs, 'funding', rid) - elif rid.startswith('dataro'): + elif rid.startswith('dataro') or rid.startswith('dataset'): add_to_list_dictionary(contrib_refs, 'related-object', rid) if len(contrib_refs) > 0:
Support rid naming in the new kitchen sink for dataset and funding xref tags.
py
diff --git a/tests/tests.py b/tests/tests.py index <HASH>..<HASH> 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -81,7 +81,7 @@ class TestDjango(TestCase): self.assertEqual(result, data) def test_context_autoescape_off(self): - """Test that the use can disable autoescape by providing a Context instance.""" + """Test that the user can disable autoescape by providing a Context instance.""" data = "&'" result = render_block_to_string('test5.html', 'block2', Context({'foo': data}, autoescape=False)) self.assertEqual(result, data)
Fix a typo in a docstring.
py
diff --git a/openpnm/network/CubicDual.py b/openpnm/network/CubicDual.py index <HASH>..<HASH> 100644 --- a/openpnm/network/CubicDual.py +++ b/openpnm/network/CubicDual.py @@ -125,7 +125,8 @@ class CubicDual(GenericNetwork): # Finally, scale network to requested spacing net['pore.coords'] *= spacing - def add_boundary_pores(self, labels, spacing): + def add_boundary_pores(self, labels=['top', 'bottom', 'front', 'back', + 'left', 'right'], spacing=None): r""" Add boundary pores to the specified faces of the network @@ -151,7 +152,7 @@ class CubicDual(GenericNetwork): Ps = self.pores(item) coords = sp.absolute(self['pore.coords'][Ps]) axis = sp.count_nonzero(sp.diff(coords, axis=0), axis=0) == 0 - offset = sp.array(axis, dtype=int)/2 + offset = sp.array(axis, dtype=int)*spacing/2 if sp.amin(coords) == sp.amin(coords[:, sp.where(axis)[0]]): offset = -1*offset topotools.add_boundary_pores(network=self, pores=Ps, offset=offset,
Fix bug in add_boundary_pores that ignored lattice spacing and update labels argument to be consistent with Cubic
py
diff --git a/snakebite/client.py b/snakebite/client.py index <HASH>..<HASH> 100644 --- a/snakebite/client.py +++ b/snakebite/client.py @@ -797,7 +797,7 @@ class Client(object): return data[max(0, len(data)-1024):len(data)] def test(self, path, exists=False, directory=False, zero_length=False): - '''Test if a paht exist, is a directory or has zero length + '''Test if a path exist, is a directory or has zero length :param path: Path to test :type path: string
Fix a typo in a comment in client.py
py
diff --git a/falafel/tests/integration.py b/falafel/tests/integration.py index <HASH>..<HASH> 100644 --- a/falafel/tests/integration.py +++ b/falafel/tests/integration.py @@ -7,15 +7,21 @@ def integration_test(module, test_func, input_data, expected): test_func(tests.integrate(input_data, module), expected) +def completed(test_func, package_name): + if not hasattr(test_func, "parametrized"): + test_func.parametrized = [] + return any(package_name.startswith(p) for p in test_func.parametrized) + + def generate_tests(metafunc, test_func, package_name): """ This function hooks in to pytest's test collection framework and provides a test for every (input_data, expected) tuple that is generated from all @archive_provider-decorated functions. """ - if metafunc.function == test_func and not hasattr(test_func, "parametrized"): + if metafunc.function == test_func and not completed(test_func, package_name): load_package(package_name) - test_func.parametrized = True # Hack to ensure we don't generate tests twice + test_func.parametrized.append(package_name) args = [] ids = [] for f in tests.ARCHIVE_GENERATORS:
Allowing integration.generate_tests to be called multiple times once for each package that contains @archive_provider tests.
py
diff --git a/fault/system_verilog_target.py b/fault/system_verilog_target.py index <HASH>..<HASH> 100644 --- a/fault/system_verilog_target.py +++ b/fault/system_verilog_target.py @@ -286,8 +286,8 @@ end; if check_timestamp: new_stat_result = os.stat(tb_file) new_times = (new_stat_result.st_atime, new_stat_result.st_mtime) - if new_times[1] - old_times[1] == 0: - new_times = (new_times[0] + 1, new_times[1] + 1) + if new_times[1] <= old_times[1]: + new_times = (new_times[0], old_times[1] + 1) os.utime(tb_file, times=new_times) verilog_libraries = " ".join(str(x) for x in self.include_verilog_libraries)
handle case when the timestamp just keeps increasing
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup, find_packages setup( name = "django-user-accounts", - version = "1.0b5", + version = "1.0b6", author = "Brian Rosner", author_email = "brosner@gmail.com", description = "a Django user account app",
Bumped version to reflect the current state
py
diff --git a/src/requirementslib/__init__.py b/src/requirementslib/__init__.py index <HASH>..<HASH> 100644 --- a/src/requirementslib/__init__.py +++ b/src/requirementslib/__init__.py @@ -1,5 +1,5 @@ # -*- coding=utf-8 -*- -__version__ = '1.1.7' +__version__ = '1.1.8.dev0' from .exceptions import RequirementError
Prebump to <I>.dev0
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup_args.update(dict( name='param', version='1.0', description='Declarative Python programming using Parameters.', - long_description=open('README.txt').read(), + long_description=open('README.rst').read(), author= "IOAM", author_email= "developers@topographica.org", maintainer= "IOAM",
fix setup.py install README.txt moved to .rst
py
diff --git a/jchart/tests.py b/jchart/tests.py index <HASH>..<HASH> 100644 --- a/jchart/tests.py +++ b/jchart/tests.py @@ -35,8 +35,8 @@ class LineChart(Chart): class LineChartParameterized(LineChart): def get_datasets(self, currency_type): - eur_data = range(10) - do_data = range(10, 20) + eur_data = list(range(10)) + do_data = list(range(10, 20)) if currency_type == 'euro': return [dict(label='Euro Chart', data=eur_data)]
ranges are not json serializable
py
diff --git a/chess_py/core/algebraic/converter.py b/chess_py/core/algebraic/converter.py index <HASH>..<HASH> 100644 --- a/chess_py/core/algebraic/converter.py +++ b/chess_py/core/algebraic/converter.py @@ -130,7 +130,7 @@ def incomplete_alg(alg_str, input_color, position): if len(alg_str) == 3: possible_piece, start_location = _get_piece_start_location(end_location, input_color, - alg_str[0], + _get_piece(alg_str, 0), position) return Move(end_loc=end_location, piece=possible_piece,
Fix piece conversion bug Use piece type in move.piece instead of string representation
py
diff --git a/hug/types.py b/hug/types.py index <HASH>..<HASH> 100644 --- a/hug/types.py +++ b/hug/types.py @@ -127,8 +127,8 @@ class InlineDictionary(Type): """A single line dictionary, where items are separted by commas and key:value are separated by a pipe""" __slots__ = () - def __call__(self, value): - return {key.strip(): value.strip() for key, value in (item.split(":") for item in value.split("|"))} + def __call__(self, string): + return {key.strip(): value.strip() for key, value in (item.split(":") for item in string.split("|"))} class OneOf(Type):
Fix error that caused Cython not to compile
py