Skip to content

Commit 478c506

Browse files
max-moserSamk13
andcommitted
chore(setup): migrate from setuptools to hatchling
* remove MANIFEST.in because that's only relevant for setuptools * declare conflicting extras for uv * format pyproject.toml with Tombi Co-authored-by: Sam Arbid <samaa2@kth.se>
1 parent 0d2bf04 commit 478c506

7 files changed

Lines changed: 115 additions & 118 deletions

File tree

.editorconfig

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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,4 @@ docs/_build/
5757

5858
# PyBuilder
5959
target/
60+
uv.lock

MANIFEST.in

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

pyproject.toml

Lines changed: 110 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,112 @@
1+
# SPDX-FileCopyrightText: 2016-2019 CERN.
2+
# SPDX-FileCopyrightText: 2022-2026 Graz University of Technology.
3+
# SPDX-FileCopyrightText: 2022 Graz University of Technology.
4+
# SPDX-FileCopyrightText: 2026 TU Wien.
5+
# SPDX-License-Identifier: MIT
6+
7+
[project]
8+
name = "invenio-records-files"
9+
description = "Invenio modules that integrates records and files."
10+
readme = "README.rst"
11+
requires-python = ">=3.9"
12+
license = "MIT"
13+
authors = [
14+
{ name = "CERN", email = "info@inveniosoftware.org" },
15+
]
16+
keywords = [
17+
"files",
18+
"invenio",
19+
"records",
20+
]
21+
classifiers = [
22+
"Development Status :: 5 - Production/Stable",
23+
]
24+
dependencies = [
25+
"invenio-base>=1.2.2,<3.0.0",
26+
"invenio-files-rest>=6.0.0,<7.0.0",
27+
"invenio-records>=6.0.0,<7.0.0",
28+
"invenio-records-rest>=6.0.0,<7.0.0",
29+
]
30+
dynamic = ["version"]
31+
32+
[project.urls]
33+
Homepage = "https://github.com/inveniosoftware/invenio-records-files"
34+
35+
[project.entry-points."invenio_base.api_apps"]
36+
invenio_records_files = "invenio_records_files:InvenioRecordsFiles"
37+
38+
[project.entry-points."invenio_base.api_blueprints"]
39+
invenio_records_files = "invenio_records_files.views:create_blueprint_from_app"
40+
41+
[project.entry-points."invenio_base.apps"]
42+
invenio_records_files = "invenio_records_files:InvenioRecordsFiles"
43+
44+
[project.entry-points."invenio_db.alembic"]
45+
invenio_records_files = "invenio_records_files:alembic"
46+
47+
[project.entry-points."invenio_db.models"]
48+
invenio_records_files = "invenio_records_files.models"
49+
50+
[project.entry-points."invenio_jsonschemas.schemas"]
51+
records_files = "invenio_records_files.jsonschemas"
52+
53+
[project.optional-dependencies]
54+
docs = [
55+
"sphinx>=3",
56+
]
57+
elasticsearch7 = [
58+
"invenio-search[elasticsearch7]>=3.0.0,<4.0.0",
59+
]
60+
mysql = [
61+
"invenio-db[mysql,versioning]>=2.2.0,<3.0.0",
62+
]
63+
opensearch2 = [
64+
"invenio-search[opensearch2]>=3.0.0,<4.0.0",
65+
]
66+
postgresql = [
67+
"invenio-db[postgresql,versioning]>=2.2.0,<3.0.0",
68+
]
69+
sqlite = [
70+
"invenio-db[versioning]>=2.2.0,<3.0.0",
71+
]
72+
tests = [
73+
"invenio-indexer>=6.0.0,<7.0.0",
74+
"mock>=1.3.0",
75+
"pytest-black>=0.6.0",
76+
"pytest-invenio>=4.0.0,<5.0.0",
77+
"sphinx>=3",
78+
]
79+
180
[build-system]
2-
requires = ["setuptools", "wheel", "babel>2.8"]
3-
build-backend = "setuptools.build_meta"
81+
requires = ["hatchling"]
82+
build-backend = "hatchling.build"
83+
84+
[tool.hatch.version]
85+
path = "invenio_records_files/__init__.py"
86+
87+
[tool.hatch.build.targets.sdist]
88+
include = [
89+
"/invenio_records_files",
90+
]
91+
92+
[tool.isort]
93+
profile = "black"
94+
95+
[tool.pydocstyle]
96+
add_ignore = "D401"
97+
98+
[tool.pytest.ini_options]
99+
addopts = '--black --isort --pydocstyle --doctest-glob="*.rst" --doctest-modules --cov=invenio_records_files --cov-report=term-missing'
100+
testpaths = "tests invenio_records_files"
101+
live_server_scope = "module"
4102

103+
# UV needs to be told explicitly which extras are conflicting:
104+
# https://docs.astral.sh/uv/concepts/projects/config/#conflicting-dependencies
105+
[tool.uv]
106+
conflicts = [
107+
[
108+
{ extra = "opensearch1" },
109+
{ extra = "opensearch2" },
110+
{ extra = "elasticsearch7" },
111+
]
112+
]

run-tests.sh

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

1818

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

setup.cfg

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

setup.py

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

0 commit comments

Comments
 (0)