Skip to content
Myr

Drop nox in favor of vanilla scripts (#566)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Drop nox in favor of vanilla scripts * Use named stages * Fix attrs dependency resolution madness * Add missing mkautodoc dev dependency * Add missing install step on windows build * Explicitly define stage order so that timed out Windows build runs last * Add missing dev dependency on Black * Clean up contributing guide * Separate docs into docs-build and docs-serve

authored by Florimond Manca · committed by Tom Christie · parent 3218c35 · Browse files · 13 files+144 added−148 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

13 files+144 added−148 removed

  • other:+144 added−148 removed

13 files+144 added−148 removed

modified:docs/contributing.md+22 added-51 removed
added:scripts/check+14 added
1#!/bin/sh -e23export PREFIX=""4if [ -d 'venv' ] ; then5 export PREFIX="venv/bin/"6fi7export SOURCE_FILES="httpx tests"89set -x1011${PREFIX}black --check --diff --target-version=py36 $SOURCE_FILES12${PREFIX}flake8 $SOURCE_FILES13${PREFIX}mypy httpx14${PREFIX}isort --check --diff --project=httpx --recursive $SOURCE_FILES
added:scripts/docs-build+10 added
1#!/bin/sh -e23export PREFIX=""4if [ -d 'venv' ] ; then5 export PREFIX="venv/bin/"6fi78set -x910${PREFIX}mkdocs build
added:scripts/docs-serve+10 added
1#!/bin/sh -e23export PREFIX=""4if [ -d 'venv' ] ; then5 export PREFIX="venv/bin/"6fi78set -x910${PREFIX}mkdocs serve
added:scripts/install+15 added
1#!/bin/sh -e23export PREFIX="venv/bin/"45set -x67python -m venv venv8${PREFIX}python -m pip install -U pip9${PREFIX}python -m pip install -r requirements.txt1011set +x1213echo14echo "Success! You can now activate your virtual environment using:"15echo "source ${PREFIX}activate"
added:scripts/lint+14 added
1#!/bin/sh -e23export PREFIX=""4if [ -d 'venv' ] ; then5 export PREFIX="venv/bin/"6fi7export SOURCE_FILES="httpx tests"89set -x1011${PREFIX}autoflake --in-place --recursive $SOURCE_FILES12${PREFIX}seed-isort-config --application-directories=httpx13${PREFIX}isort --project=httpx --recursive --apply $SOURCE_FILES14${PREFIX}black --target-version=py36 $SOURCE_FILES
modified:scripts/test+10 added-2 removed
1#!/bin/sh -e23export PREFIX=""4if [ -d 'venv' ] ; then5 export PREFIX="venv/bin/"6fi78set -x95nox -s check6nox -s test10if [ -z $CI ]; then11 scripts/check12fi1314${PREFIX}pytest $@
modified:.gitignore-1 removed
5 unmodified lines
6htmlcov/7site/8*.egg-info/9venv*/10.nox10.python-version
modified:.travis.yml+22 added-20 removed
5 unmodified lines
6branches:7 only:8 - master910matrix:11 include:12 - python: 3.713 env: NOX_SESSION=check14 - python: 3.715 env: NOX_SESSION=docs10python:11 - 3.612 - 3.713 - 3.81417 - python: 3.618 env: NOX_SESSION=test-3.619 - python: 3.720 env: NOX_SESSION=test-3.721 - python: 3.822 env: NOX_SESSION=test-3.823 dist: bionic # Required to get OpenSSL 1.1.1+15stages:16 - check17 - docs18 - test1920matrix:21 include:22 -23 stage: check24 python: 3.725 script: scripts/check26 - stage: docs27 python: 3.728 script: scripts/docs-build29 - stage: test25 - os: windows30 os: windows31 language: shell32 python: 3.733 env:34 PATH=/c/Python37:/c/Python37/Scripts:$PATH30 NOX_SESSION=test-3.735 before_install:36 - choco install python --version 3.737 - python -m pip install --upgrade pip38 install: pip install -r requirements.txt39 script: scripts/test4041 fast_finish: true42 allow_failures:43 # FIX44 # Some tests not yet resolved for Windows. (In progress)45 - os: windows4641install:42 - pip install --upgrade nox47script: scripts/test4844script:45 - nox -s ${NOX_SESSION}4649after_script:50 - if [ -f .coverage ]; then51 python -m pip install codecov;52 codecov --required;
1 unmodified line
deleted:noxfile.py-55 removed
1import nox23nox.options.stop_on_first_error = True4nox.options.reuse_existing_virtualenvs = True5nox.options.keywords = "not serve"67source_files = ("httpx", "tools", "tests", "setup.py", "noxfile.py")8910@nox.session11def lint(session):12 session.install(13 "--upgrade", "autoflake", "black", "flake8", "isort", "seed-isort-config"14 )1516 session.run("autoflake", "--in-place", "--recursive", *source_files)17 session.run("seed-isort-config", "--application-directories=httpx")18 session.run("isort", "--project=httpx", "--recursive", "--apply", *source_files)19 session.run("black", "--target-version=py36", *source_files)2021 check(session)222324@nox.session25def check(session):26 session.install(27 "--upgrade", "black", "flake8", "flake8-bugbear", "flake8-pie", "isort", "mypy"28 )2930 session.run("black", "--check", "--diff", "--target-version=py36", *source_files)31 session.run("flake8", *source_files)32 session.run("mypy", "httpx")33 session.run(34 "isort", "--check", "--diff", "--project=httpx", "--recursive", *source_files35 )363738@nox.session39def docs(session):40 session.install("--upgrade", "mkdocs", "mkdocs-material", "mkautodoc>=0.1.0")41 session.install("-e", ".")42 session.run("mkdocs", "build")434445@nox.session(reuse_venv=True)46def serve(session):47 session.install("--upgrade", "mkdocs", "mkdocs-material")4849 session.run("mkdocs", "serve")505152@nox.session(python=["3.6", "3.7", "3.8"])53def test(session):54 session.install("--upgrade", "-r", "test-requirements.txt")55 session.run("python", "-m", "pytest", *session.posargs)
added:requirements.txt+26 added
1-e .23# Optional4brotlipy==0.7.*56autoflake7black8cryptography9flake810flake8-bugbear11flake8-pie12isort13mkdocs14mkautodoc15mkdocs-material16mypy17pytest18pytest-asyncio19pytest-trio20pytest-cov21trio22trustme23uvicorn24seed-isort-config2526attrs>=19.2 # See: https://github.com/encode/httpx/pull/566#issuecomment-559862665
modified:setup.cfg+1 added-1 removed
12 unmodified lines
13combine_as_imports = True14force_grid_wrap = 015include_trailing_comma = True16known_first_party = httpx,httpxprof,tests17known_third_party = brotli,certifi,chardet,click,cryptography,h11,h2,hstspreload,nox,pytest,requests,rfc3986,setuptools,tqdm,trio,trustme,uvicorn17known_third_party = brotli,certifi,chardet,click,cryptography,h11,h2,hstspreload,pytest,rfc3986,setuptools,tqdm,trio,trustme,uvicorn18line_length = 8819multi_line_output = 32021[tool:pytest]
3 unmodified lines
deleted:test-requirements.txt-18 removed
1-e .23# Optional4brotlipy==0.7.*56cryptography7flake88flake8-bugbear9flake8-pie10isort11mypy12pytest13pytest-asyncio14pytest-trio15pytest-cov16trio17trustme18uvicorn