Uplink Versions Save

A Declarative HTTP Client for Python

v0.9.7

2 years ago

Fixed

  • Fix behavior of async @response_handler with AiohttpClient. (#256)

v0.9.6

2 years ago

Added

  • Add a new base class, uplink.retry.RetryBackoff, which can be extended to implement custom backoff strategies. An instance of a RetryBackoff subclass can be provided through the backoff argument of the @retry decorator. (#238)

Changed

  • Bump minimum version of six to 1.13.0. (#246)

Fixed

  • Fix @returns.json to cast JSON response (or field referenced by the key argument) using the type argument when the given type is callable. This restores behavior that was inadvertently changed in v0.9.3. (#215)
  • Remove all usages of asyncio.coroutine in the library code to fix warnings related to the function's deprecation in Python 3.8+. (#203)

v0.9.5

2 years ago

Added

  • Add Python 3.8, 3.9, and 3.10 as officially supported. (#237)

Fixed

  • Fix FieldMap and PartMap from raising NoneType error. (#221)
  • Fix Python 2.7 support. (#217)

Deprecated

  • Python 2.7 support will be removed in v0.10.0.

v0.9.4

3 years ago

Fixed

  • A type set as a consumer method's return annotation should not be used to deserialize a response object if no registered converters can handle the type. (3653a672ee)

v0.9.3

3 years ago

Added

  • Support for serialization using a subclass of pydantic_'s BaseModel that contains fields of a complex type, such as datetime.
  • Support for passing a subclass of pydantic's BaseModel as the request body.

v0.9.2

3 years ago

Added

  • Support for (de)serializing subclasses of pydantic's BaseModel (#200 by @gmcrocetti)

Fixed

  • Using the @get, @post, @patch, etc. decorators should retain the docstring of the wrapped method (#198)
  • The Body and Part argument annotations should support uploading binary data (#180, #183, #204)

v0.9.1

4 years ago

Fixed

  • Omit Header argument from request when its value is None. (#167, #169)
  • Fix AttributeError raised on usage of uplink.Url. (#164, #165 by @cognifloyd)

Changed

  • Exclude tests subpackages from wheel. (#188 by @daa)

v0.9.0

4 years ago

Added

  • Create consumer method templates to reduce boilerplate in request definitions. (#151, #159)
  • Context argument annotation to pass request-specific information to middleware. (#143, #155)
  • Session.context property to pass session-specific information to middleware. (#143, #155)
  • Built-in authentication support for API tokens in the querystring and header, Bearer tokens, and multi-auth. (#137)

Fixed

  • Schema defined using @returns.* decorators should override the consumer method's return annotation. (#144, #154)
  • @returns.* decorators should propagate to all consumer method when used as a class decorator. (#145, #154)
  • Decorating a Consumer subclass no longer affects other subclasses. (#152)

Changed

  • Renamed uplink.retry.stop.DISABLE to uplink.retry.stop.NEVER

v0.8.0

5 years ago

Added

  • A retry decorator to enable reattempts of failed requests. (#132)
  • A ratelimit decorator to constrain consumers to making some maximum number of calls within a given time period. (#132)
  • Timeout argument annotation to be able to pass the timeout as a consumer method argument or to inject it as a transaction hook using a Consumer instance's _inject method. (#133 by @daa)

Changed

  • Consumer subclasses now inherit class decorators from their Consumer parents, so those decorators are also applied to the subclasses' methods that are decorated with @get, @post, @patch, etc. (#138 by @daa)

Fixed

  • Memory leaks in RequestsClient and AiohttpClient caused by use of atexit.register, which was holding references to session objects and preventing the garbage collector from freeing memory reserved for those objects. (#134 by @SakornW)

v0.7.0

5 years ago

Added

  • Consumer.exceptions property for handling common client exceptions in a client-agnostic way. (#117)
  • Optional argument requires_consumer for response_handler and error_handler; when set to True, the registered callback should accept a reference to a Consumer instance as its leading argument. (#118)

Changed

  • For a Query-annotated argument, a None value indicates that the query parameter should be excluded from the request. Previous behavior was to encode the parameter as ...?name=None. To retain this behavior, specify the new encode_none parameter (i.e., Query(..., encode_none="None")). (#126 by @nphilipp)

Fixed

  • Support for changes to Schema().load and Schema().dump in marshmallow v3. (#109)