Skip to content

Commit

Permalink
Switch to pyproject.toml and hatchling build backend (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThiefMaster authored Sep 2, 2024
1 parent e1d345e commit 34f914f
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 51 deletions.
8 changes: 4 additions & 4 deletions .github/utils/check_version.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import sys
from configparser import ConfigParser
import tomllib
from pathlib import Path

cp = ConfigParser()
cp.read('setup.cfg')
version = cp['metadata']['version']
data = tomllib.loads(Path('pyproject.toml').read_text())
version = data['project']['version']
tag_version = sys.argv[1]

if tag_version != version:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ jobs:
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand Down
28 changes: 28 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[project]
name = 'Flask-Multipass-CERN'
version = '2.2.10'
description = 'CERN-specific Flask-Multipass providers'
readme = 'README.md'
license = 'MIT'
authors = [{ name = 'Indico Team', email = 'indico-team@cern.ch' }]
requires-python = '~=3.9'
dependencies = ['flask-multipass[authlib]>=0.4.3', 'urllib3>=1.26.0']

[project.optional-dependencies]
dev = ['freezegun', 'httpretty', 'pytest', 'pytest-mock', 'ruff']

[project.urls]
GitHub = 'https://github.com/indico/flask-multipass-cern'

[project.entry-points.'flask_multipass.auth_providers']
cern = 'flask_multipass_cern:CERNAuthProvider'

[project.entry-points.'flask_multipass.identity_providers']
cern = 'flask_multipass_cern:CERNIdentityProvider'

[build-system]
requires = ['hatchling==1.25.0']
build-backend = 'hatchling.build'

[tool.hatch.build]
exclude = ['.github', '.python-version']
2 changes: 1 addition & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
target-version = 'py39'
target-version = 'py312'
line-length = 120

[lint]
Expand Down
33 changes: 0 additions & 33 deletions setup.cfg

This file was deleted.

10 changes: 0 additions & 10 deletions setup.py

This file was deleted.

0 comments on commit 34f914f

Please sign in to comment.