From 55dfbc79f01fedee9ef3f4a7c09bcb4ff2a5bf74 Mon Sep 17 00:00:00 2001 From: Mike Crute Date: Wed, 26 May 2010 18:46:35 -0400 Subject: Fixing setup.py and cleaning out the buildout stuff. Also updated the docs to reflect this. --- AUTHORS | 1 + README | 11 +++--- bootstrap.py | 121 ----------------------------------------------------------- buildout.cfg | 15 -------- index.html | 86 ------------------------------------------ setup.py | 67 ++++----------------------------- 6 files changed, 14 insertions(+), 287 deletions(-) delete mode 100644 bootstrap.py delete mode 100644 buildout.cfg delete mode 100644 index.html diff --git a/AUTHORS b/AUTHORS index befbdf5..dda703b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -10,4 +10,5 @@ Vinícius das Chagas Silva Vanderson Mota dos Santos Stefan Foulis Michael Richardson +Mike Crute Halldor diff --git a/README b/README index ca3b5e1..bb30a5d 100644 --- a/README +++ b/README @@ -8,21 +8,21 @@ Installation Install dependencies:: - $ python bootstrap.py --distribute - $ ./bin/buildout + $ python setup.py install Initial configuration --------------------- :: $ $EDITOR chishop/settings.py - $ ./bin/django syncdb + $ export DJANGO_SETTINGS_FILE="chishop.settings" + $ django-admin.py syncdb Run the PyPI server ------------------- :: - $ ./bin/django runserver + $ django-admin.py runserver Please note that ``chishop/media/dists`` has to be writable by the user the web-server is running as. @@ -31,8 +31,7 @@ In production ------------- You may want to copy the file ``chishop/production_example.py`` and modify -for use as your production settings; you will also need to modify -``bin/django.wsgi`` to refer to your production settings. +for use as your production settings. Using Setuptools ================ diff --git a/bootstrap.py b/bootstrap.py deleted file mode 100644 index b964024..0000000 --- a/bootstrap.py +++ /dev/null @@ -1,121 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Corporation and Contributors. -# All Rights Reserved. -# -# This software is subject to the provisions of the Zope Public License, -# Version 2.1 (ZPL). A copy of the ZPL 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. -# -############################################################################## -"""Bootstrap a buildout-based project - -Simply run this script in a directory containing a buildout.cfg. -The script accepts buildout command-line options, so you can -use the -c option to specify an alternate configuration file. - -$Id$ -""" - -import os, shutil, sys, tempfile, urllib2 -from optparse import OptionParser - -tmpeggs = tempfile.mkdtemp() - -is_jython = sys.platform.startswith('java') - -# parsing arguments -parser = OptionParser() -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="distribute", default=False, - help="Use Disribute rather than Setuptools.") - -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout' main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.version is not None: - VERSION = '==%s' % options.version -else: - VERSION = '' - -USE_DISTRIBUTE = options.distribute -args = args + ['bootstrap'] - -to_reload = False -try: - import pkg_resources - if not hasattr(pkg_resources, '_distribute'): - to_reload = True - raise ImportError -except ImportError: - ez = {} - if USE_DISTRIBUTE: - exec urllib2.urlopen('http://python-distribute.org/distribute_setup.py' - ).read() in ez - ez['use_setuptools'](to_dir=tmpeggs, download_delay=0, no_fake=True) - else: - exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py' - ).read() in ez - ez['use_setuptools'](to_dir=tmpeggs, download_delay=0) - - if to_reload: - reload(pkg_resources) - else: - import pkg_resources - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - def quote (c): - return c - -cmd = 'from setuptools.command.easy_install import main; main()' -ws = pkg_resources.working_set - -if USE_DISTRIBUTE: - requirement = 'distribute' -else: - requirement = 'setuptools' - -if is_jython: - import subprocess - - assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd', - quote(tmpeggs), 'zc.buildout' + VERSION], - env=dict(os.environ, - PYTHONPATH= - ws.find(pkg_resources.Requirement.parse(requirement)).location - ), - ).wait() == 0 - -else: - assert os.spawnle( - os.P_WAIT, sys.executable, quote (sys.executable), - '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout' + VERSION, - dict(os.environ, - PYTHONPATH= - ws.find(pkg_resources.Requirement.parse(requirement)).location - ), - ) == 0 - -ws.add_entry(tmpeggs) -ws.require('zc.buildout' + VERSION) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -shutil.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 @@ -[buildout] -parts = django -find-links = http://bitbucket.org/ubernostrum/django-registration/downloads/django-registration-0.8-alpha-1.tar.gz -unzip = true -eggs = pkginfo - django-registration==0.8-alpha-1 - -[django] -recipe = djangorecipe -version = 1.1.1 -settings = settings -eggs = ${buildout:eggs} -test = djangopypi -project = chishop -wsgi = 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 @@ - - - - - - - ask/chishop @ GitHub - - - - - - - Fork me on GitHub - -
- -
- - - - -
- -

chishop - by ask

- -
- Simple PyPI server written in Django. -
- -

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.

Dependencies

-

Django >= 1.0.2

-

Install

-

see README.

-

License

-

BSD

-

Authors

-

Ask Solem (askh@modwheel.net)

-

Contact

-

Ask Solem Hoel (ask@modwheel.net)

- - -

Download

-

- You can download this project in either - zip or - tar formats. -

-

You can also clone the project with Git - by running: -

$ git clone git://github.com/ask/chishop
-

- - - -
- - - - diff --git a/setup.py b/setup.py index c83c08c..cb03934 100644 --- a/setup.py +++ b/setup.py @@ -1,77 +1,26 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -import os -import codecs - -try: - from setuptools import setup, find_packages -except ImportError: - from ez_setup import use_setuptools - use_setuptools() - from setuptools import setup, find_packages - -from distutils.command.install_data import install_data -from distutils.command.install import INSTALL_SCHEMES -import sys - -djangopypi = __import__('djangopypi', {}, {}, ['']) - -packages, data_files = [], [] -root_dir = os.path.dirname(__file__) -if root_dir != '': - os.chdir(root_dir) -djangopypi_dir = "djangopypi" - -def osx_install_data(install_data): - def finalize_options(self): - self.set_undefined_options("install", ("install_lib", "install_dir")) - install_data.finalize_options(self) - -#if sys.platform == "darwin": -# cmdclasses = {'install_data': osx_install_data} -#else: -# cmdclasses = {'install_data': install_data} - - -def fullsplit(path, result=None): - if result is None: - result = [] - head, tail = os.path.split(path) - if head == '': - return [tail] + result - if head == path: - return result - return fullsplit(head, [tail] + result) - - -for scheme in INSTALL_SCHEMES.values(): - scheme['data'] = scheme['purelib'] +import codecs +import djangopypi +from setuptools import setup, find_packages -for dirpath, dirnames, filenames in os.walk(djangopypi_dir): - # Ignore dirnames that start with '.' - for i, dirname in enumerate(dirnames): - if dirname.startswith("."): del dirnames[i] - for filename in filenames: - if filename.endswith(".py"): - packages.append('.'.join(fullsplit(dirpath))) - else: - data_files.append([dirpath, [os.path.join(dirpath, f) for f in - filenames]]) setup( name='chishop', version=djangopypi.__version__, + packages=find_packages(), description='Simple PyPI server written in Django.', author='Ask Solem', author_email='askh@opera.com', - packages=packages, url="http://ask.github.com/chishop", zip_safe=False, - data_files=data_files, install_requires=[ 'django>=1.0', 'docutils', - 'django-registration>0.7', + 'django-registration==0.8-alpha-1', + ], + dependency_links=[ + 'http://bitbucket.org/ubernostrum/django-registration/downloads', ], classifiers=[ "Development Status :: 3 - Alpha", -- cgit v1.2.3