Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipeline #146

Open
wants to merge 78 commits into
base: backup_master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
3cfbe97
codebase linting and quality controls
niall-byrne Nov 13, 2019
d11b6d5
testing: Update pytest coverage package
niall-byrne Nov 14, 2019
3b9b9f3
Create pythonpackage.yml
niall-byrne Nov 14, 2019
6845a74
Add build pipeline.
niall-byrne Nov 14, 2019
80dd104
Merge branch 'niall-byrne-patch-1' into pipeline
niall-byrne Nov 14, 2019
6380de9
testing: Add unittest for makeclass
niall-byrne Nov 18, 2019
662c8e1
add test cases for extract_swagger_path
Seonaid Nov 18, 2019
e8c2ca9
add test to extract_swagger_path
Seonaid Nov 18, 2019
c7ba089
refactor extract_swagger_path tests
Seonaid Nov 18, 2019
9f86b63
Added sanitize_doc unit test
AshrafPatel Nov 18, 2019
1c60c6b
Testing: added test for swagger function extract_path_arguments
slafi-vw Nov 18, 2019
adbe846
mock render_page call to test render_endpoint
Seonaid Nov 18, 2019
7dcc6db
Testing: added test for swagger function extract_path_arguments
slafi-vw Nov 18, 2019
d3730fb
testing: added test for model(...)
Nov 18, 2019
acab4b8
Added test_render_homepage.py
AshrafPatel Nov 18, 2019
eca24de
testing: Add test for operation(...)
Nov 18, 2019
d708ab0
test __parse_docs_ green
Seonaid Nov 18, 2019
cd8b2c3
linting: Apply linter to pipelines branch
niall-byrne Nov 19, 2019
d2efca4
Merge remote-tracking branch 'original/pipeline' into pipeline
Nov 19, 2019
fb2d2c5
Merge remote-tracking branch 'parent/pipeline' into pipeline
Seonaid Nov 19, 2019
794c6e0
testing: Run linting tools on test_model and test_operation
Nov 19, 2019
40005cb
linting the files
Seonaid Nov 19, 2019
300040c
testing: Fix unused import on test_operation
Nov 19, 2019
6f375c7
Merge pull request #132 from dlieu/pipeline
niall-byrne Nov 19, 2019
ef9a130
Merge pull request #130 from Seonaid/pipeline
niall-byrne Nov 19, 2019
1f72742
Merge remote-tracking branch 'original/pipeline' into pipeline
slafi-vw Nov 19, 2019
4c155eb
Testing: added test for swagger function extract_path_arguments
slafi-vw Nov 18, 2019
23a1116
testing for deduce_swagger_type_flat included bug fix discovered in t…
Seonaid Nov 19, 2019
f796969
testing: coverage for staticfiles
niall-byrne Nov 19, 2019
b93cf34
Merge pull request #133 from niall-byrne/local
niall-byrne Nov 19, 2019
c11bba6
test deduce_swaagger_type
Seonaid Nov 19, 2019
b57ceaf
testing: Add test for ResourceLister
niall-byrne Nov 19, 2019
eb5a753
Merge pull request #134 from niall-byrne/local
niall-byrne Nov 19, 2019
4acfa98
test render page
Seonaid Nov 19, 2019
41675ee
Testing: nested and extract_path_arguments
slafi-vw Nov 19, 2019
53aa2d7
Testing: nested and extract_path_arguments
slafi-vw Nov 19, 2019
e6cf2a7
linting
Seonaid Nov 19, 2019
905ad4a
Merge pull request #136 from Seonaid/pipeline
niall-byrne Nov 22, 2019
d353968
tests: clean up some formatting, ensure system compatibillity
niall-byrne Nov 22, 2019
3f1d470
scripts: ensure coverage data in regenerated on each test run
niall-byrne Nov 22, 2019
4f1e88c
testing: Fix python2 compatibillity
niall-byrne Nov 22, 2019
69979ec
testing: Fix python2 compatibillity
niall-byrne Nov 22, 2019
f3750c7
Merge pull request #131 from AshrafPatel/ashraf_test
niall-byrne Nov 23, 2019
b97f1c8
Merge remote-tracking branch 'rantav/pipeline' into pipeline
niall-byrne Nov 23, 2019
f0891f7
Merge remote-tracking branch 'rantav/pipeline' into pipeline
niall-byrne Nov 23, 2019
bd71db5
tests: refactor duplicated test cases
niall-byrne Nov 23, 2019
55c4a87
WIP: testing swagger endpoint
niall-byrne Nov 23, 2019
79f0a4a
testing: validate html generated by swagger endpoint
niall-byrne Nov 27, 2019
074e45e
testing: add coverage for extract_path_parameters
niall-byrne Nov 27, 2019
3ae3ace
Merge pull request #135 from slafi/local
niall-byrne Nov 27, 2019
30cf491
testing: Fix nested function extraction, clean up tests.
niall-byrne Nov 27, 2019
98e1fe2
testing: swagger endpoint class
niall-byrne Nov 27, 2019
71f717b
Testing: Add test_add_model
Nov 19, 2019
79e8021
testing: coverage for get_current_registry
niall-byrne Nov 28, 2019
cb0a21a
testing: WIP doc method
niall-byrne Nov 28, 2019
845eddd
testing: Add coverage for docs function
niall-byrne Nov 28, 2019
2226c92
testing: coverage for register_once
niall-byrne Nov 28, 2019
6ac8e08
testing: exclude python3 import compatibillity from coverage
niall-byrne Nov 28, 2019
0bd2125
completed test_add_model
Dec 12, 2019
d5a51dc
support python2 imports
Jan 28, 2020
1122380
seperate test fixture objects into another file
Jan 29, 2020
c066f2e
rename from TodoItem to MockTodoItem
Jan 29, 2020
06c5dac
Add Mock in front of naming for: ModelWithResourceFieldsNoRequired
Jan 29, 2020
24f9f92
refactor fixtures into seperate file
Jan 29, 2020
587e5e9
refactor patching data structures into seperate file. use context man…
Jan 29, 2020
f8df19b
refactor(DEVELOPMENT): modernize the development tool chain, and add …
niall-byrne Feb 10, 2020
1bc43e2
test(PYTHON2): add a test case to conclude coverage, and swap black f…
niall-byrne Feb 10, 2020
1ed6de6
docs(CLI): update development environment documentation
niall-byrne Feb 10, 2020
853ff70
ci(GITHUB): fix error on dockerfile manipulation
niall-byrne Feb 10, 2020
29b7dfd
fix(STDOUT): remove diagnostic print statements
niall-byrne Feb 10, 2020
b20b568
docs(README): github action badge nit
niall-byrne Feb 10, 2020
678f54c
docs(EXAMPLES): add some instructions to quickly bring up the example…
niall-byrne Feb 10, 2020
500e191
docs(CONTRIBUTING): update contact details
niall-byrne Feb 10, 2020
cb04b62
refactor(CLEANUP): cleanup the repository root, and coverage configur…
niall-byrne Feb 10, 2020
94ae777
for init testing, make sure resource_fields code is NOT called
Jan 29, 2020
4f14f0a
community: Add contribution guidelines link, and standard code of con…
niall-byrne Jan 30, 2020
3e0e5e2
fix py2 testing issues from old-style classes
Feb 10, 2020
f43ec05
docs(CONTRIBUTION): add some guidelines for commit message and linting
niall-byrne Feb 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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