Skip to content

Commit

Permalink
Revert "Revert "Pipeline""
Browse files Browse the repository at this point in the history
This reverts commit ad65f22.
  • Loading branch information
niall-byrne committed May 29, 2020
1 parent 666c330 commit 30e4998
Show file tree
Hide file tree
Showing 67 changed files with 4,017 additions and 815 deletions.
1 change: 1 addition & 0 deletions .bandit.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
skips: ['B101']
12 changes: 12 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[run]
branch = True
omit = tests/*
setup.py
source = .

[report]
precision = 1
show_missing = True
ignore_errors = True
exclude_lines =
no cover
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.tox
.pytest_cache
tests/__pycache__
__pycache__
*.pyc
15 changes: 15 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[flake8]

ignore = E203, W503, W504, W605
max-line-length = 79
max-complexity = 12

exclude =
.git
dist
build
flask_restful_swagger.egg-info
htmlcov
scripts
static

37 changes: 37 additions & 0 deletions .github/workflows/docker27.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: flask_restful_swagger Python2.7

on: [push]

jobs:
build:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Create Docker Mounted Content
run: |
echo | ssh-keygen
touch ${HOME}/.gitconfig
touch ${HOME}/.gitconfig_global
- name: Modify Dockerfile's Python Version
run: |
PYTHON_CONTAINER="python:2.7-slim"
DOCKER_CONTENT=$(tail -n +2 development/Dockerfile)
echo "FROM ${PYTHON_CONTAINER}" > development/Dockerfile
echo "${DOCKER_CONTENT}" >> development/Dockerfile
- name: Ensure File System is Writable by the Container
run: |
sudo chmod -R 777 .
- name: Build Container
run: |
docker-compose build
docker-compose up -d
- name: Run Linter
run: |
docker-compose exec -T flask_restful_swagger bash -l -c 'scripts/commander.sh lint-validate'
- name: Run Sec Test
run: |
docker-compose exec -T flask_restful_swagger bash -l -c 'scripts/commander.sh sectest'
- name: Run Unit Tests
run: |
docker-compose exec -T flask_restful_swagger bash -l -c 'scripts/commander.sh test coverage'
37 changes: 37 additions & 0 deletions .github/workflows/docker37.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: flask_restful_swagger Python3.7

on: [push]

jobs:
build:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Create Docker Mounted Content
run: |
echo | ssh-keygen
touch ${HOME}/.gitconfig
touch ${HOME}/.gitconfig_global
- name: Modify Dockerfile's Python Version
run: |
PYTHON_CONTAINER="python:3.7-slim"
DOCKER_CONTENT=$(tail -n +2 development/Dockerfile)
echo "FROM ${PYTHON_CONTAINER}" > development/Dockerfile
echo "${DOCKER_CONTENT}" >> development/Dockerfile
- name: Ensure File System is Writable by the Container
run: |
sudo chmod -R 777 .
- name: Build Container
run: |
docker-compose build
docker-compose up -d
- name: Run Linter
run: |
docker-compose exec -T flask_restful_swagger bash -l -c 'scripts/commander.sh lint-validate'
- name: Run Sec Test
run: |
docker-compose exec -T flask_restful_swagger bash -l -c 'scripts/commander.sh sectest'
- name: Run Unit Tests
run: |
docker-compose exec -T flask_restful_swagger bash -l -c 'scripts/commander.sh test coverage'
141 changes: 121 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,38 +1,139 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
lib
lib64
__pycache__
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.tox
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# Overrides
override.env

# Pycharm
.idea

# Mr Developer
.mr.developer.cfg
.project
.pydevproject
# Archives
.archive

*.iml
9 changes: 9 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[settings]
line_length=80
indent=' '
multi_line_output=3
length_sort=0
default_section=FIRSTPARTY
no_lines_before=LOCALFOLDER
sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
include_trailing_comma=true
46 changes: 46 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Contribution Guide

[Code of Conduct](./CODE_OF_CONDUCT.md)

[Contribution Guide](./development/DEVELOPMENT.md)

# Contacts

- @rantav
- @niall-byrne

__This project is part of the [Cloudify Cosmo project](https://github.com/CloudifySource/)__
11 changes: 11 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]

[requires]
python_version = "3.6"
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# flask-restful-swagger

### We have a new project lead!
We have a new project lead, @niall-byrne (Dec 2015), thank you Niall!
[![flask_restful_swagger-automation](https://github.com/rantav/flask-restful-swagger/workflows/flask_restful_swagger%20Python2.7/badge.svg)](https://github.com/rantav/flask-restful-swagger/actions)<br>
[![flask_restful_swagger-automation](https://github.com/rantav/flask-restful-swagger/workflows/flask_restful_swagger%20Python3.7/badge.svg)](https://github.com/rantav/flask-restful-swagger/actions)<br>


## What is flask-restful-swagger?
flask-restful-swagger is a wrapper for [flask-restful](http://flask-restful.readthedocs.org/en/latest/) which enables [swagger](https://developers.helloreverb.com/swagger/) support.

In essense, you just need to wrap the Api instance and add a few python decorators to get full swagger support.
In essence, you just need to wrap the Api instance and add a few python decorators to get full swagger support.

## How to:
## Installation:
Install:

```
Expand All @@ -18,7 +18,19 @@ pip install flask-restful-swagger
(This installs flask-restful as well)


And in your program, where you'd usually just use flask-restful, add just a little bit of sauce and get a swagger spec out.
## See Some Quick Examples:

```bash
PYTHONPATH=. python examples/basic.py
PYTHONPATH=. python examples/blueprints.py
PYTHONPATH=. python examples/inheritance.py
```

Browse to: [http://localhost:5000/api/spec.html](http://localhost:5000/api/spec.html)

## How To:

In your program, where you'd usually just use flask-restful, add just a little bit of sauce and get a swagger spec out.


```python
Expand Down
Loading

0 comments on commit 30e4998

Please sign in to comment.