blob: b59bd63a795e3d3028e0657f00ffaea49ec95389 [file] [log] [blame]
Tomi Pieviläinen40996e02012-03-03 11:43:08 +02001#!/usr/bin/python
Yaron de Leeuw3c316b52014-12-01 22:01:11 +02002from os.path import isfile
niemeyerdebf3cd2005-02-23 18:33:30 +00003import os
niemeyer313ef142007-11-12 14:06:05 +00004
Jake Chorleycee2c4f2017-12-06 17:05:40 +00005import setuptools
Paul Ganssle59acb7c2017-11-10 13:25:14 -05006from setuptools import setup, find_packages
Laszlo Kiss-Kollar6e6b8f12017-12-06 14:39:01 +00007from setuptools.command.test import test as TestCommand
niemeyer55254c52008-08-07 02:46:52 +00008
Jake Chorleycee2c4f2017-12-06 17:05:40 +00009from distutils.version import LooseVersion
10import warnings
11
Pierre Gergondetf39c1ae2018-03-26 12:47:58 +090012import io
13
niemeyerdb8b18d2005-12-22 15:02:22 +000014if isfile("MANIFEST"):
niemeyerdebf3cd2005-02-23 18:33:30 +000015 os.unlink("MANIFEST")
16
Jake Chorleycee2c4f2017-12-06 17:05:40 +000017if LooseVersion(setuptools.__version__) <= LooseVersion("24.3"):
18 warnings.warn("python_requires requires setuptools version > 24.3",
19 UserWarning)
20
Laszlo Kiss-Kollar6e6b8f12017-12-06 14:39:01 +000021
22class Unsupported(TestCommand):
23 def run(self):
24 print("Running 'test' with setup.py is not supported. "
25 "Use 'pytest' or 'tox' to run the tests.")
26
Paul Ganssle6c032462018-03-24 14:10:04 -040027###
28# Load metadata
29PACKAGES = find_packages(where='.', exclude=['dateutil.test'])
30
31def README():
Pierre Gergondetf39c1ae2018-03-26 12:47:58 +090032 with io.open('README.rst', encoding='utf-8') as f:
Paul Ganssledf061832018-03-24 14:51:53 -040033 readme_lines = f.readlines()
34
35 # The .. doctest directive is not supported by PyPA
36 lines_out = []
37 doctest_line_found = False
38 for line in readme_lines:
39 if line.startswith('.. doctest'):
40 doctest_line_found = True
41 lines_out.append('.. code-block:: python3\n')
42 else:
43 lines_out.append(line)
44
45 return ''.join(lines_out)
Paul Ganssle6c032462018-03-24 14:10:04 -040046README = README()
Laszlo Kiss-Kollar6e6b8f12017-12-06 14:39:01 +000047
niemeyercc77d432003-10-09 02:57:39 +000048setup(name="python-dateutil",
Iván Matellanes600ba202017-12-06 20:50:51 +000049 use_scm_version={
50 'write_to': 'dateutil/_version.py',
51 },
Yaron de Leeuw3c316b52014-12-01 22:01:11 +020052 description="Extensions to the standard Python datetime module",
Paul Ganssle31252b22017-12-05 14:06:12 +000053 author="Gustavo Niemeyer",
54 author_email="gustavo@niemeyer.net",
55 maintainer="Paul Ganssle",
56 maintainer_email="dateutil@python.org",
Adam Chainz1119b482016-05-29 12:50:15 +010057 url="https://dateutil.readthedocs.io",
Paul Ganssle7ac48be2018-03-24 09:53:00 -040058 license="Dual License",
Paul Ganssle6c032462018-03-24 14:10:04 -040059 long_description=README,
60 long_description_content_type='text/x-rst',
Paul Ganssle59acb7c2017-11-10 13:25:14 -050061 packages=PACKAGES,
Paul Gansslef533b4a2018-03-11 10:54:48 -040062 python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*",
Yaron de Leeuw3c316b52014-12-01 22:01:11 +020063 package_data={"dateutil.zoneinfo": ["dateutil-zoneinfo.tar.gz"]},
64 zip_safe=True,
65 requires=["six"],
Iván Matellanes600ba202017-12-06 20:50:51 +000066 setup_requires=['setuptools_scm'],
Yaron de Leeuw1119ee72014-12-14 21:42:37 +020067 install_requires=["six >=1.5"], # XXX fix when packaging is sane again
Yaron de Leeuw3c316b52014-12-01 22:01:11 +020068 classifiers=[
Tomi Pieviläinenaefdb2b2012-04-29 16:32:22 +030069 'Development Status :: 5 - Production/Stable',
70 'Intended Audience :: Developers',
71 'License :: OSI Approved :: BSD License',
Paul Ganssle4c4c7e92018-03-11 19:48:24 -040072 'License :: OSI Approved :: Apache Software License',
Tomi Pieviläinenaefdb2b2012-04-29 16:32:22 +030073 'Programming Language :: Python',
74 'Programming Language :: Python :: 2',
Tomi Pieviläinenaefdb2b2012-04-29 16:32:22 +030075 'Programming Language :: Python :: 2.7',
76 'Programming Language :: Python :: 3',
Tomi Pieviläinen8c6026b2013-11-01 10:37:15 +020077 'Programming Language :: Python :: 3.3',
Yaron de Leeuwb759afd2014-11-27 22:13:34 +020078 'Programming Language :: Python :: 3.4',
Thomas A Caswell68275162015-12-07 21:38:53 -050079 'Programming Language :: Python :: 3.5',
Paul Ganssle418b8ae2016-11-06 20:54:45 -050080 'Programming Language :: Python :: 3.6',
Paul Gansslef533b4a2018-03-11 10:54:48 -040081 'Programming Language :: Python :: 3.7',
Tomi Pieviläinenaefdb2b2012-04-29 16:32:22 +030082 'Topic :: Software Development :: Libraries',
Yaron de Leeuw7d13f302014-11-24 17:46:03 +020083 ],
Laszlo Kiss-Kollar6e6b8f12017-12-06 14:39:01 +000084 test_suite="dateutil.test",
85 cmdclass={
86 "test": Unsupported
87 }
niemeyer68ae2752003-09-28 01:20:02 +000088 )