Skip to content

Commit

Permalink
Merge pull request #271 from mollie/prepare-for-release-v3.0.0rc1
Browse files Browse the repository at this point in the history
Prepare for release v3.0.0rc1 🥁
  • Loading branch information
Tom Hendrikx authored Nov 8, 2022
2 parents ee6b603 + 6974113 commit a93d6fe
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ To use the Mollie API client, the following things are required:
+ Mollie API client for Python has a dependency on [Requests](http://docs.python-requests.org/en/master/) and [Requests-OAuthlib](https://requests-oauthlib.readthedocs.io/en/latest/)

## Installation ##
**Please note:** If you are looking to install the v1 version of the Mollie API client, please refer to the [v1-develop branch](https://github.com/mollie/mollie-api-python/tree/v1-develop) for installation instructions.
**Please note:** If you want to install an older version of the Mollie API client (current major version is `v3`), then please refer to their respective github branches for installation instructions:
- version 2.x.x is available from the [v2-develop branch](https://github.com/mollie/mollie-api-python/tree/v2-develop).
- version 1.x.x is available from the [v1-develop branch](https://github.com/mollie/mollie-api-python/tree/v1-develop).

By far the easiest way to install the Mollie API client is to install it with [pip](https://pip.pypa.io). The command below will install the latest released version of the client.
```shell
Expand Down
4 changes: 2 additions & 2 deletions mollie/api/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

# Don't change the syntax of the definition unless you know what you're doing, because this file is
# processed by python imports and by regular expressions. The version is defined as a string in the
# regular semantic versioning scheme (major,minor,patch).
# regular semantic versioning scheme (major, minor, patch) as defined by PEP 440.

VERSION = "2.13.0"
VERSION = "3.0.0rc1"
13 changes: 11 additions & 2 deletions tests/test_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,17 @@ def test_client_will_propagate_retry_setting(response):
assert adapter.max_retries.connect == 3


def test_client_version_is_pep440_compatible(client):
# PEP 440 specifies how python package versioning needs to look: https://peps.python.org/pep-0440
# Below is the regular expression from PEP 440, Appendix B, for canonical versions.
regex = r"^([1-9][0-9]*!)?(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*((a|b|rc)(0|[1-9][0-9]*))?(\.post(0|[1-9][0-9]*))?(\.dev(0|[1-9][0-9]*))?$" # noqa: E501
assert re.match(regex, client.CLIENT_VERSION), "Client version does not match PEP 440 specification"


def test_client_default_user_agent(client, response):
"""Default user-agent should contain some known values."""
regex = re.compile(r"^Mollie/[\d\.]+ Python/[\w\.\+]+ OpenSSL/[\w\.]+$")
version = re.escape(client.CLIENT_VERSION)
regex = re.compile(rf"^Mollie/{version} Python/[\w\.\+]+ OpenSSL/[\w\.]+$")
assert re.match(regex, client.user_agent)

# perform a request and inpect the actual used headers
Expand All @@ -279,7 +287,8 @@ def test_client_default_user_agent(client, response):

def test_oauth_client_default_user_agent(oauth_client, response):
"""Default user-agent should contain some known values."""
regex = re.compile(r"^Mollie/[\d\.]+ Python/[\w\.\+]+ OpenSSL/[\w\.]+ OAuth/2.0$")
version = re.escape(oauth_client.CLIENT_VERSION)
regex = re.compile(rf"^Mollie/{version} Python/[\w\.\+]+ OpenSSL/[\w\.]+ OAuth/2\.0$")
assert re.match(regex, oauth_client.user_agent)

# perform a request and inpect the actual used headers
Expand Down

0 comments on commit a93d6fe

Please sign in to comment.