Skip to content

Commit 4c415c6

Browse files
authored
Fix Spec Update Action (#215)
* Fix Spec Update Action * Remove old generate script
1 parent 8302398 commit 4c415c6

File tree

5 files changed

+7
-28
lines changed

5 files changed

+7
-28
lines changed

.github/workflows/spec_update.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,17 @@ jobs:
1212
- name: Setup Python environment
1313
uses: actions/[email protected]
1414
with:
15-
python-version: 2.7
15+
python-version: 3.7
1616
- name: Get current time
1717
uses: 1466587594/get-current-time@v2
1818
id: current-time
1919
with:
2020
format: YYYY_MM_DD
2121
utcOffset: "-08:00"
22-
- name: Install SDK
22+
- name: Install Requirements
2323
run: |
24-
npm install
24+
python -m pip install --upgrade pip
25+
pip install -r requirements-dev.txt
2526
- name: Update Modules
2627
run: |
2728
git submodule init
@@ -49,7 +50,7 @@ jobs:
4950
echo "::set-output name=commit::$commit"
5051
- name: Generate New Routes
5152
run: |
52-
./scripts/generate_stone.ps1
53+
python generator/generate_routes.py
5354
git add dropbox-sdk-dotnet/Dropbox.Api/Generated
5455
git add stone
5556
git add spec

generate.py renamed to generator/generate_routes.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@
99

1010
def main():
1111
"""The entry point for the program."""
12-
stone_path = os.path.abspath('stone')
13-
print(stone_path)
1412
generator_path = os.path.abspath('generator')
15-
print(generator_path)
1613
spec_path = os.path.abspath('spec')
17-
print(spec_path)
1814
specs = glob.glob(spec_path + '/*.stone') # Arbitrary sorting
1915
specs.sort()
20-
print(specs)
2116

2217
repo_path = os.path.abspath('dropbox-sdk-dotnet')
2318
print('Generating Stone types')
@@ -28,8 +23,7 @@ def main():
2823
try:
2924
subprocess.check_output(
3025
(['python', '-m', 'stone.cli', '--filter-by-route-attr', 'alpah_group=null', '-a:all', generator_path + '/csharp.stoneg.py'] +
31-
[os.path.join(repo_path, 'Dropbox.Api')] + specs),
32-
cwd=stone_path)
26+
[os.path.join(repo_path, 'Dropbox.Api')] + specs))
3327
except subprocess.CalledProcessError as e:
3428
print(e.output)
3529

generator/requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
stone

requirements-dev.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

scripts/generate_stone.ps1

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)