コード例 #1
0
def main():
    p = ArgumentParser(
        description="""

Install a Python package in 'development mode'.

This works by creating a conda.pth file in site-packages."""
        # TODO: Use setup.py to determine any entry-points to install.
    )

    p.add_argument(
        'source',
        action="store",
        metavar='PATH',
        nargs='+',
        help="Path to the source directory."
    )
    p.add_argument(
                   '-npf', '--no-pth-file',
                   action='store_true',
                   help=("Relink compiled extension dependencies against "
                         "libraries found in current conda env. "
                         "Do not add source to conda.pth."))
    add_parser_prefix(p)
    p.set_defaults(func=execute)

    args = p.parse_args()
    args_func(args, p)
コード例 #2
0
ファイル: main_index.py プロジェクト: ovz/conda-build
def main():
    p = ArgumentParser(
        description="Update package index metadata files in given directories."
    )

    p.add_argument(
        'dir',
        help='Directory that contains an index to be updated.',
        nargs='*',
        default=[os.getcwd()],
    )

    p.add_argument(
        '-c',
        "--check-md5",
        action="store_true",
        help=
        """Use MD5 values instead of file modification times for determining if a
        package's metadata needs to be updated.""",
    )

    p.add_argument(
        '-f',
        "--force",
        action="store_true",
        help="Force reading all files.",
    )

    p.add_argument(
        '-q',
        "--quiet",
        action="store_true",
        help="Don't show any output.",
    )
    p.add_argument(
        '--no-remove',
        action="store_false",
        dest="remove",
        default=True,
        help="Don't remove entries for files that don't exist.",
    )

    args = p.parse_args()

    dir_paths = [abspath(path) for path in args.dir]
    # Don't use byte strings in Python 2
    if not PY3:
        dir_paths = [path.decode(getpreferredencoding()) for path in dir_paths]

    for path in dir_paths:
        update_index(path,
                     verbose=(not args.quiet),
                     force=args.force,
                     check_md5=args.check_md5,
                     remove=args.remove)
コード例 #3
0
ファイル: main_sign.py プロジェクト: ovz/conda-build
def main():
    from conda.cli.conda_argparse import ArgumentParser

    p = ArgumentParser(
        description="""\
Tool for signing conda packages.  Signatures will be written alongside the
files as FILE.sig.""")

    p.add_argument('files',
        help="Files to sign.",
        nargs='*',
        metavar="FILE",)
    p.add_argument('-k', '--keygen',
                 action="store",
                 help="Generate a public-private "
                      "key pair ~/.conda/keys/<NAME>(.pub).",
                 metavar="NAME")
    p.add_argument('--size',
                 action="store",
                 help="Size of generated RSA public-private key pair in bits "
                      "(defaults to 2048).",
                 metavar="BITS")
    p.add_argument('-v', '--verify',
                 action="store_true",
                 help="Verify FILE(s).")

    args = p.parse_args()

    if args.keygen:
        if args.files:
            p.error('no arguments expected for --keygen')
        try:
            keygen(args.keygen, int(2048 if args.size is None else args.size))
        except ValueError as e:
            sys.exit('Error: %s' % e)
        return

    if args.size is not None:
        p.error('--size option is only allowed with --keygen option')

    if args.verify:
        for path in args.files:
            try:
                disp = 'VALID' if verify(path) else 'INVALID'
            except SignatureError as e:
                disp = 'ERROR: %s' % e
            print('%-40s %s' % (path, disp))
        return

    key_name = get_default_keyname()
    if key_name is None:
        sys.exit("Error: no private key found in %s" % KEYS_DIR)
    print("Using private key '%s' for signing." % key_name)
    key = RSA.importKey(open(join(KEYS_DIR, key_name)).read())
    for path in args.files:
        print('signing: %s' % path)
        with open('%s.sig' % path, 'w') as fo:
            fo.write('%s ' % key_name)
            fo.write(sign(path, key))
            fo.write('\n')
コード例 #4
0
ファイル: main_develop.py プロジェクト: menghaozhu/hat
def main():
    p = ArgumentParser(
        description="""

Install a Python package in 'development mode'.

This works by creating a conda.pth file in site-packages."""

        # TODO: Use setup.py to determine any entry-points to install.
    )

    p.add_argument('source',
                   action="store",
                   metavar='PATH',
                   nargs='+',
                   help="Path to the source directory.")
    p.add_argument('-npf',
                   '--no-pth-file',
                   action='store_true',
                   help=("Relink compiled extension dependencies against "
                         "libraries found in current conda env. "
                         "Do not add source to conda.pth."))
    p.add_argument('-b',
                   '--build_ext',
                   action='store_true',
                   help=("Build extensions inplace, invoking: "
                         "python setup.py build_ext --inplace; "
                         "add to conda.pth; relink runtime libraries to "
                         "environment's lib/."))
    p.add_argument('-c',
                   '--clean',
                   action='store_true',
                   help=("Invoke clean on setup.py: "
                         "python setup.py clean "
                         "use with build_ext to clean before building."))
    p.add_argument('-u',
                   '--uninstall',
                   action='store_true',
                   help=("Removes package if installed in 'development mode' "
                         "by deleting path from conda.pth file. Ignore other "
                         "options - just uninstall and exit"))

    add_parser_prefix(p)
    p.set_defaults(func=execute)

    args = p.parse_args()
    args_func(args, p)
コード例 #5
0
ファイル: main_pipbuild.py プロジェクト: hargup/conda-build
def main():
    p = ArgumentParser(
        description="""
Tool for building conda packages using pip install. NOTE: this command is
experimental.  The recommended way to build conda packages from packages on
PyPI is using conda skeleton pypi and conda build.
        """,
    )

    p.add_argument(
        "--no-binstar-upload",
        action="store_false",
        help="Do not ask to upload the package to binstar.",
        dest='binstar_upload',
        default=cc.binstar_upload,
    )
    p.add_argument(
        "--binstar-upload",
        action="store_true",
        help="Upload the package to binstar.",
        dest='binstar_upload',
        default=cc.binstar_upload,
    )
    p.add_argument(
        'pypi_name',
        action="store",
        metavar='<PYPI_NAME>',
        nargs=1,
        help="Name of package on PyPI."
    )
    p.add_argument(
        "--release",
        action='store',
        nargs=1,
        help="Version of the package to build.",
        default="latest"
    )
    p.add_argument(
        "--pypi-url",
        action="store",
        default='http://pypi.python.org/pypi',
        help="Url to use for PyPI.",
    )
    p.set_defaults(func=execute)

    args = p.parse_args()
    args_func(args, p)
コード例 #6
0
ファイル: main_index.py プロジェクト: ovz/conda-build
def main():
    p = ArgumentParser(
        description="Update package index metadata files in given directories.")

    p.add_argument(
        'dir',
        help='Directory that contains an index to be updated.',
        nargs='*',
        default=[os.getcwd()],
    )

    p.add_argument(
        '-c', "--check-md5",
        action="store_true",
        help="""Use MD5 values instead of file modification times for determining if a
        package's metadata needs to be updated.""",
    )

    p.add_argument(
        '-f', "--force",
        action="store_true",
        help="Force reading all files.",
    )

    p.add_argument(
        '-q', "--quiet",
        action="store_true",
        help="Don't show any output.",
    )
    p.add_argument(
        '--no-remove',
        action="store_false",
        dest="remove",
        default=True,
        help="Don't remove entries for files that don't exist.",
    )

    args = p.parse_args()

    dir_paths = [abspath(path) for path in args.dir]
    # Don't use byte strings in Python 2
    if not PY3:
        dir_paths = [path.decode(getpreferredencoding()) for path in dir_paths]

    for path in dir_paths:
        update_index(path, verbose=(not args.quiet), force=args.force,
            check_md5=args.check_md5, remove=args.remove)
コード例 #7
0
ファイル: main_develop.py プロジェクト: 183amir/conda-build
def main():
    p = ArgumentParser(
        description="""

Install a Python package in 'development mode'.

This works by creating a conda.pth file in site-packages."""
        # TODO: Use setup.py to determine any entry-points to install.
    )

    p.add_argument(
        'source',
        action="store",
        metavar='PATH',
        nargs='+',
        help="Path to the source directory."
    )
    p.add_argument('-npf', '--no-pth-file',
                   action='store_true',
                   help=("Relink compiled extension dependencies against "
                         "libraries found in current conda env. "
                         "Do not add source to conda.pth."))
    p.add_argument('-b', '--build_ext',
                   action='store_true',
                   help=("Build extensions inplace, invoking: "
                         "python setup.py build_ext --inplace; "
                         "add to conda.pth; relink runtime libraries to "
                         "environment's lib/."))
    p.add_argument('-c', '--clean',
                   action='store_true',
                   help=("Invoke clean on setup.py: "
                         "python setup.py clean "
                         "use with build_ext to clean before building."))
    p.add_argument('-u', '--uninstall',
                   action='store_true',
                   help=("Removes package if installed in 'development mode' "
                         "by deleting path from conda.pth file. Ignore other "
                         "options - just uninstall and exit"))

    add_parser_prefix(p)
    p.set_defaults(func=execute)

    args = p.parse_args()
    args_func(args, p)
コード例 #8
0
ファイル: main_pipbuild.py プロジェクト: pigmej/conda-build
def main():
    p = ArgumentParser(description="""
Tool for building conda packages using pip install. NOTE: this command is
experimental.  The recommended way to build conda packages from packages on
PyPI is using conda skeleton pypi and conda build.
        """, )

    p.add_argument(
        "--no-binstar-upload",
        action="store_false",
        help="Do not ask to upload the package to binstar.",
        dest='binstar_upload',
        default=cc.binstar_upload,
    )
    p.add_argument(
        "--binstar-upload",
        action="store_true",
        help="Upload the package to binstar.",
        dest='binstar_upload',
        default=cc.binstar_upload,
    )
    p.add_argument('pypi_name',
                   action="store",
                   metavar='<PYPI_NAME>',
                   nargs=1,
                   help="Name of package on PyPI.")
    p.add_argument("--release",
                   action='store',
                   nargs=1,
                   help="Version of the package to build.",
                   default="latest")
    p.add_argument(
        "--pypi-url",
        action="store",
        default='http://pypi.python.org/pypi',
        help="Url to use for PyPI.",
    )
    p.set_defaults(func=execute)

    args = p.parse_args()
    args_func(args, p)
コード例 #9
0
def main():
    p = ArgumentParser(
        description="""

Install a Python package in 'development mode'.

This works by creating a conda.pth file in site-packages."""
        # TODO: Use setup.py to determine any entry-points to install.
    )

    p.add_argument(
        'source',
        action="store",
        metavar='PATH',
        nargs='+',
        help="Path to the source directory."
    )
    add_parser_prefix(p)
    p.set_defaults(func=execute)

    args = p.parse_args()
    args_func(args, p)
コード例 #10
0
ファイル: main_convert.py プロジェクト: ovz/conda-build
def main():
    p = ArgumentParser(
        description="""
Various tools to convert conda packages. Takes a pure Python package build for
one platform and converts it to work on one or more other platforms, or
all.""",
        epilog=epilog,
    )

    # TODO: Factor this into a subcommand, since it's python package specific
    p.add_argument(
        'package_files',
        metavar='package-files',
        action="store",
        nargs='+',
        help="Package files to convert."
    )
    p.add_argument(
        '-p', "--platform",
        dest='platforms',
        action="append",
        choices=['osx-64', 'linux-32', 'linux-64', 'win-32', 'win-64', 'all'],
        help="Platform to convert the packages to."
    )
    p.add_argument(
        "--dependencies", "-d",
        nargs='*',
        help="""Additional (besides python) dependencies of the converted
        package.  To specify a version restriction for a dependency, wrap
        the dependency in quotes, like 'package >=2.0'.""",
    )
    p.add_argument(
        '--show-imports',
        action='store_true',
        default=False,
        help="Show Python imports for compiled parts of the package.",
    )
    p.add_argument(
        '-f', "--force",
        action="store_true",
        help="Force convert, even when a package has compiled C extensions.",
    )
    p.add_argument(
        '-o', '--output-dir',
        default='.',
        help="""Directory to write the output files. The packages will be
        organized in platform/ subdirectories, e.g.,
        win-32/package-1.0-py27_0.tar.bz2."""
    )
    p.add_argument(
        '-v', '--verbose',
        default=False,
        action='store_true',
        help="Print verbose output."
    )
    p.add_argument(
        "--dry-run",
        action="store_true",
        help="Only display what would have been done.",
    )
    p.add_argument(
        "-q", "--quiet",
        action="store_true",
        help="Don't print as much output."
    )

    p.set_defaults(func=execute)

    args = p.parse_args()
    args_func(args, p)
コード例 #11
0
ファイル: main_render.py プロジェクト: ovz/conda-build
def get_render_parser():
    p = ArgumentParser(
        description="""
Tool for building conda packages. A conda package is a binary tarball
containing system-level libraries, Python modules, executable programs, or
other components. conda keeps track of dependencies between packages and
platform specifics, making it simple to create working environments from
        different sets of packages.""",
        conflict_handler='resolve'
    )
    p.add_argument(
        '-V', '--version',
        action='version',
        help='Show the conda-build version number and exit.',
        version='conda-build %s' % __version__,
    )
    p.add_argument(
        '-n', "--no-source",
        action="store_true",
        help="When templating can't be completed, do not obtain the \
source to try fill in related template variables.",
    )
    p.add_argument(
        "--output",
        action="store_true",
        help="Output the conda package filename which would have been "
               "created",
    )
    p.add_argument(
        '--python',
        action="append",
        help="""Set the Python version used by conda build. Can be passed
        multiple times to build against multiple versions. Can be 'all' to
    build against all known versions (%r)""" % [i for i in
    PythonVersionCompleter() if '.' in i],
        metavar="PYTHON_VER",
        choices=PythonVersionCompleter(),
    )
    p.add_argument(
        '--perl',
        action="append",
        help="""Set the Perl version used by conda build. Can be passed
        multiple times to build against multiple versions.""",
        metavar="PERL_VER",
    )
    p.add_argument(
        '--numpy',
        action="append",
        help="""Set the NumPy version used by conda build. Can be passed
        multiple times to build against multiple versions. Can be 'all' to
    build against all known versions (%r)""" % [i for i in
    NumPyVersionCompleter() if '.' in i],
        metavar="NUMPY_VER",
        choices=NumPyVersionCompleter(),
    )
    p.add_argument(
        '--R',
        action="append",
        help="""Set the R version used by conda build. Can be passed
        multiple times to build against multiple versions.""",
        metavar="R_VER",
        choices=RVersionsCompleter(),
    )
    p.add_argument(
        '--lua',
        action="append",
        help="Set the Lua version used by conda build. Can be passed"
        "multiple times to build against multiple versions (%r)." %
        [i for i in LuaVersionsCompleter()],
        metavar="LUA_VER",
        choices=LuaVersionsCompleter(),
    )
    add_parser_channels(p)
    return p
コード例 #12
0
ファイル: main_convert.py プロジェクト: menghaozhu/hat
def main():
    p = ArgumentParser(
        description="""
Various tools to convert conda packages. Takes a pure Python package build for
one platform and converts it to work on one or more other platforms, or
all.""",
        epilog=epilog,
    )

    # TODO: Factor this into a subcommand, since it's python package specific
    p.add_argument('package_files',
                   metavar='package-files',
                   action="store",
                   nargs='+',
                   help="Package files to convert.")
    p.add_argument(
        '-p',
        "--platform",
        dest='platforms',
        action="append",
        choices=['osx-64', 'linux-32', 'linux-64', 'win-32', 'win-64', 'all'],
        help="Platform to convert the packages to.")
    p.add_argument(
        "--dependencies",
        "-d",
        nargs='*',
        help="""Additional (besides python) dependencies of the converted
        package.  To specify a version restriction for a dependency, wrap
        the dependency in quotes, like 'package >=2.0'.""",
    )
    p.add_argument(
        '--show-imports',
        action='store_true',
        default=False,
        help="Show Python imports for compiled parts of the package.",
    )
    p.add_argument(
        '-f',
        "--force",
        action="store_true",
        help="Force convert, even when a package has compiled C extensions.",
    )
    p.add_argument(
        '-o',
        '--output-dir',
        default='.',
        help="""Directory to write the output files. The packages will be
        organized in platform/ subdirectories, e.g.,
        win-32/package-1.0-py27_0.tar.bz2.""")
    p.add_argument('-v',
                   '--verbose',
                   default=False,
                   action='store_true',
                   help="Print verbose output.")
    p.add_argument(
        "--dry-run",
        action="store_true",
        help="Only display what would have been done.",
    )
    p.add_argument("-q",
                   "--quiet",
                   action="store_true",
                   help="Don't print as much output.")

    p.set_defaults(func=execute)

    args = p.parse_args()
    args_func(args, p)
コード例 #13
0
ファイル: main_build.py プロジェクト: tkf/conda-build
def main():
    p = ArgumentParser(
        description="""
Tool for building conda packages. A conda package is a binary tarball
containing system-level libraries, Python modules, executable programs, or
other components. conda keeps track of dependencies between packages and
platform specifics, making it simple to create working environments from
different sets of packages."""
    )
    p.add_argument(
        '-V', '--version',
        action='version',
        help='Show the conda-build version number and exit.',
        version = 'conda-build %s' % __version__,
    )
    p.add_argument(
        "--check",
        action="store_true",
        help="Only check (validate) the recipe.",
    )
    p.add_argument(
        "--no-anaconda-upload",
        action="store_false",
        help="Do not ask to upload the package to anaconda.org.",
        dest='binstar_upload',
        default=config.binstar_upload,
    )
    p.add_argument(
        "--no-binstar-upload",
        action="store_false",
        help=argparse.SUPPRESS,
        dest='binstar_upload',
        default=config.binstar_upload,
    )
    p.add_argument(
        "--no-include-recipe",
        action="store_false",
        help="Don't include the recipe inside the built package.",
        dest='include_recipe',
        default=True,
    )
    p.add_argument(
        "--output",
        action="store_true",
        help="Output the conda package filename which would have been "
               "created and exit.",
    )
    p.add_argument(
        '-s', "--source",
        action="store_true",
        help="Only obtain the source (but don't build).",
    )
    p.add_argument(
        '-t', "--test",
        action="store_true",
        help="Test package (assumes package is already build).",
    )
    p.add_argument(
        'recipe',
        action="store",
        metavar='RECIPE_PATH',
        nargs='+',
        choices=RecipeCompleter(),
        help="Path to recipe directory.",
    )
    p.add_argument(
        '--no-test',
        action='store_true',
        dest='notest',
        help="Do not test the package.",
    )
    p.add_argument(
        '-b', '--build-only',
        action="store_true",
        help="""Only run the build, without any post processing or
        testing. Implies --no-test and --no-anaconda-upload.""",
    )
    p.add_argument(
        '-p', '--post',
        action="store_true",
        help="Run the post-build logic. Implies --no-test and --no-anaconda-upload.",
    )
    p.add_argument(
        '--skip-existing',
        action='store_true',
        help="""Skip recipes for which there already exists an existing build
        (locally or in the channels). """
        )
    p.add_argument(
        '-q', "--quiet",
        action="store_true",
        help="do not display progress bar",
    )
    p.add_argument(
        '--python',
        action="append",
        help="""Set the Python version used by conda build. Can be passed
        multiple times to build against multiple versions. Can be 'all' to
    build against all known versions (%r)""" % [i for i in
    PythonVersionCompleter() if '.' in i],
        metavar="PYTHON_VER",
        choices=PythonVersionCompleter(),
    )
    p.add_argument(
        '--perl',
        action="append",
        help="""Set the Perl version used by conda build. Can be passed
        multiple times to build against multiple versions.""",
        metavar="PERL_VER",
    )
    p.add_argument(
        '--numpy',
        action="append",
        help="""Set the NumPy version used by conda build. Can be passed
        multiple times to build against multiple versions. Can be 'all' to
    build against all known versions (%r)""" % [i for i in
    NumPyVersionCompleter() if '.' in i],
        metavar="NUMPY_VER",
        choices=NumPyVersionCompleter(),
    )
    p.add_argument(
        '--R',
        action="append",
        help="""Set the R version used by conda build. Can be passed
        multiple times to build against multiple versions.""",
        metavar="R_VER",
        choices=RVersionsCompleter(),
    )
    add_parser_channels(p)
    p.set_defaults(func=execute)

    args = p.parse_args()
    args_func(args, p)
コード例 #14
0
def main():
    from conda.cli.conda_argparse import ArgumentParser

    p = ArgumentParser(description="""\
Tool for signing conda packages.  Signatures will be written alongside the
files as FILE.sig.""")

    p.add_argument(
        'files',
        help="Files to sign.",
        nargs='*',
        metavar="FILE",
    )
    p.add_argument('-k',
                   '--keygen',
                   action="store",
                   help="Generate a public-private "
                   "key pair ~/.conda/keys/<NAME>(.pub).",
                   metavar="NAME")
    p.add_argument(
        '--size',
        action="store",
        help="Size of generated RSA public-private key pair in bits "
        "(defaults to 2048).",
        metavar="BITS")
    p.add_argument('-v',
                   '--verify',
                   action="store_true",
                   help="Verify FILE(s).")

    args = p.parse_args()

    if args.keygen:
        if args.files:
            p.error('no arguments expected for --keygen')
        try:
            keygen(args.keygen, int(2048 if args.size is None else args.size))
        except ValueError as e:
            sys.exit('Error: %s' % e)
        return

    if args.size is not None:
        p.error('--size option is only allowed with --keygen option')

    if args.verify:
        for path in args.files:
            try:
                disp = 'VALID' if verify(path) else 'INVALID'
            except SignatureError as e:
                disp = 'ERROR: %s' % e
            print('%-40s %s' % (path, disp))
        return

    key_name = get_default_keyname()
    if key_name is None:
        sys.exit("Error: no private key found in %s" % KEYS_DIR)
    print("Using private key '%s' for signing." % key_name)
    key = RSA.importKey(open(join(KEYS_DIR, key_name)).read())
    for path in args.files:
        print('signing: %s' % path)
        with open('%s.sig' % path, 'w') as fo:
            fo.write('%s ' % key_name)
            fo.write(sign(path, key))
            fo.write('\n')
コード例 #15
0
ファイル: main_pipbuild.py プロジェクト: 183amir/conda-build
def main():
    p = ArgumentParser(
        description="""
*** This command is no longer supported.  It will be removed in a future release of conda-build. ***
The recommended way to build conda packages from packages on
PyPI is using conda skeleton pypi and conda build.
Tool for building conda packages using pip install.
        """,
    )

    p.add_argument(
        "--no-anaconda-upload",
        action="store_false",
        help="Do not ask to upload the package to anaconda.org.",
        dest='binstar_upload',
        default=cc.binstar_upload,
    )
    p.add_argument(
        "--anaconda-upload",
        action="store_true",
        help="Upload the package to anaconda.org.",
        dest='binstar_upload',
        default=cc.binstar_upload,
    )
    p.add_argument(
        'pypi_name',
        action="store",
        metavar='<PYPI_NAME>',
        nargs=1,
        help="Name of package on PyPI."
    )
    p.add_argument(
        "--release",
        action='store',
        nargs=1,
        help="Version of the package to build.",
        default="latest"
    )
    p.add_argument(
        "--pypi-url",
        action="store",
        default='http://pypi.python.org/pypi',
        help="Url to use for PyPI.",
    )
    p.add_argument(
        "--noarch-python",
        action="store_true",
        default=False,
        help="Creates package as noarch")
    p.set_defaults(func=execute)

    args = p.parse_args()
    args_func(args, p)
コード例 #16
0
ファイル: main_pipbuild.py プロジェクト: mjuric/conda-build
def main():
    p = ArgumentParser(description="""
*** This command is no longer supported.  It will be removed in a future release of conda-build. ***
The recommended way to build conda packages from packages on
PyPI is using conda skeleton pypi and conda build.
Tool for building conda packages using pip install.
        """, )

    p.add_argument(
        "--no-anaconda-upload",
        action="store_false",
        help="Do not ask to upload the package to anaconda.org.",
        dest='binstar_upload',
        default=cc.binstar_upload,
    )
    p.add_argument(
        "--anaconda-upload",
        action="store_true",
        help="Upload the package to anaconda.org.",
        dest='binstar_upload',
        default=cc.binstar_upload,
    )
    p.add_argument('pypi_name',
                   action="store",
                   metavar='<PYPI_NAME>',
                   nargs=1,
                   help="Name of package on PyPI.")
    p.add_argument("--release",
                   action='store',
                   nargs=1,
                   help="Version of the package to build.",
                   default="latest")
    p.add_argument(
        "--pypi-url",
        action="store",
        default='http://pypi.python.org/pypi',
        help="Url to use for PyPI.",
    )
    p.add_argument("--noarch-python",
                   action="store_true",
                   default=False,
                   help="Creates package as noarch")
    p.set_defaults(func=execute)

    args = p.parse_args()
    args_func(args, p)
コード例 #17
0
def main():
    p = ArgumentParser(description='''
Tool for building conda metapackages.  A metapackage is a package with no
files, only metadata.  They are typically used to collect several packages
together into a single package via dependencies.

NOTE: Metapackages can also be created by creating a recipe with the necessary
metadata in the meta.yaml, but a metapackage can be created entirely from the
command line with the conda metapackage command.
''', )

    p.add_argument(
        "--no-binstar-upload",
        action="store_false",
        help="Do not ask to upload the package to binstar.",
        dest='binstar_upload',
        default=conda.config.binstar_upload,
    )
    p.add_argument(
        "name",
        action="store",
        help="Name of the created package.",
    )
    p.add_argument(
        "version",
        action="store",
        help="Version of the created package.",
    )
    p.add_argument(
        "--build-number",
        action="store",
        type=int,
        default=0,
        help="Build number for the package (default is 0).",
    )
    p.add_argument(
        "--build-string",
        action="store",
        default=None,
        help=
        "Build string for the package (default is automatically generated).",
    )
    p.add_argument(
        "--dependencies",
        "-d",
        nargs='*',
        default=(),
        help=
        """The dependencies of the package. To specify a version restriction for a
        dependency, wrap the dependency in quotes, like 'package >=2.0'.""",
    )
    p.add_argument("--home",
                   action="store",
                   help="The homepage for the metapackage.")
    p.add_argument(
        "--license",
        action="store",
        help="The license of the metapackage.",
    )
    p.add_argument(
        "--summary",
        action="store",
        help="""Summary of the package.  Pass this in as a string on the command
        line, like --summary 'A metapackage for X'. It is recommended to use
        single quotes if you are not doing variable substitution to avoid
        interpretation of special characters.""",
    )
    p.add_argument(
        "--entry-points",
        nargs='*',
        default=(),
        help=
        """Python entry points to create automatically. They should use the same
        syntax as in the meta.yaml of a recipe, e.g., --entry-points
        bsdiff4=bsdiff4.cli:main_bsdiff4 will create an entry point called
        bsdiff4 that calls bsdiff4.cli.main_bsdiff4(). """,
    )
    p.set_defaults(func=execute)

    args = p.parse_args()
    args_func(args, p)
コード例 #18
0
def main():
    p = ArgumentParser(
        description='''
Tool for building conda metapackages.  A metapackage is a package with no
files, only metadata.  They are typically used to collect several packages
together into a single package via dependencies.

NOTE: Metapackages can also be created by creating a recipe with the necessary
metadata in the meta.yaml, but a metapackage can be created entirely from the
command line with the conda metapackage command.
''',
    )

    p.add_argument(
        "--no-anaconda-upload",
        action="store_false",
        help="Do not ask to upload the package to anaconda.org.",
        dest='binstar_upload',
        default=conda.config.binstar_upload,
    )
    p.add_argument(
        "--no-binstar-upload",
        action="store_false",
        help=argparse.SUPPRESS,
        dest='binstar_upload',
        default=conda.config.binstar_upload,
    )
    p.add_argument(
        "name",
        action="store",
        help="Name of the created package.",
    )
    p.add_argument(
        "version",
        action="store",
        help="Version of the created package.",
    )
    p.add_argument(
        "--build-number",
        action="store",
        type=int,
        default=0,
        help="Build number for the package (default is 0).",
    )
    p.add_argument(
        "--build-string",
        action="store",
        default=None,
        help="Build string for the package (default is automatically generated).",
    )
    p.add_argument(
        "--dependencies", "-d",
        nargs='*',
        default=(),
        help="""The dependencies of the package. To specify a version restriction for a
        dependency, wrap the dependency in quotes, like 'package >=2.0'.""",
    )
    p.add_argument(
        "--home",
        action="store",
        help="The homepage for the metapackage."
    )
    p.add_argument(
        "--license",
        action="store",
        help="The license of the metapackage.",
    )
    p.add_argument(
        "--summary",
        action="store",
        help="""Summary of the package.  Pass this in as a string on the command
        line, like --summary 'A metapackage for X'. It is recommended to use
        single quotes if you are not doing variable substitution to avoid
        interpretation of special characters.""",
    )
    p.add_argument(
        "--entry-points",
        nargs='*',
        default=(),
        help="""Python entry points to create automatically. They should use the same
        syntax as in the meta.yaml of a recipe, e.g., --entry-points
        bsdiff4=bsdiff4.cli:main_bsdiff4 will create an entry point called
        bsdiff4 that calls bsdiff4.cli.main_bsdiff4(). """,
    )
    p.set_defaults(func=execute)

    args = p.parse_args()
    args_func(args, p)
コード例 #19
0
def get_render_parser():
    p = ArgumentParser(
        description="""
Tool for building conda packages. A conda package is a binary tarball
containing system-level libraries, Python modules, executable programs, or
other components. conda keeps track of dependencies between packages and
platform specifics, making it simple to create working environments from
        different sets of packages.""",
        conflict_handler='resolve'
    )
    p.add_argument(
        '-V', '--version',
        action='version',
        help='Show the conda-build version number and exit.',
        version='conda-build %s' % __version__,
    )
    p.add_argument(
        '-n', "--no-source",
        action="store_true",
        help="When templating can't be completed, do not obtain the \
source to try fill in related template variables.",
    )
    p.add_argument(
        "--output",
        action="store_true",
        help="Output the conda package filename which would have been "
               "created",
    )
    p.add_argument(
        '--python',
        action="append",
        help="""Set the Python version used by conda build. Can be passed
        multiple times to build against multiple versions. Can be 'all' to
    build against all known versions (%r)""" % [i for i in
    PythonVersionCompleter() if '.' in i],
        metavar="PYTHON_VER",
        choices=PythonVersionCompleter(),
    )
    p.add_argument(
        '--perl',
        action="append",
        help="""Set the Perl version used by conda build. Can be passed
        multiple times to build against multiple versions.""",
        metavar="PERL_VER",
    )
    p.add_argument(
        '--numpy',
        action="append",
        help="""Set the NumPy version used by conda build. Can be passed
        multiple times to build against multiple versions. Can be 'all' to
    build against all known versions (%r)""" % [i for i in
    NumPyVersionCompleter() if '.' in i],
        metavar="NUMPY_VER",
        choices=NumPyVersionCompleter(),
    )
    p.add_argument(
        '--R',
        action="append",
        help="""Set the R version used by conda build. Can be passed
        multiple times to build against multiple versions.""",
        metavar="R_VER",
        choices=RVersionsCompleter(),
    )
    p.add_argument(
        '--lua',
        action="append",
        help="Set the Lua version used by conda build. Can be passed"
        "multiple times to build against multiple versions (%r)." %
        [i for i in LuaVersionsCompleter()],
        metavar="LUA_VER",
        choices=LuaVersionsCompleter(),
    )
    add_parser_channels(p)
    return p
コード例 #20
0
def main():
    p = ArgumentParser(
        description="""
Tool for building conda packages. A conda package is a binary tarball
containing system-level libraries, Python modules, executable programs, or
other components. conda keeps track of dependencies between packages and
platform specifics, making it simple to create working environments from
different sets of packages."""
    )
    p.add_argument(
        '-V', '--version',
        action='version',
        help='Show the conda-build version number and exit.',
        version = 'conda-build %s' % __version__,
    )
    p.add_argument(
        "--check",
        action="store_true",
        help="Only check (validate) the recipe.",
    )
    p.add_argument(
        "--no-binstar-upload",
        action="store_false",
        help="Do not ask to upload the package to binstar.",
        dest='binstar_upload',
        default=config.binstar_upload,
    )
    p.add_argument(
        "--output",
        action="store_true",
        help="Output the conda package filename which would have been "
               "created and exit.",
    )
    p.add_argument(
        '-s', "--source",
        action="store_true",
        help="Only obtain the source (but don't build).",
    )
    p.add_argument(
        '-t', "--test",
        action="store_true",
        help="Test package (assumes package is already build).",
    )
    p.add_argument(
        'recipe',
        action="store",
        metavar='RECIPE_PATH',
        nargs='+',
        help="Path to recipe directory.",
    )
    p.add_argument(
        '--no-test',
        action='store_true',
        dest='notest',
        help="Do not test the package.",
    )
    p.add_argument(
        '-b', '--build-only',
        action="store_true",
        help="""Only run the build, without any post processing or
        testing. Implies --no-test and --no-binstar-upload.""",
    )
    p.add_argument(
        '-p', '--post',
        action="store_true",
        help="Run the post-build logic. Implies --no-test and --no-binstar-upload.",
    )
    p.add_argument(
        '--skip-existing',
        action='store_true',
        help="""Skip recipes for which there already exists an existing build
        (locally or in the channels). """
        )
    p.add_argument(
        '-q', "--quiet",
        action="store_true",
        help="do not display progress bar",
    )
    p.add_argument(
        '--python',
        action="append",
        help="""Set the Python version used by conda build. Can be passed
        multiple times to build against multiple versions.""",
        metavar="PYTHON_VER",
    )
    p.add_argument(
        '--perl',
        action="append",
        help="""Set the Perl version used by conda build. Can be passed
        multiple times to build against multiple versions.""",
        metavar="PERL_VER",
    )
    p.add_argument(
        '--numpy',
        action="append",
        help="""Set the NumPy version used by conda build. Can be passed
        multiple times to build against multiple versions.""",
        metavar="NUMPY_VER",
    )
    p.add_argument(
        '--R',
        action="append",
        help="""Set the R version used by conda build. Can be passed
        multiple times to build against multiple versions.""",
        metavar="R_VER",
    )
    add_parser_channels(p)
    p.set_defaults(func=execute)

    args = p.parse_args()
    args_func(args, p)
コード例 #21
0
ファイル: main_build.py プロジェクト: jlas/conda-build
def main():
    p = ArgumentParser(
        description="""
Tool for building conda packages. A conda package is a binary tarball
containing system-level libraries, Python modules, executable programs, or
other components. conda keeps track of dependencies between packages and
platform specifics, making it simple to create working environments from
different sets of packages."""
    )
    p.add_argument(
        "-V",
        "--version",
        action="version",
        help="Show the conda-build version number and exit.",
        version="conda-build %s" % __version__,
    )
    p.add_argument("--check", action="store_true", help="Only check (validate) the recipe.")
    p.add_argument(
        "--no-binstar-upload",
        action="store_false",
        help="Do not ask to upload the package to binstar.",
        dest="binstar_upload",
        default=config.binstar_upload,
    )
    p.add_argument(
        "--output",
        action="store_true",
        help="Output the conda package filename which would have been " "created and exit.",
    )
    p.add_argument("-s", "--source", action="store_true", help="Only obtain the source (but don't build).")
    p.add_argument("-t", "--test", action="store_true", help="Test package (assumes package is already build).")
    p.add_argument("recipe", action="store", metavar="RECIPE_PATH", nargs="+", help="Path to recipe directory.")
    p.add_argument("--no-test", action="store_true", dest="notest", help="Do not test the package.")
    p.add_argument(
        "-b",
        "--build-only",
        action="store_true",
        help="""Only run the build, without any post processing or
        testing. Implies --no-test and --no-binstar-upload.""",
    )
    p.add_argument(
        "-p", "--post", action="store_true", help="Run the post-build logic. Implies --no-test and --no-binstar-upload."
    )
    p.add_argument(
        "--skip-existing",
        action="store_true",
        help="""Skip recipes for which there already exists an existing build
        (locally or in the channels). """,
    )
    p.add_argument("-q", "--quiet", action="store_true", help="do not display progress bar")
    p.add_argument(
        "--python",
        action="append",
        help="""Set the Python version used by conda build. Can be passed
        multiple times to build against multiple versions.""",
        metavar="PYTHON_VER",
    )
    p.add_argument(
        "--perl",
        action="append",
        help="""Set the Perl version used by conda build. Can be passed
        multiple times to build against multiple versions.""",
        metavar="PERL_VER",
    )
    p.add_argument(
        "--numpy",
        action="append",
        help="""Set the NumPy version used by conda build. Can be passed
        multiple times to build against multiple versions.""",
        metavar="NUMPY_VER",
    )
    p.add_argument(
        "--R",
        action="append",
        help="""Set the R version used by conda build. Can be passed
        multiple times to build against multiple versions.""",
        metavar="R_VER",
    )
    add_parser_channels(p)
    p.set_defaults(func=execute)

    args = p.parse_args()
    args_func(args, p)