File tree Expand file tree Collapse file tree 8 files changed +109
-3
lines changed Expand file tree Collapse file tree 8 files changed +109
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
This project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) and [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) format.
4
4
5
+ ## [ 0.4.2] - 2024-04-16
6
+ ### Updated
7
+ - View creation, by adding description and no_fail flag
8
+
9
+
5
10
## [ 0.4.1] - 2024-03-07
6
11
### Fixed
7
12
- Expired token error handling ([ #17 ] ( https://github.com/pepkit/pephubclient/issues/17 ) )
Original file line number Diff line number Diff line change
1
+ # Usage reference
2
+
3
+ pephubclient is a command line tool that can be used to interact with the PEPhub API.
4
+ It can be used to create, update, delete PEPs in the PEPhub database.
5
+
6
+ Below are usage examples for the different commands that can be used with pephubclient.
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 4
4
import coloredlogs
5
5
6
6
__app_name__ = "pephubclient"
7
- __version__ = "0.4.1 "
7
+ __version__ = "0.4.2 "
8
8
__author__ = "Oleksandr Khoroshevskyi, Rafal Stepien"
9
9
10
10
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ def send_request(
35
35
headers : Optional [dict ] = None ,
36
36
cookies : Optional [dict ] = None ,
37
37
params : Optional [dict ] = None ,
38
- json : Optional [dict ] = None ,
38
+ json : Optional [Union [ dict , list ] ] = None ,
39
39
) -> requests .Response :
40
40
request_return = requests .request (
41
41
method = method ,
Original file line number Diff line number Diff line change @@ -71,17 +71,25 @@ def create(
71
71
name : str ,
72
72
tag : str ,
73
73
view_name : str ,
74
+ description : str = None ,
74
75
sample_list : list = None ,
76
+ no_fail : bool = False ,
75
77
):
76
78
"""
77
79
Create view in project in PEPhub.
78
80
79
81
:param namespace: namespace of project
80
82
:param name: name of project
81
83
:param tag: tag of project
84
+ :param description: description of the view
82
85
:param view_name: name of the view
83
86
:param sample_list: list of sample names
87
+ :param no_fail: whether to raise an error if view was not added to the project
84
88
"""
89
+
90
+ if not sample_list or not isinstance (sample_list , list ):
91
+ raise ValueError ("Sample list must be a list of sample names." )
92
+
85
93
url = self ._build_view_request_url (
86
94
namespace = namespace , name = name , view_name = view_name
87
95
)
@@ -92,6 +100,7 @@ def create(
92
100
method = "POST" ,
93
101
url = url ,
94
102
headers = self .parse_header (self .__jwt_data ),
103
+ params = {"description" : description , "no_fail" : no_fail },
95
104
json = sample_list ,
96
105
)
97
106
if response .status_code == ResponseStatusCodes .ACCEPTED :
Original file line number Diff line number Diff line change @@ -8,4 +8,4 @@ coveralls
8
8
pytest-cov
9
9
pre-commit
10
10
coverage
11
- smokeshow
11
+ smokeshow
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ cp ../docs/templates/usage.template usage.template
3
+
4
+ for cmd in " --help" " pull --help" " push --help" ; do
5
+ echo $cmd
6
+ echo -e " ## \` phc $cmd \` " > USAGE_header.temp
7
+ phc $cmd --help > USAGE.temp 2>&1
8
+ # sed -i 's/^/\t/' USAGE.temp
9
+ sed -i.bak ' 1s;^;\`\`\`console\
10
+ ;' USAGE.temp
11
+ # sed -i '1s/^/\n\`\`\`console\n/' USAGE.temp
12
+ echo -e " \`\`\` \n" >> USAGE.temp
13
+ # sed -i -e "/\`looper $cmd\`/r USAGE.temp" -e '$G' usage.template # for -in place inserts
14
+ cat USAGE_header.temp USAGE.temp >> usage.template # to append to the end
15
+ done
16
+ rm USAGE.temp
17
+ rm USAGE_header.temp
18
+ rm USAGE.temp.bak
19
+ mv usage.template ../docs/usage.md
20
+ # cat usage.template
21
+ # rm USAGE.temp
You can’t perform that action at this time.
0 commit comments