Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions skore-hub-project/hatch/metadata.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Hatchling hooks used to dynamically update the metadata of the package."""

from pathlib import Path
from shutil import copy

from hatchling.metadata.plugin.interface import MetadataHookInterface

Expand Down Expand Up @@ -32,13 +33,11 @@ def update(self, metadata):
'readme': {'file': '../README.md'},
}
"""
# Retrieve LICENCE from root files
# Copy LICENCE file from root to `sdist`
license_filepath = self.config["license"]["file"]
license = Path(self.root, license_filepath).read_text(encoding="utf-8")

# Copy LICENCE file in `sdist`
with open(Path(self.root, "LICENSE"), "w") as f:
f.write(license)
license_filepath = Path(self.root, license_filepath)
copy(license_filepath, self.root)
license_filename = license_filepath.name

# Retrieve README from root files
readme_filepath = self.config["readme"]["file"]
Expand All @@ -51,6 +50,6 @@ def update(self, metadata):
version = self.config["version-default"]

# Update metadata
metadata["license"] = {"text": license, "content-type": "text/plain"}
metadata["license-files"] = [license_filename]
metadata["readme"] = {"text": readme, "content-type": "text/markdown"}
metadata["version"] = version
3 changes: 2 additions & 1 deletion skore-hub-project/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[project]
name = "skore-hub-project"
dynamic = ["license", "readme", "version"]
dynamic = ["license-files", "readme", "version"]
requires-python = ">=3.10"
maintainers = [{ name = "skore developers", email = "[email protected]" }]
license = "MIT"
dependencies = [
"blake3",
"httpx",
Expand Down
13 changes: 6 additions & 7 deletions skore-local-project/hatch/metadata.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Hatchling hooks used to dynamically update the metadata of the package."""

from pathlib import Path
from shutil import copy

from hatchling.metadata.plugin.interface import MetadataHookInterface

Expand Down Expand Up @@ -32,13 +33,11 @@ def update(self, metadata):
'readme': {'file': '../README.md'},
}
"""
# Retrieve LICENCE from root files
# Copy LICENCE file from root to `sdist`
license_filepath = self.config["license"]["file"]
license = Path(self.root, license_filepath).read_text(encoding="utf-8")

# Copy LICENCE file in `sdist`
with open(Path(self.root, "LICENSE"), "w") as f:
f.write(license)
license_filepath = Path(self.root, license_filepath)
copy(license_filepath, self.root)
license_filename = license_filepath.name

# Retrieve README from root files
readme_filepath = self.config["readme"]["file"]
Expand All @@ -51,6 +50,6 @@ def update(self, metadata):
version = self.config["version-default"]

# Update metadata
metadata["license"] = {"text": license, "content-type": "text/plain"}
metadata["license-files"] = [license_filename]
metadata["readme"] = {"text": readme, "content-type": "text/markdown"}
metadata["version"] = version
3 changes: 2 additions & 1 deletion skore-local-project/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[project]
name = "skore-local-project"
dynamic = ["license", "readme", "version"]
dynamic = ["license-files", "readme", "version"]
requires-python = ">=3.10"
maintainers = [{ name = "skore developers", email = "[email protected]" }]
license = "MIT"
dependencies = [
"diskcache",
"joblib",
Expand Down
13 changes: 6 additions & 7 deletions skore/hatch/metadata.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Hatchling hooks used to dynamically update the metadata of the package."""

from pathlib import Path
from shutil import copy

from hatchling.metadata.plugin.interface import MetadataHookInterface

Expand Down Expand Up @@ -32,13 +33,11 @@ def update(self, metadata):
'readme': {'file': '../README.md'},
}
"""
# Retrieve LICENCE from root files
# Copy LICENCE file from root to `sdist`
license_filepath = self.config["license"]["file"]
license = Path(self.root, license_filepath).read_text(encoding="utf-8")

# Copy LICENCE file in `sdist`
with open(Path(self.root, "LICENSE"), "w") as f:
f.write(license)
license_filepath = Path(self.root, license_filepath)
copy(license_filepath, self.root)
license_filename = license_filepath.name

# Retrieve README from root files
readme_filepath = self.config["readme"]["file"]
Expand All @@ -51,6 +50,6 @@ def update(self, metadata):
version = self.config["version-default"]

# Update metadata
metadata["license"] = {"text": license, "content-type": "text/plain"}
metadata["license-files"] = [license_filename]
metadata["readme"] = {"text": readme, "content-type": "text/markdown"}
metadata["version"] = version
4 changes: 2 additions & 2 deletions skore/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ description = """\
Skore's open-source Python library accelerates ML model development with automated evaluation reports, \
smart methodological guidance, and comprehensive cross-validation analysis.\
"""
dynamic = ["license", "readme", "version"]
dynamic = ["license-files", "readme", "version"]
requires-python = ">=3.10"
maintainers = [{ name = "skore developers", email = "[email protected]" }]
license = "MIT"
classifiers = [
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Topic :: Software Development",
"Topic :: Scientific/Engineering",
Expand Down