All Samples(17990) | Call(8562) | Derive(0) | Import(9428)
The gateway to the Distutils: do everything your setup script needs to do, in a highly flexible and user-driven way. Briefly: create a Distribution instance; find and parse config files; parse the command line; run each Distutils command found there, customized by the options supplied to 'setup()' (as keyword arguments), in config files, and on the command line. The Distribution instance might be an instance of a class supplied via the 'distclass' keyword argument to 'setup'; if no such class is supplied, then the Distribution class (in dist.py) is instantiated. All other arguments to 'setup' (except for 'cmdclass') are used to set attributes of the Distribution instance. The 'cmdclass' argument, if supplied, is a dictionary mapping command names to command classes. Each command encountered on the command line will be turned into a command class, which is in turn instantiated; any class found in 'cmdclass' is used in place of the default, which is (for command 'foo_bar') class 'foo_bar' in module 'distutils.command.foo_bar'. The command class must provide a 'user_options' attribute which is a list of option specifiers for 'distutils.fancy_getopt'. Any command-line options between the current and the next command are used to set attributes of the current command object. When the entire command-line has been successfully parsed, calls the 'run()' method on each command object in turn. This method will be driven entirely by the Distribution object (which each command object has a reference to, thanks to its constructor), and the command-specific options that became attributes of each command object.
def setup(**attrs):
"""The gateway to the Distutils: do everything your setup script needs
to do, in a highly flexible and user-driven way. Briefly: create a
Distribution instance; find and parse config files; parse the command
line; run each Distutils command found there, customized by the options
supplied to 'setup()' (as keyword arguments), in config files, and on
the command line.
The Distribution instance might be an instance of a class supplied via
the 'distclass' keyword argument to 'setup'; if no such class is
supplied, then the Distribution class (in dist.py) is instantiated.
All other arguments to 'setup' (except for 'cmdclass') are used to set
attributes of the Distribution instance.
The 'cmdclass' argument, if supplied, is a dictionary mapping command
names to command classes. Each command encountered on the command line
will be turned into a command class, which is in turn instantiated; any
class found in 'cmdclass' is used in place of the default, which is
(for command 'foo_bar') class 'foo_bar' in module
'distutils.command.foo_bar'. The command class must provide a
'user_options' attribute which is a list of option specifiers for
'distutils.fancy_getopt'. Any command-line options between the current
and the next command are used to set attributes of the current command
object.
When the entire command-line has been successfully parsed, calls the
'run()' method on each command object in turn. This method will be
driven entirely by the Distribution object (which each command object
has a reference to, thanks to its constructor), and the
command-specific options that became attributes of each command
object.
"""
global _setup_stop_after, _setup_distribution
# Determine the distribution class -- either caller-supplied or
# our Distribution (see below).
klass = attrs.get('distclass')
if klass:
del attrs['distclass']
else:
klass = Distribution
if 'script_name' not in attrs:
attrs['script_name'] = os.path.basename(sys.argv[0])
if 'script_args' not in attrs:
attrs['script_args'] = sys.argv[1:]
# Create the Distribution instance, using the remaining arguments
# (ie. everything except distclass) to initialize it
try:
_setup_distribution = dist = klass(attrs)
except DistutilsSetupError, msg:
if 'name' in attrs:
raise SystemExit, "error in %s setup command: %s" % \
(attrs['name'], msg)
else:
raise SystemExit, "error in setup command: %s" % msg
if _setup_stop_after == "init":
return dist
# Find and parse the config file(s): they will override options from
# the setup script, but be overridden by the command line.
dist.parse_config_files()
if DEBUG:
print "options (after parsing config files):"
dist.dump_option_dicts()
if _setup_stop_after == "config":
return dist
# Parse the command line and override config files; any
# command-line errors are the end user's fault, so turn them into
# SystemExit to suppress tracebacks.
try:
ok = dist.parse_command_line()
except DistutilsArgError, msg:
raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
if DEBUG:
print "options (after parsing command line):"
dist.dump_option_dicts()
if _setup_stop_after == "commandline":
return dist
# And finally, run all the commands found on the command line.
if ok:
try:
dist.run_commands()
except KeyboardInterrupt:
raise SystemExit, "interrupted"
except (IOError, os.error), exc:
error = grok_environment_error(exc)
if DEBUG:
sys.stderr.write(error + "\n")
raise
else:
raise SystemExit, error
except (DistutilsError,
CCompilerError), msg:
if DEBUG:
raise
else:
raise SystemExit, "error: " + str(msg)
return dist
VERSION='0.2.0'
from setuptools import setup, find_packages
setup(
name = 'nagare.examples',
src/e/x/example.blobattype-1.0b2/setup.py example.blobattype(Download)
from setuptools import setup, find_packages
from os.path import join
readme = open('README.txt').read()
history = open(join('docs', 'HISTORY.txt')).read()
setup(name = 'example.blobattype',
src/p/r/Products.FacultyStaffDirectory-2.1.4/Products/FacultyStaffDirectory/examples/Products.MobilePhoneExtender/setup.py Products.FacultyStaffDirectory(Download)
from setuptools import setup, find_packages
import os
version = open(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'Products', 'MobilePhoneExtender', 'version.txt')).read().strip()
if version.endswith('dev'):
version = version[:-3]
setup(name='Products.MobilePhoneExtender',
src/z/a/zamplugin.sampledata-0.5.0/setup.py zamplugin.sampledata(Download)
$Id:$
"""
import os
from setuptools import setup, find_packages
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
setup (
name='zamplugin.sampledata',
src/z/3/z3c.sampledata-0.4.0/setup.py z3c.sampledata(Download)
$Id:$
"""
import os
from setuptools import setup, find_packages
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
setup (
name='z3c.sampledata',
src/p/y/pylive-HEAD/example/i_pylons/setup.py pylive(Download)
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='i_pylons',
src/g/u/gunicorn-0.11.1/examples/frameworks/pylonstest/setup.py gunicorn(Download)
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='pylonstest',
src/c/o/cogen-0.2.1/examples/paste_integration_testapp/InputApp/setup.py cogen(Download)
from setuptools import setup, find_packages
import sys, os
version = '0.0'
setup(name='InputApp',
version=version,
src/c/o/cogen-0.2.1/examples/paste_helloworld_app/HelloWorld/setup.py cogen(Download)
from setuptools import setup, find_packages
import sys, os
version = '0.1'
setup(name='HelloWorld',
version=version,
src/r/e/restish-0.11/examples/repoze.who/setup.py restish(Download)
from setuptools import setup, find_packages
import sys, os
version = '0.0'
setup(name='example',
version=version,
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next