* This fixes the logic in the `pubs add` command so that an arxiv ID doesn't
overwrite a DOI. This also changes the logic so that if an invalid DOI, ISBN,
or arXiv ID is provided the program will raise an error.
* The code now uses the bibtexparser package to generate the bibtex file for
arxiv papers.
* A dedicated exception is added for references that can't be found.
Because of the mechanism for catching exceptions in pubs, the
UnexpectedInput exception raised by FakeInput never reached the catch
statement in the CommandTestCase and raised a FakeSystemExit instead.
This commit monkey-patches the exception handler in the ui at the same
time as the patching of the input functions to ignore UnexptectedInput
at the ui level.
This allows the user to add a reference via an arXiv ID similarly to how a reference can be added
from a DOI or ISBN. If the arXiv ID has a DOI associated with it (according to the arXiv server),
the DOI will be used. If it does not (perhaps the paper is unpublished), then a bibtex entry will
automatically be generated from the reference's metadata.
Note that a potential issue with this addition is that if a paper is added before it is published
(i.e., there is no DOI associated with it), and the paper is later published, the updated
information will have to be manually added.
This involved many changes, some side effects of the change include:
- remove of all `u"abc"` forms, in favor of
`from __future__ import unicode_literals`. Their usage was
inconsistent anyway, leading to problems when mixing with
unicode content.
- improve the tests, to allow printing for usecase even when
crashing. Should make future test easier. This is done with a
rather hacky `StdIO` class in `p3`, but it works.
- for some reason, the skipped test for Python 2 seems to work
now. While the previous point might seem related, it is not clear
that this is actually the case.
See #86 and #129.
The version number is now only stored in pubs/version.py. setup.py loads the version from the file as well as does pubs/__init__.py.
The cache structure changes to now include the version of the code which wrote the cache, which enables rebuilding the cache on version change. Loading an old cache (i.e. without the version) fails and triggers a rebuild (so does loading the new cache from the old code) so moving across this change is transparent here.
The code also switches to version 0.8.dev1 to trigger a cache rebuild (and also because the milestone is almost there). In general we will need to bump the version number to a development one each time a change makes loading old cache incompatible. There is no test for that at the moment so this means testing new code on a local bibliography repository before pushing to master.
#129 discussed using git versions, which is not so easy to integrate nicely with setuptools. This is why I chose to stick with manually changing version numbers when necessary (which should not be so often).
Current code version is added to the cache on writting. If the cache
version does not match the code version on read, the cache is ignored
which means it resets.