diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index c3a551553..cfd817606 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9] + python-version: ['3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} diff --git a/Dockerfile3.9 b/Dockerfile3.9 deleted file mode 100644 index fcd53c077..000000000 --- a/Dockerfile3.9 +++ /dev/null @@ -1,7 +0,0 @@ -FROM python:3.9 - -RUN : \ - && apt update \ - && apt install -y python3 curl \ - && curl -sSL https://install.python-poetry.org | python3 - \ - && pip install tox pre-commit pytest black python-dateutil commitizen diff --git a/README.md b/README.md deleted file mode 100644 index aaf61dc05..000000000 --- a/README.md +++ /dev/null @@ -1,284 +0,0 @@ - -

- -

-

- coveralls - PyPI version - PyPI - License - GitHub Workflow Status - Coveralls -
-
- Explore the docs ยป -

- ---- - -Connexion is a modern Python web framework that makes spec-first and api-first development easy. -You describe your API in an [OpenAPI][OpenAPI] (or [Swagger][Swagger]) specification with as much -detail as you want and Connexion will guarantee that it works as you specified. - -It works either standalone, or in combination with any ASGI or WSGI-compatible framework! - -

-
- ๐Ÿ“ข Connexion 3 was recently released! Read about the changes here ยป -
-
-

- -## โœจ Features - -Connexion provides the following functionality **based on your specification**: - -- ๐Ÿš **Automatic route registration**, no ``@route`` decorators needed -- ๐Ÿ”’ **Authentication**, split from your application logic -- ๐Ÿ”Ž **Request and response validation** of headers, parameters, and body -- ๐Ÿ“ฌ **Parameter parsing and injection**, no request object needed -- ๐Ÿ“จ **Response serialization**, you can return regular Python objects -- ๐Ÿ“บ **A Swagger UI console** with live documentation and โ€˜try it outโ€™ feature -- ๐Ÿงฉ **Pluggability**, in all dimensions - -Connexion also **helps you write your OpenAPI specification** and develop against it by providing a command line interface which lets you test and mock your specification. - -```shell - connexion run openapi.yaml -``` - -

(back to top)

- - -## ๐Ÿซถ Sponsors - - - - -Sponsors help us dedicate time to maintain Connexion. Want to help? - -Explore the options ยป - -

(back to top)

- -## ๐Ÿชค Why Connexion - -With Connexion, you write the spec first. Connexion then calls your Python -code, handling the mapping from the specification to the code. This -incentivizes you to write the specification so that all of your -developers can understand what your API does, even before you write a -single line of code. - -If multiple teams depend on your APIs, you can use Connexion to easily -send them the documentation of your API. This guarantees that your API will -follow the specification that you wrote. This is a different process from -the one offered by most frameworks, which generate a specification -*after* you've written the code. -Some disadvantages of generating specifications based on code is that -they often end up lacking details or mix your documentation with the implementation -logic of your application. - -

(back to top)

- -## โš’๏ธ How to Use - -### Installation - -You can install connexion using pip: - -```shell - $ pip install connexion -``` - -Connexion provides 'extras' with optional dependencies to unlock additional features: - -- `swagger-ui`: Enables a Swagger UI console for your application. -- `uvicorn`: Enables to run the your application using `app.run()` for - development instead of using an external ASGI server. -- `flask`: Enables the `FlaskApp` to build applications compatible with the Flask - ecosystem. - -You can install them as follows: - -```shell - $ pip install connexion[swagger-ui] - $ pip install connexion[swagger-ui,uvicorn] -``` - -

(back to top)

- -### Creating your application - -Connexion can be used either as a standalone application or as a middleware wrapping an existing -ASGI (or WSGI) application written using a different framework. The standalone application can be -built using either the `AsyncApp` or `FlaskApp`. - -- The `AsyncApp` is a lightweight application with native asynchronous support. Use it if you - are starting a new project and have no specific reason to use one of the other options. - - ```Python - from connexion import AsyncApp - - app = AsyncApp(__name__) - ``` - -- The `FlaskApp` leverages the `Flask` framework, which is useful if you're migrating from - connexion 2.X or you want to leverage the `Flask` ecosystem. - - ```python - from connexion import FlaskApp - - app = FlaskApp(__name__) - ``` - -- The `ConnexionMiddleware` can be wrapped around any existing ASGI or WSGI application. - Use it if you already have an application written in a different framework and want to add - functionality provided by connexion - - ```python - from asgi_framework import App - from connexion import ConnexionMiddleware - - app = App(__name__) - app = ConnexionMiddleware(app) - ``` - -

(back to top)

- -### Registering an API - -While you can register individual routes on your application, Connexion really shines when you -register an API defined by an OpenAPI (or Swagger) specification. -The operation described in your specification is automatically linked to your Python view function via the ``operationId`` - -**run.py** - -```python - def post_greeting(name: str, greeting: str): # Paramaeters are automatically unpacked - return f"{greeting} {name}", 200 # Responses are automatically serialized - - app.add_api("openapi.yaml") -``` - -**openapi.yaml** - -```yaml - ... - paths: - /greeting/{name}: - post: - operationId: run.post_greeting - responses: - 200: - content: - text/plain: - schema: - type: string - parameters: - - name: name - in: path - required: true - schema: - type: string - - name: greeting - in: query - required: true - schema: - type: string -``` - -

(back to top)

- -### Running your application - -If you installed connexion using `connexion[uvicorn]`, you can run it using the -`run` method. This is only recommended for development: - -```python - app.run() -``` - -In production, run your application using an ASGI server such as `uvicorn`. If you defined your -`app` in a python module called `run.py`, you can run it as follows: - -```shell - $ uvicorn run:app -``` - -Or with gunicorn: - -```shell - $ gunicorn -k uvicorn.workers.UvicornWorker run:app -``` - ----- - -Now you're able to run and use Connexion! - -See the [examples][examples] folder for more examples. - -

(back to top)

- -## ๐Ÿ“œ Changes - -A full changelog is maintained on the [GitHub releases page][Releases]. - -

(back to top)

- -## ๐Ÿคฒ Contributing - -We welcome your ideas, issues, and pull requests. Just follow the -usual/standard GitHub practices. - -For easy development, install connexion using poetry with all extras, and -install the pre-commit hooks to automatically run black formatting and static analysis checks. - -```shell - pip install poetry - poetry install --all-extras - pre-commit install -``` - -You can find out more about how Connexion works and where to apply your changes by having a look -at our [architecture][Architecture]. - -Unless you explicitly state otherwise in advance, any non trivial -contribution intentionally submitted for inclusion in this project by you -to the steward of this repository shall be under the -terms and conditions of Apache License 2.0 written below, without any -additional copyright information, terms or conditions. - -

(back to top)

- -## ๐Ÿ™ Thanks - -We'd like to thank all of Connexion's contributors for working on this -project, Swagger/OpenAPI for their support, and Zalando for originally developing and releasing Connexion. - -## ๐Ÿ“š Recommended Resources - -About the advantages of working spec-first: - -* [Blog Atlassian][Blog Atlassian] -* [API guidelines Zalando][API guidelines Zalando] -* [Blog ML6][Blog ML6] -* [Blog Zalando][Blog Zalando] - -Tools to help you work spec-first: - -* [Online swagger editor][Online swagger editor] -* [VS Code plugin][VS Code plugin] -* [Pycharm plugin][Pycharm plugin] - -[OpenAPI]: https://openapis.org/ -[Swagger]: http://swagger.io/open-source-integrations/ -[Blog atlassian]: https://www.atlassian.com/blog/technology/spec-first-api-development -[Blog ML6]: https://blog.ml6.eu/why-we-decided-to-help-maintain-connexion-c9f449877083 -[Blog Zalando]: https://engineering.zalando.com/posts/2016/12/crafting-effective-microservices-in-python.html -[API guidelines Zalando]: https://opensource.zalando.com/restful-api-guidelines/#api-first -[Online swagger editor]: https://editor.swagger.io/ -[VS Code plugin]: https://marketplace.visualstudio.com/items?itemName=42Crunch.vscode-openapi -[Pycharm plugin]: https://plugins.jetbrains.com/plugin/14837-openapi-swagger-editor -[examples]: https://github.com/spec-first/connexion/blob/main/examples -[Releases]: https://github.com/spec-first/connexion/releases -[Architecture]: https://github.com/spec-first/connexion/blob/main/docs/images/architecture.png diff --git a/docs/conf.py b/docs/conf.py index 1c044e0ad..9fff96673 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -27,20 +27,16 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ['autoapi.extension'] - -autoapi_type = 'python' -autoapi_options = ['members', - 'inherited-members', - 'undoc-members', - 'show-inheritance', - 'show-module-summary', - 'special-members', - 'imported-members'] -autoapi_python_class_content = 'both' -autoapi_dirs = [ - '../connexion' +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx_copybutton', + 'sphinx_design', + 'sphinx.ext.autosectionlabel', + 'sphinxemoji.sphinxemoji', ] +autosectionlabel_prefix_document = True + +autoclass_content = 'both' # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -62,11 +58,12 @@ # |version| and |release|, also used in various other places throughout the # built documents. # -import connexion -# The short X.Y version. -version = connexion.__version__.rsplit('.', 1)[0] +from importlib.metadata import version + # The full version, including alpha/beta/rc tags. -release = connexion.__version__ +release = version('connexion') +# The short X.Y version. +version = release.rsplit('.', 1)[0] # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -117,6 +114,18 @@ html_theme = "sphinx_rtd_theme" html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] + + html_theme_options = { + 'navigation_depth': 2 + } + + html_context = { + 'display_github': True, + 'github_user': 'spec-first', + 'github_repo': 'connexion', + 'github_version': 'main', + 'conf_py_path': '/docs/' + } except: pass @@ -147,7 +156,11 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -# html_static_path = ['_static'] +html_static_path = ['_static'] + +html_css_files = [ + 'css/default.css', +] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied diff --git a/poetry.lock b/poetry.lock index 6127cedd8..18baba837 100644 --- a/poetry.lock +++ b/poetry.lock @@ -242,20 +242,6 @@ typing-extensions = {version = ">=4", markers = "python_version < \"3.11\""} [package.extras] tests = ["mypy (>=0.800)", "pytest", "pytest-asyncio"] -[[package]] -name = "astroid" -version = "3.3.5" -description = "An abstract syntax tree for Python with inference support." -optional = false -python-versions = ">=3.9.0" -files = [ - {file = "astroid-3.3.5-py3-none-any.whl", hash = "sha256:a9d1c946ada25098d790e079ba2a1b112157278f3fb7e718ae6a9252f5835dc8"}, - {file = "astroid-3.3.5.tar.gz", hash = "sha256:5cfc40ae9f68311075d27ef68a4841bdc5cc7f6cf86671b49f00607d30188e2d"}, -] - -[package.dependencies] -typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""} - [[package]] name = "async-timeout" version = "4.0.3" @@ -574,13 +560,13 @@ files = [ [[package]] name = "docutils" -version = "0.21.2" +version = "0.18.1" description = "Docutils -- Python Documentation Utilities" optional = false -python-versions = ">=3.9" +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ - {file = "docutils-0.21.2-py3-none-any.whl", hash = "sha256:dafca5b9e384f0e419294eb4d2ff9fa826435bf15f15b7bd45723e8ad76811b2"}, - {file = "docutils-0.21.2.tar.gz", hash = "sha256:3a6b18732edf182daa3cd12775bbb338cf5691468f91eeeb109deff6ebfa986f"}, + {file = "docutils-0.18.1-py2.py3-none-any.whl", hash = "sha256:23010f129180089fbcd3bc08cfefccb3b890b0050e1ca00c867036e9d161b98c"}, + {file = "docutils-0.18.1.tar.gz", hash = "sha256:679987caf361a7539d76e584cbeddc311e3aee937877c87346f31debc63e9d06"}, ] [[package]] @@ -866,13 +852,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "identify" -version = "2.6.1" +version = "2.6.2" description = "File identification library for Python" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "identify-2.6.1-py2.py3-none-any.whl", hash = "sha256:53863bcac7caf8d2ed85bd20312ea5dcfc22226800f6d6881f232d861db5a8f0"}, - {file = "identify-2.6.1.tar.gz", hash = "sha256:91478c5fb7c3aac5ff7bf9b4344f803843dc586832d5f110d672b19aa1984c98"}, + {file = "identify-2.6.2-py2.py3-none-any.whl", hash = "sha256:c097384259f49e372f4ea00a19719d95ae27dd5ff0fd77ad630aa891306b82f3"}, + {file = "identify-2.6.2.tar.gz", hash = "sha256:fab5c716c24d7a789775228823797296a2994b075fb6080ac83a102772a98cbd"}, ] [package.extras] @@ -1910,62 +1896,98 @@ files = [ [[package]] name = "sphinx" -version = "7.4.7" +version = "5.3.0" description = "Python documentation generator" optional = false -python-versions = ">=3.9" +python-versions = ">=3.6" files = [ - {file = "sphinx-7.4.7-py3-none-any.whl", hash = "sha256:c2419e2135d11f1951cd994d6eb18a1835bd8fdd8429f9ca375dc1f3281bd239"}, - {file = "sphinx-7.4.7.tar.gz", hash = "sha256:242f92a7ea7e6c5b406fdc2615413890ba9f699114a9c09192d7dfead2ee9cfe"}, + {file = "Sphinx-5.3.0.tar.gz", hash = "sha256:51026de0a9ff9fc13c05d74913ad66047e104f56a129ff73e174eb5c3ee794b5"}, + {file = "sphinx-5.3.0-py3-none-any.whl", hash = "sha256:060ca5c9f7ba57a08a1219e547b269fadf125ae25b06b9fa7f66768efb652d6d"}, ] [package.dependencies] -alabaster = ">=0.7.14,<0.8.0" -babel = ">=2.13" -colorama = {version = ">=0.4.6", markers = "sys_platform == \"win32\""} -docutils = ">=0.20,<0.22" +alabaster = ">=0.7,<0.8" +babel = ">=2.9" +colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} +docutils = ">=0.14,<0.20" imagesize = ">=1.3" -importlib-metadata = {version = ">=6.0", markers = "python_version < \"3.10\""} -Jinja2 = ">=3.1" -packaging = ">=23.0" -Pygments = ">=2.17" -requests = ">=2.30.0" -snowballstemmer = ">=2.2" +importlib-metadata = {version = ">=4.8", markers = "python_version < \"3.10\""} +Jinja2 = ">=3.0" +packaging = ">=21.0" +Pygments = ">=2.12" +requests = ">=2.5.0" +snowballstemmer = ">=2.0" sphinxcontrib-applehelp = "*" sphinxcontrib-devhelp = "*" sphinxcontrib-htmlhelp = ">=2.0.0" sphinxcontrib-jsmath = "*" sphinxcontrib-qthelp = "*" -sphinxcontrib-serializinghtml = ">=1.1.9" -tomli = {version = ">=2", markers = "python_version < \"3.11\""} +sphinxcontrib-serializinghtml = ">=1.1.5" [package.extras] docs = ["sphinxcontrib-websupport"] -lint = ["flake8 (>=6.0)", "importlib-metadata (>=6.0)", "mypy (==1.10.1)", "pytest (>=6.0)", "ruff (==0.5.2)", "sphinx-lint (>=0.9)", "tomli (>=2)", "types-docutils (==0.21.0.20240711)", "types-requests (>=2.30.0)"] -test = ["cython (>=3.0)", "defusedxml (>=0.7.1)", "pytest (>=8.0)", "setuptools (>=70.0)", "typing_extensions (>=4.9)"] +lint = ["docutils-stubs", "flake8 (>=3.5.0)", "flake8-bugbear", "flake8-comprehensions", "flake8-simplify", "isort", "mypy (>=0.981)", "sphinx-lint", "types-requests", "types-typed-ast"] +test = ["cython", "html5lib", "pytest (>=4.6)", "typed_ast"] [[package]] -name = "sphinx-autoapi" -version = "1.8.1" -description = "Sphinx API documentation generator" +name = "sphinx-copybutton" +version = "0.5.2" +description = "Add a copy button to each of your code cells." optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" files = [ - {file = "sphinx-autoapi-1.8.1.tar.gz", hash = "sha256:842c0a8f49c824803f7edee31cb1cabd5001a987553bec7b4681283ec9e47d4a"}, - {file = "sphinx_autoapi-1.8.1-py2.py3-none-any.whl", hash = "sha256:aa453c1011e64ebdf6937539de4d65fe9c6a94c62c5522d2bcdf9aed5cd41ff1"}, + {file = "sphinx-copybutton-0.5.2.tar.gz", hash = "sha256:4cf17c82fb9646d1bc9ca92ac280813a3b605d8c421225fd9913154103ee1fbd"}, + {file = "sphinx_copybutton-0.5.2-py3-none-any.whl", hash = "sha256:fb543fd386d917746c9a2c50360c7905b605726b9355cd26e9974857afeae06e"}, ] [package.dependencies] -astroid = ">=2.4" -Jinja2 = "*" -PyYAML = "*" -sphinx = ">=3.0" -unidecode = "*" +sphinx = ">=1.8" [package.extras] -docs = ["sphinx", "sphinx-rtd-theme"] -dotnet = ["sphinxcontrib-dotnetdomain"] -go = ["sphinxcontrib-golangdomain"] +code-style = ["pre-commit (==2.12.1)"] +rtd = ["ipython", "myst-nb", "sphinx", "sphinx-book-theme", "sphinx-examples"] + +[[package]] +name = "sphinx-design" +version = "0.4.1" +description = "A sphinx extension for designing beautiful, view size responsive web components." +optional = false +python-versions = ">=3.7" +files = [ + {file = "sphinx_design-0.4.1-py3-none-any.whl", hash = "sha256:23bf5705eb31296d4451f68b0222a698a8a84396ffe8378dfd9319ba7ab8efd9"}, + {file = "sphinx_design-0.4.1.tar.gz", hash = "sha256:5b6418ba4a2dc3d83592ea0ff61a52a891fe72195a4c3a18b2fa1c7668ce4708"}, +] + +[package.dependencies] +sphinx = ">=4,<7" + +[package.extras] +code-style = ["pre-commit (>=2.12,<3.0)"] +rtd = ["myst-parser (>=0.18.0,<2)"] +testing = ["myst-parser (>=0.18.0,<2)", "pytest (>=7.1,<8.0)", "pytest-cov", "pytest-regressions"] +theme-furo = ["furo (>=2022.06.04,<2022.07)"] +theme-pydata = ["pydata-sphinx-theme (>=0.9.0,<0.10.0)"] +theme-rtd = ["sphinx-rtd-theme (>=1.0,<2.0)"] +theme-sbt = ["sphinx-book-theme (>=0.3.0,<0.4.0)"] + +[[package]] +name = "sphinx-rtd-theme" +version = "1.2.0" +description = "Read the Docs theme for Sphinx" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" +files = [ + {file = "sphinx_rtd_theme-1.2.0-py2.py3-none-any.whl", hash = "sha256:f823f7e71890abe0ac6aaa6013361ea2696fc8d3e1fa798f463e82bdb77eeff2"}, + {file = "sphinx_rtd_theme-1.2.0.tar.gz", hash = "sha256:a0d8bd1a2ed52e0b338cbe19c4b2eef3c5e7a048769753dac6a9f059c7b641b8"}, +] + +[package.dependencies] +docutils = "<0.19" +sphinx = ">=1.6,<7" +sphinxcontrib-jquery = {version = ">=2.0.0,<3.0.0 || >3.0.0", markers = "python_version > \"3\""} + +[package.extras] +dev = ["bump2version", "sphinxcontrib-httpdomain", "transifex-client", "wheel"] [[package]] name = "sphinxcontrib-applehelp" @@ -2015,6 +2037,20 @@ lint = ["mypy", "ruff (==0.5.5)", "types-docutils"] standalone = ["Sphinx (>=5)"] test = ["html5lib", "pytest"] +[[package]] +name = "sphinxcontrib-jquery" +version = "4.1" +description = "Extension to include jQuery on newer Sphinx releases" +optional = false +python-versions = ">=2.7" +files = [ + {file = "sphinxcontrib-jquery-4.1.tar.gz", hash = "sha256:1620739f04e36a2c779f1a131a2dfd49b2fd07351bf1968ced074365933abc7a"}, + {file = "sphinxcontrib_jquery-4.1-py2.py3-none-any.whl", hash = "sha256:f936030d7d0147dd026a4f2b5a57343d233f1fc7b363f68b3d4f1cb0993878ae"}, +] + +[package.dependencies] +Sphinx = ">=1.8" + [[package]] name = "sphinxcontrib-jsmath" version = "1.0.1" @@ -2061,6 +2097,20 @@ lint = ["mypy", "ruff (==0.5.5)", "types-docutils"] standalone = ["Sphinx (>=5)"] test = ["pytest"] +[[package]] +name = "sphinxemoji" +version = "0.3.1" +description = "An extension to use emoji codes in your Sphinx documentation" +optional = false +python-versions = ">=3.9" +files = [ + {file = "sphinxemoji-0.3.1-py3-none-any.whl", hash = "sha256:dae483695f8d1e90a28a6e9bbccc08d256202afcc1d0fbd33b51b3b4352d439e"}, + {file = "sphinxemoji-0.3.1.tar.gz", hash = "sha256:23ecff1f1e765393e49083b45386b7da81ced97c9a18a1dfd191460a97da3b11"}, +] + +[package.dependencies] +sphinx = ">=5.0" + [[package]] name = "swagger-ui-bundle" version = "1.1.0" @@ -2108,17 +2158,6 @@ files = [ {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, ] -[[package]] -name = "unidecode" -version = "1.3.8" -description = "ASCII transliterations of Unicode text" -optional = false -python-versions = ">=3.5" -files = [ - {file = "Unidecode-1.3.8-py3-none-any.whl", hash = "sha256:d130a61ce6696f8148a3bd8fe779c99adeb4b870584eeb9526584e9aa091fd39"}, - {file = "Unidecode-1.3.8.tar.gz", hash = "sha256:cfdb349d46ed3873ece4586b96aa75258726e2fa8ec21d6f00a591d98806c2f4"}, -] - [[package]] name = "urllib3" version = "2.2.3" @@ -2600,13 +2639,13 @@ propcache = ">=0.2.0" [[package]] name = "zipp" -version = "3.20.2" +version = "3.21.0" description = "Backport of pathlib-compatible object wrapper for zip files" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "zipp-3.20.2-py3-none-any.whl", hash = "sha256:a817ac80d6cf4b23bf7f2828b7cabf326f15a001bea8b1f9b49631780ba28350"}, - {file = "zipp-3.20.2.tar.gz", hash = "sha256:bc9eb26f4506fda01b81bcde0ca78103b6e62f991b381fec825435c836edbc29"}, + {file = "zipp-3.21.0-py3-none-any.whl", hash = "sha256:ac1bbe05fd2991f160ebce24ffbac5f6d11d83dc90891255885223d42b3cd931"}, + {file = "zipp-3.21.0.tar.gz", hash = "sha256:2c9958f6430a2040341a52eb608ed6dd93ef4392e02ffe219417c1b28b5dd1f4"}, ] [package.extras] @@ -2626,4 +2665,4 @@ uvicorn = ["uvicorn"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "b93c866acd7e34eda433eeb5e2030bdbb852ce47804ddbc0fe0e814f85fe718d" +content-hash = "7f7484f3470fde9d8126335b7b30a1ebf96ae6d55d45b83773d3fae975963530" diff --git a/pyproject.toml b/pyproject.toml index dce84e987..d36ecf904 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "connexion" version = "2.0.dev0" description = "Connexion - API first applications with OpenAPI/Swagger" -readme = "README.md" +readme = "README.rst" keywords = ["api", "swagger", "openapi"] license = "Apache-2.0" authors = [ @@ -54,7 +54,7 @@ python-multipart = ">= 0.0.5" PyYAML = ">= 5.1" requests = ">= 2.27" typing-extensions = ">= 4.6.1" -werkzeug = ">= 2.2.1" +werkzeug = ">= 3.1.3" aiohttp="^3.10.0" aiohttp-jinja2="^1.6" MarkupSafe="^3.0.0" @@ -67,7 +67,11 @@ uvicorn = { version = ">= 0.17.6", extras = ["standard"], optional = true } jsf = { version = ">=0.10.0", optional = true } [tool.poetry.group.docs.dependencies] -sphinx-autoapi="1.8.1" +sphinx = "5.3.0" +sphinx_copybutton = "0.5.2" +sphinx_design = "0.4.1" +sphinx-rtd-theme = "1.2.0" +sphinxemoji = "0.3.1" [tool.poetry.extras] flask = ["a2wsgi", "flask"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 3c6e79cf3..000000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[bdist_wheel] -universal=1 diff --git a/setup.py b/setup.py deleted file mode 100755 index bf66f2ea9..000000000 --- a/setup.py +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env python3 - -import inspect -import os -import sys - -from setuptools import find_packages, setup -from setuptools.command.test import test as TestCommand - -__location__ = os.path.join(os.getcwd(), os.path.dirname(inspect.getfile(inspect.currentframe()))) - - -def read_version(package): - with open(os.path.join(package, '__init__.py')) as fd: - for line in fd: - if line.startswith('__version__ = '): - return line.split()[-1].strip().strip("'") - - -version = read_version('connexion') - -install_requires = [ - 'clickclick>=1.2,<21', - 'jsonschema>=2.5.1,<5', - 'PyYAML>=5.1,<7', - 'requests>=2.9.1,<3', - 'inflection>=0.3.1,<0.6', - 'werkzeug>=1.0,<2.3', - 'importlib-metadata>=1 ; python_version<"3.8"', - 'packaging>=20', -] - -swagger_ui_require = 'swagger-ui-bundle>=0.0.2,<0.1' - -flask_require = [ - 'flask>=1.0.4,<2.3', - 'itsdangerous>=0.24', -] -aiohttp_require = [ - 'aiohttp>=2.3.10,<4', - 'aiohttp-jinja2>=0.14.0,<2', - 'MarkupSafe>=0.23', -] - -tests_require = [ - 'decorator>=5,<6', - 'pytest>=6,<7', - 'pytest-cov>=2,<3', - 'testfixtures>=6,<7', - *flask_require, - swagger_ui_require -] - -tests_require.extend(aiohttp_require) -tests_require.append('pytest-aiohttp') -tests_require.append('aiohttp-remotes') - -docs_require = [ - 'sphinx-autoapi==1.8.1' -] - - -class PyTest(TestCommand): - - user_options = [('cov-html=', None, 'Generate junit html report')] - - def initialize_options(self): - TestCommand.initialize_options(self) - self.cov = None - self.pytest_args = ['--cov', 'connexion', '--cov-report', 'term-missing', '-v'] - self.cov_html = False - - def finalize_options(self): - TestCommand.finalize_options(self) - if self.cov_html: - self.pytest_args.extend(['--cov-report', 'html']) - self.pytest_args.extend(['tests']) - - def run_tests(self): - import pytest - - errno = pytest.main(self.pytest_args) - sys.exit(errno) - - -def readme(): - try: - return open('README.rst', encoding='utf-8').read() - except TypeError: - return open('README.rst').read() - - -setup( - name='connexion', - packages=find_packages(), - version=version, - description='Connexion - API first applications with OpenAPI/Swagger and Flask', - long_description=readme(), - author='Zalando SE', - url='https://github.com/zalando/connexion', - keywords='openapi oai swagger rest api oauth flask microservice framework', - license='Apache License Version 2.0', - setup_requires=['flake8'], - python_requires=">=3.6", - install_requires=install_requires + flask_require, - tests_require=tests_require, - extras_require={ - 'tests': tests_require, - 'flask': flask_require, - 'swagger-ui': swagger_ui_require, - 'aiohttp': aiohttp_require, - 'docs': docs_require - }, - cmdclass={'test': PyTest}, - test_suite='tests', - classifiers=[ - 'Programming Language :: Python', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers', - 'Operating System :: OS Independent', - 'Topic :: Internet :: WWW/HTTP :: WSGI :: Application', - 'Topic :: Software Development :: Libraries :: Application Frameworks' - ], - include_package_data=True, # needed to include swagger-ui (see MANIFEST.in) - entry_points={'console_scripts': ['connexion = connexion.cli:main']} -)