blob: f8317ce37eb0bb5863144e5736dbf6568e98339a [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
Miro Hrončok26bc1712018-09-09 19:49:33 +020013import sys
Pierre Gergondetf39c1ae2018-03-26 12:47:58 +090014
niemeyerdb8b18d2005-12-22 15:02:22 +000015if isfile("MANIFEST"):
niemeyerdebf3cd2005-02-23 18:33:30 +000016 os.unlink("MANIFEST")
17
Jake Chorleycee2c4f2017-12-06 17:05:40 +000018if LooseVersion(setuptools.__version__) <= LooseVersion("24.3"):
19 warnings.warn("python_requires requires setuptools version > 24.3",
20 UserWarning)
21
Laszlo Kiss-Kollar6e6b8f12017-12-06 14:39:01 +000022
23class Unsupported(TestCommand):
24 def run(self):
Miro Hrončok26bc1712018-09-09 19:49:33 +020025 sys.stderr.write("Running 'test' with setup.py is not supported. "
26 "Use 'pytest' or 'tox' to run the tests.\n")
27 sys.exit(1)
Laszlo Kiss-Kollar6e6b8f12017-12-06 14:39:01 +000028
Paul Ganssle27708772018-05-20 20:47:51 -040029
Paul Ganssle6c032462018-03-24 14:10:04 -040030###
31# Load metadata
32PACKAGES = find_packages(where='.', exclude=['dateutil.test'])
33
Paul Ganssle27708772018-05-20 20:47:51 -040034
Paul Ganssle6c032462018-03-24 14:10:04 -040035def README():
Pierre Gergondetf39c1ae2018-03-26 12:47:58 +090036 with io.open('README.rst', encoding='utf-8') as f:
Paul Ganssledf061832018-03-24 14:51:53 -040037 readme_lines = f.readlines()
38
39 # The .. doctest directive is not supported by PyPA
40 lines_out = []
Paul Ganssledf061832018-03-24 14:51:53 -040041 for line in readme_lines:
42 if line.startswith('.. doctest'):
Paul Ganssledf061832018-03-24 14:51:53 -040043 lines_out.append('.. code-block:: python3\n')
44 else:
45 lines_out.append(line)
46
47 return ''.join(lines_out)
Paul Ganssle27708772018-05-20 20:47:51 -040048README = README() # NOQA
49
Laszlo Kiss-Kollar6e6b8f12017-12-06 14:39:01 +000050
niemeyercc77d432003-10-09 02:57:39 +000051setup(name="python-dateutil",
Iván Matellanes600ba202017-12-06 20:50:51 +000052 use_scm_version={
53 'write_to': 'dateutil/_version.py',
54 },
Yaron de Leeuw3c316b52014-12-01 22:01:11 +020055 description="Extensions to the standard Python datetime module",
Paul Ganssle31252b22017-12-05 14:06:12 +000056 author="Gustavo Niemeyer",
57 author_email="gustavo@niemeyer.net",
58 maintainer="Paul Ganssle",
59 maintainer_email="dateutil@python.org",
Adam Chainz1119b482016-05-29 12:50:15 +010060 url="https://dateutil.readthedocs.io",
Paul Ganssle7ac48be2018-03-24 09:53:00 -040061 license="Dual License",
Paul Ganssle6c032462018-03-24 14:10:04 -040062 long_description=README,
63 long_description_content_type='text/x-rst',
Paul Ganssle59acb7c2017-11-10 13:25:14 -050064 packages=PACKAGES,
Paul Gansslef533b4a2018-03-11 10:54:48 -040065 python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*",
Yaron de Leeuw3c316b52014-12-01 22:01:11 +020066 package_data={"dateutil.zoneinfo": ["dateutil-zoneinfo.tar.gz"]},
67 zip_safe=True,
Iván Matellanes600ba202017-12-06 20:50:51 +000068 setup_requires=['setuptools_scm'],
Sherry Zhoufe4f6392018-06-08 11:45:39 +010069 install_requires=["six >=1.5"],
Yaron de Leeuw3c316b52014-12-01 22:01:11 +020070 classifiers=[
Tomi Pieviläinenaefdb2b2012-04-29 16:32:22 +030071 'Development Status :: 5 - Production/Stable',
72 'Intended Audience :: Developers',
73 'License :: OSI Approved :: BSD License',
Paul Ganssle4c4c7e92018-03-11 19:48:24 -040074 'License :: OSI Approved :: Apache Software License',
Tomi Pieviläinenaefdb2b2012-04-29 16:32:22 +030075 'Programming Language :: Python',
76 'Programming Language :: Python :: 2',
Tomi Pieviläinenaefdb2b2012-04-29 16:32:22 +030077 'Programming Language :: Python :: 2.7',
78 'Programming Language :: Python :: 3',
Tomi Pieviläinen8c6026b2013-11-01 10:37:15 +020079 'Programming Language :: Python :: 3.3',
Yaron de Leeuwb759afd2014-11-27 22:13:34 +020080 'Programming Language :: Python :: 3.4',
Thomas A Caswell68275162015-12-07 21:38:53 -050081 'Programming Language :: Python :: 3.5',
Paul Ganssle418b8ae2016-11-06 20:54:45 -050082 'Programming Language :: Python :: 3.6',
Paul Gansslef533b4a2018-03-11 10:54:48 -040083 'Programming Language :: Python :: 3.7',
Tomi Pieviläinenaefdb2b2012-04-29 16:32:22 +030084 'Topic :: Software Development :: Libraries',
Yaron de Leeuw7d13f302014-11-24 17:46:03 +020085 ],
Laszlo Kiss-Kollar6e6b8f12017-12-06 14:39:01 +000086 test_suite="dateutil.test",
87 cmdclass={
88 "test": Unsupported
89 }
niemeyer68ae2752003-09-28 01:20:02 +000090 )