Skip to content

Commit 1cb7ada

Browse files
committed
chore: remove unnecessary hatch definition for version
1 parent cec4639 commit 1cb7ada

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

.hatch_build.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,13 @@
99

1010
class MetaDataHook(MetadataHookInterface):
1111
def update(self, metadata: dict[str, t.Any]) -> None:
12-
about = load_about()
13-
metadata["version"] = about["__package_version__"]
1412
metadata["dependencies"] = load_requirements("base.in")
1513
metadata["optional-dependencies"] = {
1614
"dev": load_requirements("dev.txt"),
1715
"full": load_requirements("plugins.txt"),
1816
}
1917

2018

21-
def load_about() -> dict[str, str]:
22-
about: dict[str, str] = {}
23-
with open(os.path.join(HERE, "tutor", "__about__.py"), "rt", encoding="utf-8") as f:
24-
exec(f.read(), about) # pylint: disable=exec-used
25-
return about
26-
27-
2819
def load_requirements(filename: str) -> list[str]:
2920
requirements = []
3021
with open(
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- [Chore] Remove unnecessary hatch definition for version. (by @mlabeeb03)

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ Community = "https://discuss.openedx.org/tag/tutor"
4040
[tool.hatch.metadata.hooks.custom]
4141
path = ".hatch_build.py"
4242

43+
[tool.hatch.version]
44+
path = "tutor/__about__.py"
45+
4346
[build-system]
4447
requires = ["hatchling"]
4548
build-backend = "hatchling.build"

0 commit comments

Comments
 (0)