--- /dev/null
+---
+name: Test Suite
+
+on:
+ push:
+ branches: ["master"]
+ pull_request:
+ branches: ["master"]
+
+jobs:
+ tests:
+ name: "Python ${{ matrix.python-version }}"
+ runs-on: "ubuntu-latest"
+
+ strategy:
+ matrix:
+ python-version: ["3.6", "3.7", "3.8"]
+
+ steps:
+ - uses: "actions/checkout@v2"
+ - uses: "actions/setup-python@v1"
+ with:
+ python-version: "${{ matrix.python-version }}"
+ - name: "Install dependencies"
+ run: "scripts/install"
+ - name: "Run linting checks"
+ run: "scripts/check"
+ - name: "Run tests"
+ run: "scripts/test"
+++ /dev/null
-dist: xenial
-language: python
-
-cache: pip
-
-branches:
- only:
- - master
-
-python:
- - 3.6
- - 3.7
- - 3.8
-
-stages:
- - check
- - docs
- - test
-
-matrix:
- include:
- -
- stage: check
- python: 3.7
- script: scripts/check
- - stage: docs
- python: 3.7
- script: scripts/docs-build
- - stage: test
- os: windows
- language: shell
- python: 3.7
- env:
- PATH=/c/Python37:/c/Python37/Scripts:$PATH
- before_install:
- - choco install python --version 3.7
- - python -m pip install --upgrade pip
- install: pip install -r requirements.txt
- script: scripts/test
-
- fast_finish: true
- allow_failures:
- # FIX
- # Some tests not yet resolved for Windows. (In progress)
- - os: windows
-
-script: scripts/test
-
-after_script:
- - if [ -f .coverage ]; then
- python -m pip install codecov;
- codecov --required;
- fi
<p align="center"><strong>HTTPX</strong> <em>- A next-generation HTTP client for Python.</em></p>
<p align="center">
-<a href="https://travis-ci.org/encode/httpx">
- <img src="https://travis-ci.org/encode/httpx.svg?branch=master" alt="Build Status">
+<a href="https://github.com/encode/httpx/actions">
+ <img src="https://github.com/encode/httpx/workflows/Test%20Suite/badge.svg" alt="Test Suite">
</a>
<a href="https://codecov.io/gh/encode/httpx">
<img src="https://codecov.io/gh/encode/httpx/branch/master/graph/badge.svg" alt="Coverage">
+++ /dev/null
-coverage:
- status:
- patch:
- default:
- target: '100'
- project:
- default:
- target: '100'
<div align="center">
<p>
-<a href="https://travis-ci.org/encode/httpx">
- <img src="https://travis-ci.org/encode/httpx.svg?branch=master" alt="Build Status">
-</a>
-<a href="https://codecov.io/gh/encode/httpx">
- <img src="https://codecov.io/gh/encode/httpx/branch/master/graph/badge.svg" alt="Coverage">
+<a href="https://github.com/encode/httpx/actions">
+ <img src="https://github.com/encode/httpx/workflows/Test%20Suite/badge.svg" alt="Test Suite">
</a>
<a href="https://pypi.org/project/httpx/">
<img src="https://badge.fury.io/py/httpx.svg" alt="Package version">
#!/bin/sh -e
-export PREFIX="venv/bin/"
+# Use the Python executable provided from the `-p` option, or a default.
+[ "$1" = "-p" ] && PYTHON=$2 || PYTHON="python3"
-set -x
+REQUIREMENTS="requirements.txt"
+VENV="venv"
-python -m venv venv
-${PREFIX}python -m pip install -U pip
-${PREFIX}python -m pip install -r requirements.txt
+set -x
-set +x
+if [ -z "$GITHUB_ACTIONS" ]; then
+ "$PYTHON" -m venv "$VENV"
+ PIP="$VENV/bin/pip"
+else
+ PIP="pip"
+fi
-echo
-echo "Success! You can now activate your virtual environment using:"
-echo "source ${PREFIX}activate"
+"$PIP" install -r "$REQUIREMENTS"
+"$PIP" install -e .
set -x
-if [ -z $CI ]; then
+if [ -z $GITHUB_ACTIONS ]; then
scripts/check
fi