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

Supported kargs in versioned documentation #71

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 29 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Python package

trigger:
- master

pool:
vmImage: ubuntu-latest

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.10'
displayName: 'Use Python 3.10'

- script: |
python -m pip install --upgrade pip build setuptools twine
pip install -r requirements.txt
displayName: 'Install dependencies'

- script: |
python -m build
displayName: 'build project'

- task: TwineAuthenticate@1
inputs:
artifactFeed: 'APIs/core-api-dependencies'

- script: |
twine upload -r "core-api-dependencies" --config-file $(PYPIRC_PATH) dist/*
5 changes: 5 additions & 0 deletions fastapi_versioning/versioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def VersionedFastAPI(
title=app.title,
**kwargs,
)
args = {arg: value for arg, value in kwargs.items() if
arg not in ['title', 'description', 'version']}

version_route_mapping: Dict[Tuple[int, int], List[APIRoute]] = defaultdict(
list
)
Expand All @@ -57,6 +60,7 @@ def VersionedFastAPI(
title=app.title,
description=app.description,
version=semver,
**args
)
for route in version_route_mapping[version]:
for method in route.methods:
Expand All @@ -80,6 +84,7 @@ def noop() -> None:
title=app.title,
description=app.description,
version=semver,
**args
)
for route in unique_routes.values():
versioned_app.router.routes.append(route)
Expand Down
132 changes: 132 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
anyio==3.6.2
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
arrow==1.2.3
asttokens==2.2.1
attrs==22.2.0
Babel==2.11.0
backcall==0.2.0
bcrypt==4.0.1
beautifulsoup4==4.11.1
bleach==5.0.1
certifi==2022.12.7
cffi==1.15.1
charset-normalizer==3.0.1
click==8.1.3
cloudpickle==2.2.1
comm==0.1.2
contourpy==1.0.7
cryptography==39.0.0
cycler==0.11.0
debugpy==1.6.5
decorator==5.1.1
defusedxml==0.7.1
entrypoints==0.4
et-xmlfile==1.1.0
exceptiongroup==1.1.0
executing==1.2.0
fastapi==0.95.0
fastjsonschema==2.16.2
fonttools==4.38.0
fqdn==1.5.1
greenlet==2.0.1
h11==0.14.0
httptools==0.5.0
idna==3.4
iniconfig==2.0.0
ipykernel==6.20.2
ipytest==0.13.0
ipython==8.8.0
ipython-genutils==0.2.0
isoduration==20.11.0
jedi==0.18.2
Jinja2==3.1.2
json5==0.9.11
jsonpointer==2.3
jsonschema==4.17.3
jupyter-events==0.6.3
jupyter_client==7.4.9
jupyter_core==5.1.3
jupyter_server==2.1.0
jupyter_server_terminals==0.4.4
jupyterlab==3.5.2
jupyterlab-pygments==0.2.2
jupyterlab_server==2.19.0
kiwisolver==1.4.4
MarkupSafe==2.1.1
matplotlib==3.7.0
matplotlib-inline==0.1.6
mistune==2.0.4
mypy-extensions==1.0.0
nbclassic==0.4.8
nbclient==0.7.2
nbconvert==7.2.8
nbformat==5.7.3
nest-asyncio==1.5.6
notebook==6.5.2
notebook_shim==0.2.2
numpy==1.24.1
openpyxl==3.1.1
packaging==23.0
pandas==1.5.2
pandera==0.13.4
pandocfilters==1.5.0
paramiko==2.12.0
parso==0.8.3
pexpect==4.8.0
pickleshare==0.7.5
Pillow==9.4.0
platformdirs==2.6.2
pluggy==1.0.0
prometheus-client==0.15.0
prompt-toolkit==3.0.36
psutil==5.9.4
ptyprocess==0.7.0
pure-eval==0.2.2
pycparser==2.21
pydantic==1.10.4
pygad==2.19.2
Pygments==2.14.0
PyNaCl==1.5.0
pyodbc==4.0.35
pyparsing==3.0.9
pyrsistent==0.19.3
pytest==7.2.1
python-dateutil==2.8.2
python-dotenv==1.0.0
python-json-logger==2.0.4
pytz==2022.7.1
PyYAML==6.0
pyzmq==25.0.0
requests==2.28.2
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
scipy==1.10.1
seaborn==0.12.2
Send2Trash==1.8.0
six==1.16.0
sniffio==1.3.0
soupsieve==2.3.2.post1
SQLAlchemy==1.4.31
stack-data==0.6.2
starlette==0.26.1
terminado==0.17.1
tinycss2==1.2.1
tomli==2.0.1
tornado==6.2
traitlets==5.8.1
typing-inspect==0.8.0
typing_extensions==4.4.0
uri-template==1.2.0
urllib3==1.26.14
uuid==1.30
uvicorn==0.21.1
uvloop==0.17.0
watchfiles==0.19.0
wcwidth==0.2.6
webcolors==1.12
webencodings==0.5.1
websocket-client==1.4.2
websockets==10.4
wrapt==1.15.0
XlsxWriter==3.0.8
19 changes: 19 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[metadata]
description = This package provides the input and output schemas used by the CoreAPI in its endpoints
name = fastapi_versioning
version = 1.0.1
author = Imogate
license = MIT
license_files = LICENSE
classifiers =
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3

[options]
package_dir =
= fastapi_versioning
packages = find:

[options.packages.find]
where=src
exclude = tests*
26 changes: 1 addition & 25 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
from setuptools import setup

with open("README.md", "r") as fh:
long_description = fh.read()

setup(
name="fastapi_versioning",
version="0.10.0",
author="Dean Way",
description="api versioning for fastapi web applications",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/DeanWay/fastapi-versioning",
packages=["fastapi_versioning"],
classifiers=[
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
install_requires=[
"fastapi>=0.56.0",
"starlette",
],
python_requires=">=3.6",
)
setup()