Skip to content

Commit 0d53373

Browse files
committed
build: migrate packaging to hatchling + hatch-vcs and uv
Move project metadata and dependencies from setup.cfg into a PEP 621 [project] table, swap the setuptools/setuptools-scm backend for hatchling + hatch-vcs (version_scheme preserved as no-guess-dev), and add a committed uv.lock. setup.py and tox.ini are retained until their replacements are proven.
1 parent a4bb8a4 commit 0d53373

3 files changed

Lines changed: 4593 additions & 180 deletions

File tree

‎pyproject.toml‎

Lines changed: 116 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,117 @@
1+
[project]
2+
name = "osw"
3+
description = "Python toolset for data processing, queries, wikicode generation and page manipulation"
4+
authors = [{ name = "OpenSemanticWorld", email = "team@opensemantic.world" }]
5+
readme = "README.md"
6+
license = "AGPL-3.0-or-later"
7+
license-files = ["LICENSE.txt"]
8+
requires-python = ">=3.10,<3.14"
9+
dynamic = ["version"]
10+
classifiers = [
11+
"Development Status :: 3 - Alpha",
12+
"Intended Audience :: Developers",
13+
"Programming Language :: Python",
14+
"Programming Language :: Python :: 3",
15+
"Programming Language :: Python :: 3.10",
16+
"Programming Language :: Python :: 3.11",
17+
"Programming Language :: Python :: 3.12",
18+
"Programming Language :: Python :: 3.13",
19+
"Topic :: Software Development :: Libraries :: Python Modules",
20+
]
21+
dependencies = [
22+
"oold>=0.15.0",
23+
"opensemantic",
24+
"opensemantic.core>=0.57.4",
25+
"opensemantic.base>=0.42.7",
26+
"pydantic[email]>=1.10.17",
27+
"datamodel-code-generator==0.51.0",
28+
"black",
29+
"isort",
30+
"ruamel.yaml<0.19.0",
31+
"mwclient>=0.11.0",
32+
"rdflib",
33+
"PyLD",
34+
"SPARQLWrapper",
35+
"jsonpath-ng",
36+
"numpy",
37+
"pyyaml",
38+
"pandas",
39+
"typing_extensions",
40+
"pathlib",
41+
"sphinx",
42+
"chardet",
43+
"matplotlib",
44+
"scipy",
45+
"dask",
46+
"asyncio",
47+
"tqdm",
48+
"pybars3-wheel",
49+
]
50+
51+
[project.urls]
52+
Homepage = "https://github.com/OpenSemanticLab/osw-python"
53+
Documentation = "https://opensemanticlab.github.io/osw-python/"
54+
Source = "https://github.com/OpenSemanticLab/osw-python"
55+
Changelog = "https://github.com/OpenSemanticLab/osw-python/blob/main/CHANGELOG.md"
56+
Download = "https://pypi.org/project/osw/#files"
57+
58+
[project.optional-dependencies]
59+
wikitext = ["mwparserfromhell"]
60+
DB = [
61+
"psycopg2",
62+
"sqlalchemy",
63+
]
64+
S3 = ["boto3"]
65+
dataimport = [
66+
"geopy",
67+
"deepl",
68+
"openpyxl",
69+
]
70+
UI = ["pysimplegui"]
71+
workflow = [
72+
"prefect>=2.20.25,<3.0",
73+
# prefect 2.20.25 is the final 2.x release (no backports). Its
74+
# GatherTaskGroup subclasses anyio's TaskGroup but doesn't implement
75+
# create_task, which newer anyio 4.x made abstract (broken on 4.14,
76+
# verified good on 4.6.2); hold anyio to the last verified-good 4.6 line
77+
# so the prefect-2.x flow engine can still instantiate task groups.
78+
"anyio>=4.4.0,<4.7",
79+
]
80+
tutorial = ["osw[dataimport]"]
81+
all = ["osw[dataimport,DB,UI,S3,wikitext]"]
82+
83+
# Dev requirements. Kept as extras in this phase so tox (extras = testing)
84+
# keeps working; migrated to a dependency-group in the dev-tooling phase.
85+
dev = [
86+
"pre-commit>=3.2.0",
87+
"tox",
88+
]
89+
testing = [
90+
"pytest-asyncio",
91+
# inherit the capped prefect pin (<3.0); a bare "prefect" here resolved to
92+
# 3.x in CI, whose server API breaks the prefect-2.20-targeted tests
93+
"osw[workflow]",
94+
"setuptools",
95+
"pytest",
96+
"pytest-cov",
97+
"pytest-mock",
98+
"geopy",
99+
"deepl",
100+
"sqlalchemy",
101+
"psycopg2-binary", # see: https://www.psycopg.org/docs/install.html#psycopg-vs-psycopg-binary
102+
"mwparserfromhell",
103+
"jsondiff",
104+
]
105+
1106
[build-system]
2-
# AVOID CHANGING REQUIRES: IT WILL BE UPDATED BY PYSCAFFOLD!
3-
requires = ["setuptools>=46.1.0", "setuptools_scm[toml]>=5"]
4-
build-backend = "setuptools.build_meta"
5-
6-
[tool.setuptools_scm]
7-
# For smarter version schemes and other configuration options,
8-
# check out https://github.com/pypa/setuptools_scm
9-
version_scheme = "no-guess-dev"
107+
requires = ["hatchling", "hatch-vcs"]
108+
build-backend = "hatchling.build"
109+
110+
[tool.hatch.version]
111+
source = "vcs"
112+
# Preserve the setuptools-scm scheme the project used previously so tag-derived
113+
# versions are identical (e.g. 1.1.2.post1.dev25+g<sha>).
114+
raw-options = { version_scheme = "no-guess-dev" }
115+
116+
[tool.hatch.build.targets.wheel]
117+
packages = ["src/osw"]

‎setup.cfg‎

Lines changed: 3 additions & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -1,153 +1,6 @@
1-
# This file is used to configure your project.
2-
# Read more about the various options under:
3-
# https://setuptools.pypa.io/en/latest/userguide/declarative_config.html
4-
# https://setuptools.pypa.io/en/latest/references/keywords.html
5-
6-
[metadata]
7-
name = osw
8-
description = Python toolset for data processing, queries, wikicode generation and page manipulation
9-
author = OpenSemanticWorld
10-
author_email = team@opensemantic.world
11-
license = AGPL-3.0-or-later
12-
license_files = LICENSE.txt
13-
long_description = file: README.md
14-
long_description_content_type = text/markdown; charset=UTF-8; variant=GFM
15-
url = https://github.com/OpenSemanticLab/osw-python
16-
# Add here related links, for example:
17-
project_urls =
18-
Documentation = https://opensemanticlab.github.io/osw-python/
19-
Source = https://github.com/OpenSemanticLab/osw-python
20-
Changelog = https://github.com/OpenSemanticLab/osw-python/blob/main/CHANGELOG.md
21-
# Tracker = https://github.com/pyscaffold/pyscaffold/issues
22-
# Conda-Forge = https://anaconda.org/conda-forge/pyscaffold
23-
Download = https://pypi.org/project/osw/#files
24-
# Twitter = https://twitter.com/PyScaffold
25-
26-
# Change if running only on Windows, Mac or Linux (comma-separated)
27-
platforms = any
28-
29-
# Add here all kinds of additional classifiers as defined under
30-
# https://pypi.org/classifiers/
31-
classifiers =
32-
Development Status :: 3 - Alpha
33-
Programming Language :: Python
34-
35-
36-
[options]
37-
zip_safe = False
38-
packages = find_namespace:
39-
include_package_data = True
40-
package_dir =
41-
=src
42-
43-
# Require a min/specific Python version (comma-separated conditions)
44-
python_requires = >=3.10, <3.14
45-
46-
# Add here dependencies of your project (line-separated), e.g. requests>=2.2,<3.0.
47-
# Version specifiers like >=2.2,<3.0 avoid problems due to API changes in
48-
# new major versions. This works if the required packages follow Semantic Versioning.
49-
# For more information, check out https://semver.org/.
50-
install_requires =
51-
oold>=0.15.0
52-
opensemantic
53-
opensemantic.core>=0.57.4
54-
opensemantic.base>=0.42.7
55-
pydantic[email]>=1.10.17
56-
datamodel-code-generator==0.51.0
57-
black
58-
isort
59-
ruamel.yaml<0.19.0
60-
mwclient>=0.11.0
61-
rdflib
62-
PyLD
63-
SPARQLWrapper
64-
jsonpath-ng
65-
numpy
66-
pyyaml
67-
pandas
68-
typing_extensions
69-
pathlib
70-
sphinx
71-
chardet
72-
matplotlib
73-
scipy
74-
dask
75-
asyncio
76-
tqdm
77-
pybars3-wheel
78-
79-
[options.packages.find]
80-
where = src
81-
exclude =
82-
tests
83-
84-
[options.extras_require]
85-
# Add here additional requirements for extra features, to install with:
86-
# `pip install osw[PDF]` like:
87-
# PDF = ReportLab; RXP
88-
wikitext =
89-
mwparserfromhell
90-
DB =
91-
psycopg2
92-
sqlalchemy
93-
S3 =
94-
boto3
95-
dataimport =
96-
geopy
97-
deepl
98-
openpyxl
99-
UI =
100-
pysimplegui
101-
workflow =
102-
prefect>=2.20.25,<3.0
103-
# prefect 2.20.25 is the final 2.x release (no backports). Its
104-
# GatherTaskGroup subclasses anyio's TaskGroup but doesn't implement
105-
# create_task, which newer anyio 4.x made abstract (broken on 4.14,
106-
# verified good on 4.6.2); hold anyio to the last verified-good 4.6 line
107-
# so the prefect-2.x flow engine can still instantiate task groups.
108-
anyio>=4.4.0,<4.7
109-
tutorial =
110-
%(dataimport)s
111-
all =
112-
%(dataimport)s
113-
%(DB)s
114-
%(UI)s
115-
%(S3)s
116-
%(wikitext)s
117-
118-
119-
# Add here dev requirements (semicolon/line-separated)
120-
dev =
121-
pre-commit>=3.2.0
122-
tox
123-
124-
# Add here test requirements (semicolon/line-separated)
125-
testing =
126-
pytest-asyncio
127-
# inherit the capped prefect pin (<3.0); a bare "prefect" here resolved to
128-
# 3.x in CI, whose server API breaks the prefect-2.20-targeted tests
129-
%(workflow)s
130-
setuptools
131-
pytest
132-
pytest-cov
133-
pytest-mock
134-
geopy
135-
deepl
136-
sqlalchemy
137-
psycopg2-binary # see: https://www.psycopg.org/docs/install.html#psycopg-vs-psycopg-binary
138-
mwparserfromhell
139-
jsondiff
140-
141-
[options.entry_points]
142-
# Add here console scripts like:
143-
# console_scripts =
144-
# script_name = osw.module:function
145-
# For example:
146-
# console_scripts =
147-
# fibonacci = osw.skeleton:run
148-
# And any other entry points, for example:
149-
# pyscaffold.cli =
150-
# awesome = pyscaffoldext.awesome.extension:AwesomeExtension
1+
# Project metadata and dependencies moved to pyproject.toml ([project] table).
2+
# The tool sections below (pytest, black, flake8) are retained temporarily and
3+
# migrate to pyproject.toml / ruff in the dev-tooling phase.
1514

1525
[tool:pytest]
1536
# Specify command line options as you would do when invoking pytest directly.
@@ -165,17 +18,6 @@ norecursedirs =
16518
testpaths = tests
16619
asyncio_default_fixture_loop_scope = function
16720

168-
# Use pytest markers to select/deselect specific tests
169-
# markers =
170-
# slow: mark tests as slow (deselect with '-m "not slow"')
171-
# system: mark end-to-end system tests
172-
173-
[devpi:upload]
174-
# Options for the devpi: PyPI server and packaging tool
175-
# VCS export must be deactivated since we are using setuptools-scm
176-
no_vcs = 1
177-
formats = bdist_wheel
178-
17921
[tool.black]
18022
line-length = 88
18123

@@ -198,14 +40,3 @@ exclude =
19840
src/osw/model/entity.py #autogenerated
19941
per-file-ignores =
20042
__init__.py:F401
201-
202-
[pyscaffold]
203-
# PyScaffold's parameters when the project was created.
204-
# This will be used when updating. Do not change!
205-
version = 4.3.1
206-
package = osw
207-
extensions =
208-
github_actions
209-
markdown
210-
no_skeleton
211-
pre_commit

0 commit comments

Comments
 (0)