示例#1
0
def test_version():

    cmd = ""
    cmd += "--version"

    result = common.cli(cmd)

    info_version = info.get_version()
    info_prog_name = info.get_prog_name()

    assert f"{info_prog_name}, version {info_version}" == result
示例#2
0
sys.path.insert(0, 'netdiff')
from info import get_version
sys.path.remove('netdiff')


if sys.argv[-1] == 'setup.py':
    print("To install, run 'python setup.py install'\n")


if sys.argv[-1] == 'publish':
    import os
    os.system('find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf')
    os.system("python setup.py sdist bdist_wheel")
    os.system("twine upload -s dist/*")
    os.system("rm -rf dist build")
    args = {'version': get_version()}
    print("You probably want to also tag the version now:")
    print("  git tag -a %(version)s -m 'version %(version)s'" % args)
    print("  git push --tags")
    sys.exit()


def get_install_requires():
    """
    parse requirements.txt, ignore links, exclude comments
    """
    requirements = []
    for line in open('requirements.txt').readlines():
        # skip to next iteration if comment or empty line
        if line.startswith('#') or line == '' or line.startswith('http') or line.startswith('git'):
            continue
示例#3
0
import uuid
import re
import click_completion
import urllib.request
from io import BytesIO

HERE = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, f"{HERE}")
""" Import custom modules. """

import info
import util


@click.group()
@click.version_option(info.get_version(), prog_name=info.get_prog_name())
def cli():
    """ CLI tool to build and manage custom Docker images. """
    pass


@cli.command()
@click.option(
    "--from",
    "from_",
    help="Base image (used in Dockerfile FROM). Example: --from=ubuntu:20.04",
    metavar="<name:tag>",
    required=True,
    default="ubuntu:18.04",
    show_default=True,
    type=str,
示例#4
0
文件: setup.py 项目: tadeugr/dugaire
""" Import custom modules. """

# The directory containing this file
HERE = os.path.dirname(os.path.realpath(__file__))

sys.path.insert(1, f"{HERE}/dugaire")

import info

# REAME content
README = open(os.path.join(HERE, "README.md")).read()

setup(
    name=info.get_prog_name(),
    version=info.get_version(),
    description="Build Docker images with custom packages for local development, testing and daily tasks.",
    long_description=README,
    long_description_content_type="text/markdown",
    url="https://github.com/tadeugr/dugaire",
    author="Tadeu Granemann",
    license="Apache License, Version 2.0",
    classifiers=[
        "License :: OSI Approved :: Apache Software License",
        "Programming Language :: Python",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 3",
    ],
    packages=find_packages(exclude=("tests",)),
    include_package_data=True,
    install_requires=[