aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Crute <mcrute@gmail.com>2010-05-26 18:46:35 -0400
committerMike Crute <mcrute@gmail.com>2010-05-26 18:46:35 -0400
commit55dfbc79f01fedee9ef3f4a7c09bcb4ff2a5bf74 (patch)
tree87dd35a808f40673b72f1993a9cc07d6fb886ed6
parent047d4bb87145f8b2729bdf517a18ccb4c4a9ca48 (diff)
downloadchishop-55dfbc79f01fedee9ef3f4a7c09bcb4ff2a5bf74.tar.bz2
chishop-55dfbc79f01fedee9ef3f4a7c09bcb4ff2a5bf74.tar.xz
chishop-55dfbc79f01fedee9ef3f4a7c09bcb4ff2a5bf74.zip
Fixing setup.py and cleaning out the buildout stuff. Also updated the docs to reflect this.
-rw-r--r--AUTHORS1
-rw-r--r--README11
-rw-r--r--bootstrap.py121
-rw-r--r--buildout.cfg15
-rw-r--r--index.html86
-rw-r--r--setup.py67
6 files changed, 14 insertions, 287 deletions
diff --git a/AUTHORS b/AUTHORS
index befbdf5..dda703b 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -10,4 +10,5 @@ Vinícius das Chagas Silva <vinimaster@gmail.com>
10Vanderson Mota dos Santos <vanderson.mota@gmail.com> 10Vanderson Mota dos Santos <vanderson.mota@gmail.com>
11Stefan Foulis <stefan.foulis@gmail.com> 11Stefan Foulis <stefan.foulis@gmail.com>
12Michael Richardson <michael@michaelrichardson.me> 12Michael Richardson <michael@michaelrichardson.me>
13Mike Crute <mcrute@gmail.com>
13Halldor 14Halldor
diff --git a/README b/README
index ca3b5e1..bb30a5d 100644
--- a/README
+++ b/README
@@ -8,21 +8,21 @@ Installation
8 8
9Install dependencies:: 9Install dependencies::
10 10
11 $ python bootstrap.py --distribute 11 $ python setup.py install
12 $ ./bin/buildout
13 12
14Initial configuration 13Initial configuration
15--------------------- 14---------------------
16:: 15::
17 16
18 $ $EDITOR chishop/settings.py 17 $ $EDITOR chishop/settings.py
19 $ ./bin/django syncdb 18 $ export DJANGO_SETTINGS_FILE="chishop.settings"
19 $ django-admin.py syncdb
20 20
21Run the PyPI server 21Run the PyPI server
22------------------- 22-------------------
23:: 23::
24 24
25 $ ./bin/django runserver 25 $ django-admin.py runserver
26 26
27Please note that ``chishop/media/dists`` has to be writable by the 27Please note that ``chishop/media/dists`` has to be writable by the
28user the web-server is running as. 28user the web-server is running as.
@@ -31,8 +31,7 @@ In production
31------------- 31-------------
32 32
33You may want to copy the file ``chishop/production_example.py`` and modify 33You may want to copy the file ``chishop/production_example.py`` and modify
34for use as your production settings; you will also need to modify 34for use as your production settings.
35``bin/django.wsgi`` to refer to your production settings.
36 35
37Using Setuptools 36Using Setuptools
38================ 37================
diff --git a/bootstrap.py b/bootstrap.py
deleted file mode 100644
index b964024..0000000
--- a/bootstrap.py
+++ /dev/null
@@ -1,121 +0,0 @@
1##############################################################################
2#
3# Copyright (c) 2006 Zope Corporation and Contributors.
4# All Rights Reserved.
5#
6# This software is subject to the provisions of the Zope Public License,
7# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
8# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11# FOR A PARTICULAR PURPOSE.
12#
13##############################################################################
14"""Bootstrap a buildout-based project
15
16Simply run this script in a directory containing a buildout.cfg.
17The script accepts buildout command-line options, so you can
18use the -c option to specify an alternate configuration file.
19
20$Id$
21"""
22
23import os, shutil, sys, tempfile, urllib2
24from optparse import OptionParser
25
26tmpeggs = tempfile.mkdtemp()
27
28is_jython = sys.platform.startswith('java')
29
30# parsing arguments
31parser = OptionParser()
32parser.add_option("-v", "--version", dest="version",
33 help="use a specific zc.buildout version")
34parser.add_option("-d", "--distribute",
35 action="store_true", dest="distribute", default=False,
36 help="Use Disribute rather than Setuptools.")
37
38parser.add_option("-c", None, action="store", dest="config_file",
39 help=("Specify the path to the buildout configuration "
40 "file to be used."))
41
42options, args = parser.parse_args()
43
44# if -c was provided, we push it back into args for buildout' main function
45if options.config_file is not None:
46 args += ['-c', options.config_file]
47
48if options.version is not None:
49 VERSION = '==%s' % options.version
50else:
51 VERSION = ''
52
53USE_DISTRIBUTE = options.distribute
54args = args + ['bootstrap']
55
56to_reload = False
57try:
58 import pkg_resources
59 if not hasattr(pkg_resources, '_distribute'):
60 to_reload = True
61 raise ImportError
62except ImportError:
63 ez = {}
64 if USE_DISTRIBUTE:
65 exec urllib2.urlopen('http://python-distribute.org/distribute_setup.py'
66 ).read() in ez
67 ez['use_setuptools'](to_dir=tmpeggs, download_delay=0, no_fake=True)
68 else:
69 exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
70 ).read() in ez
71 ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
72
73 if to_reload:
74 reload(pkg_resources)
75 else:
76 import pkg_resources
77
78if sys.platform == 'win32':
79 def quote(c):
80 if ' ' in c:
81 return '"%s"' % c # work around spawn lamosity on windows
82 else:
83 return c
84else:
85 def quote (c):
86 return c
87
88cmd = 'from setuptools.command.easy_install import main; main()'
89ws = pkg_resources.working_set
90
91if USE_DISTRIBUTE:
92 requirement = 'distribute'
93else:
94 requirement = 'setuptools'
95
96if is_jython:
97 import subprocess
98
99 assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd',
100 quote(tmpeggs), 'zc.buildout' + VERSION],
101 env=dict(os.environ,
102 PYTHONPATH=
103 ws.find(pkg_resources.Requirement.parse(requirement)).location
104 ),
105 ).wait() == 0
106
107else:
108 assert os.spawnle(
109 os.P_WAIT, sys.executable, quote (sys.executable),
110 '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout' + VERSION,
111 dict(os.environ,
112 PYTHONPATH=
113 ws.find(pkg_resources.Requirement.parse(requirement)).location
114 ),
115 ) == 0
116
117ws.add_entry(tmpeggs)
118ws.require('zc.buildout' + VERSION)
119import zc.buildout.buildout
120zc.buildout.buildout.main(args)
121shutil.rmtree(tmpeggs)
diff --git a/buildout.cfg b/buildout.cfg
deleted file mode 100644
index 160db4c..0000000
--- a/buildout.cfg
+++ /dev/null
@@ -1,15 +0,0 @@
1[buildout]
2parts = django
3find-links = http://bitbucket.org/ubernostrum/django-registration/downloads/django-registration-0.8-alpha-1.tar.gz
4unzip = true
5eggs = pkginfo
6 django-registration==0.8-alpha-1
7
8[django]
9recipe = djangorecipe
10version = 1.1.1
11settings = settings
12eggs = ${buildout:eggs}
13test = djangopypi
14project = chishop
15wsgi = true
diff --git a/index.html b/index.html
deleted file mode 100644
index 29cef02..0000000
--- a/index.html
+++ /dev/null
@@ -1,86 +0,0 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
8 <title>ask/chishop @ GitHub</title>
9
10 <style type="text/css">
11 body {
12 margin-top: 1.0em;
13 background-color: #8f92bd;
14 font-family: "helvetica";
15 color: #000000;
16 }
17 #container {
18 margin: 0 auto;
19 width: 700px;
20 }
21 h1 { font-size: 3.8em; color: #706d42; margin-bottom: 3px; }
22 h1 .small { font-size: 0.4em; }
23 h1 a { text-decoration: none }
24 h2 { font-size: 1.5em; color: #706d42; }
25 h3 { text-align: center; color: #706d42; }
26 a { color: #706d42; }
27 .description { font-size: 1.2em; margin-bottom: 30px; margin-top: 30px; font-style: italic;}
28 .download { float: right; }
29 pre { background: #000; color: #fff; padding: 15px;}
30 hr { border: 0; width: 80%; border-bottom: 1px solid #aaa}
31 .footer { text-align:center; padding-top:30px; font-style: italic; }
32 </style>
33
34</head>
35
36<body>
37 <a href="http://github.com/ask/chishop"><img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a>
38
39 <div id="container">
40
41 <div class="download">
42 <a href="http://github.com/ask/chishop/zipball/master">
43 <img border="0" width="90" src="http://github.com/images/modules/download/zip.png"></a>
44 <a href="http://github.com/ask/chishop/tarball/master">
45 <img border="0" width="90" src="http://github.com/images/modules/download/tar.png"></a>
46 </div>
47
48 <h1><a href="http://github.com/ask/chishop">chishop</a>
49 <span class="small">by <a href="http://github.com/ask">ask</a></small></h1>
50
51 <div class="description">
52 Simple PyPI server written in Django.
53 </div>
54
55 <p>Simple PyPI server written in Django. Supports register/upload new projects and releases using distutils and installation of distributions on server using easy_install/pip.</p><h2>Dependencies</h2>
56<p>Django >= 1.0.2</p>
57<h2>Install</h2>
58<p>see README.</p>
59<h2>License</h2>
60<p>BSD</p>
61<h2>Authors</h2>
62<p>Ask Solem (askh@modwheel.net) <br/> <br/> </p>
63<h2>Contact</h2>
64<p>Ask Solem Hoel (ask@modwheel.net) <br/> </p>
65
66
67 <h2>Download</h2>
68 <p>
69 You can download this project in either
70 <a href="http://github.com/ask/chishop/zipball/master">zip</a> or
71 <a href="http://github.com/ask/chishop/tarball/master">tar</a> formats.
72 </p>
73 <p>You can also clone the project with <a href="http://git-scm.com">Git</a>
74 by running:
75 <pre>$ git clone git://github.com/ask/chishop</pre>
76 </p>
77
78 <div class="footer">
79 get the source code on GitHub : <a href="http://github.com/ask/chishop">ask/chishop</a>
80 </div>
81
82 </div>
83
84
85</body>
86</html>
diff --git a/setup.py b/setup.py
index c83c08c..cb03934 100644
--- a/setup.py
+++ b/setup.py
@@ -1,77 +1,26 @@
1#!/usr/bin/env python 1#!/usr/bin/env python
2# -*- coding: utf-8 -*- 2# -*- coding: utf-8 -*-
3import os
4import codecs
5
6try:
7 from setuptools import setup, find_packages
8except ImportError:
9 from ez_setup import use_setuptools
10 use_setuptools()
11 from setuptools import setup, find_packages
12
13from distutils.command.install_data import install_data
14from distutils.command.install import INSTALL_SCHEMES
15import sys
16
17djangopypi = __import__('djangopypi', {}, {}, [''])
18
19packages, data_files = [], []
20root_dir = os.path.dirname(__file__)
21if root_dir != '':
22 os.chdir(root_dir)
23djangopypi_dir = "djangopypi"
24
25def osx_install_data(install_data):
26 def finalize_options(self):
27 self.set_undefined_options("install", ("install_lib", "install_dir"))
28 install_data.finalize_options(self)
29
30#if sys.platform == "darwin":
31# cmdclasses = {'install_data': osx_install_data}
32#else:
33# cmdclasses = {'install_data': install_data}
34
35
36def fullsplit(path, result=None):
37 if result is None:
38 result = []
39 head, tail = os.path.split(path)
40 if head == '':
41 return [tail] + result
42 if head == path:
43 return result
44 return fullsplit(head, [tail] + result)
45
46
47for scheme in INSTALL_SCHEMES.values():
48 scheme['data'] = scheme['purelib']
49 3
4import codecs
5import djangopypi
6from setuptools import setup, find_packages
50 7
51for dirpath, dirnames, filenames in os.walk(djangopypi_dir):
52 # Ignore dirnames that start with '.'
53 for i, dirname in enumerate(dirnames):
54 if dirname.startswith("."): del dirnames[i]
55 for filename in filenames:
56 if filename.endswith(".py"):
57 packages.append('.'.join(fullsplit(dirpath)))
58 else:
59 data_files.append([dirpath, [os.path.join(dirpath, f) for f in
60 filenames]])
61setup( 8setup(
62 name='chishop', 9 name='chishop',
63 version=djangopypi.__version__, 10 version=djangopypi.__version__,
11 packages=find_packages(),
64 description='Simple PyPI server written in Django.', 12 description='Simple PyPI server written in Django.',
65 author='Ask Solem', 13 author='Ask Solem',
66 author_email='askh@opera.com', 14 author_email='askh@opera.com',
67 packages=packages,
68 url="http://ask.github.com/chishop", 15 url="http://ask.github.com/chishop",
69 zip_safe=False, 16 zip_safe=False,
70 data_files=data_files,
71 install_requires=[ 17 install_requires=[
72 'django>=1.0', 18 'django>=1.0',
73 'docutils', 19 'docutils',
74 'django-registration>0.7', 20 'django-registration==0.8-alpha-1',
21 ],
22 dependency_links=[
23 'http://bitbucket.org/ubernostrum/django-registration/downloads',
75 ], 24 ],
76 classifiers=[ 25 classifiers=[
77 "Development Status :: 3 - Alpha", 26 "Development Status :: 3 - Alpha",