Merge lp:~codersquid/python-oops-datedir-repo/optional-prune-dependencies into lp:python-oops-datedir-repo

Proposed by Sheila Miguez
Status: Needs review
Proposed branch: lp:~codersquid/python-oops-datedir-repo/optional-prune-dependencies
Merge into: lp:python-oops-datedir-repo
Diff against target: 62 lines (+14/-6)
3 files modified
buildout.cfg (+1/-1)
oops_datedir_repo/prune.py (+8/-2)
setup.py (+5/-3)
To merge this branch: bzr merge lp:~codersquid/python-oops-datedir-repo/optional-prune-dependencies
Reviewer Review Type Date Requested Status
Colin Watson (community) Needs Fixing
Review via email: mp+327978@code.launchpad.net

Commit message

makes launchpadlib an optional dependency for prune

Description of the change

This change makes launchpadlib an optional dependency.

from a command line prompt, one can type

    pip install -e .\[prune\]

To install this with all of the dependencies required by prune, or

    pip install -e .

To go without.

To post a comment you must log in.
Revision history for this message
Sheila Miguez (codersquid) wrote :

I was unable to run the unit tests and need help.

I created and activated a virtualenv, ran boostrap.py, and installed testrepository.

`testr run` suggested `testr init`. After doing the init step, `testr run` still failed due to bin/py not existing. I've missed a step somewhere.

Revision history for this message
Sheila Miguez (codersquid) wrote :

Using run-of-the-mill unittest, trunk has a failure, if I have time I'll take a look at it to get things clean before proceeding with work on this branch.

virtualenv venv
. venv/bin/activate
pip install -e .\[test\]
venv/bin/python -m unittest discover -v

======================================================================
ERROR: test_read_detect_rfc822 (oops_datedir_repo.tests.test_serializer.TestParsing)
oops_datedir_repo.tests.test_serializer.TestParsing.test_read_detect_rfc822
----------------------------------------------------------------------
_StringException: Traceback (most recent call last):
  File "oops_datedir_repo/tests/test_serializer.py", line 63, in test_read_detect_rfc822
    self.assertEqual(self.expected_dict, read(source_file))
  File "oops_datedir_repo/serializer.py", line 61, in read
    return serializer_bson.read(StringIO(content))
  File "oops_datedir_repo/serializer_bson.py", line 57, in read
    report = bson.loads(fp.read())
  File "/home/codersquid/work/hexr/python-oops-datedir-repo/venv/local/lib/python2.7/site-packages/bson/__init__.py", line 47, in loads
    return decode_document(data, 0)[1]
  File "/home/codersquid/work/hexr/python-oops-datedir-repo/venv/local/lib/python2.7/site-packages/bson/codec.py", line 269, in decode_document
    if data[end_point - 1] not in ('\0', 0):
IndexError: string index out of range

Revision history for this message
Colin Watson (cjwatson) wrote :
review: Needs Fixing
57. By Sheila Miguez

merge forward from trunk r57

Revision history for this message
Sheila Miguez (codersquid) wrote :

I've updated my branch from trunk. The tests work now!

Unmerged revisions

57. By Sheila Miguez

merge forward from trunk r57

56. By Sheila Miguez

make prune dependencies optional

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'buildout.cfg'
--- buildout.cfg 2011-11-11 04:21:05 +0000
+++ buildout.cfg 2019-07-09 13:42:14 +0000
@@ -31,7 +31,7 @@
3131
32[scripts]32[scripts]
33recipe = z3c.recipe.scripts33recipe = z3c.recipe.scripts
34eggs = oops_datedir_repo [test]34eggs = oops_datedir_repo [test][prune]
35include-site-packages = true35include-site-packages = true
36allowed-eggs-from-site-packages = 36allowed-eggs-from-site-packages =
37 subunit37 subunit
3838
=== modified file 'oops_datedir_repo/prune.py'
--- oops_datedir_repo/prune.py 2018-03-12 12:06:11 +0000
+++ oops_datedir_repo/prune.py 2019-07-09 13:42:14 +0000
@@ -29,8 +29,14 @@
29from textwrap import dedent29from textwrap import dedent
30import sys30import sys
3131
32from launchpadlib.launchpad import Launchpad32try:
33from launchpadlib.uris import lookup_service_root33 from launchpadlib.launchpad import Launchpad
34 from launchpadlib.uris import lookup_service_root
35except ImportError:
36 print("Missing launchpadlib dependency. Did you install "
37 "oops_datedir_repo without 'prune'?")
38 pass
39
34from pytz import utc40from pytz import utc
3541
36import oops_datedir_repo42import oops_datedir_repo
3743
=== modified file 'setup.py'
--- setup.py 2018-03-12 12:06:11 +0000
+++ setup.py 2019-07-09 13:42:14 +0000
@@ -43,7 +43,6 @@
43 install_requires = [43 install_requires = [
44 'bson',44 'bson',
45 'iso8601',45 'iso8601',
46 'launchpadlib', # Needed for pruning - perhaps should be optional.
47 'oops>=0.0.11',46 'oops>=0.0.11',
48 'pytz',47 'pytz',
49 'six',48 'six',
@@ -52,11 +51,14 @@
52 test=[51 test=[
53 'fixtures',52 'fixtures',
54 'testtools',53 'testtools',
55 ]54 ],
55 prune=[
56 'launchpadlib',
57 ],
56 ),58 ),
57 entry_points=dict(59 entry_points=dict(
58 console_scripts=[ # `console_scripts` is a magic name to setuptools60 console_scripts=[ # `console_scripts` is a magic name to setuptools
59 'bsondump = oops_datedir_repo.bsondump:main',61 'bsondump = oops_datedir_repo.bsondump:main',
60 'prune = oops_datedir_repo.prune:main',62 'prune = oops_datedir_repo.prune:main [prune]',
61 ]),63 ]),
62 )64 )

Subscribers

People subscribed via source and target branches

to all changes: