Commit Graph

41 Commits

Author SHA1 Message Date
Robbe Sneyders
a210917b46 Drop Python 3.7 in favor of 3.11 and 3.12 (#1752)
Python 3.7 is end of life. We should support the newer versions instead.

I also changed tox to only run against the minimum dependency versions
on the lowest Python version, since this should lead to the lowest
versions over all Python versions, and hopefully helps speed up our
pipelines :)
2023-10-23 23:11:06 +02:00
Robbe Sneyders
abc1da750e Update routing documentation (#1738)
Works towards #1531 

Some parts of the old outing docs will need to be included on the
`parameters` and `swagger-ui` pages which we still need to add.
2023-10-12 01:37:45 +02:00
Robbe Sneyders
15e985e864 Introduce poetry (#1628) 2023-02-07 20:17:38 +01:00
Robbe Sneyders
edb0381af3 Implement user facing interface for ConnexionMiddleware (#1621)
This PR adds an interface for the ConnexionMiddleware, similar to the
interface of the Connexion Apps.

The Connexion Apps are now a simple wrapper around the
ConnexionMiddleware and framework app, delegating the work to the
middleware. This enables a similar interface and behavior for users when
using either the middleware or apps.

The arguments are repeated everywhere there is a user interface, but are
parsed in a central place. Repeating the arguments is not DRY, but
needed to provide users with IDE autocomplete, typing, etc. They are
parsed in a single `_Options` class, which also provides a mechanism to
set default options on an App level, and override them on the more
granular API level.

This makes the long list of provided parameters a lot more manageable,
so I would like to use it for the `Jsonifier` as well, and re-add the
`debug` and `extra_files` arguments which I have dropped in previous
PRs. I'll submit a separate PR for this.

I renamed the `options` parameter to `swagger_ui_options` since it only
contains swagger UI options. This is a breaking change though, and we'll
need to highlight this upon release.

We still have quite a lot of `App`, `MiddlewareApp`, and abstract
classes. It would be great if we could find a way to reduce those
further, or at least find better naming to make it more clear what each
one does 🙂 .

Finally, I added examples on how the middleware can be used with third
party frameworks under `examples/frameworks`. Currently there's an
example for Starlette and Quart, but this should be easy to extend. They
also show how the `ASGIDecorator` and `StarletteDecorator` from my
previous PR can be used.
2023-01-26 14:40:29 +01:00
Robbe Sneyders
67bd37fe77 Activate mypy check in pre-commit (#1560) 2022-08-23 09:02:14 +02:00
Robbe Sneyders
29747fafc3 Add black formatting 2022-06-25 23:50:40 +02:00
Robbe Sneyders
7f2931037e Add pre-commit hook (#1511) 2022-04-12 22:02:29 +02:00
Robbe Sneyders
9d3155f1be Add Python 3.10 in favor of 3.6 (#1494)
* Add Python 3.10 in favor of 3.6

* Increase lower bound requests for Python 3.10 compatibility
2022-03-28 23:54:53 +02:00
Robbe Sneyders
ca70b16ff5 Drop aiohttp support (#1491) 2022-03-22 22:26:41 +01:00
Christian Clauss
8c49a61156 Tox.ini: Run mypy in ignore_outcome mode (#1405)
* Tox.ini: Run mypy in allow errors mode

* py39: mypy

* touch .mypy_cache

* Make sure .mypy_cache exists

* Update tox.ini

* mkdir .mypy_cache

* mkdir .mypy_cache

* mkdir .mypy_cache

* mypy --install-types --non-interactive . || true

* mypy --exclude=/examples/ --install-types --non-interactive . || true

* mypy --exclude /examples/ --install-types --non-interactive .

* mypy --exclude /examples/* --install-types --non-interactive .

* mypy --exclude '/app\.py$' --install-types --non-interactive .

* mypy --exclude '/(app|hello)\.py$' --install-types --non-interactive .

* mypy --exclude '/(api|app|hello)\.py$' --install-types --non-interactive .

* mypy --exclude '/(__init__|api|app|hello)\.py$' --install-types --non-interactive .

* mypy --exclude '/(__init__|api|api.pets|app|hello)\.py$' --install-types --non-interactive .

* mypy --exclude '/(__init__|api|api.pets|app|hello|resty)\.py$' --install-types --non-interactive .

* mypy --exclude '/(__init__|api|api.pets|app|hello|orm|resty)\.py$' --install-types --non-interactive .

* Update pipeline.yml

* Update tox.ini

* Update pipeline.yml

* Update tox.ini

* Update mypy invocation and fix typing errors

Make it such that mypy will not return an exit code 2, which
indicates a failure in running mypy itself.

Co-authored-by: Ruwan <ruwanlambrichts@gmail.com>
2021-08-23 14:20:05 +02:00
Robbe Sneyders
2066503c5c Add ARCHITECTURE.rst and module docstrings (#1368)
* Add ARCHITECTURE.rst and module docstrings

* fix flake8

Co-authored-by: Henning Jacobs <henning@zalando.de>
2021-07-09 17:49:54 +02:00
Christian Clauss
1012721d2d Upgrade isort==5.9.1 (#1388)
* Upgrade isort==5.9.1

* isort --thirdparty connexion,aiohttp ./tests

* isort --thirdparty aiohttp,connexion --check-only --diff .

* cd tests before running isort
2021-07-07 12:43:36 +02:00
Robbe Sneyders
e3dd3c9273 Add API reference documentation (#1390)
* Add auto generated api documentation

* Fix rst formatting errors

* Add flake8 rst docstring check
2021-07-06 23:33:20 +02:00
Christian Clauss
080c176aa8 tox.ini: flake8==3.9.2 2021-07-04 21:53:04 +02:00
Christian Clauss
068c4e9a85 GitHub Action: test on current version of Python (#1379)
* GitHub Action: test on current version of Python

* tox.ini: py39

* 3.7: py37-min,py37-pypi,flake8

* Update tox.ini
2021-07-04 19:35:56 +02:00
Robbe Sneyders
82a0b8eb44 Add upper limits for dependency versions 2021-06-25 13:08:46 +02:00
Robbe Sneyders
b0eadadecc Update isort commands for newest version 2021-06-25 13:08:46 +02:00
Robbe Sneyders
f72fbc4d25 Move CICD from travis to github actions 2021-06-25 13:08:46 +02:00
Henning Jacobs
7240f94748 fix release.sh to succeed 2019-12-16 14:39:38 +01:00
Tomasz Trębski
ec37d03902 Drop Python 2.7 support (#1058)
* Drop 2.7

* fixup! Drop 2.7

* fixup! Drop 2.7
2019-10-27 23:01:23 +01:00
Henning Jacobs
c8d8973c7e drop Python 3.5, add 3.8 (#1056)
* drop Python 3.5, add 3.8

* remove old pypy 2.7 (no longer available on 18.04)
2019-10-18 13:32:43 +02:00
Tomasz Trębski
042174a585 Fix travis deprecation (#988) 2019-07-13 11:27:34 +02:00
Tomasz Trębski
123c5c9fbd Remove Python 3.4 (#990)
* EOL Python 3.4

* fixup! EOL Python 3.4

* fixup! EOL Python 3.4

* fixup! EOL Python 3.4
2019-07-09 13:53:44 +02:00
Jacob Floyd
890fe9a171 Respond with problems by default in aiohttp. (#952)
* Respond with problems by default in aiohttp.
2019-06-14 09:07:07 +02:00
Daniel Grossmann-Kavanagh
08e4536e5e bump and pin isort, apply all automatic fixes (#903)
Fixes the build.

Changes proposed in this pull request:
 - apply all of the isort changes that resulted from the latest version
 - pin to the latest version (4.3.15) so this doesn't happen again, unless we bump the version on purpose
2019-03-15 13:04:33 +01:00
Daniel Grossmann-Kavanagh
f32c8444a1 Pin flake8 to avoid needing to import any types mentioned in type hints (#867)
Flake8 now requires you to import anything mentioned in a type hint comment. This is extra annoying to reconcile across python versions.
2019-02-04 13:03:19 +01:00
krise3k
fa9c00a191 Run travis on python3.7 (#790) 2018-11-22 08:32:36 +01:00
Diogo Dutra
f24ca441dc Changes did on the base code to support aiohttp
- Added the AioHttpApi and AioHttpApp on connexion __init__;
- Created an abstract method on AbstractApi to cast the framework response to connexion response;
- Implemented the get_connexion_response on FlaskApi;
- Changed the CLI to use any kind of App class;
- Changed the ResponseValidator to always convert the response to a connexion response;
- Changed the ResponseValidator to support coroutine responses;
- Added the aiohttp as optional dependency;
- Added ujson as optional dependency;
- Skipped the aiohttp tests run on python 2.7;
- Changed the tests configs to run aiohttp tests properly on python 3.4+.
2018-01-18 12:53:58 -02:00
Henning Jacobs
7199745862 Fix tests (#560)
* isort

* no longer test dev dependencies on Travis
2018-01-13 19:48:43 +01:00
Rafael Caricio
498976f191 Add Python 3.6 2017-06-30 17:33:30 +02:00
Yoan Blanc
6b5107122e Using Requirements Builder for Tox setup
Requirements Builder provides a way to run tests against all interesting
versions of the requirements: minimal, latest as well as development
(from git, hg, svn).

It requires to move the requirements into the setup.py and to provide a
minimal version. requirements-devel aims at helping you working

* It detected a conflict with six version which had to be bumped up;
* building PyYAML from Subversion fails so it's commented in the
  requirement-devel.txt file.

A cool blog post on how to keep some balance between setup.py and
requirements.txt file:
https://caremad.io/posts/2013/07/setup-vs-requirement/
2016-10-18 14:45:16 +02:00
Yoan Blanc
be437a980b Fix isort checks 2016-10-16 11:32:11 +02:00
Jens Finkhaeuser
e493bfd8ee Add CLI option to isort to output diff of proposed changes. 2016-09-13 16:34:29 +02:00
Rafael Caricio
e3871185c0 #237 Guarantee we still support Flask 0.10.1 2016-06-03 13:35:34 +02:00
Rafael Caricio
c4590fbcbb Use tox in travis 2016-04-08 14:33:27 +02:00
Rafael Caricio
a86b96c5e2 Sort imports in tests and examples 2016-04-08 14:33:27 +02:00
Rafael Caricio
6358c8c47d Adopt isort to ensure better code quality 2016-04-08 14:33:27 +02:00
Rafael Caricio
9085ae5c4b Support parameters definitions in path 2016-02-16 18:41:57 +01:00
Rafael Caricio
9f8ecf37aa Update tox.ini to match project test definitions 2016-02-15 15:42:35 +01:00
João Santos
00281f9435 Make code more pythonic and less error prone 2015-10-13 11:53:18 +02:00
Henning Jacobs
8e440446d5 allow running python3 setup.py flake8 2015-06-12 10:42:25 +02:00