-
Notifications
You must be signed in to change notification settings - Fork 81
/
setup.py
86 lines (71 loc) · 2.65 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
74
75
76
77
78
79
80
81
82
83
84
85
86
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
from shutil import rmtree
from setuptools import setup, Command
long_desc = '''Python Env Wrapper is a set of commands to manage multiple [virtual environments](http://pypi.python.org/pypi/virtualenv). Pew can create, delete and copy your environments, using a single command to switch to them wherever you are, while keeping them in a single (configurable) location.
Virtualenvs makes it easier to work on more than one project at a time without introducing conflicts in their dependencies.
Pew is completely shell-agnostic and thus works on bash, zsh, fish, powershell, etc.
For the documentation, you might want to read here:
https://github.com/berdario/pew#usage'''
here = os.path.abspath(os.path.dirname(__file__))
VERSION = '1.2.0'
AUTHOR = os.environ.get('DEBFULLNAME', 'Dario Bertini')
EMAIL = os.environ.get('DEBEMAIL', 'berdario+pypi@gmail.com')
class DebCommand(Command):
"""Support for setup.py deb"""
description = 'Build and publish the .deb package.'
user_options = []
@staticmethod
def status(s):
"""Prints things in bold."""
print('\033[1m{0}\033[0m'.format(s))
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
try:
self.status('Removing previous builds…')
rmtree(os.path.join(here, 'deb_dist'))
except FileNotFoundError:
pass
self.status(u'Creating debian mainfest…')
os.system('{0} setup.py --command-packages=stdeb.command sdist_dsc -z artful --package3=pew --depends3=python3-virtualenv-clone'.format(sys.executable))
self.status(u'Building .deb…')
os.chdir('deb_dist/pew-{0}'.format(VERSION))
os.system('dpkg-buildpackage -rfakeroot -uc -us')
setup(
name='pew',
version=VERSION,
description='tool to manage multiple virtualenvs written in pure python',
long_description=long_desc,
author=AUTHOR,
author_email=EMAIL,
url='https://github.com/berdario/pew',
license='MIT License',
packages=['pew'],
install_requires=[
'virtualenv>=1.11', 'virtualenv-clone>=0.2.5', 'setuptools>=17.1'
],
extras_require={
':sys_platform=="win32"': [
'shellingham'
],
'pythonz': [
'pythonz-bd>=1.10.2'
]
},
include_package_data=True,
zip_safe=False,
cmdclass={
'deb': DebCommand
},
entry_points={
'console_scripts': ['pew = pew.pew:pew']},
classifiers=[
'Programming Language :: Python :: 3',
'Intended Audience :: Developers',
'Environment :: Console']
)