-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
69 lines (62 loc) · 2.1 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
##############################################################################
#
# Copyright (c) 2008-2013 Agendaless Consulting and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the BSD-like license at
# http://www.repoze.org/LICENSE.txt. A copy of the license should accompany
# this distribution. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL
# EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND
# FITNESS FOR A PARTICULAR PURPOSE
#
##############################################################################
import os
import random
import re
import urllib2
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
try:
with open(os.path.join(here, 'README.rst')) as f:
README = f.read()
except IOError:
README = ''
pkgre = re.compile('href="/pypi/([^/"]+)/')
prefixes = [
'zope.',
'zc.',
'z3c.',
# Uncomment following line to unleash Plone pain.
# 'Products.'
]
def matches(name):
for prefix in prefixes:
if name.startswith(prefix):
return True
return False
def get_zope_packages():
html = urllib2.urlopen('https://pypi.python.org/pypi/').read()
return [pkg.strip() for pkg in pkgre.findall(html) if matches(pkg)]
random.seed()
zope_packages = get_zope_packages()
install_requires=[random.choice(zope_packages), random.choice(zope_packages)]
setup(name='zope.cooties',
version='40.5',
description=('Give the haters more to hate.'),
long_description=README,
classifiers=[
"Intended Audience :: Developers",
"Programming Language :: Python",
"License :: Repoze Public License",
],
keywords='zope cooties lol',
author="Chris Rossi",
author_email="[email protected]",
url="http://pylonsproject.org",
license="BSD-derived (http://www.repoze.org/LICENSE.txt)",
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires = install_requires,
)