1 |
|
test
|
|
1 |
#! /usr/bin/env python
|
|
2 |
# -*- coding: utf-8 -*-
|
|
3 |
|
|
4 |
import glob
|
|
5 |
import os
|
|
6 |
import re
|
|
7 |
import subprocess
|
|
8 |
|
|
9 |
from distutils.command.sdist import sdist
|
|
10 |
from setuptools import setup, find_packages
|
|
11 |
|
|
12 |
class eo_sdist(sdist):
|
|
13 |
def run(self):
|
|
14 |
if os.path.exists('VERSION'):
|
|
15 |
os.remove('VERSION')
|
|
16 |
version = get_version()
|
|
17 |
version_file = open('VERSION', 'w')
|
|
18 |
version_file.write(version)
|
|
19 |
version_file.close()
|
|
20 |
sdist.run(self)
|
|
21 |
if os.path.exists('VERSION'):
|
|
22 |
os.remove('VERSION')
|
|
23 |
|
|
24 |
def get_version():
|
|
25 |
if os.path.exists('VERSION'):
|
|
26 |
version_file = open('VERSION', 'r')
|
|
27 |
version = version_file.read()
|
|
28 |
version_file.close()
|
|
29 |
return version
|
|
30 |
if os.path.exists('.git'):
|
|
31 |
p = subprocess.Popen(['git', 'describe', '--dirty', '--match=v*'], stdout=subprocess.PIPE)
|
|
32 |
result = p.communicate()[0]
|
|
33 |
if p.returncode == 0:
|
|
34 |
version = result.split()[0][1:]
|
|
35 |
version = version.replace('-', '.')
|
|
36 |
return version
|
|
37 |
return '0'
|
|
38 |
|
|
39 |
|
|
40 |
setup(
|
|
41 |
name='corbo',
|
|
42 |
version=get_version(),
|
|
43 |
description='Announces Manager',
|
|
44 |
author='Serghei Mihai',
|
|
45 |
author_email='smihai@entrouvert.com',
|
|
46 |
packages=find_packages(),
|
|
47 |
include_package_data=True,
|
|
48 |
scripts=('manage.py',),
|
|
49 |
url='http://repos.entrouvert.org/corbo.git',
|
|
50 |
classifiers=[
|
|
51 |
'Environment :: Web Environment',
|
|
52 |
'Framework :: Django',
|
|
53 |
'Intended Audience :: Developers',
|
|
54 |
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
|
|
55 |
'Operating System :: OS Independent',
|
|
56 |
'Programming Language :: Python',
|
|
57 |
'Programming Language :: Python :: 2',
|
|
58 |
],
|
|
59 |
install_requires=['django == 1.7',
|
|
60 |
'django-ckeditor',
|
|
61 |
'gadjo'
|
|
62 |
],
|
|
63 |
zip_safe=False,
|
|
64 |
)
|
initial packaging