From 12e828567463c27b275ed25f76cb7735d1b3b79d Mon Sep 17 00:00:00 2001 From: Olivier Mangin Date: Tue, 20 Mar 2018 18:43:51 -0400 Subject: [PATCH 1/3] Adds tag list completion in --- pubs/commands/add_cmd.py | 5 +++-- pubs/completion.py | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pubs/commands/add_cmd.py b/pubs/commands/add_cmd.py index a425434..233fd7a 100644 --- a/pubs/commands/add_cmd.py +++ b/pubs/commands/add_cmd.py @@ -6,9 +6,9 @@ from .. import repo from .. import paper from .. import templates from .. import apis -from .. import color from .. import pretty from .. import utils +from ..completion import CommaSeparatedTagsCompletion class ValidateDOI(argparse.Action): @@ -26,7 +26,8 @@ def parser(subparsers, conf): parser.add_argument('-I', '--isbn', help='isbn number to retrieve the bibtex entry, if it is not provided', default=None) parser.add_argument('-d', '--docfile', help='pdf or ps file', default=None) parser.add_argument('-t', '--tags', help='tags associated to the paper, separated by commas', - default=None) + default=None + ).completer = CommaSeparatedTagsCompletion(conf) parser.add_argument('-k', '--citekey', help='citekey associated with the paper;\nif not provided, one will be generated automatically.', default=None) parser.add_argument('-L', '--link', action='store_false', dest='copy', default=True, diff --git a/pubs/completion.py b/pubs/completion.py index f08af56..a48f75c 100644 --- a/pubs/completion.py +++ b/pubs/completion.py @@ -59,6 +59,11 @@ class TagModifierCompletion(BaseCompleter): return [partial_expr + t for t in tags if t.startswith(t_prefix)] +class CommaSeparatedTagsCompletion(TagModifierCompletion): + + regxp = r"[^,]*$" + + class CommaSeparatedListCompletion(BaseCompleter): values = [] From ec0b38331923c2d5565c8915eb89de072c30ab36 Mon Sep 17 00:00:00 2001 From: "Fabien C. Y. Benureau" Date: Thu, 22 Mar 2018 11:29:52 +0900 Subject: [PATCH 2/3] add python osx 2.7 to travis testing --- .travis.yml | 50 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2b1ccc1..8173790 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,27 +1,43 @@ -os: - - linux -language: python -python: - - "2.7" - - "3.3" - - "3.4" - - "3.5" - - "3.6" +# list of environments to test matrix: include: - - language: generic - os: osx - python: - - "3" + - os: linux + language: python + python: 2.7 + - os: linux + language: python + python: 3.3 + - os: linux + language: python + python: 3.4 + - os: linux + language: python + python: 3.5 + - os: linux + language: python + python: 3.6 + - os: osx + language: generic + python: 2.7 + before_install: + - python2 --version + - pip2 install -U virtualenv + - virtualenv env -p python2 + - source env/bin/activate + - os: osx + language: generic + python: ">=3.6" before_install: - brew update - brew outdated python3 || brew install python3 || brew upgrade python3 - - pip install -U virtualenv - - virtualenv env -p python3 + - python3 -m venv env - source env/bin/activate + # command to install dependencies install: - - "pip install -r tests/requirements.txt" - - "python setup.py install" + - python --version + - pip install -r tests/requirements.txt + - python setup.py install + # command to run tests script: python -m unittest discover From f8a8e0e2074788694a0eacedbc495cb10cff296f Mon Sep 17 00:00:00 2001 From: "Fabien C. Y. Benureau" Date: Thu, 22 Mar 2018 11:38:26 +0900 Subject: [PATCH 3/3] pyfakefs 3.3 --- tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index d633271..c3ee05b 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,4 +1,4 @@ # those are the additional packages required to run the tests six -pyfakefs +pyfakefs==3.3 ddt