def main(): p = argparse.ArgumentParser( description='tool for inspecting conda packages' ) subcommand = p.add_subparsers( dest='subcommand', ) linkages = subcommand.add_parser( "linkages", help="Tools to investigate linkages of binary libraries in a package", ) linkages.add_argument( 'packages', action='store', nargs='+', help='conda packages to inspect', ) linkages.add_argument( '--show-files', action="store_true", help="Show the files in the package that link to each library", ) add_parser_prefix(linkages) p.set_defaults(func=execute) args = p.parse_args() args_func(args, p)
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)
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)
def main(): p = argparse.ArgumentParser( description='various tools to convert conda packages', epilog=epilog, formatter_class=RawDescriptionHelpFormatter, ) # 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'], required=True, help="Platform to convert the packages to" ) 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.set_defaults(func=execute) args = p.parse_args() args_func(args, p)
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)
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.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)
def main(): p = argparse.ArgumentParser( description='tool for building conda packages just using pip install' ) 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 = "specify version of package to build", default="latest" ) p.add_argument( "--pypi-url", action = "store", nargs=1, default='http://pypi.python.org/pypi', help = "Url to use for PyPI", ) p.add_argument( '-V', '--version', action = 'version', version = 'conda-pipbuild %s' % __version__, ) p.set_defaults(func=execute) args = p.parse_args() args_func(args, p)
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)
def main(): p = argparse.ArgumentParser( description="""Install a Python package in 'development mode'. This works by creating a conda.pth file in site-packages, and using 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)
def main(): p = argparse.ArgumentParser( description='tool for building conda packages just using pip install') 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="specify version of package to build", default="latest") p.add_argument( "--pypi-url", action="store", nargs=1, default='http://pypi.python.org/pypi', help="Url to use for PyPI", ) p.add_argument( '-V', '--version', action='version', version='conda-pipbuild %s' % __version__, ) p.set_defaults(func=execute) args = p.parse_args() args_func(args, p)
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)
def main(): p = argparse.ArgumentParser( description="""Install a Python package in 'development mode'. This works by creating a conda.pth file in site-packages, and using 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)
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)
def main(): p = argparse.ArgumentParser( description='create skeleton recipes for packages from hosting sites' ) repos = p.add_subparsers( dest="repo" ) pypi = repos.add_parser( "pypi", help="Create recipes from packages on PyPI", ) pypi.add_argument( "packages", action="store", nargs='+', help="""PyPi packages to create recipe skeletons for. You can also specify package[extra,...] features.""", ) pypi.add_argument( "--output-dir", action="store", nargs=1, help="Directory to write recipes to", default=".", ) pypi.add_argument( "--version", action="store", nargs=1, help="Version to use. Applies to all packages", ) pypi.add_argument( "--all-urls", action="store_true", help="""Look at all URLs, not just source URLs. Use this if it can't find the right URL.""", ) pypi.add_argument( "--pypi-url", action="store", nargs=1, default='https://pypi.python.org/pypi', help="URL to use for PyPI", ) pypi.add_argument( "--no-download", action="store_false", dest="download", default=True, help="""Don't download the package. This will keep the recipe from finding the right dependencies and entry points if the package uses distribute. WARNING: The default option downloads and runs the package's setup.py script.""" ) pypi.add_argument( "--no-prompt", action="store_true", default=False, dest="noprompt", help="""Don't prompt the user on ambiguous choices. Instead, make the best possible choice and continue.""" ) pypi.add_argument( "--all-extras", action="store_true", default=False, help="Add all extra feature requirements. Applies to all packages.", ) pypi.add_argument( "--recursive", action='store_true', help='Create recipes for dependencies if they do not already exist.' ) pypi.add_argument( "--python-version", action='store', default=default_python, help="""Version of Python to use to run setup.py. Default is %(default)s.""", choices=['2.6', '2.7', '3.3', '3.4'], ) pypi.add_argument( "--manual-url", action='store_true', default=False, help="Manually choose source url when more than one urls are present." + "Default is the one with least source size." ) cpan = repos.add_parser( "cpan", help="Create recipes from packages on CPAN", ) cpan.add_argument( "packages", action="store", nargs='+', help="CPAN packages to create recipe skeletons for", ) cpan.add_argument( "--output-dir", help="Directory to write recipes to", default=".", ) cpan.add_argument( "--version", help="Version to use. Applies to all packages", ) cpan.add_argument( "--meta-cpan-url", action="store", nargs=1, default='http://api.metacpan.org', help="URL to use for MetaCPAN API", ) cpan.add_argument( "--recursive", action='store_true', help='Create recipes for dependencies if they do not already exist.') cran = repos.add_parser( "cran", help="Create recipes from packages on CRAN", ) cran.add_argument( "packages", action="store", nargs='+', help="""CRAN packages to create recipe skeletons for. You can also specify package[extra,...] features.""", ) cran.add_argument( "--output-dir", action="store", nargs=1, help="Directory to write recipes to", default=".", ) cran.add_argument( "--version", action="store", nargs=1, help="Version to use. Applies to all packages", ) cran.add_argument( "--git-tag", action="store", nargs=1, help="Git tag to use for GitHub recipes.", ) cran.add_argument( "--all-urls", action="store_true", help="""Look at all URLs, not just source URLs. Use this if it can't find the right URL.""", ) cran.add_argument( "--cran-url", action="store", default='http://cran.r-project.org/', help="URL to use for CRAN (default: %(default)s)", ) cran.add_argument( "--recursive", action='store_true', dest='recursive', help='Create recipes for dependencies if they do not already exist.', ) cran.add_argument( "--no-recursive", action='store_false', dest='recursive', help="Don't create recipes for dependencies if they do not already exist.", ) cran.add_argument( '--no-archive', action='store_false', dest='archive', help="Don't include an Archive download url", ) p.set_defaults(func=execute) args = p.parse_args() args_func(args, p)
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)
def main(): p = argparse.ArgumentParser( description='''tool for building conda metapackages. A metapackage is a package with no files, only metadata''' ) 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)
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)
def main(): p = argparse.ArgumentParser( description='create skeleton recipes for packages from hosting sites' ) repos = p.add_subparsers( dest="repo" ) pypi = repos.add_parser( "pypi", help="Create recipes from packages on PyPI", ) pypi.add_argument( "packages", action="store", nargs='+', help="PyPi packages to create recipe skeletons for", ) pypi.add_argument( "--output-dir", action="store", nargs=1, help="Directory to write recipes to", default=".", ) pypi.add_argument( "--version", action="store", nargs=1, help="Version to use. Applies to all packages", ) pypi.add_argument( "--all-urls", action="store_true", help="""Look at all URLs, not just source URLs. Use this if it can't find the right URL.""", ) pypi.add_argument( "--pypi-url", action="store", nargs=1, default='https://pypi.python.org/pypi', help="URL to use for PyPI", ) pypi.add_argument( "--no-download", action="store_false", dest="download", default=True, help="""Don't download the package. This will keep the recipe from finding the right dependencies and entry points if the package uses distribute. WARNING: The default option downloads and runs the package's setup.py script.""" ) pypi.add_argument( "--no-prompt", action="store_true", default=False, dest="noprompt", help="""Don't prompt the user on ambiguous choices. Instead, make the best possible choice and continue.""" ) pypi.add_argument( "--recursive", action='store_true', help='Create recipes for dependencies if they do not already exist.' ) pypi.add_argument( "--python-version", action='store', default=default_python, help="""Version of Python to use to run setup.py. Default is %(default)s.""", choices=['2.6', '2.7', '3.3', '3.4'], ) cpan = repos.add_parser( "cpan", help="Create recipes from packages on CPAN", ) cpan.add_argument( "packages", action="store", nargs='+', help="CPAN packages to create recipe skeletons for", ) cpan.add_argument( "--output-dir", help="Directory to write recipes to", default=".", ) cpan.add_argument( "--version", help="Version to use. Applies to all packages", ) cpan.add_argument( "--meta-cpan-url", action="store", nargs=1, default='http://api.metacpan.org', help="URL to use for MetaCPAN API", ) cpan.add_argument( "--recursive", action='store_true', help='Create recipes for dependencies if they do not already exist.') p.set_defaults(func=execute) args = p.parse_args() args_func(args, p)
def main(): p = argparse.ArgumentParser( description='Tools for inspecting conda packages' ) subcommand = p.add_subparsers( dest='subcommand', ) linkages_help = """ Investigate linkages of binary libraries in a package (only works in Linux and OS X). Aggregates the output of ldd (on Linux) and otool -L (on OS X). Useful for finding broken links, or links against system libraries that ought to be dependent conda packages.""" linkages = subcommand.add_parser( "linkages", # help controls conda inspect -h and description controls conda # inspect linkages -h help=linkages_help, description=linkages_help, ) linkages.add_argument( 'packages', action='store', nargs='*', help='conda packages to inspect', ) linkages.add_argument( '--untracked', action='store_true', help="""Inspect the untracked files in the environment. Useful when used in conjunction with conda build --build-only.""", ) linkages.add_argument( '--show-files', action="store_true", help="Show the files in the package that link to each library", ) add_parser_prefix(linkages) objects_help = """Investigate binary object files in a package (only works in OS X). Aggregates the output of otool on all the binary object files in a package.""" objects = subcommand.add_parser( "objects", help=objects_help, description=objects_help, ) objects.add_argument( 'packages', action='store', nargs='*', help='conda packages to inspect', ) objects.add_argument( '--untracked', action='store_true', help="""Inspect the untracked files in the environment. Useful when used in conjunction with conda build --build-only.""", ) objects.add_argument( '--groupby', action='store', default='filename', choices={'filename', 'filetype', 'rpath'}, help='Attribute to group by (default: %(default)s)', ) add_parser_prefix(objects) p.set_defaults(func=execute) args = p.parse_args() args_func(args, p)
def main(): p = ArgumentParser( description='Tools for inspecting conda packages.', epilog=""" Run --help on the subcommands like 'conda inspect linkages --help' to see the options available. """, ) subcommand = p.add_subparsers( dest='subcommand', ) linkages_help = """ Investigates linkages of binary libraries in a package (works in Linux and OS X). This is an advanced command to aid building packages that link against C libraries. Aggregates the output of ldd (on Linux) and otool -L (on OS X) by dependent packages. Useful for finding broken links, or links against system libraries that ought to be dependent conda packages. """ linkages = subcommand.add_parser( "linkages", # help controls conda inspect -h and description controls conda # inspect linkages -h help=linkages_help, description=linkages_help, ) linkages.add_argument( 'packages', action='store', nargs='*', help='Conda packages to inspect.', ) linkages.add_argument( '--untracked', action='store_true', help="""Inspect the untracked files in the environment. This is useful when used in conjunction with conda build --build-only.""", ) linkages.add_argument( '--show-files', action="store_true", help="Show the files in the package that link to each library", ) linkages.add_argument( '--all', action='store_true', help="Generate a report for all packages in the environment.", ) add_parser_prefix(linkages) objects_help = """ Investigate binary object files in a package (only works on OS X). This is an advanced command to aid building packages that have compiled libraries. Aggregates the output of otool on all the binary object files in a package. """ objects = subcommand.add_parser( "objects", help=objects_help, description=objects_help, ) objects.add_argument( 'packages', action='store', nargs='*', help='Conda packages to inspect.', ) objects.add_argument( '--untracked', action='store_true', help="""Inspect the untracked files in the environment. This is useful when used in conjunction with conda build --build-only.""", ) # TODO: Allow groupby to include the package (like for --all) objects.add_argument( '--groupby', action='store', default='filename', choices=('filename', 'filetype', 'rpath'), help='Attribute to group by (default: %(default)s).', ) objects.add_argument( '--all', action='store_true', help="Generate a report for all packages in the environment.", ) add_parser_prefix(objects) p.set_defaults(func=execute) args = p.parse_args() args_func(args, p)
def main(): p = ArgumentParser( description='Tools for inspecting conda packages.', epilog=""" Run --help on the subcommands like 'conda inspect linkages --help' to see the options available. """, ) subcommand = p.add_subparsers(dest='subcommand', ) linkages_help = """ Investigates linkages of binary libraries in a package (works in Linux and OS X). This is an advanced command to aid building packages that link against C libraries. Aggregates the output of ldd (on Linux) and otool -L (on OS X) by dependent packages. Useful for finding broken links, or links against system libraries that ought to be dependent conda packages. """ linkages = subcommand.add_parser( "linkages", # help controls conda inspect -h and description controls conda # inspect linkages -h help=linkages_help, description=linkages_help, ) linkages.add_argument( 'packages', action='store', nargs='*', help='Conda packages to inspect.', ) linkages.add_argument( '--untracked', action='store_true', help= """Inspect the untracked files in the environment. This is useful when used in conjunction with conda build --build-only.""", ) linkages.add_argument( '--show-files', action="store_true", help="Show the files in the package that link to each library", ) linkages.add_argument( '--all', action='store_true', help="Generate a report for all packages in the environment.", ) add_parser_prefix(linkages) objects_help = """ Investigate binary object files in a package (only works on OS X). This is an advanced command to aid building packages that have compiled libraries. Aggregates the output of otool on all the binary object files in a package. """ objects = subcommand.add_parser( "objects", help=objects_help, description=objects_help, ) objects.add_argument( 'packages', action='store', nargs='*', help='Conda packages to inspect.', ) objects.add_argument( '--untracked', action='store_true', help= """Inspect the untracked files in the environment. This is useful when used in conjunction with conda build --build-only.""", ) # TODO: Allow groupby to include the package (like for --all) objects.add_argument( '--groupby', action='store', default='filename', choices=('filename', 'filetype', 'rpath'), help='Attribute to group by (default: %(default)s).', ) objects.add_argument( '--all', action='store_true', help="Generate a report for all packages in the environment.", ) add_parser_prefix(objects) p.set_defaults(func=execute) args = p.parse_args() args_func(args, p)
def main(): p = ArgumentParser( description=""" Generates a boilerplate/skeleton recipe, which you can then edit to create a full recipe. Some simple skeleton recipes may not even need edits. """, epilog=""" Run --help on the subcommands like 'conda skeleton pypi --help' to see the options available. """, ) repos = p.add_subparsers( dest="repo" ) pypi_example = """ Examples: Create a recipe for the sympy package: conda skeleton pypi sympy Create a recipes for the flake8 package and all its dependencies: conda skeleton pypi --recursive flake8 Use the --pypi-url flag to point to a PyPI mirror url: conda skeleton pypi --pypi-url <mirror-url> package_name """ pypi = repos.add_parser( "pypi", help=""" Create recipe skeleton for packages hosted on the Python Packaging Index (PyPI) (pypi.python.org). """, epilog=pypi_example, ) pypi.add_argument( "packages", action="store", nargs='+', help="""PyPi packages to create recipe skeletons for. You can also specify package[extra,...] features.""", ).completer = PyPIPackagesCompleter pypi.add_argument( "--output-dir", action="store", nargs=1, help="Directory to write recipes to (default: %(default)s).", default=".", ) pypi.add_argument( "--version", action="store", nargs=1, help="Version to use. Applies to all packages.", ) pypi.add_argument( "--all-urls", action="store_true", help="""Look at all URLs, not just source URLs. Use this if it can't find the right URL.""", ) pypi.add_argument( "--pypi-url", action="store", default='https://pypi.python.org/pypi', help="URL to use for PyPI (default: %(default)s).", ) pypi.add_argument( "--no-prompt", action="store_true", default=False, dest="noprompt", help="""Don't prompt the user on ambiguous choices. Instead, make the best possible choice and continue.""" ) pypi.add_argument( "--all-extras", action="store_true", default=False, help="Add all extra feature requirements. Applies to all packages.", ) pypi.add_argument( "--recursive", action='store_true', help='Create recipes for dependencies if they do not already exist.' ) pypi.add_argument( "--version-compare", action='store_true', help="""Compare the package version of the recipe with the one available on PyPI.""" ) pypi.add_argument( "--python-version", action='store', default=default_python, help="""Version of Python to use to run setup.py. Default is %(default)s.""", choices=['2.6', '2.7', '3.3', '3.4'], ) pypi.add_argument( "--manual-url", action='store_true', default=False, help="Manually choose source url when more than one urls are present." + "Default is the one with least source size." ) pypi.add_argument( "--noarch-python", action='store_true', default=False, help="Creates recipe as noarch python" ) pypi.add_argument( "--setup-options", action='append', default=[], help='Options to be added to setup.py install in the recipe. ' 'The same options are passed to setup.py install in both ' 'the construction of the recipe and in the recipe itself.' 'For options that include a double-hypen or to pass multiple ' 'options, use the syntax ' '--setup-options="--option1 --option-with-arg arg"' ) pypi.add_argument( "--pin-numpy", action='store_true', help="Ensure that the generated recipe pins the version of numpy" "to CONDA_NPY." ) cpan = repos.add_parser( "cpan", help=""" Create recipe skeleton for packages hosted on the Comprehensive Perl Archive Network (CPAN) (cpan.org). """, ) cpan.add_argument( "packages", action="store", nargs='+', help="CPAN packages to create recipe skeletons for.", ) cpan.add_argument( "--output-dir", help="Directory to write recipes to (default: %(default)s).", default=".", ) cpan.add_argument( "--version", help="Version to use. Applies to all packages.", ) cpan.add_argument( "--meta-cpan-url", action="store", nargs=1, default='http://api.metacpan.org', help="URL to use for MetaCPAN API.", ) cpan.add_argument( "--recursive", action='store_true', help='Create recipes for dependencies if they do not already exist.') cran = repos.add_parser( "cran", help=""" Create recipe skeleton for packages hosted on the Comprehensive R Archive Network (CRAN) (cran.r-project.org). """, ) cran.add_argument( "packages", action="store", nargs='*', help="""CRAN packages to create recipe skeletons for.""", ).completer = CRANPackagesCompleter cran.add_argument( "--output-dir", action="store", nargs=1, help="Directory to write recipes to (default: %(default)s).", default=".", ) cran.add_argument( "--version", action="store", nargs=1, help="Version to use. Applies to all packages.", ) cran.add_argument( "--git-tag", action="store", nargs=1, help="Git tag to use for GitHub recipes.", ) cran.add_argument( "--all-urls", action="store_true", help="""Look at all URLs, not just source URLs. Use this if it can't find the right URL.""", ) cran.add_argument( "--cran-url", action="store", default='http://cran.r-project.org/', help="URL to use for CRAN (default: %(default)s).", ) cran.add_argument( "--recursive", action='store_true', dest='recursive', help='Create recipes for dependencies if they do not already exist.', ) cran.add_argument( "--no-recursive", action='store_false', dest='recursive', help="Don't create recipes for dependencies if they do not already exist.", ) cran.add_argument( '--no-archive', action='store_false', dest='archive', help="Don't include an Archive download url.", ) cran.add_argument( "--version-compare", action='store_true', help="""Compare the package version of the recipe with the one available on CRAN. Exits 1 if a newer version is available and 0 otherwise.""" ) cran.add_argument( "--update-outdated", action="store_true", help="""Update outdated packages in the output directory (set by --output-dir). If packages are given, they are updated; otherwise, all recipes in the output directory are updated.""", ) luarocks = repos.add_parser( "luarocks", help=""" Create recipe skeleton for luarocks, hosted at luarocks.org """, ) luarocks.add_argument( "packages", action="store", nargs='+', help="luarocks packages to create recipe skeletons for.", ) luarocks.add_argument( "--output-dir", help="Directory to write recipes to (default: %(default)s).", default=".", ) luarocks.add_argument( "--version", help="Version to use. Applies to all packages.", ) luarocks.add_argument( "--recursive", action='store_true', help='Create recipes for dependencies if they do not already exist.') p.set_defaults(func=execute) args = p.parse_args() args_func(args, p)
def main(): p = ArgumentParser( description=""" Generates a boilerplate/skeleton recipe, which you can then edit to create a full recipe. Some simple skeleton recipes may not even need edits. """, epilog=""" Run --help on the subcommands like 'conda skeleton pypi --help' to see the options available. """, ) repos = p.add_subparsers(dest="repo") pypi_example = """ Examples: Create a recipe for the sympy package: conda skeleton pypi sympy Create a recipes for the flake8 package and all its dependencies: conda skeleton pypi --recursive flake8 Use the --pypi-url flag to point to a PyPI mirror url: conda skeleton pypi --pypi-url <mirror-url> package_name """ pypi = repos.add_parser( "pypi", help=""" Create recipe skeleton for packages hosted on the Python Packaging Index (PyPI) (pypi.python.org). """, epilog=pypi_example, ) pypi.add_argument( "packages", action="store", nargs='+', help="""PyPi packages to create recipe skeletons for. You can also specify package[extra,...] features.""", ).completer = PyPIPackagesCompleter pypi.add_argument( "--output-dir", action="store", nargs=1, help="Directory to write recipes to (default: %(default)s).", default=".", ) pypi.add_argument( "--version", action="store", nargs=1, help="Version to use. Applies to all packages.", ) pypi.add_argument( "--all-urls", action="store_true", help="""Look at all URLs, not just source URLs. Use this if it can't find the right URL.""", ) pypi.add_argument( "--pypi-url", action="store", default='https://pypi.python.org/pypi', help="URL to use for PyPI (default: %(default)s).", ) pypi.add_argument( "--no-prompt", action="store_true", default=False, dest="noprompt", help="""Don't prompt the user on ambiguous choices. Instead, make the best possible choice and continue.""") pypi.add_argument( "--all-extras", action="store_true", default=False, help="Add all extra feature requirements. Applies to all packages.", ) pypi.add_argument( "--recursive", action='store_true', help='Create recipes for dependencies if they do not already exist.') pypi.add_argument( "--version-compare", action='store_true', help="""Compare the package version of the recipe with the one available on PyPI.""") pypi.add_argument( "--python-version", action='store', default=default_python, help= """Version of Python to use to run setup.py. Default is %(default)s.""", choices=['2.6', '2.7', '3.3', '3.4'], ) pypi.add_argument( "--manual-url", action='store_true', default=False, help="Manually choose source url when more than one urls are present." + "Default is the one with least source size.") pypi.add_argument("--noarch-python", action='store_true', default=False, help="Creates recipe as noarch python") cpan = repos.add_parser( "cpan", help=""" Create recipe skeleton for packages hosted on the Comprehensive Perl Archive Network (CPAN) (cpan.org). """, ) cpan.add_argument( "packages", action="store", nargs='+', help="CPAN packages to create recipe skeletons for.", ) cpan.add_argument( "--output-dir", help="Directory to write recipes to (default: %(default)s).", default=".", ) cpan.add_argument( "--version", help="Version to use. Applies to all packages.", ) cpan.add_argument( "--meta-cpan-url", action="store", nargs=1, default='http://api.metacpan.org', help="URL to use for MetaCPAN API.", ) cpan.add_argument( "--recursive", action='store_true', help='Create recipes for dependencies if they do not already exist.') cran = repos.add_parser( "cran", help=""" Create recipe skeleton for packages hosted on the Comprehensive R Archive Network (CRAN) (cran.r-project.org). """, ) cran.add_argument( "packages", action="store", nargs='*', help="""CRAN packages to create recipe skeletons for.""", ).completer = CRANPackagesCompleter cran.add_argument( "--output-dir", action="store", nargs=1, help="Directory to write recipes to (default: %(default)s).", default=".", ) cran.add_argument( "--version", action="store", nargs=1, help="Version to use. Applies to all packages.", ) cran.add_argument( "--git-tag", action="store", nargs=1, help="Git tag to use for GitHub recipes.", ) cran.add_argument( "--all-urls", action="store_true", help="""Look at all URLs, not just source URLs. Use this if it can't find the right URL.""", ) cran.add_argument( "--cran-url", action="store", default='http://cran.r-project.org/', help="URL to use for CRAN (default: %(default)s).", ) cran.add_argument( "--recursive", action='store_true', dest='recursive', help='Create recipes for dependencies if they do not already exist.', ) cran.add_argument( "--no-recursive", action='store_false', dest='recursive', help= "Don't create recipes for dependencies if they do not already exist.", ) cran.add_argument( '--no-archive', action='store_false', dest='archive', help="Don't include an Archive download url.", ) cran.add_argument( "--version-compare", action='store_true', help="""Compare the package version of the recipe with the one available on CRAN. Exits 1 if a newer version is available and 0 otherwise.""") cran.add_argument( "--update-outdated", action="store_true", help="""Update outdated packages in the output directory (set by --output-dir). If packages are given, they are updated; otherwise, all recipes in the output directory are updated.""", ) luarocks = repos.add_parser( "luarocks", help=""" Create recipe skeleton for luarocks, hosted at luarocks.org """, ) luarocks.add_argument( "packages", action="store", nargs='+', help="luarocks packages to create recipe skeletons for.", ) luarocks.add_argument( "--output-dir", help="Directory to write recipes to (default: %(default)s).", default=".", ) luarocks.add_argument( "--version", help="Version to use. Applies to all packages.", ) luarocks.add_argument( "--recursive", action='store_true', help='Create recipes for dependencies if they do not already exist.') p.set_defaults(func=execute) args = p.parse_args() args_func(args, p)
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)
def main(): p = argparse.ArgumentParser( description='create skeleton recipes for packages from hosting sites') repos = p.add_subparsers(dest="repo") pypi = repos.add_parser( "pypi", help="Create recipes from packages on PyPI", ) pypi.add_argument( "packages", action="store", nargs='+', help="""PyPi packages to create recipe skeletons for. You can also specify package[extra,...] features.""", ) pypi.add_argument( "--output-dir", action="store", nargs=1, help="Directory to write recipes to", default=".", ) pypi.add_argument( "--version", action="store", nargs=1, help="Version to use. Applies to all packages", ) pypi.add_argument( "--all-urls", action="store_true", help="""Look at all URLs, not just source URLs. Use this if it can't find the right URL.""", ) pypi.add_argument( "--pypi-url", action="store", nargs=1, default='https://pypi.python.org/pypi', help="URL to use for PyPI", ) pypi.add_argument( "--no-download", action="store_false", dest="download", default=True, help="""Don't download the package. This will keep the recipe from finding the right dependencies and entry points if the package uses distribute. WARNING: The default option downloads and runs the package's setup.py script.""") pypi.add_argument( "--no-prompt", action="store_true", default=False, dest="noprompt", help="""Don't prompt the user on ambiguous choices. Instead, make the best possible choice and continue.""") pypi.add_argument( "--all-extras", action="store_true", default=False, help="Add all extra feature requirements. Applies to all packages.", ) pypi.add_argument( "--recursive", action='store_true', help='Create recipes for dependencies if they do not already exist.') pypi.add_argument( "--python-version", action='store', default=default_python, help= """Version of Python to use to run setup.py. Default is %(default)s.""", choices=['2.6', '2.7', '3.3', '3.4'], ) cpan = repos.add_parser( "cpan", help="Create recipes from packages on CPAN", ) cpan.add_argument( "packages", action="store", nargs='+', help="CPAN packages to create recipe skeletons for", ) cpan.add_argument( "--output-dir", help="Directory to write recipes to", default=".", ) cpan.add_argument( "--version", help="Version to use. Applies to all packages", ) cpan.add_argument( "--meta-cpan-url", action="store", nargs=1, default='http://api.metacpan.org', help="URL to use for MetaCPAN API", ) cpan.add_argument( "--recursive", action='store_true', help='Create recipes for dependencies if they do not already exist.') p.set_defaults(func=execute) args = p.parse_args() args_func(args, p)
def main(): p = argparse.ArgumentParser( description='Tools for inspecting conda packages') subcommand = p.add_subparsers(dest='subcommand', ) linkages_help = """ Investigate linkages of binary libraries in a package (only works in Linux and OS X). Aggregates the output of ldd (on Linux) and otool -L (on OS X). Useful for finding broken links, or links against system libraries that ought to be dependent conda packages.""" linkages = subcommand.add_parser( "linkages", # help controls conda inspect -h and description controls conda # inspect linkages -h help=linkages_help, description=linkages_help, ) linkages.add_argument( 'packages', action='store', nargs='*', help='conda packages to inspect', ) linkages.add_argument( '--untracked', action='store_true', help="""Inspect the untracked files in the environment. Useful when used in conjunction with conda build --build-only.""", ) linkages.add_argument( '--show-files', action="store_true", help="Show the files in the package that link to each library", ) add_parser_prefix(linkages) objects_help = """Investigate binary object files in a package (only works in OS X). Aggregates the output of otool on all the binary object files in a package.""" objects = subcommand.add_parser( "objects", help=objects_help, description=objects_help, ) objects.add_argument( 'packages', action='store', nargs='*', help='conda packages to inspect', ) objects.add_argument( '--untracked', action='store_true', help="""Inspect the untracked files in the environment. Useful when used in conjunction with conda build --build-only.""", ) objects.add_argument( '--groupby', action='store', default='filename', choices={'filename', 'filetype', 'rpath'}, help='Attribute to group by (default: %(default)s)', ) add_parser_prefix(objects) p.set_defaults(func=execute) args = p.parse_args() args_func(args, p)
def main(): p = ArgumentParser( description=""" Generates a boilerplate/skeleton recipe, which you can then edit to create a full recipe. Some simple skeleton recipes may not even need edits. """, epilog=""" Run --help on the subcommands like 'conda skeleton pypi --help' to see the options available. """, ) repos = p.add_subparsers( dest="repo" ) pypi_example = """ Examples: Create a recipe for the sympy package: conda skeleton pypi sympy Create a recipes for the flake8 package and all its dependencies: conda skeleton pypi --recursive flake8 Use the --pypi-url flag to point to a PyPI mirror url: conda skeleton pypi --pypi-url <mirror-url> package_name """ pypi = repos.add_parser( "pypi", help=""" Create recipe skeleton for packages hosted on the Python Packaging Index (PyPI) (pypi.python.org). """, epilog=pypi_example, ) pypi.add_argument( "packages", action="store", nargs='+', help="""PyPi packages to create recipe skeletons for. You can also specify package[extra,...] features.""", ) pypi.add_argument( "--output-dir", action="store", nargs=1, help="Directory to write recipes to.", default=".", ) pypi.add_argument( "--version", action="store", nargs=1, help="Version to use. Applies to all packages.", ) pypi.add_argument( "--all-urls", action="store_true", help="""Look at all URLs, not just source URLs. Use this if it can't find the right URL.""", ) pypi.add_argument( "--pypi-url", action="store", default='https://pypi.python.org/pypi', help="URL to use for PyPI (default: %(default)s).", ) pypi.add_argument( "--no-download", action="store_false", dest="download", default=True, help="""Don't download the package. This will keep the recipe from finding the right dependencies and entry points if the package uses distribute. WARNING: Without this flag, conda skeleton pypi downloads and runs the package's setup.py script.""" ) pypi.add_argument( "--no-prompt", action="store_true", default=False, dest="noprompt", help="""Don't prompt the user on ambiguous choices. Instead, make the best possible choice and continue.""" ) pypi.add_argument( "--all-extras", action="store_true", default=False, help="Add all extra feature requirements. Applies to all packages.", ) pypi.add_argument( "--recursive", action='store_true', help='Create recipes for dependencies if they do not already exist.' ) pypi.add_argument( "--version-compare", action='store_true', help='Compare the package version of the recipe with the one available' 'on PyPI' ) pypi.add_argument( "--python-version", action='store', default=default_python, help="""Version of Python to use to run setup.py. Default is %(default)s.""", choices=['2.6', '2.7', '3.3', '3.4'], ) pypi.add_argument( "--manual-url", action='store_true', default=False, help="Manually choose source url when more than one urls are present." + "Default is the one with least source size." ) pypi.add_argument( "--noarch-python", action='store_true', default=False, help="Creates recipe as noarch python" ) cpan = repos.add_parser( "cpan", help=""" Create recipe skeleton for packages hosted on the Comprehensive Perl Archive Network (CPAN) (cpan.org). """, ) cpan.add_argument( "packages", action="store", nargs='+', help="CPAN packages to create recipe skeletons for.", ) cpan.add_argument( "--output-dir", help="Directory to write recipes to.", default=".", ) cpan.add_argument( "--version", help="Version to use. Applies to all packages.", ) cpan.add_argument( "--meta-cpan-url", action="store", nargs=1, default='http://api.metacpan.org', help="URL to use for MetaCPAN API.", ) cpan.add_argument( "--recursive", action='store_true', help='Create recipes for dependencies if they do not already exist.') cran = repos.add_parser( "cran", help=""" Create recipe skeleton for packages hosted on the Comprehensive R Archive Network (CRAN) (cran.r-project.org). """, ) cran.add_argument( "packages", action="store", nargs='+', help="""CRAN packages to create recipe skeletons for.""", ) cran.add_argument( "--output-dir", action="store", nargs=1, help="Directory to write recipes to.", default=".", ) cran.add_argument( "--version", action="store", nargs=1, help="Version to use. Applies to all packages.", ) cran.add_argument( "--git-tag", action="store", nargs=1, help="Git tag to use for GitHub recipes.", ) cran.add_argument( "--all-urls", action="store_true", help="""Look at all URLs, not just source URLs. Use this if it can't find the right URL.""", ) cran.add_argument( "--cran-url", action="store", default='http://cran.r-project.org/', help="URL to use for CRAN (default: %(default)s).", ) cran.add_argument( "--recursive", action='store_true', dest='recursive', help='Create recipes for dependencies if they do not already exist.', ) cran.add_argument( "--no-recursive", action='store_false', dest='recursive', help="Don't create recipes for dependencies if they do not already exist.", ) cran.add_argument( '--no-archive', action='store_false', dest='archive', help="Don't include an Archive download url.", ) p.set_defaults(func=execute) args = p.parse_args() args_func(args, p)