Skip to content

Releases: a-feld/pywreck

v0.5.2

27 Oct 03:30
Compare
Choose a tag to compare

What's Changed

  • Adds support for Python 3.11

Full Changelog: v0.5.1...v0.5.2

v0.5.1

12 Jul 03:11
Compare
Choose a tag to compare

Minor Update

Headers used to require a type of Optional[Dict[str, str]]. This has been changed to Optional[Mapping[str, str]] to support non-dict mapping types.

v0.5.0

04 Apr 01:02
Compare
Choose a tag to compare

Breaking Changes

Timeouts now encompass the entire request/response cycle

The timeout API has been simplified to:

  • A timeout argument that tracks the entire request/response cycle
  • A connection close timeout (if using the Connection API)

request/response API example

# The following call can take at most 1 second to complete
response = await pywreck.head("www.example.com", "/", timeout=1.0)

Connection API example

# Upon exiting the "async with" block, wait up to 1 second for the connection
# to close before forcing the connection to close
async with await pywreck.Connection.create(
    "www.example.com",
    close_timeout=1.0,
) as conn:
    # Retrieve the response with a 1 second timeout on the request
    response = await conn.request("HEAD", "/", timeout=1.0)

v0.4.1

26 Nov 19:54
Compare
Choose a tag to compare

Bug Fixes

Fixed an issue where chunked request bytes were not fully consumed. This bug caused errors when chunked requests were issued prior to other requests on a reused connection object.

Full Changelog: v0.4.0...v0.4.1

v0.4.0

26 Nov 15:18
Compare
Choose a tag to compare

Bug Fix

Prevent concurrent access to the underlying connection when a request is in progress.

Example:

connection = await pywreck.Connection.create("www.example.com")
coros = (connection.request("GET", "/foo"), connection.request("GET", "/bar"))
await asyncio.gather(*coros)

Note: this request cannot execute concurrently since the underlying connection can only be used for one HTTP/1 request at a time. The exclusive access to the underlying connection is now enforced.

To execute this request concurrently, 2 separate connections must be opened:

coros = (pywreck.request("GET", "www.example.com", "/foo"), pywreck.request("GET", "www.example.com", "/bar"))
await asyncio.gather(*coros)

Full Changelog: v0.3.0...v0.4.0

v0.3.0

13 Nov 17:22
Compare
Choose a tag to compare

Breaking Changes

Mark Response class as frozen. Assignment to attributes of Response after creation is now disallowed.

v0.2.2

13 Nov 16:58
Compare
Choose a tag to compare

Add a Connection class

Multiple requests can now be issued over a single connection. Example:

async with await pywreck.Connection.create("www.example.com") as conn:
    for _ in range(2):
        response = await conn.request("HEAD", "/")
        print(response)

v0.2.1

28 Oct 02:22
Compare
Choose a tag to compare

Support for Python 3.10

Added support and pypi classifiers for python 3.10

v0.2.0

08 Aug 04:12
Compare
Choose a tag to compare

Breaking Changes

Remove methods:

  • connect
  • options
  • trace
  • patch

Improvements

  • Improved type annotations for remaining shortcut methods (get, head, post, put, delete)

v0.1.7

05 Jul 23:49
Compare
Choose a tag to compare

The timeout argument is now respected for connection close.