Skip to content

Commit

Permalink
Fix Spec Update Action (dropbox#215)
Browse files Browse the repository at this point in the history
* Fix Spec Update Action
* Remove old generate script
  • Loading branch information
rogebrd authored Feb 23, 2021
1 parent 8302398 commit 4c415c6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 28 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/spec_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ jobs:
- name: Setup Python environment
uses: actions/[email protected]
with:
python-version: 2.7
python-version: 3.7
- name: Get current time
uses: 1466587594/get-current-time@v2
id: current-time
with:
format: YYYY_MM_DD
utcOffset: "-08:00"
- name: Install SDK
- name: Install Requirements
run: |
npm install
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Update Modules
run: |
git submodule init
Expand Down Expand Up @@ -49,7 +50,7 @@ jobs:
echo "::set-output name=commit::$commit"
- name: Generate New Routes
run: |
./scripts/generate_stone.ps1
python generator/generate_routes.py
git add dropbox-sdk-dotnet/Dropbox.Api/Generated
git add stone
git add spec
Expand Down
8 changes: 1 addition & 7 deletions generate.py → generator/generate_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,10 @@

def main():
"""The entry point for the program."""
stone_path = os.path.abspath('stone')
print(stone_path)
generator_path = os.path.abspath('generator')
print(generator_path)
spec_path = os.path.abspath('spec')
print(spec_path)
specs = glob.glob(spec_path + '/*.stone') # Arbitrary sorting
specs.sort()
print(specs)

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

Expand Down
1 change: 1 addition & 0 deletions generator/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
stone
1 change: 0 additions & 1 deletion requirements-dev.txt

This file was deleted.

16 changes: 0 additions & 16 deletions scripts/generate_stone.ps1

This file was deleted.

0 comments on commit 4c415c6

Please sign in to comment.