Skip to content

Commit c8074e4

Browse files
Swap build backend to hatch and implement "fancy PyPI readme" package to make readme links absolute (SeequentEvo#57)
* Swap build backend to hatch and implement "fancy PyPI readme" package to make readme links absolute * Fix namespace configuration for hatch * Update lock file
1 parent 05b2ec3 commit c8074e4

5 files changed

Lines changed: 83 additions & 71 deletions

File tree

packages/evo-files/pyproject.toml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
[build-system]
2-
requires = ["setuptools >= 61.0.0"]
3-
build-backend = "setuptools.build_meta"
4-
51
[project]
62
name = "evo-files"
73
description = "Python SDK for using the Seequent Evo File API"
8-
version = "0.1.0"
4+
version = "0.1.1"
95
requires-python = ">=3.10"
106
license-files = ["LICENSE.md"]
11-
readme = "README.md"
7+
dynamic = ["readme"]
128
authors = [
139
{ name = "Seequent", email = "support@seequent.com" }
1410
]
@@ -40,26 +36,31 @@ notebooks = [
4036
"jupyter",
4137
]
4238

43-
[tool.setuptools.packages.find]
44-
where = ["src"]
45-
namespaces = true
46-
4739
[tool.ruff]
4840
src = ["src", "tests"]
4941
line-length = 120
5042

5143
[tool.ruff.lint]
5244
extend-select = ["I", "RUF022"]
5345

54-
[tool.bumpver]
55-
current_version = "v0.1.0"
56-
version_pattern = "vMAJOR.MINOR.PATCH[.PYTAGNUM]"
57-
commit = true
58-
tag = true
59-
commit_message = "Bump version from {old_version} to {new_version}"
46+
[build-system]
47+
requires = ["hatchling", "hatch-fancy-pypi-readme"]
48+
build-backend = "hatchling.build"
6049

61-
[tool.bumpver.file_patterns]
62-
"pyproject.toml" = [
63-
'version = "{pep440_version}"',
64-
'current_version = "{version}"',
65-
]
50+
[tool.hatch.build.targets.sdist]
51+
include = ["src"]
52+
53+
[tool.hatch.build.targets.wheel]
54+
packages = ["src/evo"]
55+
56+
[tool.hatch.metadata.hooks.fancy-pypi-readme]
57+
content-type = "text/markdown"
58+
59+
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
60+
path = "README.md"
61+
62+
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
63+
# Literal TOML strings (single quotes) need no escaping of backslashes.
64+
# Converts relative links to absolute links in PyPI
65+
pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
66+
replacement = '[\1](https://github.com/SeequentEvo/evo-python-sdk/tree/main/packages/$HFPR_PACKAGE_NAME/\g<2>)'
Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[project]
22
name = "evo-objects"
33
description = "Python SDK for using the Seequent Evo Geoscience Object API"
4-
version = "0.1.0"
4+
version = "0.1.1"
55
requires-python = ">=3.10"
66
license-files = ["LICENSE.md"]
7-
readme = "README.md"
7+
dynamic = ["readme"]
88
authors = [
99
{ name = "Seequent", email = "support@seequent.com" }
1010
]
@@ -13,10 +13,6 @@ dependencies = [
1313
"pydantic>=2,<3",
1414
]
1515

16-
[build-system]
17-
requires = ["setuptools >= 61.0.0"]
18-
build-backend = "setuptools.build_meta"
19-
2016
[project.optional-dependencies]
2117
aiohttp = ["evo-sdk-common[aiohttp]>=0.1.0"]
2218
notebooks = ["evo-sdk-common[notebooks]>=0.1.0"]
@@ -42,26 +38,31 @@ notebooks = [
4238
"jupyter",
4339
]
4440

45-
[tool.setuptools.packages.find]
46-
where = ["src"]
47-
namespaces = true
48-
4941
[tool.ruff]
5042
src = ["src", "tests"]
5143
line-length = 120
5244

5345
[tool.ruff.lint]
5446
extend-select = ["I", "RUF022"]
5547

56-
[tool.bumpver]
57-
current_version = "v0.1.0"
58-
version_pattern = "vMAJOR.MINOR.PATCH[.PYTAGNUM]"
59-
commit = "True"
60-
tag = "True"
61-
commit_message = "Bump version from {old_version} to {new_version}"
48+
[build-system]
49+
requires = ["hatchling", "hatch-fancy-pypi-readme"]
50+
build-backend = "hatchling.build"
6251

63-
[tool.bumpver.file_patterns]
64-
"pyproject.toml" = [
65-
'version = "{pep440_version}"',
66-
'current_version = "{version}"',
67-
]
52+
[tool.hatch.build.targets.sdist]
53+
include = ["/src"]
54+
55+
[tool.hatch.build.targets.wheel]
56+
packages = ["src/evo"]
57+
58+
[tool.hatch.metadata.hooks.fancy-pypi-readme]
59+
content-type = "text/markdown"
60+
61+
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
62+
path = "README.md"
63+
64+
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
65+
# Literal TOML strings (single quotes) need no escaping of backslashes.
66+
# Converts relative links to absolute links in PyPI
67+
pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
68+
replacement = '[\1](https://github.com/SeequentEvo/evo-python-sdk/tree/main/packages/$HFPR_PACKAGE_NAME/\g<2>)'

packages/evo-sdk-common/pyproject.toml

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[project]
22
name = "evo-sdk-common"
33
description = "Python package that establishes a common framework for use by client libraries that interact with Seequent Evo APIs"
4-
version = "0.1.3"
4+
version = "0.1.4"
55
requires-python = ">=3.10"
66
license-files = ["LICENSE.md"]
7-
readme = "README.md"
7+
dynamic = ["readme"]
88
authors = [
99
{ name = "Seequent", email = "support@seequent.com" }
1010
]
@@ -15,10 +15,6 @@ dependencies = [
1515
"python-dateutil",
1616
]
1717

18-
[build-system]
19-
requires = ["setuptools>=61.0.0"]
20-
build-backend = "setuptools.build_meta"
21-
2218
[project.optional-dependencies]
2319
aiohttp = ["aiohttp"]
2420
notebooks = [
@@ -50,29 +46,31 @@ notebooks = [
5046
"jupyter",
5147
]
5248

53-
[tool.setuptools.packages.find]
54-
where = ["src"]
55-
namespaces = true
56-
57-
[tool.setuptools.package-data]
58-
"evo.notebooks" = ["assets/*"]
59-
6049
[tool.ruff]
6150
src = ["src", "tests"]
6251
line-length = 120
6352

6453
[tool.ruff.lint]
6554
extend-select = ["I", "RUF022"]
6655

67-
[tool.bumpver]
68-
current_version = "v0.1.0"
69-
version_pattern = "vMAJOR.MINOR.PATCH[.PYTAGNUM]"
70-
commit = "True"
71-
tag = "True"
72-
commit_message = "Bump version from {old_version} to {new_version}"
56+
[build-system]
57+
requires = ["hatchling", "hatch-fancy-pypi-readme"]
58+
build-backend = "hatchling.build"
59+
60+
[tool.hatch.build.targets.sdist]
61+
include = ["src", "assets"]
7362

74-
[tool.bumpver.file_patterns]
75-
"pyproject.toml" = [
76-
'version = "{pep440_version}"',
77-
'current_version = "{version}"',
78-
]
63+
[tool.hatch.build.targets.wheel]
64+
packages = ["src/evo"]
65+
66+
[tool.hatch.metadata.hooks.fancy-pypi-readme]
67+
content-type = "text/markdown"
68+
69+
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
70+
path = "README.md"
71+
72+
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
73+
# Literal TOML strings (single quotes) need no escaping of backslashes.
74+
# Converts relative links to absolute links in PyPI
75+
pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
76+
replacement = '[\1](https://github.com/SeequentEvo/evo-python-sdk/tree/main/packages/$HFPR_PACKAGE_NAME/\g<2>)'

pyproject.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
name = "evo-python-sdk"
33
version = "0.1.0"
44
description = "Monorepo containing independently versioned Evo Python SDKs"
5-
readme = "README.md"
65
requires-python = ">=3.10"
76
dependencies = [
87
"evo-sdk-common[aiohttp]",
98
"evo-objects[utils]",
109
"evo-files",
1110
]
11+
dynamic = ["readme"]
1212

1313
[project.urls]
1414
Source = "https://github.com/SeequentEvo/evo-python-sdk"
@@ -49,3 +49,13 @@ evo-objects = { workspace = true }
4949

5050
[tool.uv.workspace]
5151
members = ["packages/*"]
52+
53+
[build-system]
54+
requires = ["hatchling"]
55+
build-backend = "hatchling.build"
56+
57+
[tool.hatch.build.targets.sdist]
58+
include = ["packages"]
59+
60+
[tool.hatch.build.targets.wheel]
61+
include = ["packages"]

uv.lock

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)