adrienverge / localstripe

A fake but stateful Stripe server that you can run locally, for testing purposes.
GNU General Public License v3.0
192 stars 59 forks source link

build: Migrate from setup.py to pyproject.toml #222

Closed adrienverge closed 9 months ago

adrienverge commented 9 months ago

docs: Remove specificity of commands pip3 and python3

Python 2 has been sunset since 2020 ^0, and localstripe never supported it.

This commit updates documentation to use python and pip instead of python3 and pip3.


Remove UTF-8 headers in Python files

The # -*- coding: utf-8 -*- headers are useful for Python 2, but aren't needed for Python 3 which is the only supported version. Let's drop these headers.


build: Migrate from setup.py to pyproject.toml

Using setup.py is deprecated and the new recommanded way is to declare a pyproject.toml file (see PEP 517 ^1).

This commit proposes to use setuptools to achieve that, because setuptools is already used by localstripe, is standard and referenced by the official Python packaging documentation ^2, and seems to be the most lightweight solution.

For some period, the setup.py file will be kept (although almost empty), to allow old tools versions to keep working.

I have done the same migration for yamllint 7 months ago ^3 and it appeared to work well.