Some changes to make scripts work in the new setup"

This commit is contained in:
Neil Hanlon 2022-06-17 15:54:11 -04:00
parent e022a38966
commit 0abdea5c86
Signed by untrusted user: neil
GPG Key ID: 705BC21EC3C70F34
9 changed files with 37 additions and 14 deletions

View File

@ -41,12 +41,15 @@ config = {
} }
# Importing the config from yaml # Importing the config from yaml
for conf in glob.iglob('configs/*.yaml'): import importlib_resources
_rootdir = importlib_resources.files("empanadas")
for conf in glob.iglob(f"{_rootdir}/configs/*.yaml"):
with open(conf, 'r', encoding="utf-8") as file: with open(conf, 'r', encoding="utf-8") as file:
rldict.update(yaml.safe_load(file)) rldict.update(yaml.safe_load(file))
# Import all SIG configs from yaml # Import all SIG configs from yaml
for conf in glob.iglob('sig/*.yaml'): for conf in glob.iglob(f"{_rootdir}/sig/*.yaml"):
with open(conf, 'r', encoding="utf-8") as file: with open(conf, 'r', encoding="utf-8") as file:
sigdict.update(yaml.safe_load(file)) sigdict.update(yaml.safe_load(file))

View File

@ -17,7 +17,7 @@ import json
from jinja2 import Environment, FileSystemLoader from jinja2 import Environment, FileSystemLoader
from empanadas.common import Color from empanadas.common import Color, _rootdir
#HAS_LIBREPO = True #HAS_LIBREPO = True
#try: #try:
@ -83,7 +83,7 @@ class RepoSync:
self.gpgkey = gpgkey self.gpgkey = gpgkey
# Templates # Templates
file_loader = FileSystemLoader('templates') file_loader = FileSystemLoader(f"{_rootdir}/templates")
self.tmplenv = Environment(loader=file_loader) self.tmplenv = Environment(loader=file_loader)
# each el can have its own designated container to run stuff in, # each el can have its own designated container to run stuff in,

View File

@ -23,7 +23,7 @@ import productmd.treeinfo
from jinja2 import Environment, FileSystemLoader from jinja2 import Environment, FileSystemLoader
from empanadas.common import Color from empanadas.common import Color, _rootdir
class IsoBuild: class IsoBuild:
""" """
@ -86,7 +86,7 @@ class IsoBuild:
) )
# Templates # Templates
file_loader = FileSystemLoader('templates') file_loader = FileSystemLoader(f"{_rootdir}/templates")
self.tmplenv = Environment(loader=file_loader) self.tmplenv = Environment(loader=file_loader)
self.compose_latest_dir = os.path.join( self.compose_latest_dir = os.path.join(

View File

@ -45,6 +45,21 @@ docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"]
perf = ["ipython"] perf = ["ipython"]
testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "packaging", "pep517", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy", "importlib-resources (>=1.3)"] testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "packaging", "pep517", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy", "importlib-resources (>=1.3)"]
[[package]]
name = "importlib-resources"
version = "5.8.0"
description = "Read resources from Python packages"
category = "main"
optional = false
python-versions = ">=3.7"
[package.dependencies]
zipp = {version = ">=3.1.0", markers = "python_version < \"3.10\""}
[package.extras]
docs = ["sphinx", "jaraco.packaging (>=9)", "rst.linker (>=1.9)"]
testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)"]
[[package]] [[package]]
name = "jinja2" name = "jinja2"
version = "2.11.3" version = "2.11.3"
@ -197,7 +212,7 @@ python-versions = "*"
name = "zipp" name = "zipp"
version = "3.6.0" version = "3.6.0"
description = "Backport of pathlib-compatible object wrapper for zip files" description = "Backport of pathlib-compatible object wrapper for zip files"
category = "dev" category = "main"
optional = false optional = false
python-versions = ">=3.6" python-versions = ">=3.6"
@ -207,8 +222,8 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes
[metadata] [metadata]
lock-version = "1.1" lock-version = "1.1"
python-versions = ">=3.6" python-versions = ">=3.7"
content-hash = "24b4f1aa7304910b04db920cbf95e7c5f483008effe499a9303d02d561a421d4" content-hash = "17bc9d78b4ea2e474754a1d321fec745361870a5315784e2a2f5b54a564bc5d8"
[metadata.files] [metadata.files]
atomicwrites = [ atomicwrites = [
@ -227,6 +242,10 @@ importlib-metadata = [
{file = "importlib_metadata-4.8.3-py3-none-any.whl", hash = "sha256:65a9576a5b2d58ca44d133c42a241905cc45e34d2c06fd5ba2bafa221e5d7b5e"}, {file = "importlib_metadata-4.8.3-py3-none-any.whl", hash = "sha256:65a9576a5b2d58ca44d133c42a241905cc45e34d2c06fd5ba2bafa221e5d7b5e"},
{file = "importlib_metadata-4.8.3.tar.gz", hash = "sha256:766abffff765960fcc18003801f7044eb6755ffae4521c8e8ce8e83b9c9b0668"}, {file = "importlib_metadata-4.8.3.tar.gz", hash = "sha256:766abffff765960fcc18003801f7044eb6755ffae4521c8e8ce8e83b9c9b0668"},
] ]
importlib-resources = [
{file = "importlib_resources-5.8.0-py3-none-any.whl", hash = "sha256:7952325ffd516c05a8ad0858c74dff2c3343f136fe66a6002b2623dd1d43f223"},
{file = "importlib_resources-5.8.0.tar.gz", hash = "sha256:568c9f16cb204f9decc8d6d24a572eeea27dacbb4cee9e6b03a8025736769751"},
]
jinja2 = [ jinja2 = [
{file = "Jinja2-2.11.3-py2.py3-none-any.whl", hash = "sha256:03e47ad063331dd6a3f04a43eddca8a966a26ba0c5b7207a9a9e4e08f1b29419"}, {file = "Jinja2-2.11.3-py2.py3-none-any.whl", hash = "sha256:03e47ad063331dd6a3f04a43eddca8a966a26ba0c5b7207a9a9e4e08f1b29419"},
{file = "Jinja2-2.11.3.tar.gz", hash = "sha256:a6d58433de0ae800347cab1fa3043cebbabe8baa9d29e668f1c768cb87a333c6"}, {file = "Jinja2-2.11.3.tar.gz", hash = "sha256:a6d58433de0ae800347cab1fa3043cebbabe8baa9d29e668f1c768cb87a333c6"},

View File

@ -5,20 +5,21 @@ description = "hand crafted ISOs with love and spice"
authors = ["Louis Abel <louis@rockylinux.org>", "Neil Hanlon <neil@rockylinux.org>"] authors = ["Louis Abel <louis@rockylinux.org>", "Neil Hanlon <neil@rockylinux.org>"]
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = ">=3.6" python = ">=3.7"
rpm-py-installer = "~1.1.0" rpm-py-installer = "~1.1.0"
PyYAML = "~6.0" PyYAML = "~6.0"
Jinja2 = "~2" Jinja2 = "~2"
productmd = "~1.33" productmd = "~1.33"
importlib-resources = "^5.8.0"
[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]
pytest = "~5" pytest = "~5"
[tool.poetry.scripts] [tool.poetry.scripts]
sync-from-peridot = "empanadas.scripts.sync-from-peridot:run" sync_from_peridot = "empanadas.scripts.sync_from_peridot:run"
sync-from-peridot-test = "empanadas.scripts.sync-from-peridot-test:run" sync_from_peridot_test = "empanadas.scripts.sync_from_peridot_test:run"
sync-sig = "empanadas.scripts.sync-sig:run" sync_sig = "empanadas.scripts.sync_sig:run"
build-iso = "empanadas.scripts.build-iso:run" build-iso = "empanadas.scripts.build_iso:run"
[build-system] [build-system]
requires = ["poetry-core>=1.0.0"] requires = ["poetry-core>=1.0.0"]