-
Notifications
You must be signed in to change notification settings - Fork 71
/
setup.py
93 lines (79 loc) · 2.89 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import os
from distutils.core import setup
PROJECT_NAME = 'el_pagination'
ROOT = os.path.abspath(os.path.dirname(__file__))
VENV = os.path.join(ROOT, '.venv')
VENV_LINK = os.path.join(VENV, 'local')
install_requires = [
'django>=3.2.0',
]
project = __import__(PROJECT_NAME)
root_dir = os.path.dirname(__file__)
if root_dir:
os.chdir(root_dir)
data_files = []
for dirpath, dirnames, filenames in os.walk(PROJECT_NAME):
for i, dirname in enumerate(dirnames):
if dirname.startswith('.'):
del dirnames[i]
if '__init__.py' in filenames:
continue
elif filenames:
for f in filenames:
data_files.append(os.path.join(
dirpath[len(PROJECT_NAME) + 1:], f))
def read(filename):
return open(os.path.join(ROOT, filename)).read()
class VenvLinkDeleted(object):
restore_link = False
def __enter__(self):
"""Remove the link."""
if os.path.islink(VENV_LINK):
os.remove(VENV_LINK)
self.restore_link = True
def __exit__(self, exc_type, exc_val, exc_tb):
"""Restore the link."""
if self.restore_link:
os.symlink(VENV, VENV_LINK)
with VenvLinkDeleted():
setup(
name='django-el-pagination',
version=project.get_version(),
description=(
"Django pagination tools supporting Ajax, multiple and lazy "
"pagination, Twitter-style and Digg-style pagination."
), # project.__doc__,
long_description=read('README.rst'),
author='Oleksandr Shtalinberg',
author_email='[email protected]',
url='http://github.com/shtalinberg/django-el-pagination',
keywords='django endless pagination ajax',
packages=[
PROJECT_NAME,
'{0}.templatetags'.format(PROJECT_NAME),
'{0}.tests'.format(PROJECT_NAME),
'{0}.tests.integration'.format(PROJECT_NAME),
'{0}.tests.templatetags'.format(PROJECT_NAME),
],
package_data={PROJECT_NAME: data_files},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.2',
'Framework :: Django :: 5.0',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'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',
'Topic :: Utilities',
],
install_requires=install_requires,
)