Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
PWZER committed Sep 29, 2021
1 parent 206f5b2 commit d74217c
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 68 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 100
ignore = E402,W504
20 changes: 20 additions & 0 deletions .github/workflows/lint-and-pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Python Package using Conda

on: [push, pull_request]

jobs:
lint-and-pytest:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- run: python setup.py install
- run: pip install flask8 pytest requests uvicorn tornado flask falcon aiohttp bottle sanic quart starlette
- run: flask8
- run: pytest -s test/
16 changes: 0 additions & 16 deletions .github/workflows/tox.yml

This file was deleted.

74 changes: 26 additions & 48 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,54 +1,32 @@
import os
import platform
from pathlib import Path

from setuptools import find_packages, setup
from distutils.version import StrictVersion


DESCRIPTION = 'Swagger UI for Python web framework, such Tornado, Flask, Quart, Sanic and Falcon.'

cur_dir = os.path.dirname(os.path.abspath(__file__))


def load_package_data():
package_data = []
for data_dir in ['static', 'templates']:
for file_name in os.listdir(os.path.join(cur_dir, 'swagger_ui', data_dir)):
package_data.append(data_dir + '/' + file_name)
return {'swagger_ui': package_data}


def readme():
with open('README.md') as f:
return f.read()


def load_requirements():
with open(os.path.join(cur_dir, 'requirements.txt')) as requirements_file:
return [r.strip() for r in requirements_file.read().split()]


if __name__ == '__main__':
if StrictVersion(platform.python_version()) < StrictVersion('3.0.0'):
raise Exception("`swagger-ui-py` support python version >= 3.0.0 only.")

setup(
name='swagger-ui-py',
version='21.09.28',
description=DESCRIPTION,
long_description=readme(),
long_description_content_type='text/markdown',
license='Apache License 2.0',
# include_package_data=True,
packages=find_packages(),
package_data=load_package_data(),
install_requires=[
"jinja2>=2.0",
"PyYaml>=5.0",
],
tests_requires=[
],
url='https://github.com/PWZER/swagger-ui-py',
author='PWZER',
author_email='pwzergo@gmail.com',
)
if StrictVersion(platform.python_version()) < StrictVersion('3.0.0'):
raise Exception("`swagger-ui-py` support python version >= 3.0.0 only.")

setup(
name='swagger-ui-py',
version='21.09.28',
description=(
'Swagger UI for Python web framework, '
'such as Tornado, Flask, Quart, Sanic and Falcon.'
),
long_description=Path(__file__).parent.joinpath('README.md').read_text(),
long_description_content_type='text/markdown',
license='Apache License 2.0',
packages=find_packages(),
package_data={
'swagger_ui': ['static/*', 'templates/*'],
},
install_requires=[
"jinja2>=2.0",
"PyYaml>=5.0",
],
url='https://github.com/PWZER/swagger-ui-py',
author='PWZER',
author_email='pwzergo@gmail.com',
)
4 changes: 0 additions & 4 deletions test/common.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import sys
import time
import socket
import requests
from pathlib import Path

cur_dir = Path(__file__).resolve().parent

sys.path.insert(1, str(cur_dir.parent))

config_path = str(cur_dir.joinpath('conf/test3.yaml'))


mode_list = ['auto', None]

kwargs_list = [
Expand Down

0 comments on commit d74217c

Please sign in to comment.