diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..7b9c6b5d --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,117 @@ +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 -p all -e flake8,towncrier,twine,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: + name: "Test ${{ matrix.python-version }} with ${{ matrix.twisted-version }} Twisted" + 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", "pypy-3.7"] + twisted-version: ["lowest", "latest"] + experimental: [false] + + include: + - 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 coveralls + + - run: tox -e ${{ steps.pyfactor.outputs.value }}-twisted_${{ matrix.twisted-version }} + + - run: coveralls + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_REPO_TOKEN: 4nctuKHTnVtbdmty2FgdO3iiWm1nb7xc4 + COVERALLS_FLAG_NAME: python_${{ matrix.python-version }}-twisted_${{ matrix.twisted-version }} + COVERALLS_PARALLEL: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ecbc6b40..00000000 --- a/.travis.yml +++ /dev/null @@ -1,78 +0,0 @@ -# AUTO-GENERATED BY tox2travis.py -- DO NOT EDIT THIS FILE BY HAND! - -dist: xenial -language: python - -cache: pip - -jobs: - include: - - python: "3.8" - env: TOXENV=towncrier,twine,check-manifest,flake8,docs - - python: "2.7" - env: TOXENV=py27-twisted_lowest,py27-twisted_latest - - python: "3.5" - env: TOXENV=py35-twisted_lowest,py35-twisted_latest - - python: "3.6" - env: TOXENV=py36-twisted_lowest,py36-twisted_latest - - python: "3.7" - env: TOXENV=py37-twisted_lowest,py37-twisted_latest - - python: "3.8" - env: TOXENV=py38-twisted_latest - - python: "pypy" - env: TOXENV=pypy-twisted_lowest,pypy-twisted_latest - - python: "pypy3" - env: TOXENV=pypy3-twisted_latest - - python: "pypy3" - env: TOXENV=pypy3-twisted_trunk-pyopenssl_trunk - if: branch = master - - python: "3.5" - env: TOXENV=py35-twisted_trunk-pyopenssl_trunk - if: branch = master - - python: "3.6" - env: TOXENV=py36-twisted_trunk-pyopenssl_trunk - if: branch = master - - python: "3.7" - env: TOXENV=py37-twisted_trunk-pyopenssl_trunk - if: branch = master - - python: "3.8" - env: TOXENV=py38-twisted_trunk-pyopenssl_trunk - if: branch = master - - # Don't fail on trunk versions. - allow_failures: - - env: TOXENV=pypy3-twisted_trunk-pyopenssl_trunk - - env: TOXENV=py35-twisted_trunk-pyopenssl_trunk - - env: TOXENV=py36-twisted_trunk-pyopenssl_trunk - - env: TOXENV=py37-twisted_trunk-pyopenssl_trunk - - env: TOXENV=py38-twisted_trunk-pyopenssl_trunk - -before_install: - - pip install --upgrade pip - - pip install --upgrade setuptools - -install: - - pip install tox coveralls - -script: - - tox - -after_success: - - coveralls - -after_failure: - - | - if [[ -f "_trial_temp/httpbin-server-error.log" ]] - then - echo "httpbin-server-error.log:" - cat "_trial_temp/httpbin-server-error.log" - fi - -notifications: - email: false - -branches: - only: - - master - -# AUTO-GENERATED BY tox2travis.py -- DO NOT EDIT THIS FILE BY HAND! diff --git a/changelog.d/307.removal.rst b/changelog.d/307.removal.rst new file mode 100644 index 00000000..b82c7bfb --- /dev/null +++ b/changelog.d/307.removal.rst @@ -0,0 +1 @@ +The minimum supported Twisted version has increased to 18.7.0. Older versions are no longer tested in CI. diff --git a/setup.py b/setup.py index 473ed2fb..6d5e24de 100644 --- a/setup.py +++ b/setup.py @@ -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={ diff --git a/src/treq/test/local_httpbin/child.py b/src/treq/test/local_httpbin/child.py index 5b972b49..dcd1f797 100644 --- a/src/treq/test/local_httpbin/child.py +++ b/src/treq/test/local_httpbin/child.py @@ -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. @@ -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, diff --git a/tox.ini b/tox.ini index 942321d2..663a262c 100644 --- a/tox.ini +++ b/tox.ini @@ -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] @@ -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.