-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·94 lines (79 loc) · 2.2 KB
/
Copy pathsetup.py
File metadata and controls
executable file
·94 lines (79 loc) · 2.2 KB
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
94
#!/usr/bin/env python
"""Script to load defaults to database and install the packages."""
import atexit
import subprocess as sp
from setuptools.command.install import install
from distutils.cmd import Command
from setuptools import find_packages, setup
APPS = [
'users',
'geographic',
'organizations',
'services',
]
class Migrate(Command):
"""Migrate the database and create sample users."""
description = 'Makemigrations for PoPe models.'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
for app in APPS:
sp.call('./manage.py makemigrations {}'.format(app).split())
sp.call('./manage.py migrate --noinput'.split())
class LoadFixtures(Command):
"""Load fixtures from all apps to the database."""
description = 'Populate database with default data.'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
fixtures = [
'geographic/fixtures/administrative_areas.json'
]
for data in fixtures:
sp.call('./manage.py loaddata {}'.format(data).split())
setup(
name='pope',
version='1.0',
install_requires=[
'django>=2.1.5',
'django-compressor==2.2',
'markdown<=2.6',
'Pillow<4.3',
'requests>=2.20',
'djangorestframework==3.8.2',
'django-filter>=1.0.1',
'coreapi>=1.32',
'pygments',
'django-cors-headers>=2.4.0',
'gunicorn'
],
extras_require={
'dev': ['flake8', 'astroid==1.5.3', 'rednose<1.3',
'django-nose', 'coverage']
},
packages=find_packages(),
scripts=['manage.py'],
author='CPA - Bay Area',
author_email='fabricasoftwares@gmail.com',
url='https://www.bayareacpa.com.br',
entry_points={
'console_scripts': [
'pope=manage:main'
]
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Programming Language :: Python :: 3.6',
],
cmdclass={
'migrate': Migrate,
'loaddb': LoadFixtures
}
)