chore: migrate from setup.cfg to pyproject.toml

This commit is contained in:
Éloi Rivard 2023-10-08 00:04:45 +02:00
parent e360ee7dfb
commit ab73308ed8
No known key found for this signature in database
GPG key ID: 7EDA204EA57DD184
7 changed files with 95 additions and 92 deletions

View file

@ -74,9 +74,9 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: '**/setup.cfg'
cache-dependency-path: '**/pyproject.toml'
- name: Change dependencies to minimal supported versions
run: sed -i -e 's/>=/==/g; s/~=.*==\(.*\)/==\1/g; s/~=/==/g;' setup.cfg
run: sed -i -e 's/>=/==/g; s/~=.*==\(.*\)/==\1/g; s/~=/==/g;' pyproject.toml
if: matrix.dependencies == 'minimal'
- name: Install dependencies
run: |

View file

@ -11,7 +11,7 @@ MAGICK_MOGRIFY := mogrify
.PHONY: all
all: install ## Alias for install
.PHONY: install
install: virtualenv setup.cfg $(INSTALL_STAMP) ## Install dependencies
install: virtualenv pyproject.toml $(INSTALL_STAMP) ## Install dependencies
$(INSTALL_STAMP):
$(VENV)/bin/pip install -U pip
$(VENV)/bin/pip install -e .
@ -23,7 +23,7 @@ $(PYTHON):
$(VIRTUALENV) $(VENV)
.PHONY: install-dev
install-dev: virtualenv setup.cfg $(INSTALL_STAMP) $(DEV_STAMP) ## Install development dependencies
install-dev: virtualenv pyproject.toml $(INSTALL_STAMP) $(DEV_STAMP) ## Install development dependencies
$(DEV_STAMP): $(PYTHON)
$(VENV)/bin/pip install -Ue .[dev]
touch $(DEV_STAMP)

View file

@ -281,7 +281,7 @@ Index](https://pypi.org) (PyPI) and publish a tag in the git repository.
::: {note}
The above command will prompt for version number, handle
`CHANGELOG.md` and `setup.cfg` updates, package creation,
`CHANGELOG.md` and `pyproject.toml` updates, package creation,
pypi upload. It will prompt you before each step to get your consent.
:::

View file

@ -32,14 +32,14 @@ def runserver(ctx):
ctx.forward(run)
@click.command(name="generate_password_hash")
@cli.command(name="generate_password_hash")
def password_hash():
"""Get password from user and hash it without printing it in clear text."""
password = getpass.getpass(prompt="Password: ")
print(generate_password_hash(password))
@click.command()
@cli.command()
@click.argument(
"config_file",
type=click.Choice(

88
pyproject.toml Normal file
View file

@ -0,0 +1,88 @@
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "ihatemoney"
version = "6.1.2.dev0"
description = "A simple shared budget manager web application."
readme = "README.md"
license = {file = "LICENSE"}
authors = [
{"name" = "Alexis Métaireau & contributors", email = "alexis@notmyidea.org"},
]
keywords = ["web", "budget"]
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
]
dependencies = [
"blinker>=1.4,<2",
"cachetools>=4.1,<5",
"debts>=0.5,<1",
"email_validator>=1.0,<3",
"Flask-Babel>=1.0,<4",
"Flask-Cors>=3.0.8,<4",
"Flask-Limiter>=2.6,<3",
"Flask-Mail>=0.9.1,<1",
"Flask-Migrate>=2.5.3,<5", # Not following semantic versioning (e.g. https://github.com/miguelgrinberg/flask-migrate/commit/1af28ba273de6c88544623b8dc02dd539340294b)
"Flask-RESTful>=0.3.9,<1",
"Flask-SQLAlchemy>=2.4,<3",
"Flask-Talisman>=0.8,<2",
"Flask-WTF>=0.14.3,<2",
"WTForms>=2.3.1,<3.1",
"Flask>=2,<2.3",
"Werkzeug>=2,<2.3",
"itsdangerous>=2,<3",
"Jinja2>=3,<4",
"qrcode>=7.1,<8",
"requests>=2.25,<3",
"SQLAlchemy-Continuum>=1.3.12,<2",
"SQLAlchemy>=1.3.0,<1.5", # New 1.4 changes API, see #728
"python-dateutil",
]
[project.optional-dependencies]
database = [
# Python 3.11 support starts in 2.9.2
"psycopg2-binary>=2.9.2,<3",
"PyMySQL>=0.9,<1.1",
]
dev = [
"black==23.3.0",
"flake8==5.0.4",
"isort==5.11.5",
"vermin==1.5.2",
"pytest>=6.2.5",
"pytest-flask>=1.2.0",
"pytest-libfaketime>=0.1.2",
"tox>=3.14.6",
"zest.releaser>=6.20.1",
]
doc = [
"Sphinx>=7.0.1,<8",
"docutils==0.20.1",
"myst-parser>=2,<3",
]
[project.urls]
"Source Code" = "https://github.com/spiral-project/ihatemoney"
"Main instance" = "https://ihatemoney.org/"
"Mobile app" = "https://ihatemoney.org/mobile"
"Documentation" = "https://ihatemoney.readthedocs.io/en/latest/"
[project.scripts]
ihatemoney = "ihatemoney.manage:cli"
[tool.setuptools]
packages = ["ihatemoney"]

View file

@ -1,82 +0,0 @@
[metadata]
name = ihatemoney
version = 6.1.2.dev0
url = https://github.com/spiral-project/ihatemoney
description = A simple shared budget manager web application.
long_description = file: README.rst, CHANGELOG.rst
author = Alexis Métaireau & contributors
author_email= alexis@notmyidea.org
keywords = web, budget
license = Custom BSD Beerware
classifiers =
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Internet :: WWW/HTTP
Topic :: Internet :: WWW/HTTP :: WSGI :: Application
[options]
packages = find:
include_package_data = True
zip_safe = False
install_requires =
blinker>=1.4,<2
cachetools>=4.1,<5
debts>=0.5,<1
email_validator>=1.0,<3
Flask-Babel>=1.0,<4
Flask-Cors>=3.0.8,<4
Flask-Limiter>=2.6,<3
Flask-Mail>=0.9.1,<1
Flask-Migrate>=2.5.3,<5 # Not following semantic versioning (e.g. https://github.com/miguelgrinberg/flask-migrate/commit/1af28ba273de6c88544623b8dc02dd539340294b)
Flask-RESTful>=0.3.9,<1
Flask-SQLAlchemy>=2.4,<3
Flask-Talisman>=0.8,<2
Flask-WTF>=0.14.3,<2
WTForms>=2.3.1,<3.1
Flask>=2,<2.3
Werkzeug>=2,<2.3
itsdangerous>=2,<3
Jinja2>=3,<4
qrcode>=7.1,<8
requests>=2.25,<3
SQLAlchemy-Continuum>=1.3.12,<2
SQLAlchemy>=1.3.0,<1.5 # New 1.4 changes API, see #728
python-dateutil
[options.extras_require]
database =
# Python 3.11 support starts in 2.9.2
psycopg2-binary>=2.9.2,<3
PyMySQL>=0.9,<1.1
dev =
black==23.3.0
flake8==5.0.4
isort==5.11.5
vermin==1.5.2
pytest>=6.2.5
pytest-flask>=1.2.0
pytest-libfaketime>=0.1.2
tox>=3.14.6
zest.releaser>=6.20.1
doc =
Sphinx>=7.0.1,<8
docutils==0.20.1
myst-parser>=2,<3
[options.entry_points]
flask.commands =
generate_password_hash = ihatemoney.manage:password_hash
generate-config = ihatemoney.manage:generate_config
console_scripts =
ihatemoney = ihatemoney.manage:cli
paste.app_factory =
main = ihatemoney.run:main

View file

@ -1,3 +0,0 @@
from setuptools import setup
setup()