This repository has been archived by the owner on Aug 21, 2024. It is now read-only.
forked from Nekmo/angular-django
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
73 lines (61 loc) · 2.26 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
# -*- coding: utf-8 -*-
import copy
from itertools import chain
from setuptools import setup
REQUIREMENT_FILE = 'requirements.in'
DEV_STATUS = 'Production/Stable' # Planning, Pre-Alpha, Alpha, Beta, Production/Stable, Mature, Inactive
CLASSIFIERS = [ # https://github.com/github/choosealicense.com/tree/gh-pages/_licenses
'License :: OSI Approved :: MIT License',
# 'License :: OSI Approved :: BSD License',
# 'License :: OSI Approved :: ISC License (ISCL)',
# 'License :: OSI Approved :: Apache Software License',
# 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
] # https://pypi.python.org/pypi?%3Aaction=list_classifiers
NATURAL_LANGUAGE = 'English'
PLATFORMS = [
# 'universal',
'linux',
# 'macosx',
# 'solaris',
# 'irix',
# 'win'
# 'bsd'
# 'ios'
# 'android'
]
PYTHON_VERSIONS = ['3.6', '3.7', '3.8', '3.9']
def get_python_classifiers(versions):
for version in range(2, 4):
if not next(iter(filter(lambda x: int(float(x)) != version, versions.copy())), False):
versions.add('{} :: Only'.format(version))
break
return ['Programming Language :: Python :: %s' % version for version in versions]
def get_platform_classifiers(platform):
parts = {
'linux': ('POSIX', 'Linux'),
'win': ('Microsoft', 'Windows'),
'solaris': ('POSIX', 'SunOS/Solaris'),
'aix': ('POSIX', 'Linux'),
'unix': ('Unix',),
'bsd': ('POSIX', 'BSD')
}[platform]
return ['Operating System :: {}'.format(' :: '.join(parts[:i+1]))
for i in range(len(parts))]
def read_file(path):
with open(path) as f:
return f.read()
statuses = ['Planning', 'Pre-Alpha', 'Alpha', 'Beta', 'Production/Stable', 'Mature', 'Inactive']
# Classifiers
classifiers = copy.copy(CLASSIFIERS)
classifiers.extend(get_python_classifiers(set(PYTHON_VERSIONS) - {2.8, 2.9}))
classifiers.extend(chain(*[get_platform_classifiers(platform) for platform in PLATFORMS]))
classifiers.extend([
'Natural Language :: {}'.format(NATURAL_LANGUAGE),
'Development Status :: {} - {}'.format(statuses.index(DEV_STATUS) + 1, DEV_STATUS),
])
setup(
classifiers=classifiers,
platforms=PLATFORMS,
install_requires=read_file(REQUIREMENT_FILE),
)