Skip to content

Commit 2bfdc62

Browse files
committed
Install was broken, release 2.5.3
1 parent d2f47ce commit 2bfdc62

File tree

5 files changed

+64
-12
lines changed

5 files changed

+64
-12
lines changed

Changelog

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,23 @@
55
.. contents::
66
:local:
77

8+
.. _version-2.5.3:
9+
10+
2.5.3
11+
=====
12+
:release-date: 2012-04-13 06:16 P.M GMT
13+
:by: Ask Solem
14+
15+
* 2.5.2 release broke installation because of an import in the package.
16+
17+
Fixed by not having setup.py import the djcelery module anymore,
18+
but rather parsing the package file for metadata.
19+
820
.. _version-2.5.2:
921

1022
2.5.2
1123
=====
12-
:release-date: 2012-04-12 05:00 P.M GMT
24+
:release-date: 2012-04-13 05:00 P.M GMT
1325
:by: Ask Solem
1426

1527
.. _v251-news:

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
.. image:: http://cloud.github.com/downloads/ask/celery/celery_128.png
66

7-
:Version: 2.5.2
7+
:Version: 2.5.3
88
:Web: http://celeryproject.org/
99
:Download: http://pypi.python.org/pypi/django-celery/
1010
:Source: http://github.com/ask/django-celery/

djcelery/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
"""Django Celery Integration."""
2+
# :copyright: (c) 2009 - 2012 by Ask Solem.
3+
# :license: BSD, see LICENSE for more details.
24
from __future__ import absolute_import
35

46
import os
57

6-
VERSION = (2, 5, 2)
7-
8+
VERSION = (2, 5, 3)
89
__version__ = ".".join(map(str, VERSION[0:3])) + "".join(VERSION[3:])
910
__author__ = "Ask Solem"
1011
__contact__ = "ask@celeryproject.org"
1112
__homepage__ = "http://celeryproject.org"
1213
__docformat__ = "restructuredtext"
1314
__license__ = "BSD (3 clause)"
1415

16+
# -eof meta-
1517

1618
def setup_loader():
1719
os.environ.setdefault("CELERY_LOADER", "djcelery.loaders.DjangoLoader")

docs/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
.. image:: http://cloud.github.com/downloads/ask/celery/celery_128.png
66

7-
:Version: 2.5.2
7+
:Version: 2.5.3
88
:Web: http://celeryproject.org/
99
:Download: http://pypi.python.org/pypi/django-celery/
1010
:Source: http://github.com/ask/django-celery/

setup.py

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,45 @@
1212
from setuptools import setup, Command # noqa
1313
from distutils.command.install import INSTALL_SCHEMES
1414

15-
import djcelery as distmeta
15+
# -*- Distribution Meta -*-
16+
NAME = "django-celery"
17+
18+
import re
19+
re_meta = re.compile(r'__(\w+?)__\s*=\s*(.*)')
20+
re_vers = re.compile(r'VERSION\s*=\s*\((.*?)\)')
21+
re_doc = re.compile(r'^"""(.+?)"""')
22+
rq = lambda s: s.strip("\"'")
23+
24+
def add_default(m):
25+
attr_name, attr_value = m.groups()
26+
return ((attr_name, rq(attr_value)), )
27+
28+
29+
def add_version(m):
30+
v = list(map(rq, m.groups()[0].split(", ")))
31+
return (("VERSION", ".".join(v[0:3]) + "".join(v[3:])), )
32+
33+
34+
def add_doc(m):
35+
return (("doc", m.groups()[0]), )
36+
37+
pats = {re_meta: add_default,
38+
re_vers: add_version,
39+
re_doc: add_doc}
40+
here = os.path.abspath(os.path.dirname(__file__))
41+
meta_fh = open(os.path.join(here, "djcelery/__init__.py"))
42+
try:
43+
meta = {}
44+
for line in meta_fh:
45+
if line.strip() == '# -eof meta-':
46+
break
47+
for pattern, handler in pats.items():
48+
m = pattern.match(line.strip())
49+
if m:
50+
meta.update(handler(m))
51+
finally:
52+
meta_fh.close()
53+
1654

1755
packages, data_files = [], []
1856
root_dir = os.path.dirname(__file__)
@@ -122,12 +160,12 @@ def extra_args(self):
122160

123161

124162
setup(
125-
name='django-celery',
126-
version=distmeta.__version__,
127-
description=distmeta.__doc__,
128-
author=distmeta.__author__,
129-
author_email=distmeta.__contact__,
130-
url=distmeta.__homepage__,
163+
name=NAME,
164+
version=meta["VERSION"],
165+
description=meta["doc"],
166+
author=meta["author"],
167+
author_email=meta["contact"],
168+
url=meta["homepage"],
131169
platforms=["any"],
132170
license="BSD",
133171
packages=packages,

0 commit comments

Comments
 (0)