Merge lp:~adam.russell/pyexiv2/pyexiv2-0.3 into lp:pyexiv2

Proposed by Adam
Status: Needs review
Proposed branch: lp:~adam.russell/pyexiv2/pyexiv2-0.3
Merge into: lp:pyexiv2
Diff against target: 57 lines (+40/-0)
3 files modified
.bzrignore (+2/-0)
setup.py (+25/-0)
src/libexiv2python.py (+13/-0)
To merge this branch: bzr merge lp:~adam.russell/pyexiv2/pyexiv2-0.3
Reviewer Review Type Date Requested Status
Olivier Tilloy Pending
Review via email: mp+96040@code.launchpad.net

Description of the change

I have added a setup.py file for you. I didn't want to touch the system you have in place with scons, though, so I worked around that. However, I (and many others, I'm sure) love the pip and virtualenv tools, and currently pyexiv2 isn't very friendly with those. This branch allows pyexiv2 to easily be installed by pip, e.g.:

pip install -e bzr+lp:~adam.russell/pyexiv2/pyexiv2-0.3#egg=pyexiv2

This branch will make things easier on any project that depends on pyexiv2, as they will be able to put it in a requirements.txt file. It's a step closer to being able to put pyexiv2 on PyPI, too, if that's something you want to do.

I should note that I only tested these changes with Python 2.7. Not sure how old of a Python version you want to support, or if that even really matters. Anyway, let me know if you have any questions about what I wrote or if there are any changes you'd like me to make.

To post a comment you must log in.
Revision history for this message
Olivier Tilloy (osomon) wrote :

Thanks for your contribution Adam!

I’m not familiar with pip and virtualenv myself, but I guess making pyexiv2 more accessible to developers who use those tools can only be a good thing.

I don’t have much spare time on my hands now, but I’ll eventually review your code, thanks in advance for your patience.

I hadn’t though of publishing pyexiv2 on PyPI before (it’s already available in a number of distributions as native packages), but it can’t hurt :)

Regarding the versions of Python supported, it’s 2.6 and upwards (unfortunately Python 3 is not supported yet). When I get to testing your code I’ll make sure I test with 2.6 too.

Revision history for this message
Hobson Lane (hobs) wrote :

Awesome. Pip and setup.py support will makes pyexiv2 easier to integrate into Pinax and Django webapps.

Revision history for this message
Adam (adam.russell) wrote :

Have you had a chance to review these changes yet, by any chance?

Revision history for this message
Olivier Tilloy (osomon) wrote :

> Have you had a chance to review these changes yet, by any chance?

Unfortunately, no, not yet. Sorry about the delay, I hope you don’t interpret it as a lack of interest from my part, your contribution is most welcome but at the moment I can’t spare time to review it. I’ll eventually get to it…

Unmerged revisions

376. By Adam Russell <email address hidden>

Reload libexiv2python in libexiv2python.py.

375. By Adam Russell <email address hidden>

Remove relative import from libexiv2python.py.

374. By Adam Russell <email address hidden>

Add setup.py.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2010-01-28 19:29:34 +0000
3+++ .bzrignore 2012-03-06 02:31:21 +0000
4@@ -1,3 +1,5 @@
5 .sconsign.dblite
6 build
7 doc/_build/*
8+dist
9+*.egg-info
10
11=== added file 'setup.py'
12--- setup.py 1970-01-01 00:00:00 +0000
13+++ setup.py 2012-03-06 02:31:21 +0000
14@@ -0,0 +1,25 @@
15+#!/usr/bin/env python
16+
17+import os
18+import subprocess
19+from setuptools import setup, find_packages, Extension
20+
21+
22+orig_dir = os.getcwd()
23+os.chdir(os.path.abspath(os.path.dirname(__file__)))
24+subprocess.call('scons')
25+os.chdir(orig_dir)
26+
27+setup(
28+ name = "pyexiv2",
29+ version = "0.3.3",
30+ url = 'http://tilloy.net/dev/pyexiv2/',
31+ author = 'Olivier Tilloy',
32+ author_email = 'olivier@tilloy.net',
33+ description = 'A python binding to exiv2, the C++ library for manipulation of EXIF, IPTC and XMP image metadata.',
34+ license = 'GNU GPL v2',
35+ download_url = 'https://launchpad.net/pyexiv2/0.3.x/0.3.3/+download/pyexiv2-0.3.3.tar.bz2',
36+ packages = find_packages('src'),
37+ package_dir = {'': 'src'},
38+ data_files = [('', ['build/libexiv2python.so'])],
39+)
40
41=== added file 'src/libexiv2python.py'
42--- src/libexiv2python.py 1970-01-01 00:00:00 +0000
43+++ src/libexiv2python.py 2012-03-06 02:31:21 +0000
44@@ -0,0 +1,13 @@
45+'''\
46+This file is a hack to get the package working post-build but without
47+requiring an actual installation. Specifically, this enables
48+"development mode" installation via ``python setup.py develop``.
49+
50+'''
51+
52+import os
53+import sys
54+sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__),
55+ '..', 'build')))
56+reload(sys.modules['libexiv2python'])
57+from libexiv2python import *

Subscribers

People subscribed via source and target branches