Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.1.1 - Fix some minor bugs #15

Merged
merged 1 commit into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
=====================================
generator=datazen
version=3.1.2
hash=d6cd0e307dd25044b7eb3a7adaf13b33
hash=e17a2a1feecf3316dd227e4ef69c4351
=====================================
-->

# rcmpy ([1.1.0](https://pypi.org/project/rcmpy/))
# rcmpy ([1.1.1](https://pypi.org/project/rcmpy/))

[![python](https://img.shields.io/pypi/pyversions/rcmpy.svg)](https://pypi.org/project/rcmpy/)
![Build Status](https://github.com/vkottler/rcmpy/workflows/Python%20Package/badge.svg)
Expand Down
2 changes: 1 addition & 1 deletion local/variables/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
major: 1
minor: 1
patch: 0
patch: 1
entry: rcmpy
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta:__legacy__"

[project]
name = "rcmpy"
version = "1.1.0"
version = "1.1.1"
description = "A configuration-file management system."
readme = "README.md"
requires-python = ">=3.7"
Expand Down
4 changes: 2 additions & 2 deletions rcmpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# =====================================
# generator=datazen
# version=3.1.2
# hash=db6b75d059437ccfb73620d52efc9103
# hash=8cf27e726efd71565b56531e6b4da766
# =====================================

"""
Expand All @@ -10,4 +10,4 @@

DESCRIPTION = "A configuration-file management system."
PKG_NAME = "rcmpy"
VERSION = "1.1.0"
VERSION = "1.1.1"
5 changes: 4 additions & 1 deletion rcmpy/environment/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ def _init_templates(self, template_names: Set[str]) -> bool:
that may be relevant to some task.
"""

candidates = self.state.root_directories("templates")
# The variant's template directory takes precedence.
candidates = self.state.root_directories(
"templates", common_first=False
)

# Prefer variant templates, if the variant template-directory
# exists.
Expand Down
11 changes: 9 additions & 2 deletions rcmpy/state/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ def update_manifest(self, data: Dict[str, Any]) -> None:
self.manifest_new = self.manifest != data
self.manifest = data

def root_directories(self, subdir: str) -> List[Path]:
def root_directories(
self, subdir: str, common_first: bool = True
) -> List[Path]:
"""
Get up to a pair of directories from some sub-directory of the current
root.
Expand All @@ -96,7 +98,10 @@ def root_directories(self, subdir: str) -> List[Path]:

candidates = [root.joinpath("common")]
if self.variant:
candidates.insert(0, root.joinpath(self.variant))
if common_first:
candidates.append(root.joinpath(self.variant))
else:
candidates.insert(0, root.joinpath(self.variant))

return [x for x in candidates if x.is_dir()]

Expand Down Expand Up @@ -124,6 +129,7 @@ def preprocessor(stream: DataStream) -> DataStream:
expect_overwrite=True,
preprocessor=preprocessor,
).data,
expect_overwrite=True,
logger=self.logger,
)

Expand All @@ -147,6 +153,7 @@ def _load_variables(self) -> None:
includes_key="includes",
expect_overwrite=True,
).data,
expect_overwrite=True,
logger=self.logger,
)

Expand Down