Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mkexp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esmenv
mkexp
Commits
16a6ad54
Commit
16a6ad54
authored
8 months ago
by
Karl-Hermann Wieners
Browse files
Options
Downloads
Patches
Plain Diff
Templates: load user template also if user dir is not in mkexp path
parent
104fc0e7
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGES.rst
+8
-0
8 additions, 0 deletions
CHANGES.rst
mkexp
+9
-2
9 additions, 2 deletions
mkexp
test.py
+9
-0
9 additions, 0 deletions
test.py
with
26 additions
and
2 deletions
CHANGES.rst
+
8
−
0
View file @
16a6ad54
...
...
@@ -6,6 +6,14 @@ Make Experiments!
Release Changes
---------------
Release 1.4.1
=============
Templates
---------
* Load user template also if user dir is not in mkexp path
Release 1.4.0
=============
...
...
This diff is collapsed.
Click to expand it.
mkexp
+
9
−
2
View file @
16a6ad54
...
...
@@ -286,11 +286,15 @@ if args.path:
config_roots
=
args
.
path
.
split
(
'
:
'
)
experiment_config_name
=
args
.
config
experiment_config_id
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
args
.
config
))[
0
]
if
not
os
.
path
.
exists
(
experiment_config_name
):
feedback
.
die
(
"
config file
'
{0}
'
does not exist
"
.
format
(
experiment_config_name
))
(
experiment_config_dir
,
experiment_config_base
)
=
os
.
path
.
split
(
experiment_config_name
)
(
experiment_config_id
,
experiment_config_format
)
=
os
.
path
.
splitext
(
experiment_config_base
)
# Overrides
invalid_args
=
[
x
for
x
in
args
.
assigns
if
not
x
.
find
(
'
=
'
)
+
1
]
...
...
@@ -300,8 +304,11 @@ if invalid_args:
# Setup templating environment
template_roots
=
config_roots
if
experiment_config_dir
not
in
template_roots
:
template_roots
.
append
(
experiment_config_dir
)
template_env
=
Environment
(
loader
=
ChoiceLoader
(
list
(
map
(
FileSystemLoader
,
config
_roots
))),
loader
=
ChoiceLoader
(
list
(
map
(
FileSystemLoader
,
template
_roots
))),
variable_start_string
=
'
%{
'
,
variable_end_string
=
'
}
'
,
line_statement_prefix
=
'
#%
'
,
...
...
This diff is collapsed.
Click to expand it.
test.py
+
9
−
0
View file @
16a6ad54
...
...
@@ -160,6 +160,15 @@ class RunningTestCase(MkexpTestCase):
self
.
assertTrue
(
is_exec
(
'
test/experiments/test0001/test0001.run
'
))
self
.
assertFalse
(
is_exec
(
'
test/experiments/test0001/test0001.nox
'
))
def
test_template_not_in_path
(
self
):
expected
=
align
(
u
"""
Script directory:
'
experiments/test0001
'
Data directory:
'
experiments/test0001
'
(already exists)
Work directory:
'
experiments/test0001
'
(already exists)
"""
)
result
=
output
(
script
(
"
mkexp -p does_not_exist test0001.config
"
))
self
.
assertMultiLineEqual
(
expected
,
result
)
class
CommandLineTestCase
(
MkexpTestCase
):
def
test_pass_section_variables
(
self
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment