LEFT | RIGHT |
1 # -*- coding: utf-8 -*- | |
2 | |
3 # This file is part of Adblock Plus <https://adblockplus.org/>, | 1 # This file is part of Adblock Plus <https://adblockplus.org/>, |
4 # Copyright (C) 2006-2016 Eyeo GmbH | 2 # Copyright (C) 2006-2016 Eyeo GmbH |
5 # | 3 # |
6 # Adblock Plus is free software: you can redistribute it and/or modify | 4 # Adblock Plus is free software: you can redistribute it and/or modify |
7 # it under the terms of the GNU General Public License version 3 as | 5 # it under the terms of the GNU General Public License version 3 as |
8 # published by the Free Software Foundation. | 6 # published by the Free Software Foundation. |
9 # | 7 # |
10 # Adblock Plus is distributed in the hope that it will be useful, | 8 # Adblock Plus is distributed in the hope that it will be useful, |
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
14 # | 12 # |
15 # You should have received a copy of the GNU General Public License | 13 # You should have received a copy of the GNU General Public License |
16 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 14 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
17 | 15 |
18 """A library for working with Adblock Plus filterlists.""" | 16 import subprocess |
| 17 from os import path |
| 18 from setuptools import setup, Command |
19 | 19 |
20 from setuptools import setup | 20 |
| 21 DEVENV = 'devenv' |
| 22 PIP = path.join(DEVENV, 'bin', 'pip') |
| 23 DEV_DEPENDENCIES = ['pytest', 'tox'] |
| 24 |
| 25 |
| 26 class devenv(Command): |
| 27 """Set up development virtualenv.""" |
| 28 |
| 29 description = "set up development virtualenv" |
| 30 user_options = [('python=', 'p', "the python interpreter to use")] |
| 31 |
| 32 def initialize_options(self): |
| 33 self.python = 'python' |
| 34 |
| 35 def finalize_options(self): |
| 36 pass |
| 37 |
| 38 def run(self): |
| 39 subprocess.check_call(['virtualenv', '-p', self.python, DEVENV]) |
| 40 subprocess.check_call([PIP, 'install'] + DEV_DEPENDENCIES) |
| 41 subprocess.check_call([PIP, 'install', '-e', '.']) |
21 | 42 |
22 | 43 |
23 setup( | 44 setup( |
24 name='python-abp', | 45 name='python-abp', |
25 version='0.0.1', | 46 version='0.0.1', |
26 description='ABP python tools', | 47 description='ABP python tools', |
27 long_description=__doc__, | 48 long_description="A library for working with Adblock Plus filter lists.", |
28 author='Vasily Kuznetsov', | 49 author='Vasily Kuznetsov', |
29 author_email='vasily@adblockplus.org', | 50 author_email='vasily@adblockplus.org', |
30 url='https://hg.adblockplus.org/python-abp/', | 51 url='https://hg.adblockplus.org/python-abp/', |
31 packages=['abp', 'abp.filters'], | 52 packages=['abp', 'abp.filters'], |
| 53 cmdclass={'devenv': devenv}, |
32 include_package_data=True, | 54 include_package_data=True, |
33 license='GPLv3', | 55 license='GPLv3', |
34 zip_safe=False, | 56 zip_safe=False, |
35 keywords='filterlist adblockplus ABP', | 57 keywords='filterlist adblockplus ABP', |
36 classifiers=[ | 58 classifiers=[ |
37 'Development Status :: 2 - Pre-Alpha', | 59 'Development Status :: 2 - Pre-Alpha', |
38 'Intended Audience :: Developers', | 60 'Intended Audience :: Developers', |
39 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', | 61 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', |
40 'Natural Language :: English', | 62 'Natural Language :: English', |
41 'Programming Language :: Python :: 2', | 63 'Programming Language :: Python :: 2', |
42 'Programming Language :: Python :: 2.7', | 64 'Programming Language :: Python :: 2.7', |
43 'Programming Language :: Python :: 3', | 65 'Programming Language :: Python :: 3', |
44 'Programming Language :: Python :: 3.3', | |
45 'Programming Language :: Python :: 3.4', | |
46 'Programming Language :: Python :: 3.5', | 66 'Programming Language :: Python :: 3.5', |
47 ] | 67 ] |
48 ) | 68 ) |
LEFT | RIGHT |