Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 68 lines (59 sloc) 1.931 kb
f3a826e @sbuss Add wtftz script and upate setup.
authored
1 try:
2 from setuptools import setup
3 except ImportError:
4 from distutils import setup
5
37d0f4f @sbuss Fix packaging problems.
authored
6
7 def load_readme():
261c450 @sbuss Include bare README in MANIFEST.
authored
8 readme_file = "README"
37d0f4f @sbuss Fix packaging problems.
authored
9 try:
10 return open(readme_file, 'r').read()
11 except Exception:
12 raise RuntimeError("Cannot find readme file {fname}.".format(
13 fname=readme_file))
14
15
16 def load_version():
17 """Open and parse out the version number from the _version.py module.
18
19 Because of namespacing wtftz.wtfz.converter.convert to wtftz.convert,
20 which has the dependencies listed below, I can't import __version__ from
21 __init__.py. Open and parse wtftz/_version.py instead.
22
23 Inspired by http://stackoverflow.com/a/7071358
24 """
25 import re
26 version_file = "wtftz/_version.py"
27 version_line = open(version_file).read().rstrip()
28 vre = re.compile(r'__version__ = "([^"]+)"')
29 matches = vre.findall(version_line)
30 if matches and len(matches) > 0:
31 return matches[0]
32 else:
33 raise RuntimeError(
34 "Cannot find version string in {version_file}.".format(
35 version_file=version_file))
36
37 version = load_version()
38 long_description = load_readme()
f3a826e @sbuss Add wtftz script and upate setup.
authored
39
40 setup(
41 name='wtftz',
37d0f4f @sbuss Fix packaging problems.
authored
42 version=version,
f3a826e @sbuss Add wtftz script and upate setup.
authored
43 description="Convert a timestamp from one timezone to another",
37d0f4f @sbuss Fix packaging problems.
authored
44 long_description=long_description,
f3a826e @sbuss Add wtftz script and upate setup.
authored
45 author='Steven Buss',
46 author_email='steven.buss@gmail.com',
47 url='https://github.com/sbuss/wtftz',
37d0f4f @sbuss Fix packaging problems.
authored
48 download_url=('https://github.com/sbuss/wtftz/tarball/v%s' % version),
f3a826e @sbuss Add wtftz script and upate setup.
authored
49 classifiers=[
50 "Development Status :: 3 - Alpha",
51 "Intended Audience :: Developers",
52 "License :: OSI Approved :: BSD License",
53 "Operating System :: OS Independent",
54 "Programming Language :: Python :: 2.7",
55 ],
56 packages=[
57 'wtftz',
58 ],
59 scripts=[
37d0f4f @sbuss Fix packaging problems.
authored
60 'bin/wtftz',
f3a826e @sbuss Add wtftz script and upate setup.
authored
61 ],
2a3b7a0 @sbuss Add tests directory to setup.
authored
62 test_suite="tests",
f3a826e @sbuss Add wtftz script and upate setup.
authored
63 install_requires=[
64 'python-dateutil>=1.5',
65 'pytz',
66 ],
67 )
Something went wrong with that request. Please try again.