75 lines
2.0 KiB
Python
75 lines
2.0 KiB
Python
#!/usr/bin/env python
|
|
import os
|
|
import posix
|
|
import sys
|
|
from setuptools import setup, find_packages
|
|
from setuptools import Command
|
|
|
|
|
|
class MyCommand(Command):
|
|
user_options = []
|
|
|
|
def initialize_options(self):
|
|
pass
|
|
|
|
def finalize_options(self):
|
|
pass
|
|
|
|
|
|
class SetupPythonEnvironment(MyCommand):
|
|
description = 'create a (virtual) python environment'
|
|
|
|
def run(self):
|
|
python_bin = sys.executable if sys.executable else 'python'
|
|
path = 'env/python'
|
|
prompt = '(dav)'
|
|
|
|
print('Creating new python environment in {path}'.format(path=path))
|
|
cmd = ('{bin} -m virtualenv'
|
|
' --prompt="{prompt}"'
|
|
' {path}'.format(bin=python_bin, path=path, prompt=prompt))
|
|
os.system(cmd)
|
|
|
|
print('Depending on your operating system and shell,')
|
|
print('you should enter the new environment by running')
|
|
print('ONE of the following commands:')
|
|
print('> source %s/bin/activate' % path)
|
|
print('> %s/Scripts/activate.bat' % path)
|
|
print('> %s/Scripts/activate.ps1' % path)
|
|
|
|
|
|
if sys.version_info.major != 2:
|
|
sys.stderr.write('This is not python 2. I want python 2.\n')
|
|
sys.exit(posix.EX_USAGE)
|
|
|
|
|
|
setup(
|
|
name='django-dav-events',
|
|
version='1.0',
|
|
description='A django based web application project to submit DAV Events.',
|
|
url='https://www.heinzelwelt.de',
|
|
maintainer='Jens Kleineheismann',
|
|
maintainer_email='heinzel@heinzelwelt.de',
|
|
cmdclass={
|
|
'mkpyenv': SetupPythonEnvironment,
|
|
},
|
|
packages=find_packages(),
|
|
include_package_data=True,
|
|
entry_points={
|
|
'console_scripts': [
|
|
'django-dav-admin = dav_base.console_scripts.admin:main',
|
|
],
|
|
},
|
|
install_requires=[
|
|
'babel',
|
|
'django >= 1.11, < 2.0',
|
|
'django-extensions',
|
|
'django-bootstrap3',
|
|
'django-countries',
|
|
'django-datetime-widget',
|
|
],
|
|
extras_require={
|
|
'production': ['psycopg2'],
|
|
},
|
|
)
|