2.2 (2025-03-29)¶
Improved support for Path-like usage¶
Improvements have been made to both package configurations and script environment variables to handle/provide Path-like capabilities. This should provide flexibility for developers wanting to use either string or Path-like variables in their scripts.
For example, environment variables representing paths in scripts can now utilizing Path-like features. Previous implementation may have had scripts that prepared paths using joins:
my_subdir = releng_join(TARGET_DIR, 'subdir')
This now can be replaced using the following:
my_subdir = TARGET_DIR / 'subdir'
Package configuration options now accept Path-like values as well. For
example, previous releases where developers may use pathlib
to define
a file would have had to cast the value before providing it into a
LIBFOO_CONF_DEFS
option:
from pathlib import Path
MY_CONFIG = Path(__file__) / 'resources' / 'prj.conf'
LIBFOO_CONF_DEFS = {
'--conf': str(MY_CONFIG),
}
With this release, performing a cast is no longer required:
LIBFOO_CONF_DEFS = {
'--conf': MY_CONFIG,
}
Note that capabilities like releng_join
will
remain. releng-tool plans to support both string and Path-like arguments
where possible.
Extension priority changes¶
Support for alternative extensions
has been tweaked in which extension is used first over others. As
releng-tool promotes the .rt
extension over others, it will be the
first extension checked for. The new extension ordering is as follows:
File with a
.rt
extensionFile with a
.py
extensionFile without an extension (deprecated)
File with a
.releng
extension (deprecated)
Where before this release, the extension priority was:
File without an extension
File with a
.rt
extensionFile with a
.releng
extensionFile with a
.py
extension
It is recommended for any projects using extensionless scripts or using the
.releng
extension to transition to using the .rt
extension.
Fixes with directory copies and symbolic links¶
Corrections to releng_copy
and
releng_copy_into
have been made to
properly replicate directory symbolic links found in the first-level path
of a provided directory. The original implementation of these calls would
treat directory symbolic links in the same manner as directories and
replicate the content inside.
Convenient working directory changes with releng_tmpdir
¶
The releng_tmpdir
script helper has been
updated to allow hinting a working directory change should occur in a
prepared temporary directory.
Before, developers could use a combination of
releng_tmpdir
with
releng_wd
to help easily prepare and
move a working context into a temporary directory:
with releng_tmpdir() as dir_, releng_wd(dir_):
# invoked in temporary directory
...
With this release, developers can use the wd
argument to achieve the
same result:
with releng_tmpdir(wd=True):
# invoked in temporary directory
...