Skip to content

Commit

Permalink
Merge 6e698af into 80e52e2
Browse files Browse the repository at this point in the history
  • Loading branch information
twm committed Dec 23, 2020
2 parents 80e52e2 + 6e698af commit 226fe89
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 10 deletions.
120 changes: 120 additions & 0 deletions .github/workflows/ci.yaml
@@ -0,0 +1,120 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
lint:
runs-on: ubuntu-20.04
timeout-minutes: 5

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: '3.8'

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key:
${{ runner.os }}-pip-lint-${{ hashFiles('pyproject.toml', 'setup.py', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-lint-
${{ runner.os }}-pip-
- run: python -m pip install tox

- run: tox -q -e flake8

- run: tox -q -e towncrier

- run: tox -q -e twine

- run: tox -q -e check-manifest


docs:
runs-on: ubuntu-20.04
timeout-minutes: 5

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: "3.8"

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key:
${{ runner.os }}-pip-docs-${{ hashFiles('pyproject.toml', 'setup.py', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-docs-
${{ runner.os }}-pip-
- run: python -m pip install tox

- run: tox -q -e docs


test:
runs-on: ubuntu-20.04
timeout-minutes: 10
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "pypy-2.7"]
twisted-version: ["lowest", "latest"]
experimental: [false]

include:
- python-version: "pypy-3.7"
twisted-version: "latest"
experimental: true

- python-version: "3.8"
twisted-version: "trunk"
experimental: true

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key:
${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'setup.py', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: Translate Python version to Tox factor
id: pyfactor
shell: python
run: |
table = {
"2.7": "py27",
"3.5": "py35",
"3.6": "py36",
"3.7": "py37",
"3.8": "py38",
"3.9": "py39",
"pypy-2.7": "pypy",
"pypy-3.7": "pypy3",
}
factor = table["${{ matrix.python-version }}"]
print("::set-output name=value::" + factor)
- run: python -m pip install tox

- run: tox -e ${{ steps.pyfactor.outputs.value }}-twisted_${{ matrix.twisted-version }}
3 changes: 1 addition & 2 deletions setup.py
Expand Up @@ -33,8 +33,7 @@
"requests >= 2.1.0",
"hyperlink >= 19.0.0",
"six >= 1.13.0",
"Twisted[tls] >= 16.4.0 ; python_version < '3.7'",
"Twisted[tls] >= 18.7.0 ; python_version >= '3.7'",
"Twisted[tls] >= 18.7.0",
"attrs",
],
extras_require={
Expand Down
6 changes: 3 additions & 3 deletions src/treq/test/local_httpbin/child.py
Expand Up @@ -35,7 +35,7 @@
from .shared import _HTTPBinDescription


def _certificates_for_authority_and_server(service_identity, key_size=1024):
def _certificates_for_authority_and_server(service_identity, key_size=2048):
"""
Create a self-signed CA certificate and server certificate signed
by the CA.
Expand All @@ -44,8 +44,8 @@ def _certificates_for_authority_and_server(service_identity, key_size=1024):
:type service_identity: :py:class:`unicode`
:param key_size: (optional) The size of CA's and server's private
RSA keys. Defaults to 1024 bits, which is the minimum allowed
by OpenSSL Contexts at the default security level as of 1.1.
RSA keys. Defaults to 2048 bits, which is the minimum allowed
by OpenSSL Contexts at the default security level.
:type key_size: :py:class:`int`
:return: a 3-tuple of ``(certificate_authority_certificate,
Expand Down
7 changes: 2 additions & 5 deletions tox.ini
Expand Up @@ -2,7 +2,7 @@
envlist =
{pypy,py27,py35,py36,py37}-twisted_lowest,
{pypy,pypy3,py27,py35,py36,py37,py38}-twisted_latest,
{pypy3,py35,py36,py37,py38}-twisted_trunk-pyopenssl_trunk,
{pypy3,py35,py36,py37,py38}-twisted_trunk,
towncrier, twine, check-manifest, flake8, docs

[testenv]
Expand All @@ -11,13 +11,10 @@ deps =
coverage
mock

!py37-twisted_lowest: Twisted==16.4.0
py37-twisted_lowest: Twisted==18.7.0
twisted_lowest: Twisted==18.7.0
twisted_latest: Twisted
twisted_trunk: https://github.com/twisted/twisted/archive/trunk.zip

pyopenssl_trunk: https://github.com/pyca/pyopenssl/archive/master.zip

docs: Sphinx>=1.4.8
setenv =
# Avoid unnecessary network access when creating virtualenvs for speed.
Expand Down

0 comments on commit 226fe89

Please sign in to comment.