Skip to content

Commit 5698a09

Browse files
Merge pull request #383 from mollie/improve-developer-setup
Replace Makefile with tox
2 parents 77616ab + 6cfc5f0 commit 5698a09

File tree

5 files changed

+80
-77
lines changed

5 files changed

+80
-77
lines changed

DEVELOPMENT.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Development
2+
3+
## Running tests locally
4+
5+
To run tests locally, install [tox](https://tox.wiki/) using [uv](https://docs.astral.sh/uv/)
6+
with [tox-uv](https://github.com/tox-dev/tox-uv):
7+
8+
```bash
9+
uv tool install tox --with tox-uv
10+
```
11+
12+
Install Python versions:
13+
14+
```bash
15+
uv python install 3.8 3.9 3.10 3.11 3.12
16+
```
17+
18+
To run tests for all Python versions:
19+
20+
```shell
21+
tox
22+
```
23+
24+
TODO: Deduplicate Python version list in [tests.yaml](.github/workflows/tests.yaml)

Makefile

Lines changed: 0 additions & 59 deletions
This file was deleted.

README.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Accepting [iDEAL](https://www.mollie.com/en/payments/ideal/), [Bancontact/Mister
1010
[![PyPI version](https://badge.fury.io/py/mollie-api-python.svg)](http://badge.fury.io/py/mollie-api-python)
1111
![Tests](https://github.com/mollie/mollie-api-python/actions/workflows/tests.yaml/badge.svg)
1212

13-
## Requirements ##
13+
## Requirements
1414
To use the Mollie API client, the following things are required:
1515

1616
+ Get yourself a free [Mollie account](https://my.mollie.com/dashboard/signup). No sign up costs.
@@ -21,10 +21,10 @@ To use the Mollie API client, the following things are required:
2121
+ Up-to-date OpenSSL (or other SSL/TLS toolkit)
2222
+ 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/)
2323

24-
## Migration to v3 ##
24+
## Migration to v3
2525
If your application uses a recent v2 version of the Mollie API client and you're ready to migrate to v3, [read all about the API changes](https://github.com/mollie/mollie-api-python/blob/master/v3-api-changes.md) that we made. Use the docs to quickly find how to update your integration code and use the v3 client correctly.
2626

27-
## Installation ##
27+
## Installation
2828
**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:
2929
- version 2.x.x is available from the [v2-develop branch](https://github.com/mollie/mollie-api-python/tree/v2-develop).
3030
- version 1.x.x is available from the [v1-develop branch](https://github.com/mollie/mollie-api-python/tree/v1-develop).
@@ -63,7 +63,7 @@ export MOLLIE_PUBLIC_URL=https://some.ngrok.url.io
6363
$ python examples/app.py
6464
```
6565

66-
## How to receive payments ##
66+
## How to receive payments
6767

6868
To successfully receive a payment, these steps should be implemented:
6969

@@ -75,7 +75,7 @@ To successfully receive a payment, these steps should be implemented:
7575

7676
Find our full documentation online on [docs.mollie.com](https://docs.mollie.com).
7777

78-
## Getting started ##
78+
## Getting started
7979

8080
Importing the Mollie API Client
8181
```python
@@ -109,7 +109,7 @@ For a payment create example, see [Example 1 - New Payment](https://github.com/m
109109

110110
In general, request body parameters for an API endpoint should be added to a dictionary and provided as the first argument (or `data` keyword argument). Query string parameters can be provided as keyword arguments.
111111

112-
## Retrieving payments ##
112+
## Retrieving payments
113113
We can use the `payment.id` to retrieve a payment and check if the payment `isPaid`.
114114

115115
```python
@@ -127,13 +127,13 @@ payments = mollie_client.payments.list()
127127

128128
For an extensive example of listing payments with the details and status, see [Example 5 - Payments History](https://github.com/mollie/mollie-api-python/blob/master/examples/05-payments-history.py).
129129

130-
## Payment webhook ##
130+
## Payment webhook
131131

132132
When the status of a payment changes the `webhookUrl` we specified in the creation of the payment will be called.
133133
There we can use the `id` from our POST parameters to check te status and act upon that, see [Example 2 - Webhook verification](https://github.com/mollie/mollie-api-python/blob/master/examples/02-webhook-verification.py).
134134

135135

136-
## Multicurrency ##
136+
## Multicurrency
137137
Since the 2.0 version of the API (supported by version 2.0.0 of the client) non-EUR payments for your customers is now supported.
138138
A full list of available currencies can be found [in our documentation](https://docs.mollie.com/guides/multicurrency).
139139

@@ -150,7 +150,7 @@ payment = mollie_client.payments.create({
150150
```
151151
_After the customer completes the payment, the `payment.settlement_amount` will contain the amount + currency that will be settled on your account._
152152

153-
### Fully integrated iDEAL payments ###
153+
### Fully integrated iDEAL payments
154154

155155
If you want to fully integrate iDEAL payments in your web site, some additional steps are required.
156156
First, you need to retrieve the list of issuers (banks) that support iDEAL and have your customer pick the issuer
@@ -180,7 +180,7 @@ payment = mollie_client.payments.create({
180180
```
181181
The `payment.checkout_url` is a URL that points directly to the online banking environment of the selected issuer.
182182

183-
### Refunding payments ###
183+
### Refunding payments
184184

185185
The API also supports refunding payments. Note that there is no confirmation and that all refunds are immediate and
186186
definitive. Refunds are only supported for iDEAL, credit card, Bancontact, SOFORT Banking, PayPal, Belfius Direct Net, KBC/CBC,
@@ -200,7 +200,7 @@ refund = payment.refunds.create({
200200

201201
For a working example, see [Example 11 - Refund payment](https://github.com/mollie/mollie-api-python/blob/master/examples/11-refund-payment.py).
202202

203-
## OAuth2 ##
203+
## OAuth2
204204

205205
At https://docs.mollie.com/oauth/getting-started the OAuth process is explained. Please read this first.
206206

@@ -232,7 +232,7 @@ The merchant can then grant the authorization to your client application for the
232232
Mollie will then redirect the merchant back to the Redirect URI you have specified. The URI will contain some query parameters, which contains the auth token. At the page listening at the Redirect URI, you should extract that token, and use it to request a regular OAuth token.
233233

234234

235-
### Initializing via OAuth2 ###
235+
### Initializing via OAuth2
236236

237237
You should implement the `get_token` and `set_token` methods yourself. They should retrieve and store the OAuth token that is sent from Mollie somewhere in your application (f.i. in the database).
238238

@@ -283,16 +283,22 @@ mollie_client.setup_oauth_authorization_response(authorization_response)
283283
mollie_client.organizations.get('me')
284284
```
285285

286-
## API documentation ##
286+
## API documentation
287287
If you wish to learn more about our API, please visit the [Mollie Developer Portal](https://www.mollie.com/en/developers). API Documentation is available in English.
288288

289-
## Want to help us make our API client even better? ##
289+
## Want to help us make our API client even better?
290290

291-
Want to help us make our API client even better? We take [pull requests](https://github.com/mollie/mollie-api-python/pulls?utf8=%E2%9C%93&q=is%3Apr), sure. But how would you like to contribute to a technology oriented organization? Mollie is hiring developers and system engineers. [Check out our vacancies](https://jobs.mollie.com/) or [get in touch](mailto:[email protected]).
291+
Want to help us make our API client even better?
292+
We take [pull requests](https://github.com/mollie/mollie-api-python/pulls?utf8=%E2%9C%93&q=is%3Apr), sure.
293+
Check out [DEVELOPMENT.md](./DEVELOPMENT.md).
292294

293-
## License ##
295+
But how would you like to contribute to a technology oriented organization?
296+
Mollie is hiring developers and system engineers.
297+
[Check out our vacancies](https://jobs.mollie.com/) or [get in touch](mailto:[email protected]).
298+
299+
## License
294300
[BSD (Berkeley Software Distribution) License](https://opensource.org/licenses/bsd-license.php).
295301
Copyright (c) 2014-2022, Mollie B.V.
296302

297-
## Support ##
303+
## Support
298304
Contact: [www.mollie.com](https://www.mollie.com)[email protected] — +31 20 820 20 70

pyproject.toml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,35 @@ exclude_lines = [
2222
"pragma: no cover",
2323
"if TYPE_CHECKING:",
2424
]
25+
26+
[tool.tox]
27+
requires = ["tox>=4.19"]
28+
env_list = ["flake8", "3.12", "3.11", "3.10", "3.9", "3.8", "type"]
29+
30+
[tool.tox.env_run_base]
31+
description = "Run tests under {base_python}"
32+
deps = [
33+
"pytest",
34+
"pytest-cov",
35+
"pytest-mock",
36+
"mock",
37+
"responses",
38+
]
39+
commands = [["pytest"]]
40+
41+
[tool.tox.env.type]
42+
description = "Run type check"
43+
deps = [
44+
"mypy",
45+
"types-requests",
46+
]
47+
commands = [["mypy", "--config", "mypy.ini", "mollie"]]
48+
49+
[tool.tox.env.flake8]
50+
description = "Run codestyle check"
51+
deps = [
52+
"flake8",
53+
"flake8-isort",
54+
"flake8-black",
55+
]
56+
commands = [["flake8", "mollie"]]

release_process.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Release Process ##
1+
## Release Process
22
To create a release there are a few steps you should follow:
33
- We use [Semantic Versioning](https://semver.org/). If you're going to release a breaking change or a major new feature, do a minor version bump (x.y.z => x.y+1.z). Otherwise, do a patch version bump (x.y.z => x.y.z+1).
44
- If you decide to do a minor version change, handle deprecations. See (Pending)DeprecationWarning subclasses in `error.py`.

0 commit comments

Comments
 (0)