File tree 4 files changed +39
-42
lines changed
4 files changed +39
-42
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,12 @@ jobs:
19
19
action : ['lint', 'type', 'format']
20
20
steps :
21
21
- name : Checkout code
22
- uses : actions/checkout@v3
22
+ uses : actions/checkout@v4
23
23
with :
24
24
fetch-depth : ' 0'
25
25
26
26
- name : Cache poetry
27
- uses : actions/cache@v3.3.1
27
+ uses : actions/cache@v4
28
28
with :
29
29
path : ~/.cache/pypoetry/virtualenvs
30
30
key : ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('**/poetry.lock') }}
@@ -71,12 +71,12 @@ jobs:
71
71
72
72
steps :
73
73
- name : Checkout code
74
- uses : actions/checkout@v3
74
+ uses : actions/checkout@v4
75
75
with :
76
76
fetch-depth : ' 0'
77
77
78
78
- name : Cache poetry
79
- uses : actions/cache@v3.3.1
79
+ uses : actions/cache@v4
80
80
with :
81
81
path : ~/.cache/pypoetry/virtualenvs
82
82
key : ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('**/poetry.lock') }}
Original file line number Diff line number Diff line change 19
19
matrix :
20
20
python-version : ['3.10', '3.11']
21
21
steps :
22
- - uses : actions/checkout@v3
22
+ - uses : actions/checkout@v4
23
23
- name : Cache poetry
24
- uses : actions/cache@v3.3.1
24
+ uses : actions/cache@v4
25
25
with :
26
26
path : ~/.cache/pypoetry/virtualenvs
27
27
key : ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('**/poetry.lock') }}
@@ -62,14 +62,14 @@ jobs:
62
62
pr-number : ${{ github.event.inputs.pr_number }}
63
63
64
64
- name : Checkout code
65
- uses : actions/checkout@v3
65
+ uses : actions/checkout@v4
66
66
with :
67
67
fetch-depth : ' 0'
68
68
# Use the pull request merge commit ref if one is provided
69
69
ref : ${{ github.event.inputs.pr_number && format('refs/pull/{0}/merge', github.event.inputs.pr_number) || 'main' }}
70
70
71
71
- name : Cache poetry
72
- uses : actions/cache@v3.3.1
72
+ uses : actions/cache@v4
73
73
with :
74
74
path : ~/.cache/pypoetry/virtualenvs
75
75
key : ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('**/poetry.lock') }}
Original file line number Diff line number Diff line change 31
31
"type": "github"
32
32
}
33
33
},
34
+ "git-hooks": {
35
+ "inputs": {
36
+ "flake-compat": "flake-compat",
37
+ "gitignore": "gitignore",
38
+ "nixpkgs": [
39
+ "nixpkgs"
40
+ ]
41
+ },
42
+ "locked": {
43
+ "lastModified": 1742058297,
44
+ "owner": "cachix",
45
+ "repo": "git-hooks.nix",
46
+ "rev": "59f17850021620cd348ad2e9c0c64f4e6325ce2a",
47
+ "type": "github"
48
+ },
49
+ "original": {
50
+ "owner": "cachix",
51
+ "repo": "git-hooks.nix",
52
+ "type": "github"
53
+ }
54
+ },
34
55
"gitignore": {
35
56
"inputs": {
36
57
"nixpkgs": [
37
- "pre-commit -hooks",
58
+ "git -hooks",
38
59
"nixpkgs"
39
60
]
40
61
},
66
87
"type": "github"
67
88
}
68
89
},
69
- "pre-commit-hooks": {
70
- "inputs": {
71
- "flake-compat": "flake-compat",
72
- "gitignore": "gitignore",
73
- "nixpkgs": [
74
- "nixpkgs"
75
- ]
76
- },
77
- "locked": {
78
- "lastModified": 1737465171,
79
- "owner": "cachix",
80
- "repo": "pre-commit-hooks.nix",
81
- "rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17",
82
- "type": "github"
83
- },
84
- "original": {
85
- "owner": "cachix",
86
- "repo": "pre-commit-hooks.nix",
87
- "type": "github"
88
- }
89
- },
90
90
"root": {
91
91
"inputs": {
92
92
"devenv": "devenv",
93
+ "git-hooks": "git-hooks",
93
94
"nixpkgs": "nixpkgs",
94
- "pre-commit-hooks": "pre-commit-hooks"
95
+ "pre-commit-hooks": [
96
+ "git-hooks"
97
+ ]
95
98
}
96
99
}
97
100
},
Original file line number Diff line number Diff line change @@ -175,7 +175,9 @@ def upload(
175
175
project = cast (ProjectRef , project )
176
176
177
177
attributes = {
178
- "contents" : str (base64 .b64encode (bytes (hugr_package .to_json (), "utf-8" )))
178
+ "contents" : base64 .b64encode (bytes (hugr_package .to_json (), "utf-8" )).decode (
179
+ "utf-8"
180
+ )
179
181
}
180
182
181
183
annotations = CreateAnnotations (
@@ -287,15 +289,7 @@ def _fetch_hugr_package(handle: HUGRRef) -> Package:
287
289
if res .status_code != 200 :
288
290
raise qnx_exc .ResourceFetchFailed (message = res .text , status_code = res .status_code )
289
291
290
- hugr_base_64_bytes = res .json ()["data" ]["attributes" ]["contents" ]
291
- encoded_bytes = hugr_base_64_bytes .strip ()
292
- # remove leading b'
293
- encoded_bytes = encoded_bytes [1 :]
294
- # add a trailing '='
295
- encoded_bytes += "="
296
-
297
- # Step 2: Decode the base64 bytes back into the original bytes
298
- # Step 3: Convert the bytes back into the original string
299
- decoded_hugr_str = base64 .b64decode (encoded_bytes ).decode ("utf-8" )
292
+ contents : str = res .json ()["data" ]["attributes" ]["contents" ]
293
+ decoded_hugr_str = base64 .b64decode (contents ).decode ("utf-8" )
300
294
301
295
return Package .from_json (decoded_hugr_str )
You can’t perform that action at this time.
0 commit comments