From 41de8b5aabee2aa2b0ed2f26285f2949d209ba0b Mon Sep 17 00:00:00 2001 From: Olivier Mangin Date: Wed, 26 Sep 2018 23:29:02 -0700 Subject: [PATCH 1/4] Fixes code blocks in readme.md. --- readme.md | 84 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 48 insertions(+), 36 deletions(-) diff --git a/readme.md b/readme.md index 5b43e56..5e618e0 100644 --- a/readme.md +++ b/readme.md @@ -16,20 +16,23 @@ Pubs is built with the following principles in mind: ## Installation You can install the latest stable version of `pubs` through Pypi, with: - - pip install pubs + ``` + pip install pubs + ``` Alternatively, you can: - install the latest development version with pip: - + ``` pip install --upgrade git+https://github.com/pubs/pubs + ``` - clone the repository and install it manually: - + ``` git clone https://github.com/pubs/pubs cd pubs python setup.py install [--user] + ``` Arch Linux users can also use the [pubs-git](https://aur.archlinux.org/packages/pubs-git/) AUR package. @@ -37,28 +40,34 @@ Arch Linux users can also use the [pubs-git](https://aur.archlinux.org/packages/ ## Getting started Create your library (by default, goes to `~/.pubs/`). - - pubs init + ``` + pubs init + ``` Import existing data from bibtex (pubs will try to automatically copy documents defined as 'file' in bibtex): - - pubs import path/to/collection.bib + ``` + pubs import path/to/collection.bib + ``` or for a .bib file containing a single reference: - - pubs add reference.bib -d article.pdf + ``` + pubs add reference.bib -d article.pdf + ``` pubs can also automatically retrieve the bibtex from a doi: - - pubs add -D 10.1007/s00422-012-0514-6 -d article.pdf + ``` + pubs add -D 10.1007/s00422-012-0514-6 -d article.pdf + ``` or an ISBN (dashes are ignored): - - pubs add -I 978-0822324669 -d article.pdf + ``` + pubs add -I 978-0822324669 -d article.pdf + ``` or an arXiv id (automatically downloading arXiv article is in the works): - - pubs add -X math/9501234 -d article.pdf + ``` + pubs add -X math/9501234 -d article.pdf + ``` ## References always up-to-date @@ -66,8 +75,9 @@ or an arXiv id (automatically downloading arXiv article is in the works): If you use latex, you can automatize references, by running `pubs export > references.bib` each time you update your library, which also fits well as a `makefile` rule. This ensures that your reference file is always up-to-date; you can cite a paper in your manuscript a soon as you add it in pubs. This means that if you have, for instance, a doi on a webpage, you only need to do: - - pubs add -D 10.1007/s00422-012-0514-6 + ``` + pubs add -D 10.1007/s00422-012-0514-6 + ``` and then add `\cite{Loeb_2012}` in your manuscript. After exporting the bibliography, the citation will correctly appear in your compiled pdf. @@ -75,23 +85,25 @@ and then add `\cite{Loeb_2012}` in your manuscript. After exporting the bibliogr ## Document management You can attach a document to a reference: - - pubs add Loeb2012_downloaded.pdf Loeb_2012 + ``` + pubs add Loeb2012_downloaded.pdf Loeb_2012 + ``` And open your documents automatically from the command line: - - pubs doc open Loeb_2012 - pubs doc open --with lp Loeb_2012 # Opens the document with `lp` to actually print it. - + ``` + pubs doc open Loeb_2012 + pubs doc open --with lp Loeb_2012 # Opens the document with `lp` to actually print it. + ``` ## Customization Pubs is designed to interact well with your command line tool chain. You can add custom commands to pubs by defining aliases in your configuration file (make sure that the alias plugin is activated in your configuration by using `pubs conf`). - - [[alias]] - evince = open --with evince - count = !pubs list -k "$@" | wc -l + ```ini + [[alias]] + evince = open --with evince + count = !pubs list -k "$@" | wc -l + ``` The first command defines a new subcommand: `pubs open --with evince` will be executed when `pubs evince` is typed. The second starts with a bang: `!`, and is treated as a shell command. If other arguments are provided they are passed to the shell command as in a script. In the example above the `count` alias can take arguments that are be passed to the `pubs list -k` command, hence enabling filters like `pubs count year:2012`. @@ -102,14 +114,14 @@ The second starts with a bang: `!`, and is treated as a shell command. If other For autocompletion to work, you need the [argcomplete](https://argcomplete.readthedocs.io) Python package, and Bash 4.2 or newer. For activating *bash* or *tsch* completion, consult the [argcomplete documentation](https://argcomplete.readthedocs.io/en/latest/#global-completion). For *zsh* completion, the global activation is not supported but bash completion compatibility can be used for pubs. For that, add the following to your `.zshrc`: - - # Enable and load bashcompinit - autoload -Uz compinit bashcompinit - compinit - bashcompinit - # Argcomplete explicit registration for pubs - eval "$(register-python-argcomplete pubs)" - + ```shell + # Enable and load bashcompinit + autoload -Uz compinit bashcompinit + compinit + bashcompinit + # Argcomplete explicit registration for pubs + eval "$(register-python-argcomplete pubs)" + ``` ## Need more help ? From d931b977e493cd1b324e80766e0a2eacf77fdcdd Mon Sep 17 00:00:00 2001 From: Olivier Mangin Date: Tue, 4 Dec 2018 20:36:36 -0800 Subject: [PATCH 2/4] Fix #173: add MANIFEST.in with readme. Also add package data for test fixtures. --- MANIFEST.in | 1 + setup.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..1a69f4c --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include readme.md diff --git a/setup.py b/setup.py index aa0cded..ee088a2 100644 --- a/setup.py +++ b/setup.py @@ -4,6 +4,7 @@ import unittest from setuptools import setup + with open('pubs/version.py') as f: exec(f.read()) # defines __version__ @@ -11,11 +12,13 @@ here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'readme.md'), 'r') as fd: long_description = fd.read() + def pubs_test_suite(): test_loader = unittest.TestLoader() test_suite = test_loader.discover('tests', pattern='test_*.py') return test_suite + setup( name='pubs', version=__version__, @@ -40,6 +43,8 @@ setup( ], }, + include_package_data=True, + install_requires=['pyyaml', 'bibtexparser>=1.0', 'python-dateutil', 'six', 'requests', 'configobj', 'beautifulsoup4', 'feedparser'], extras_require={'autocompletion': ['argcomplete'], @@ -54,7 +59,7 @@ setup( 'Intended Audience :: Science/Research', ], - test_suite= 'tests', + test_suite='tests', tests_require=['pyfakefs>=3.4', 'mock', 'ddt'], # in order to avoid 'zipimport.ZipImportError: bad local file header' From a6c7376b51e2c674e81db78865ce8c2809196c0c Mon Sep 17 00:00:00 2001 From: Olivier Mangin Date: Tue, 4 Dec 2018 20:40:34 -0800 Subject: [PATCH 3/4] Version 0.8.2 --- changelog.md | 11 ++++++++++- pubs/version.py | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index f3e3036..3cd48aa 100644 --- a/changelog.md +++ b/changelog.md @@ -3,7 +3,7 @@ ## Current master -[Full Changelog](https://github.com/pubs/pubs/compare/v0.8.1...master) +[Full Changelog](https://github.com/pubs/pubs/compare/v0.8.2...master) ### Implemented enhancements @@ -13,6 +13,15 @@ ### Fixed bugs +## [v0.8.2](https://github.com/pubs/pubs/compare/v0.8.1...v0.8.2) (2018-12-04) + +Fixes install on python2. + +### Fixed bugs + +- Fix missing readme.md for python2 pip install. [(#174)](https://github.com/pubs/pubs/pull/174) + + ## [v0.8.1](https://github.com/pubs/pubs/compare/v0.8.0...v0.8.1) (2018-08-28) A hotfix release. All users of 0.8.0 are urged to upgrade. diff --git a/pubs/version.py b/pubs/version.py index ef72cc0..4ca39e7 100644 --- a/pubs/version.py +++ b/pubs/version.py @@ -1 +1 @@ -__version__ = '0.8.1' +__version__ = '0.8.2' From 3c6d547a9184b55cf0edf476cb1e88d8ae07b2b5 Mon Sep 17 00:00:00 2001 From: "Fabien C. Y. Benureau" Date: Fri, 4 Jan 2019 13:13:08 +0900 Subject: [PATCH 4/4] allow python 3.3's travis job to fail --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 9e31abd..2c998bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,6 +38,9 @@ matrix: - python3 -m venv env - source env/bin/activate + allow_failures: + - python: 3.3 + # command to install dependencies install: - python --version