Move data inside package and update references

This commit is contained in:
thePR0M3TH3AN
2025-06-21 12:20:51 -04:00
parent c5b6077eee
commit b72d726bd5
31 changed files with 8 additions and 6 deletions

View File

@@ -1,2 +1,2 @@
include templates/** include voxvera/templates/**
include src/** include voxvera/src/**

View File

@@ -10,7 +10,7 @@ include = ["voxvera*"]
include-package-data = true include-package-data = true
[tool.setuptools.package-data] [tool.setuptools.package-data]
voxvera = ["../templates/**", "../src/**"] voxvera = ["templates/**", "src/**"]
[project] [project]
name = "voxvera" name = "voxvera"

View File

@@ -15,7 +15,7 @@ from voxvera import cli
def _setup_tmp(monkeypatch, tmp_path): def _setup_tmp(monkeypatch, tmp_path):
repo_root = Path(__file__).resolve().parent.parent 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, "ROOT", tmp_path)
monkeypatch.setattr(cli, "_src_res", lambda *p: tmp_path / "src" / Path(*p)) monkeypatch.setattr(cli, "_src_res", lambda *p: tmp_path / "src" / Path(*p))
monkeypatch.setattr(cli, "run", lambda *a, **k: None) monkeypatch.setattr(cli, "run", lambda *a, **k: None)

View File

@@ -17,11 +17,13 @@ ROOT = Path(__file__).resolve().parent.parent
def _template_res(*parts) -> Traversable: 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: 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): def require_cmd(cmd: str):

0
src/create_flyer.sh → voxvera/src/create_flyer.sh Executable file → Normal file
View File

0
src/generate_qr.sh → voxvera/src/generate_qr.sh Executable file → Normal file
View File

View File

View File

View File

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB