From 8506403b66d146338105612946980e40cc4ed0b3 Mon Sep 17 00:00:00 2001 From: keming Date: Wed, 18 Mar 2020 10:21:53 +0800 Subject: [PATCH 1/5] change trigger condition --- .github/workflows/pythonpackage.yml | 44 ++++++++++++++++------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 033c4d5..616844a 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -1,10 +1,14 @@ name: Python package -on: [push] +on: + pull_request: + push: + branches: + - master + - dev jobs: build: - runs-on: ${{ matrix.os }} strategy: max-parallel: 3 @@ -13,21 +17,21 @@ jobs: os: [ubuntu-latest] steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - name: Lint with flake8 - run: | - pip install flake8 - make style - - name: Test with pytest - run: | - pip install pytest - pip install flask falcon starlette[full] - make test + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Lint with flake8 + run: | + pip install flake8 + make style + - name: Test with pytest + run: | + pip install pytest + pip install flask falcon starlette[full] + make test From d97f3547d2f259478103108b3cf21b7d96c73c52 Mon Sep 17 00:00:00 2001 From: keming Date: Wed, 18 Mar 2020 10:22:41 +0800 Subject: [PATCH 2/5] fix starlette json decode error return --- spectree/plugins/starlette_plugin.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spectree/plugins/starlette_plugin.py b/spectree/plugins/starlette_plugin.py index 579b7be..bd4c2e1 100644 --- a/spectree/plugins/starlette_plugin.py +++ b/spectree/plugins/starlette_plugin.py @@ -63,8 +63,7 @@ async def validate(self, func, query, json, headers, cookies, resp, *args, **kwa 'spectree_validation': err.errors(), }, ) - response = JSONResponse(err.errors(), 422) - return response + return JSONResponse(err.errors(), 422) except JSONDecodeError as err: self.logger.info( '422 Validation Error', @@ -72,7 +71,7 @@ async def validate(self, func, query, json, headers, cookies, resp, *args, **kwa 'spectree_validation': str(err), } ) - response = JSONResponse({'error_msg': str(err)}, 422) + return JSONResponse({'error_msg': str(err)}, 422) except Exception: raise From 4686d747ad2367893a39a124f2a41c04fdc83373 Mon Sep 17 00:00:00 2001 From: keming Date: Wed, 18 Mar 2020 10:23:06 +0800 Subject: [PATCH 3/5] upgrade to v0.3.3 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 61b5701..85f1403 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ setup( name='spectree', - version='0.3.2', + version='0.3.3', author='Keming Yang', author_email='kemingy94@gmail.com', description=('generate OpenAPI document and validate request&response ' From ee6ecb3f0f2ba510d33271e527c6c2a42d50cea2 Mon Sep 17 00:00:00 2001 From: keming Date: Wed, 18 Mar 2020 10:27:05 +0800 Subject: [PATCH 4/5] remove dev trigger --- .github/workflows/pythonpackage.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 616844a..3f767f3 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -5,7 +5,6 @@ on: push: branches: - master - - dev jobs: build: From 9bcd315e287d9f3131cecee679ac5e10a97fea1e Mon Sep 17 00:00:00 2001 From: keming Date: Wed, 18 Mar 2020 10:29:07 +0800 Subject: [PATCH 5/5] every push should trigger ci --- .github/workflows/pythonpackage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 3f767f3..1757dad 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -2,9 +2,9 @@ name: Python package on: pull_request: - push: branches: - master + push: jobs: build: