當前位置: 首頁>>代碼示例>>Python>>正文


Python nox.session方法代碼示例

本文整理匯總了Python中nox.session方法的典型用法代碼示例。如果您正苦於以下問題:Python nox.session方法的具體用法?Python nox.session怎麽用?Python nox.session使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在nox的用法示例。


在下文中一共展示了nox.session方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: default

# 需要導入模塊: import nox [as 別名]
# 或者: from nox import session [as 別名]
def default(session):
    # Install all test dependencies, then install this package in-place.
    session.install("mock", "pytest", "pytest-cov")
    session.install("-e", ".")

    # Run py.test against the unit tests.
    session.run(
        "py.test",
        "--quiet",
        "--cov=google.cloud.firestore",
        "--cov=google.cloud",
        "--cov=tests.unit",
        "--cov-append",
        "--cov-config=.coveragerc",
        "--cov-report=",
        "--cov-fail-under=0",
        os.path.join("tests", "unit"),
        *session.posargs,
    ) 
開發者ID:googleapis,項目名稱:python-firestore,代碼行數:21,代碼來源:noxfile.py

示例2: docs

# 需要導入模塊: import nox [as 別名]
# 或者: from nox import session [as 別名]
def docs(session):
    """Build the docs for this library."""

    session.install("-e", ".")
    session.install("sphinx<3.0.0", "alabaster", "recommonmark")

    shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
    session.run(
        "sphinx-build",
        "-W",  # warnings as errors
        "-T",  # show full traceback on exception
        "-N",  # no colors
        "-b",
        "html",
        "-d",
        os.path.join("docs", "_build", "doctrees", ""),
        os.path.join("docs", ""),
        os.path.join("docs", "_build", "html", ""),
    ) 
開發者ID:googleapis,項目名稱:python-firestore,代碼行數:21,代碼來源:noxfile.py

示例3: lint

# 需要導入模塊: import nox [as 別名]
# 或者: from nox import session [as 別名]
def lint(session):
    session.interpreter = 'python3.6'
    session.install(
        'flake8', 'flake8-import-order', 'pylint', 'docutils',
        'gcp-devrel-py-tools>=0.0.3')
    session.install('.')
    session.run(
        'python', 'setup.py', 'check', '--metadata',
        '--restructuredtext', '--strict')
    session.run(
        'flake8',
        '--import-order-style=google',
        '--application-import-names=google,tests',
        '--ignore=E501,I202',
        '--exclude=gapic,fixtures',
        'google', 'tests')
    session.run(
        'gcp-devrel-py-tools', 'run-pylint',
        '--config', 'pylint.conf.py',
        '--library-filesets', 'google',
        '--test-filesets', 'tests',
        success_codes=range(0, 31)) 
開發者ID:googleapis,項目名稱:gax-python,代碼行數:24,代碼來源:nox.py

示例4: run_black

# 需要導入模塊: import nox [as 別名]
# 或者: from nox import session [as 別名]
def run_black(session, use_check=False):
    args = ["black"]
    if use_check:
        args.append("--check")

    args.extend(
        [
            "--line-length=79",
            get_path("docs"),
            get_path("noxfile.py"),
            get_path("google"),
            get_path("tests"),
        ]
    )

    session.run(*args) 
開發者ID:googleapis,項目名稱:python-ndb,代碼行數:18,代碼來源:noxfile.py

示例5: doctest

# 需要導入模塊: import nox [as 別名]
# 或者: from nox import session [as 別名]
def doctest(session):
    # Install all dependencies.
    session.install("Sphinx")
    session.install("sphinxcontrib.spelling")
    session.install(".")
    # Run the script for building docs and running doctests.
    run_args = [
        "sphinx-build",
        "-W",
        "-b",
        "doctest",
        "-d",
        get_path("docs", "_build", "doctrees"),
        get_path("docs"),
        get_path("docs", "_build", "doctest"),
    ]
    session.run(*run_args) 
開發者ID:googleapis,項目名稱:python-ndb,代碼行數:19,代碼來源:noxfile.py

示例6: install_packages

# 需要導入模塊: import nox [as 別名]
# 或者: from nox import session [as 別名]
def install_packages(session, package_a, package_b, command_a, command_b):
    session.chdir(package_a)
    session.run('rm', '-rf', 'dist', 'build', '*.egg-info')
    session.run(*command_a)
    session.chdir(HERE)
    session.chdir(package_b)
    session.run('rm', '-rf', 'dist', 'build', '*.egg-info')
    session.run(*command_b)
    session.chdir(HERE) 
開發者ID:pypa,項目名稱:sample-namespace-packages,代碼行數:11,代碼來源:noxfile.py

示例7: session_pkgutil

# 需要導入模塊: import nox [as 別名]
# 或者: from nox import session [as 別名]
def session_pkgutil(session, command_a, command_b):
    session.install('--upgrade', 'setuptools', 'pip')
    install_packages(
        session, 'pkgutil/pkg_a', 'pkgutil/pkg_b',
        command_a, command_b)
    session.run('python', 'verify_packages.py') 
開發者ID:pypa,項目名稱:sample-namespace-packages,代碼行數:8,代碼來源:noxfile.py

示例8: session_pkg_resources

# 需要導入模塊: import nox [as 別名]
# 或者: from nox import session [as 別名]
def session_pkg_resources(session, command_a, command_b):
    session.install('--upgrade', 'setuptools', 'pip')
    install_packages(
        session, 'pkg_resources/pkg_a', 'pkg_resources/pkg_b',
        command_a, command_b)
    session.run('python', 'verify_packages.py') 
開發者ID:pypa,項目名稱:sample-namespace-packages,代碼行數:8,代碼來源:noxfile.py

示例9: session_pep420

# 需要導入模塊: import nox [as 別名]
# 或者: from nox import session [as 別名]
def session_pep420(session, command_a, command_b):
    session.install('--upgrade', 'setuptools', 'pip')
    install_packages(
        session, 'native/pkg_a', 'native/pkg_b',
        command_a, command_b)
    session.run('python', 'verify_packages.py') 
開發者ID:pypa,項目名稱:sample-namespace-packages,代碼行數:8,代碼來源:noxfile.py

示例10: session_cross_pkg_resources_pkgutil

# 需要導入模塊: import nox [as 別名]
# 或者: from nox import session [as 別名]
def session_cross_pkg_resources_pkgutil(
        session, command_a, command_b):
    session.install('--upgrade', 'setuptools', 'pip')
    install_packages(
        session, 'pkg_resources/pkg_a', 'pkgutil/pkg_b',
        command_a, command_b)
    session.run('python', 'verify_packages.py') 
開發者ID:pypa,項目名稱:sample-namespace-packages,代碼行數:9,代碼來源:noxfile.py

示例11: test

# 需要導入模塊: import nox [as 別名]
# 或者: from nox import session [as 別名]
def test(session, sqlalchemy, hana_driver):
    if 'NOX_SAP_HANA_URI' not in os.environ:
        session.skip(
            "Environment variable NOX_SAP_HANA_URI must be defined. "
            "Example: NOX_SAP_HANA_URI=USERNAME:PASSWORD@sap-hana-host:PORT"
        )

    pip_env = {}
    if PIP_INDEX_URL:
        session.log('Use and trust custom index url from NOX_PIP_INDEX_URL')
        pip_env = {
            'PIP_INDEX_URL': PIP_INDEX_URL,
            'PIP_TRUSTED_HOST': urlparse(PIP_INDEX_URL).netloc
        }

    session.install('sqlalchemy~={}.0'.format(sqlalchemy))
    session.install(hana_driver, env=pip_env)
    session.install('.[test]')

    dburi = 'hana+' + hana_driver + '://' + os.environ['NOX_SAP_HANA_URI']
    session.run(
        'pytest',
        '--dburi', dburi,
        '--requirements', 'sqlalchemy_hana.requirements:Requirements',
        *session.posargs
    ) 
開發者ID:SAP,項目名稱:sqlalchemy-hana,代碼行數:28,代碼來源:noxfile.py

示例12: _install_dev_packages

# 需要導入模塊: import nox [as 別名]
# 或者: from nox import session [as 別名]
def _install_dev_packages(session):
    session.install("-e", ".") 
開發者ID:googlemaps,項目名稱:google-maps-services-python,代碼行數:4,代碼來源:noxfile.py

示例13: _install_test_dependencies

# 需要導入模塊: import nox [as 別名]
# 或者: from nox import session [as 別名]
def _install_test_dependencies(session):
    session.install("pytest")
    session.install("pytest-cov")
    session.install("responses") 
開發者ID:googlemaps,項目名稱:google-maps-services-python,代碼行數:6,代碼來源:noxfile.py

示例14: _install_doc_dependencies

# 需要導入模塊: import nox [as 別名]
# 或者: from nox import session [as 別名]
def _install_doc_dependencies(session):
    session.install("sphinx") 
開發者ID:googlemaps,項目名稱:google-maps-services-python,代碼行數:4,代碼來源:noxfile.py

示例15: tests

# 需要導入模塊: import nox [as 別名]
# 或者: from nox import session [as 別名]
def tests(session):
    _install_dev_packages(session)
    _install_test_dependencies(session)

    session.install("pytest")
    session.run("pytest")

    session.notify("cover") 
開發者ID:googlemaps,項目名稱:google-maps-services-python,代碼行數:10,代碼來源:noxfile.py


注:本文中的nox.session方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。