Skip to content

Commit 0debd18

Browse files
authored
Merge branch 'main' into pytest-runner
2 parents 7d47f04 + 1ad079b commit 0debd18

2 files changed

Lines changed: 29 additions & 5 deletions

File tree

.github/workflows/pypiupload.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,33 @@ name: Publish to PyPi
66
on:
77
release:
88
types: [created]
9+
workflow_dispatch: # Allow manual trigger for testing
910

1011
jobs:
1112
deploy:
1213
runs-on: ubuntu-latest
14+
permissions: # required for OIDC authentication
15+
id-token: write
16+
contents: read
1317
strategy:
1418
matrix:
1519
python-version: [3.x]
1620

1721
steps:
1822
- uses: actions/checkout@v2
23+
24+
- name: Configure AWS credentials (OIDC)
25+
uses: aws-actions/configure-aws-credentials@v4
26+
with:
27+
role-to-assume: arn:aws:iam::082972943155:role/oidc-github-dropbox-stone-branch-main
28+
aws-region: us-west-2
29+
- name: Get PyPI token from AWS Secrets Manager
30+
id: get-secret
31+
uses: aws-actions/aws-secretsmanager-get-secrets@v2
32+
with:
33+
secret-ids: |
34+
PYPI_SECRET,arn:aws:secretsmanager:us-west-2:082972943155:secret:pypi-api-token-vbs5JD
35+
parse-json-secrets: false
1936
- name: Publish to PyPi
2037
uses: actions/setup-python@v2.1.4
2138
with:
@@ -34,7 +51,7 @@ jobs:
3451
- name: Publish
3552
env:
3653
TWINE_USERNAME: __token__
37-
TWINE_PASSWORD: ${{ secrets.pypi_secret }}
54+
TWINE_PASSWORD: ${{ env.PYPI_SECRET }}
3855
run: |
3956
twine check dist/*
4057
twine upload dist/*

stone/backends/obj_c_types.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class ObjCTypesBackend(ObjCBaseBackend):
8383

8484
cmdline_parser = _cmdline_parser
8585
obj_name_to_namespace = {} # type: typing.Dict[str, str]
86-
namespace_to_has_route_auth_list = {} # type: typing.Dict[typing.Any, typing.Set]
86+
namespace_to_has_route_auth_list = {} # type: typing.Dict[typing.Any, typing.List]
8787

8888
def generate(self, api):
8989
"""
@@ -134,18 +134,25 @@ def generate(self, api):
134134
ns_dict = {"name": ns_name, "children": [], }
135135
jazzy_cfg['custom_categories'].insert(idx, ns_dict)
136136

137+
namespace_to_has_route_auth_list = {}
138+
137139
for namespace in api.namespaces.values():
138-
self.namespace_to_has_route_auth_list[namespace] = set()
140+
namespace_to_has_route_auth_list[namespace] = set()
139141
if namespace.routes:
140142
for route in namespace.routes:
141143
auth_types = set(map(lambda x: x.strip(), route.attrs.get('auth').split(',')))
142144
if 'noauth' not in auth_types:
143-
self.namespace_to_has_route_auth_list[namespace].add(
145+
namespace_to_has_route_auth_list.setdefault(namespace, set()).add(
144146
route.attrs.get('auth'))
145147
else:
146-
self.namespace_to_has_route_auth_list[namespace].add(
148+
namespace_to_has_route_auth_list.setdefault(namespace, set()).add(
147149
'user')
148150

151+
self.namespace_to_has_route_auth_list = {
152+
k: sorted(v)
153+
for k, v in namespace_to_has_route_auth_list.items()
154+
}
155+
149156
with self.output_to_relative_path('DBSDKImportsGenerated.h'):
150157
self._generate_all_imports(api)
151158

0 commit comments

Comments
 (0)