Merge pull request #72 from PR0M3TH3AN/codex/refactor-resource-access-in-voxvera/cli.py

Package resources inside voxvera
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2025-06-21 12:21:05 -04:00
commit 95652bc836
31 files changed
+8 -6

No files matched your search

+2 -2
View File
@@ -1,2 +1,2 @@
include templates/**
include src/**
include voxvera/templates/**
include voxvera/src/**
+1 -1
View File
@@ -10,7 +10,7 @@ include = ["voxvera*"]
include-package-data = true
[tool.setuptools.package-data]
voxvera = ["../templates/**", "../src/**"]
voxvera = ["templates/**", "src/**"]
[project]
name = "voxvera"
+1 -1
View File
@@ -15,7 +15,7 @@ from voxvera import cli
def _setup_tmp(monkeypatch, tmp_path):
repo_root = Path(__file__).resolve().parent.parent
shutil.copytree(repo_root / "src", tmp_path / "src")
shutil.copytree(repo_root / "voxvera" / "src", tmp_path / "src")
monkeypatch.setattr(cli, "ROOT", tmp_path)
monkeypatch.setattr(cli, "_src_res", lambda *p: tmp_path / "src" / Path(*p))
monkeypatch.setattr(cli, "run", lambda *a, **k: None)
+4 -2
View File
@@ -17,11 +17,13 @@ ROOT = Path(__file__).resolve().parent.parent
def _template_res(*parts) -> Traversable:
return resources.files(__package__).joinpath('..', 'templates', *parts)
"""Return a Traversable for files under the packaged ``templates`` folder."""
return resources.files(__package__).joinpath('templates', *parts)
def _src_res(*parts) -> Traversable:
return resources.files(__package__).joinpath('..', 'src', *parts)
"""Return a Traversable for files under the packaged ``src`` folder."""
return resources.files(__package__).joinpath('src', *parts)
def require_cmd(cmd: str):
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.