-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
73 lines (64 loc) · 2.35 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env python
import os
import re
import sys
from codecs import open
from distutils.core import setup
from os import path
from setuptools import find_packages
def get_long_description():
current_dir = path.abspath(path.dirname(__file__))
readme_path = path.join(current_dir, "README.md")
with open(readme_path, encoding="utf-8") as f:
return f.read()
def get_version():
version_file = open(path.join("csv_export", "__init__.py"), encoding="utf-8").read()
version_match = re.search(
r"__version__ = ['\"]([0-9]+\.[0-9]+\.[0-9]+(\.dev[0-9])?)['\"]", version_file, re.MULTILINE
)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
if sys.argv[-1] == "publish":
os.system("python setup.py sdist upload") # noqa
print("You should also add a git tag for this version:")
print(" git tag {}".format(get_version()))
print(" git push --tags")
sys.exit()
setup(
name="django-csv-export-view",
version=get_version(),
license="BSD",
description="Django class-based view for CSV exports",
long_description=get_long_description(),
long_description_content_type="text/markdown",
url="https://github.com/benkonrath/django-csv-export-view",
author="Ben Konrath",
author_email="[email protected]",
packages=find_packages(exclude=["tests*"]),
include_package_data=True,
data_files=[("", ["README.md", "CHANGELOG.md"])],
zip_safe=False,
install_requires=[
"django>=3.2",
],
python_requires="!=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Utilities",
],
)