Skip to content

Commit c214614

Browse files
max-moserSamk13
andcommitted
chore(setup): migrate from setuptools to hatchling
* remove MANIFEST.in because that's only relevant for setuptools * translate the i18n/translation mechanisms as well * format pyproject.toml with Tombi Co-authored-by: Sam Arbid <samaa2@kth.se>
1 parent 36c92c5 commit c214614

9 files changed

Lines changed: 118 additions & 143 deletions

File tree

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ indent_size = 2
2525
# Dockerfile
2626
[Dockerfile]
2727
indent_size = 4
28+
29+
# Align TOML indenting with Tombi
30+
[*.toml]
31+
indent_size = 2

.github/workflows/i18n-push.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ jobs:
1313
uses: inveniosoftware/invenio-i18n/.github/workflows/i18n-push-base.yml@master
1414
with:
1515
extract-backend: true
16+
backend-package-path: invenio_saml
1617
secrets: inherit

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@ target/
6060

6161
# Vim swapfiles
6262
.*.sw?
63+
uv.lock

MANIFEST.in

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

babel.ini

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

pyproject.toml

Lines changed: 112 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,114 @@
1+
# SPDX-FileCopyrightText: 2019-2021 CERN.
2+
# SPDX-FileCopyrightText: 2019-2024 Esteban J. Garcia Gabancho.
3+
# SPDX-FileCopyrightText: 2019 Esteban J. Garcia Gabancho.
4+
# SPDX-FileCopyrightText: 2021 Graz University of Technology.
5+
# SPDX-FileCopyrightText: 2022-2026 Graz University of Technology.
6+
# SPDX-FileCopyrightText: 2026 TU Wien.
7+
# SPDX-License-Identifier: MIT
8+
9+
[project]
10+
name = "invenio-saml"
11+
description = "Invenio module that provides SAML integration."
12+
readme = "README.rst"
13+
requires-python = ">=3.9"
14+
license = "MIT"
15+
authors = [
16+
{ name = "Esteban J. Garcia Gabancho", email = "info@inveniosoftware.org" },
17+
]
18+
keywords = [
19+
"SAML",
20+
"SSO",
21+
"invenio",
22+
]
23+
classifiers = [
24+
"Development Status :: 5 - Production/Stable",
25+
]
26+
dependencies = [
27+
"invenio-accounts>=9.0.0,<10.0.0",
28+
"python3-saml>=1.5.0",
29+
"uritools>=2.2.0",
30+
]
31+
dynamic = ["version"]
32+
33+
[project.urls]
34+
Homepage = "https://github.com/inveniosoftware/invenio-saml"
35+
36+
[project.entry-points."invenio_base.api_apps"]
37+
invenio_saml = "invenio_saml:InvenioSSOSAML"
38+
39+
[project.entry-points."invenio_base.apps"]
40+
invenio_saml = "invenio_saml:InvenioSSOSAML"
41+
42+
[project.entry-points."invenio_i18n.translations"]
43+
invenio_saml = "invenio_saml"
44+
45+
[project.optional-dependencies]
46+
tests = [
47+
"invenio-app>=3.0.0,<4.0.0",
48+
"invenio-db[mysql,postgresql,versioning]>=2.2.0,<3.0.0",
49+
"invenio-mail>=1.0.0,<3.0.0",
50+
"invenio-oauthclient>=9.0.0,<10.0.0",
51+
"invenio-userprofiles>=7.0.0,<8.0.0",
52+
"mock>=2.0.0",
53+
"pytest-black>=0.6.0",
54+
"pytest-freezegun>=0.2.0",
55+
"pytest-invenio>=4.0.0,<5.0.0",
56+
"redis>=2.10.5",
57+
"Sphinx>=4.5.0",
58+
]
59+
160
[build-system]
2-
requires = ["setuptools", "wheel", "babel>2.8"]
3-
build-backend = "setuptools.build_meta"
61+
requires = ["hatchling"]
62+
build-backend = "hatchling.build"
63+
64+
# see https://babel.pocoo.org/en/latest/messages.html#toml-configuration-format
65+
[tool.babel]
66+
[tool.babel.compile_catalog]
67+
directory = "invenio_saml/translations/"
68+
use_fuzzy = true
69+
70+
[tool.babel.extract_messages]
71+
copyright_holder = "CERN"
72+
msgid_bugs_address = "info@inveniosoftware.org"
73+
mapping_file = "pyproject.toml"
74+
output_file = "invenio_saml/translations/messages.pot"
75+
add_comments = "NOTE"
76+
77+
[tool.babel.init_catalog]
78+
input_file = "invenio_saml/translations/messages.pot"
79+
output_dir = "invenio_saml/translations/"
80+
81+
[[tool.babel.mappings]]
82+
method = "javascript"
83+
pattern = "**.js"
84+
encoding = "utf-8"
85+
extract_messages = "$._, jQuery._"
86+
87+
[[tool.babel.mappings]]
88+
method = "python"
89+
pattern = "**.py"
90+
encoding = "utf-8"
91+
92+
[[tool.babel.mappings]]
93+
method = "jinja2"
94+
pattern = "**/templates/**.html"
95+
encoding = "utf-8"
96+
97+
[tool.hatch.version]
98+
path = "invenio_saml/__init__.py"
99+
100+
[tool.hatch.build.targets.sdist]
101+
include = [
102+
"/invenio_saml",
103+
]
104+
105+
[tool.isort]
106+
profile = "black"
107+
108+
[tool.pydocstyle]
109+
add_ignore = "D401"
4110

111+
[tool.pytest.ini_options]
112+
addopts = '--black --isort --pydocstyle --doctest-glob="*.rst" --doctest-modules --cov=invenio_saml --cov-report=term-missing'
113+
testpaths = "tests invenio_saml"
114+
live_server_scope = "module"

run-tests.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ function cleanup() {
1515
trap cleanup EXIT
1616

1717

18-
python -m check_manifest
1918
python -m sphinx.cmd.build -qnNW docs docs/_build/html
2019
eval "$(docker-services-cli up --db ${DB:-postgresql} --cache ${CACHE:-redis} --env)"
2120
python -m pytest

setup.cfg

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

setup.py

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

0 commit comments

Comments
 (0)