Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: setup.py

Issue 29338156: Issue 3754 - Initial setup of the python-abp repo. (Closed)
Patch Set: Update ignore files, describe testing in README.md and fix a typo in tox.ini. Created March 16, 2016, 3:56 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: setup.py
===================================================================
new file mode 100644
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,68 @@
+# This file is part of Adblock Plus <https://adblockplus.org/>,
+# Copyright (C) 2006-2016 Eyeo GmbH
+#
+# Adblock Plus is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 3 as
+# published by the Free Software Foundation.
+#
+# Adblock Plus is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
+
+import subprocess
+from os import path
+from setuptools import setup, Command
+
+
+DEVENV = 'devenv'
+PIP = path.join(DEVENV, 'bin', 'pip')
+DEV_DEPENDENCIES = ['pytest', 'tox']
+
+
+class devenv(Command):
+ """Set up development virtualenv."""
+
+ description = "set up development virtualenv"
+ user_options = [('python=', 'p', "the python interpreter to use")]
+
+ def initialize_options(self):
+ self.python = 'python'
+
+ def finalize_options(self):
+ pass
+
+ def run(self):
+ subprocess.check_call(['virtualenv', '-p', self.python, DEVENV])
+ subprocess.check_call([PIP, 'install'] + DEV_DEPENDENCIES)
Sebastian Noack 2016/03/16 16:03:59 Wait, wouldn't that install these packages globall
Vasily Kuznetsov 2016/03/16 16:29:35 It will install in the devenv because (line 22) "P
Sebastian Noack 2016/03/16 16:44:59 Are you sure that works even without virtualenv be
Vasily Kuznetsov 2016/03/17 09:23:08 Yes, it definitely works. I ran this thing many ti
+ subprocess.check_call([PIP, 'install', '-e', '.'])
+
+
+setup(
+ name='python-abp',
+ version='0.0.1',
+ description='ABP python tools',
+ long_description="A library for working with Adblock Plus filterlists.",
+ author='Vasily Kuznetsov',
+ author_email='vasily@adblockplus.org',
+ url='https://hg.adblockplus.org/python-abp/',
+ packages=['abp', 'abp.filters'],
+ cmdclass={'devenv': devenv},
+ include_package_data=True,
+ license='GPLv3',
+ zip_safe=False,
+ keywords='filterlist adblockplus ABP',
+ classifiers=[
+ 'Development Status :: 2 - Pre-Alpha',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
+ 'Natural Language :: English',
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.5',
+ ]
+)

Powered by Google App Engine
This is Rietveld