Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
concepts-processing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Package registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
meldb
concepts-processing
Commits
e6ab6fbc
Commit
e6ab6fbc
authored
5 months ago
by
mjbonifa
Browse files
Options
Downloads
Patches
Plain Diff
fix: added version message to publish
parent
196f1306
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
acmc/main.py
+4
-1
4 additions, 1 deletion
acmc/main.py
acmc/phen.py
+4
-2
4 additions, 2 deletions
acmc/phen.py
docs/usage.md
+2
-1
2 additions, 1 deletion
docs/usage.md
tests/test_acmc.py
+12
-2
12 additions, 2 deletions
tests/test_acmc.py
with
22 additions
and
6 deletions
acmc/main.py
+
4
−
1
View file @
e6ab6fbc
...
...
@@ -53,7 +53,7 @@ def phen_export(args):
def
phen_publish
(
args
):
"""
Handle the `phen publish` command.
"""
phen
.
publish
(
args
.
phen_dir
,
args
.
remote_url
)
phen
.
publish
(
args
.
phen_dir
,
args
.
msg
,
args
.
remote_url
)
def
phen_copy
(
args
):
...
...
@@ -203,6 +203,9 @@ def main():
default
=
str
(
phen
.
DEFAULT_PHEN_PATH
.
resolve
()),
help
=
"
Phenotype workspace directory
"
,
)
phen_publish_parser
.
add_argument
(
"
-m
"
,
"
--msg
"
,
help
=
"
Message to include with the published version
"
)
phen_publish_parser
.
add_argument
(
"
-r
"
,
"
--remote_url
"
,
help
=
"
URL to remote git repository
"
)
...
...
This diff is collapsed.
Click to expand it.
acmc/phen.py
+
4
−
2
View file @
e6ab6fbc
...
...
@@ -766,7 +766,7 @@ def map_target_code_type(phen_path, phenotype, target_code_type):
logger
.
info
(
f
"
Phenotype processed target code type
{
target_code_type
}
"
)
def
publish
(
phen_dir
,
remote_url
):
def
publish
(
phen_dir
,
msg
,
remote_url
):
"""
Publishes updates to the phenotype by commiting all changes to the repo directory
"""
# Validate config
...
...
@@ -821,7 +821,9 @@ def publish(phen_dir, remote_url):
# Create and push the tag
if
version
in
repo
.
tags
:
raise
Exception
(
f
"
Tag
{
version
}
already exists in repo
{
phen_path
}
"
)
repo
.
create_tag
(
version
,
message
=
f
"
Release
{
version
}
"
)
if
msg
is
None
:
msg
=
f
"
Release
{
version
}
"
repo
.
create_tag
(
version
,
message
=
msg
)
logger
.
info
(
f
"
New version:
{
version
}
"
)
# push to origin if a remote repo
...
...
This diff is collapsed.
Click to expand it.
docs/usage.md
+
2
−
1
View file @
e6ab6fbc
...
...
@@ -108,7 +108,8 @@ The `phen` command is used phenotype-related operations.
```
-
`-d`
,
`--phen-dir`
: (Optional) Directory of phenotype configuration (the default is ./build/phen).
-
`-r`
,
`--remote_url`
: (Optional) URL to a remote git repository, only supports an empty repo without existing commits
-
`-m`
,
`--msg`
: (Optional) Message to include with the published version-
-
`-r`
,
`--remote_url`
: (Optional) URL to a remote git repository, only supports an empty repo without existing commits.
-
**Copy Phenotype Configuration**
...
...
This diff is collapsed.
Click to expand it.
tests/test_acmc.py
+
12
−
2
View file @
e6ab6fbc
...
...
@@ -109,10 +109,20 @@ def test_phen_workflow(tmp_dir, monkeypatch, caplog, config_file):
main
.
main
()
assert
"
Phenotype processed successfully
"
in
caplog
.
text
# publish phenotype
# publish phenotype
with version message
with
caplog
.
at_level
(
logging
.
DEBUG
):
monkeypatch
.
setattr
(
sys
,
"
argv
"
,
[
"
main.py
"
,
"
phen
"
,
"
publish
"
,
"
-d
"
,
str
(
phen_path
.
resolve
())]
sys
,
"
argv
"
,
[
"
main.py
"
,
"
phen
"
,
"
publish
"
,
"
-d
"
,
str
(
phen_path
.
resolve
()),
"
-m
"
,
"
version message
"
,
],
)
main
.
main
()
assert
"
Phenotype published successfully
"
in
caplog
.
text
...
...
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