Commit Graph

181 Commits

Author SHA1 Message Date
Tom Christie 66cce0f1c3 Merge branch 'master' of https://github.com/encode/starlette 2018-10-16 16:10:34 +01:00
Tom Christie b829248e7d Add feature list to README/docs 2018-10-16 16:10:24 +01:00
Tom Christie c50460fbb9
Add final missing annotations, and enable '--disallow-untyped-defs' (#115)
* fix(dataStructures): missing annotations added

* fix(requests.py): annotations added

* fix(Annotations): wrong annotations fixed on datastructures and requests modules.

* fix(Missing annotation): missing annotations added on testclient module.

* fix(testclient): annotations fixed

* minor tweaks

* fix(testclient): Session request method fixed. WIP _ASGIAdapter send method

* fix(testclient): small tweaks

* Switch on --disallow-untyped-defs when testing with mypy
2018-10-16 15:56:28 +01:00
Tom Christie 43fb676439
Add missing type annotations (#113)
* Add missing type annotations

* Type annotation tweak
2018-10-16 13:20:10 +01:00
Tom Christie e2cdd2e1ee Type annotation tweaks 2018-10-16 10:28:11 +01:00
Marcos Schroh d05aa0fd16 Missing annotations added on responses module. (#67)
* fix(dataStructures): missing annotations added

* fix(requests.py): annotations added

* fix(Annotations): wrong annotations fixed on datastructures and requests modules.

* fix(Missing annotation): missing annotations added on responses module.

* fix(responses): annotations fixed

* fix(datastructures): missing annotations added
2018-10-16 10:25:58 +01:00
Tom Christie 0a86c16a24
Adding type annotations (#112)
* Adding type annotations

* Add missing import
2018-10-16 10:22:55 +01:00
Marcos Schroh 300977aa23 Missing annotations added on applications module (#73)
* fix(dataStructures): missing annotations added

* fix(requests.py): annotations added

* fix(Annotations): wrong annotations fixed on datastructures and requests modules.

* fix(Missing annotation): missing annotations added on applications module.

* fix(): ASGIApp annotation type should be used.

* fix(): Optional typing should be avoided when we have default values.

* fix(applications): unnecessary comment for annotation deleted

* small tweaks

* fix(applications): annotations fixed

* fix: Methods should have None as default value on Path

* fix(applications): Unnecessary annotation removed.
2018-10-16 09:26:37 +01:00
Tom Christie 709bdf38f5 Version 0.4.2 2018-10-15 12:21:01 +01:00
Tom Christie 097152be5a
Add GZip middleware (#111) 2018-10-15 12:08:10 +01:00
Tom Christie d05ef2328d
Enable mypy in tests (#110) 2018-10-15 10:13:09 +01:00
Tom Christie 77d995d7c8
Handle server: None and scheme: None cases in URL scope (#109) 2018-10-15 09:36:05 +01:00
Tom Christie 02aaa4bddf Version 0.4.1 2018-10-12 18:15:56 +01:00
Tom Christie c43a070eed
Form parsing (#102)
* Work towards MultiPartParser

* Work towards MultiPartParser

* Add test for multipart files

* MultiPart parsing

* Fix for large multipart messages

* Add python-multipart to docs

* Add python-multipart to 'pip install starlette[full]'

* Add FormParser

* Add docs for request.form()

* Drop mypy momentarily
2018-10-12 18:15:04 +01:00
Alex Botello 7a0f89abb8 Respond to credentialed requests with specific origin (#105)
* Respond with specific origin instead of wildcard for credentialed requests

* Add test case for credentialed standard request

* Add tests for setting vary header
2018-10-12 09:46:10 +01:00
Tom Christie cc09042c1c
Enable mypy in tests (#103)
* Enable mypy in tests

* Fix TestClient annotations
2018-10-10 17:33:12 +01:00
Tom Christie 09ce2c373a Version 0.4.0 2018-10-10 17:12:58 +01:00
Tom Christie 58898a729c
Add explicit UJSONResponse (#99) 2018-10-10 17:04:12 +01:00
Tom Christie 59c5c24f6a Version 0.3.7 2018-10-10 09:01:01 +01:00
Ben Fitzhardinge 9cbcba79df Added init file so autodetect will pick up middleware (#101) 2018-10-10 09:00:09 +01:00
Tom Christie 04d40e7489 Version 0.3.6 2018-10-09 15:48:34 +01:00
Tom Christie 139753f857
Add support for `app.on_event("startup")` and `app.on_event("cleanup")`. (#98)
* Push black linting into ./scripts/test Fix some annotations etc.

* Skip black on 3.7

* Fix script

* Blergh. Shell equality tests are weird

* Attempt to fix equality check

* Document 'allow_origin_regex'

* Support app.on_event('startup') and app.on_event('cleanup')

* Nicer decorator handling for on_event

* Add documentation for app.on_event()
2018-10-09 15:47:51 +01:00
Karan Suthar 27fc98b58b unicorn command correction in docs (#97) 2018-10-09 12:41:53 +01:00
Tom Christie 060f0593bc
Push black linting into ./scripts/test (#96)
* Push black linting into ./scripts/test Fix some annotations etc.

* Skip black on 3.7

* Fix script

* Blergh. Shell equality tests are weird

* Attempt to fix equality check
2018-10-09 12:27:27 +01:00
Tom Christie d505abc0b5
Don't partially enforce CORS server-side (#93)
* Don't partially enforce CORS server-side

* Comment on CORS enforcement
2018-10-09 10:07:51 +01:00
Alex Botello fc6883aa0a Support `allow_origin_regex` in CORSMiddleware (#92)
* Add tests for allow_origin_regex

* Add support for allow_origin_regex

* black linting

* refactor if statement on line 76

* Invert conditional to a more readable syntax
2018-10-09 09:35:08 +01:00
Tom Christie bdf99f1f61
Extra guardrails for ensuring correct responses with TestClient (#91)
* Extra guardrails for ensuring correct responses with TestClient

* Black formatting
2018-10-08 10:39:43 +01:00
Tom Christie f9c93d60a1 Version 0.3.5 2018-10-08 08:56:23 +01:00
Jordan Eremieff d1ba5d6722 Cookies (#86)
* Initial cookies support for response/request classes

* Type hint

* Drop .get_cookie() from request class
2018-10-06 13:08:16 +01:00
Alex Botello 651ed96c1e Fix runtime error within CORSMiddleware (#88)
* Fix duplicate messages sent in CORSMiddleware.
2018-10-06 12:54:53 +01:00
Tom Christie 67fd28adc2 Version 0.3.4 2018-10-05 16:39:11 +01:00
Tom Christie c98c15005e
Middleware and CORS support (#83)
* Tweaks to URL datastructure

* Linting

* Add Middleware

* Type annotations

* CORS support

* Add CORS support

* Fix code example
2018-10-05 16:38:02 +01:00
Tom Christie 19670ae2cd
Middleware (#82)
* Tweaks to URL datastructure

* Linting

* Add Middleware
2018-10-05 12:04:11 +01:00
Tom Christie 94044e5991
Tweaks to URL datastructure (#81)
* Tweaks to URL datastructure

* Linting
2018-10-05 11:29:06 +01:00
Marcos Schroh d36499526d Missing annotations added on staticfiles module (#70)
* fix(Missing annotation): missing annotations added on staticfiles module.

* fix(staticfiles annotations): annotations fixed.

* refactor(staticfiles): only instanciate a class when is necessary.
2018-10-02 19:06:34 +01:00
Tom Christie bc66a872e9 Version 0.3.3 2018-10-02 13:31:09 +01:00
Tom Christie a24ba66556 Type hinting 2018-10-02 13:24:02 +01:00
Marcos Schroh 041381e40c Missing annotations on websockets module. (#69)
* fix(Missing annotation): missing annotations added on websockets module.

* fix(websockets annotations): implied optionals should be used.
2018-10-02 13:15:33 +01:00
Tom Christie 6d2e9f4fae replace -> replace_components (Avoid clashing with str builtin) 2018-10-02 13:13:16 +01:00
Marcos Schroh 7eafe567df Missing annotations added datastructures & requests modules (#60)
* fix(dataStructures): missing annotations added

* fix(requests.py): annotations added

* fix(Annotations): wrong annotations fixed on datastructures and requests modules.
2018-10-02 12:31:05 +01:00
Tom Christie 7dc07267c2 Update background task tests 2018-10-02 12:29:44 +01:00
Tom Christie ee32830003 Minor tweaks to background task docs 2018-10-02 11:47:49 +01:00
Alex Botello 7c1a1e9dd5 Add support for background tasks (#65)
* Build out a BackgroundTask class

* Integrate BackgroundTask into Response class

* Add test cases for background tasks

* Add documentation for background tasks

* Reformat files with black

* Make requested changes

* Improve documentation example
2018-10-02 11:40:08 +01:00
Tom Christie 4c7e79f4e7 Minor tweaks to WS docs 2018-10-02 11:30:54 +01:00
Jordan Eremieff 1ce4c89149 Class-based websocket handler (#62)
* WebSocketEndpoint class, docs, tests.

* Refactor WebSocketEndpoint class to only store scope. Update WebSocketEndpoint docs example and tests.

* Add decode method to WebSocketEndpoint, update docs, update tests
2018-10-02 11:26:19 +01:00
Marcos Schroh df2985f50e Missing annotations debug module (#68)
* fix(Missing annotation): missing annotations added on debug module.

* fix(debug.py): linting fixed.

* fix(debug annotations): annotations fixed.

* fix(): ASGIInstance annotation type should be used on return of _DebugResponder __call__ method.

* fix(): Exception type should be used instead of Any.
2018-09-28 10:41:22 +01:00
Marcos Schroh 29c53d5a54 fix(Missing annotation): missing annotations added on endpoints module. (#72) 2018-09-27 10:19:21 +01:00
Marcos Schroh a24aa3dfe7 fix(Missing annotation): missing annotations added on routing module. (#71) 2018-09-26 15:30:38 +01:00
Tom Christie 12e4ef60d7
Add link to latest TechEmpower benchmarks (#61) 2018-09-20 10:00:25 +01:00
Tom Christie fb74074b3f Black formatting 2018-09-18 11:03:18 +01:00