Skip to content

Commit 563de9d

Browse files
committed
Specify package version only once. Use it in the User Agent string (instead of the out-of-date, hardcoded version #). PEP8 setup.py.
1 parent b8325fc commit 563de9d

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

embedly/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
from __future__ import absolute_import
2-
from .client import Embedly
3-
4-
__version__ = '0.4.3'
2+
from .client import Embedly, __version__

embedly/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
# py3k
1515
from urllib.parse import quote, urlencode
1616

17-
1817
from .models import Url
1918

20-
USER_AGENT = 'Mozilla/5.0 (compatible; embedly-python/0.3;)'
19+
20+
__version__ = '0.4.3'
21+
USER_AGENT = 'Mozilla/5.0 (compatible; embedly-python/%s;)' % __version__
2122

2223

2324
class Embedly(object):

setup.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,32 @@
77

88
required = ['httplib2']
99

10-
if sys.version_info[:2] < (2,6):
10+
if sys.version_info[:2] < (2, 6):
1111
required.append('simplejson')
1212

13+
version = __import__('embedly').__version__
14+
1315
if os.path.exists("README.rst"):
1416
long_description = codecs.open("README.rst", "r", "utf-8").read()
1517
else:
1618
long_description = "See https://github.com/embedly/embedly-python"
1719

1820

1921
setup(
20-
name = 'Embedly',
21-
version = '0.4.3',
22-
author = 'Embed.ly, Inc.',
23-
author_email = '[email protected]',
24-
description = 'Python Library for Embedly',
22+
name='Embedly',
23+
version=version,
24+
author='Embed.ly, Inc.',
25+
author_email='[email protected]',
26+
description='Python Library for Embedly',
2527
long_description=long_description,
26-
license = """
28+
license="""
2729
Copyright (c) 2011, Embed.ly, Inc.
2830
All rights reserved. Released under the 3-clause BSD license.
2931
""",
30-
url = "https://github.com/embedly/embedly-python",
31-
packages = ['embedly'],
32-
install_requires = required,
33-
zip_safe = True,
32+
url="https://github.com/embedly/embedly-python",
33+
packages=['embedly'],
34+
install_requires=required,
35+
zip_safe=True,
3436
classifiers=(
3537
'Development Status :: 5 - Production/Stable',
3638
'Intended Audience :: Developers',
@@ -45,4 +47,4 @@
4547
'Programming Language :: Python :: 3.3',
4648
),
4749
**extra
48-
)
50+
)

0 commit comments

Comments
 (0)