All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Updated documentation. Replacing lorem-ipsum text with descriptive text
for
SetEnvironment
operations.
- The
exec-makedoc
script was outdated. Fixed it to work with the updated directory layout that puts code undersrc
.
- Added
.style.yapf
rules and refactored code to match style. - Added virtual environment detection to helper scripts.
- Refactored the directory structure to put the example
into an
examples
directory and to move the source code itself intosrc/setenvironment
.
- 0.4.0 was 'released' but not noted on the CHANGELOG. 0.5.0 will also contain 0.4.0.
- Add decorator support for
@ConfigParserEnhanced.operation_handler
- Updated to 0.4.0 to sync modifications required by ConfigParserEnhanced 0.4.0.
expand_envvars_in_string
free function and replaced withos.path.expandvars()
- Bug (Issue #22) -
envvar_op
would fail when processingremove_path_entry
That is, there was no branch inenvvar_op
for invokingremove_path_entry
. - BUG (Issue #16) -
module-load
would fail if loading a default module. That is,module-load <module_name>
, would fail because we expected a 2nd argument providing the version number. This has been fixed so that we now allow 1 or 2 arguments tomodule-load
where 1 argument will use the default argument as set up in the modulefiles. - BUGS (Issue #51) - 12/57 tests would fail when running pytest on TLCC2
machines. Here is a summary of what was causing each test to fail:
load_args_as_list
: env_modules_python.module does not accept listsload_error_by_mlstatus
: LMOD error checking not presentload_error_exception
: LMOD error checking not presentload_error_module_returns_nonetype
: missing mock patch for Popenload_error_no_modulecmd
: LMOD error checking not presentload_status_error
: LMOD error checking not presentload_status_ok
: LMOD error checking not present, missing moduleload_success_by_mlstatus
: LMOD error checking not present, missing moduleswap_status_ok
: LMOD error checking not present, missing modulesunload_status_ok
: LMOD error checking not presentmodulecmd_not_found
: LMOD error checking not presentmethod_apply_module_test
: capturing return code of env_modules_python.module, which is alwaysNone
- BUGS (Issue #53) - 10/57 tests would fail when running pytest on ATS2
machines. Here is a summary of what was causing each to test fail:
test_ModuleHelper_module_load_args_as_list
: mock_popen attributes and named params missing; list 'command' not handledtest_ModuleHeler_module_load_error_by_mlstatus
: mock_popen attributes and named params missingtest_ModuleHeler_module_load_error_exception
: mock_popen attributes and named params missingtest_ModuleHeler_module_load_error_module_returns_nonetype
: mock_popen attributes and named params missingtest_ModuleHeler_module_load_error_no_modulecmd
: mock_popen attributes and named params missingtest_ModuleHeler_module_load_status_error_return
: mock_popen attributes and named params missingtest_ModuleHeler_module_load_status_error_stderr
: stderr not populated via os.popentest_ModuleHeler_modulecmd_not_found
: mock_popen attributes and named params missingtest_SetEnvironment_method_apply_module_load_noexist
: NamedError raised instead of RuntimeError in python 3.7.2test_SetEnvironment_method_apply_module_use_badpath
: mock_popen attributes and named params missing
- New envvar command:
envvar-assert-not-empty
as part of ISSUE #12 - New envvar command:
envvar-set-if-empty
as part of ISSUE #15
- Rename free function
envvar_assign
toenvvar_set
- Renamed handlers from public api to private api for consistency.
Only
handler_initialize
andhandler_finalize
remain in the public API sinceConfigParserEnhanced
has them there and they're designed to be overridden.
- New free-function:
envvar_assign
- A helper that handles assigning envvars. Adds option to raise an exception if the envvar value is an empty string or not. Default is to allow empty assignment, but having this toggle will allow us to tune this later on. - Added a
handler_initialize
handler for the start of searches. - Added a new private function:
_initialize_handler_parameters
which controls the initialization of thehandler_parameters
that is passed around by the handlers when parsing a.ini
file section. This replaced 3x snippets that did the same thing. - New command:
envvar-remove-substr
- this will remove a substring from an existing envvar. Syntax:envvar-remove-substr <envvar> : <substr>
. - New command:
envvar-remove-path-entry
- this will remove a path entry from an existing path-type envvar. Syntax:envvar-remove-path-entry <envvar>: <path>
. - New command:
envvar-find-in-path
- This new function will locate an executable that is on the path. Syntax:envvar-find-in-path <envvar>: <executable>
- Changes the
actions
parameter to now be a dictionary where each key is a section name and the values are now action lists. This allows caching of action lists when parsing multiple sections instead of the previous behvaiour where the last section parsed was what stored actions. See Issue #13 for additional details on bugs this could create. - Modify
write_actions_to_file()
to add new parameter(s):include_body = True
include_shebang = True
to allow customization of the generated output when generating output data for files.
- Rename
_gen_actions_script()
togenerate_actions_script()
to expose generation of script content to the public API. - Free functions
envvar_assign
andenvvar_op
are now exposed to the package API in the__init__.py
file. - Updated to account for changes in
ConfigParserEnhanced
regarding operation normalization. This doesn't affect.ini
file construction but internally we now need to use_
instead of-
characters in the operation matching. Operations in.ini
files should actually be able to interchance-
and_
without changing any actual behaviour now.
- Fixed Issue #13
- Modified
apply()
,pretty_print_actions()
,generate_actions_script()
andwrite_actions_to_file()
to take a requiredsections
parameter to specify which section should be worked on.
- Modified
- ConfigParserEnhanced is currently alpha and has many changes occurring.
apply()
method now handlesenvvar
andmodule
commands properly.- Added a sample 'modulefiles' dir under
unittests
for testing module command handling. - Added
write_actions_to_file(filename,interpreter)
. This currently only supportsbash
andpython
output.
- Fairly major overhaul of the way we generate the commands to support
the
write_actions_to_file()
operations. In python now we generate snippets of python code that get executed rather than just calling things likeos.environ[envvar] = value
directly within theif-then-else
case statements. This was done to try and minimize the number of different places in the code we check the value of the operation to decide what to do -- or to collect all of them for a given task such asmodules
orenvvars
into the same method. The general idea is to reduce the number of different places within the code one must add some new case entry to the switch if we added some new envvar or module operation.
- Expand testing to fully test the new
apply()
- Clean up
apply()
- Expand messaging & console logging for
apply()
- Expand messaging & console logging for
- Clean up Documentation
- Style & Consistency
0.0.1
- Initial development version