Skip to content

Commit

Permalink
Merge branch 'master' into parallel-coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
glyph committed Dec 28, 2021
2 parents 6a0454e + 7d6e9b7 commit a2e0b92
Show file tree
Hide file tree
Showing 46 changed files with 1,682 additions and 769 deletions.
118 changes: 118 additions & 0 deletions .github/workflows/ci.yaml
@@ -0,0 +1,118 @@
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: ["3.6", "3.7", "3.8", "3.9", "pypy-3.7"]
twisted-version: ["lowest", "latest"]
experimental: [false]

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

- python-version: "3.9"
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 = {
"3.6": "py36",
"3.7": "py37",
"3.8": "py38",
"3.9": "py39",
"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
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -13,4 +13,3 @@ coverage
htmlcov
_trial_temp*
.tox
_trial_temp.lock
20 changes: 16 additions & 4 deletions .readthedocs.yml
@@ -1,5 +1,17 @@
# https://docs.readthedocs.io/en/stable/config-file/v2.html
version: 2

sphinx:
fail_on_warning: false

formats:
- pdf
- epub

python:
version: 2.7
pip_install: true
extra_requirements:
- dev
version: 3.8
install:
- method: pip
path: .
extra_requirements:
- docs
79 changes: 0 additions & 79 deletions .travis.yml

This file was deleted.

82 changes: 82 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -8,6 +8,88 @@ Changelog

.. towncrier release notes start
21.5.0 (2021-05-24)
===================

Features
--------

- PEP 517/518 ``build-system`` metadata is now provided in ``pyproject.toml``. (`#329 <https://github.com/twisted/treq/issues/329>`__)


Bugfixes
--------

- ``treq.testing.StubTreq`` now persists ``twisted.web.server.Session`` instances between requests. (`#327 <https://github.com/twisted/treq/issues/327>`__)


Improved Documentation
----------------------

- The dependency on Sphinx required to build the documentation has been moved from the ``dev`` extra to the new ``docs`` extra. (`#296 <https://github.com/twisted/treq/issues/296>`__)


Deprecations and Removals
-------------------------

- Support for Python 2.7 and 3.5 has been dropped. treq no longer depends on ``six`` or ``mock``. (`#318 <https://github.com/twisted/treq/issues/318>`__)


21.1.0 (2021-01-14)
===================

Features
--------

- Support for Python 3.9: treq is now tested with CPython 3.9. (`#305 <https://github.com/twisted/treq/issues/305>`__)
- The *auth* parameter now accepts arbitrary text and `bytes` for usernames and passwords. Text is encoded as UTF-8, per :rfc:`7617`. Previously only ASCII was allowed. (`#268 <https://github.com/twisted/treq/issues/268>`__)
- treq produces a more helpful exception when passed a tuple of the wrong size in the *files* parameter. (`#299 <https://github.com/twisted/treq/issues/299>`__)


Bugfixes
--------

- The *params* argument once more accepts non-ASCII ``bytes``, fixing a regression first introduced in treq 20.4.1. (`#303 <https://github.com/twisted/treq/issues/303>`__)
- treq request APIs no longer mutates a :class:`http_headers.Headers <twisted.web.http_headers.Headers>` passed as the *headers* parameter when the *auth* parameter is also passed. (`#314 <https://github.com/twisted/treq/issues/314>`__)
- The agent returned by :func:`treq.auth.add_auth()` and :func:`treq.auth.add_basic_auth()` is now marked to provide :class:`twisted.web.iweb.IAgent`. (`#312 <https://github.com/twisted/treq/issues/312>`__)
- treq's package metadata has been updated to require ``six >= 1.13``, noting a dependency introduced in treq 20.9.0. (`#295 <https://github.com/twisted/treq/issues/295>`__)


Improved Documentation
----------------------

- The documentation of the *params* argument has been updated to more accurately describe its type-coercion behavior. (`#281 <https://github.com/twisted/treq/issues/281>`__)
- The :mod:`treq.auth` module has been documented. (`#313 <https://github.com/twisted/treq/issues/313>`__)


Deprecations and Removals
-------------------------

- Support for Python 2.7, which has reached end of support, is deprecated. This is the last release with support for Python 2.7. (`#309 <https://github.com/twisted/treq/issues/309>`__)
- Support for Python 3.5, which has reached end of support, is deprecated. This is the last release with support for Python 3.5. (`#306 <https://github.com/twisted/treq/issues/306>`__)
- Deprecate tolerance of non-string values when passing headers as a dict. They have historically been silently dropped, but will raise TypeError in the next treq release. Also deprecate passing headers other than :class:`dict`, :class:`~twisted.web.http_headers.Headers`, or ``None``. Historically falsy values like ``[]`` or ``()`` were accepted. (`#294 <https://github.com/twisted/treq/issues/294>`__)
- treq request functions and methods like :func:`treq.get()` and :meth:`HTTPClient.post()` now issue a ``DeprecationWarning`` when passed unknown keyword arguments, rather than ignoring them.
Mixing the *json* argument with *files* or *data* is also deprecated.
These warnings will change to a ``TypeError`` in the next treq release. (`#297 <https://github.com/twisted/treq/issues/297>`__)
- The minimum supported Twisted version has increased to 18.7.0. Older versions are no longer tested in CI. (`#307 <https://github.com/twisted/treq/issues/307>`__)


20.9.0 (2020-09-27)
===================

Features
--------

- The *url* parameter of :meth:`HTTPClient.request()` (and shortcuts like :meth:`~HTTPClient.get()`) now accept :class:`hyperlink.DecodedURL` and :class:`hyperlink.URL` in addition to :class:`str` and :class:`bytes`. (`#212 <https://github.com/twisted/treq/issues/212>`__)
- Compatibility with the upcoming Twisted 20.9.0 release (`#290 <https://github.com/twisted/treq/issues/290>`__).


Improved Documentation
----------------------

- An example of sending and receiving JSON has been added. (`#278 <https://github.com/twisted/treq/issues/278>`__)


20.4.1 (2020-04-16)
===================

Expand Down
24 changes: 10 additions & 14 deletions CONTRIBUTING.rst
@@ -1,28 +1,24 @@
Developing
==========

Install dependencies:
This project uses `Tox <https://tox.readthedocs.io/en/latest/config.html>`_ to manage virtual environments.

::
To run the tests::

pip install treq[dev]
tox -e py38-twisted_latest

Run Tests (unit & integration):
Lint::

::

trial treq

Lint:

::

pep8 treq
pyflakes treq
tox -e flake8

Build docs::

tox -e docs
firefox docs/html/index.html

To do it all::

tox -p

Release notes
-------------
Expand Down
3 changes: 1 addition & 2 deletions MANIFEST.in
Expand Up @@ -7,8 +7,7 @@ prune docs/_build
prune docs/html

exclude tox.ini
exclude tox2travis.py
exclude .travis.yml
exclude .github
exclude .readthedocs.yml

# This directory will be empty at release time.
Expand Down

0 comments on commit a2e0b92

Please sign in to comment.