Skip to content

Commit

Permalink
Clean
Browse files Browse the repository at this point in the history
  • Loading branch information
thomass-dev committed Oct 16, 2024
1 parent 9c9ac3d commit 86e9395
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/skore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ jobs:
fail-fast: true
matrix:
os: ['ubuntu-latest', 'windows-latest']
python-version: ['3.12']
# os: ['ubuntu-latest', 'windows-latest']
# python-version: ['3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down
12 changes: 5 additions & 7 deletions skore/hatch/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@

class MetadataHook(MetadataHookInterface):
def update(self, metadata):
license = Path(self.root, self.config["license-file"]).read_text()
readme = Path(self.root, self.config["readme-file"]).read_text()
version = self.config["version-default"]
readme = Path(self.root, self.config["readme-file"]).read_text(encoding="utf8")
license = Path(self.root, self.config["license-file"]).read_text(
encoding="utf8"
)

with suppress(FileNotFoundError):
version = Path(self.root, "VERSION.txt").read_text(encoding="utf8")
version = Path(self.root, "VERSION.txt").read_text()

metadata["version"] = version
metadata["readme"] = {"text": readme, "content-type": "text/markdown"}
metadata["license"] = {"text": license, "content-type": "text/plain"}
metadata["readme"] = {"text": readme, "content-type": "text/markdown"}
metadata["version"] = version
18 changes: 18 additions & 0 deletions skore/tests/unit/utils/test_show_versions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import os
import tempfile

from skore.utils._show_versions import _get_deps_info, _get_sys_info, show_versions


Expand Down Expand Up @@ -26,3 +29,18 @@ def test_show_versions(capfd):
assert "pip" in captured.out
assert "setuptools" in captured.out
assert "skore" in captured.out


def test_get_deps_in_any_working_directory(capfd):
cwd = os.getcwd()
with tempfile.TemporaryDirectory() as temp_dir:
os.chdir(temp_dir)
show_versions()
captured = capfd.readouterr()
assert "python" in captured.out
assert "executable" in captured.out
assert "machine" in captured.out
assert "pip" in captured.out
assert "setuptools" in captured.out
assert "skore" in captured.out
os.chdir(cwd)

0 comments on commit 86e9395

Please sign in to comment.