2013-03-02 16:53:02 +01:00
|
|
|
#!/usr/bin/env python
|
2011-12-06 23:21:39 +01:00
|
|
|
|
2016-03-16 13:42:24 +01:00
|
|
|
import os
|
|
|
|
import subprocess
|
2013-03-02 16:53:02 +01:00
|
|
|
from os.path import exists
|
2017-03-10 16:06:03 +01:00
|
|
|
|
2013-03-02 16:53:02 +01:00
|
|
|
try:
|
|
|
|
from setuptools import setup
|
|
|
|
except ImportError:
|
|
|
|
from distutils.core import setup
|
2011-12-06 23:21:39 +01:00
|
|
|
|
2016-03-16 13:42:24 +01:00
|
|
|
def get_version():
|
|
|
|
'''Use the VERSION, if absent generates a version with git describe, if not
|
|
|
|
tag exists, take 0.0.0- and add the length of the commit log.
|
|
|
|
'''
|
|
|
|
if os.path.exists('VERSION'):
|
|
|
|
with open('VERSION', 'r') as v:
|
|
|
|
return v.read()
|
|
|
|
if os.path.exists('.git'):
|
2019-01-03 13:35:50 +01:00
|
|
|
p = subprocess.Popen(['git','describe','--dirty=.dirty','--match=v*'],
|
|
|
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
2016-03-16 13:42:24 +01:00
|
|
|
result = p.communicate()[0]
|
|
|
|
if p.returncode == 0:
|
2019-01-03 13:35:50 +01:00
|
|
|
result = result.decode('ascii').strip()[1:] # strip spaces/newlines and initial v
|
|
|
|
if '-' in result: # not a tagged version
|
|
|
|
real_number, commit_count, commit_hash = result.split('-', 2)
|
|
|
|
version = '%s.post%s+%s' % (real_number, commit_count, commit_hash)
|
|
|
|
else:
|
|
|
|
version = result
|
|
|
|
return version
|
2016-03-16 13:42:24 +01:00
|
|
|
else:
|
2019-01-03 13:35:50 +01:00
|
|
|
return '0.0.post%s' % len(
|
|
|
|
subprocess.check_output(
|
|
|
|
['git', 'rev-list', 'HEAD']).splitlines())
|
2016-03-16 13:42:24 +01:00
|
|
|
return '0.0.0'
|
|
|
|
|
2011-12-06 23:21:39 +01:00
|
|
|
setup(
|
2013-03-02 16:53:02 +01:00
|
|
|
name='django-tenant-schemas',
|
2016-03-16 13:42:24 +01:00
|
|
|
version=get_version(),
|
2013-03-02 16:53:02 +01:00
|
|
|
author='Bernardo Pires Carneiro',
|
|
|
|
author_email='carneiro.be@gmail.com',
|
2013-03-03 08:44:03 +01:00
|
|
|
packages=[
|
2014-08-21 10:25:04 +02:00
|
|
|
'tenant_schemas',
|
2017-03-10 16:06:03 +01:00
|
|
|
'tenant_schemas.migration_executors',
|
2014-08-21 10:25:04 +02:00
|
|
|
'tenant_schemas.postgresql_backend',
|
|
|
|
'tenant_schemas.management',
|
|
|
|
'tenant_schemas.management.commands',
|
|
|
|
'tenant_schemas.templatetags',
|
|
|
|
'tenant_schemas.test',
|
|
|
|
'tenant_schemas.tests',
|
2013-03-03 08:44:03 +01:00
|
|
|
],
|
2013-03-02 16:53:02 +01:00
|
|
|
scripts=[],
|
|
|
|
url='https://github.com/bcarneiro/django-tenant-schemas',
|
|
|
|
license='MIT',
|
|
|
|
description='Tenant support for Django using PostgreSQL schemas.',
|
2014-09-17 10:22:33 +02:00
|
|
|
long_description=open('README.rst').read() if exists("README.rst") else "",
|
2014-08-21 10:25:04 +02:00
|
|
|
classifiers=[
|
|
|
|
'License :: OSI Approved :: MIT License',
|
|
|
|
'Framework :: Django',
|
2016-11-10 22:44:16 +01:00
|
|
|
'Framework :: Django :: 1.8',
|
|
|
|
'Framework :: Django :: 1.9',
|
|
|
|
'Framework :: Django :: 1.10',
|
2014-08-21 10:25:04 +02:00
|
|
|
'Programming Language :: Python',
|
2016-11-10 22:44:16 +01:00
|
|
|
"Programming Language :: Python :: 2.7",
|
|
|
|
"Programming Language :: Python :: 3.5",
|
|
|
|
"Topic :: Database",
|
|
|
|
"Topic :: Software Development :: Libraries",
|
2014-08-21 10:25:04 +02:00
|
|
|
],
|
2013-03-02 16:53:02 +01:00
|
|
|
install_requires=[
|
2016-05-17 11:34:48 +02:00
|
|
|
'Django >= 1.8.0',
|
2013-03-16 09:48:45 +01:00
|
|
|
'psycopg2',
|
2011-12-06 23:21:39 +01:00
|
|
|
],
|
2013-11-18 20:50:23 +01:00
|
|
|
zip_safe=False,
|
2011-12-06 23:21:39 +01:00
|
|
|
)
|