Commit Graph

555 Commits

Author SHA1 Message Date
Johnathan Raymond
e21521f45c
Fix type hinting for load_env (#2107)
* Deprecate `load_env` in favor of `env_prefix`

`load_env` both enabled/disabled environment variable parsing, while
also letting the user modify the env prefix. Deprecate the ability to
disable environment parsing, and add a new config variable to track the
user's desired prefix for environment-based configuration.

Resolves: #2102

* Add a few common .gitignore patterns
2021-04-12 21:31:35 +03:00
Stephen Sadowski
30479765cb
Fix request.args.pop removes parameters inconsistently (#2110)
* Fix https://github.com/sanic-org/sanic/issues/2106

* style

* also apply fix to request.query_args

* add test

Co-authored-by: Arthur Goldberg <arthur.c.goldberg@gmail.com>
Co-authored-by: artcg <arthurgoldbergfwd@gmail.com>
2021-04-11 01:04:33 +03:00
ENT8R
53a571ec6c
Consistent use of error loggers (#2109)
* Consistent use of error loggers

* Fix tests
2021-04-10 21:35:53 +03:00
ENT8R
ad97cac313
Explicit usage of CIMultiDict getters (#2104) 2021-04-08 13:30:12 +03:00
Harsha Narayana
1a352ddf55
GIT-2023: Enable GitHub Actions support (#2050)
* GIT-2023: Enable GitHub Actions support

* GIT-2023: fix tox runtime trigger

* GIT-2023: add top level action name

* GIT-2023: rename tox step name

* GIT-2023: rename build task names

* GIT-2023: remove macos and windows + nightly versions

* GIT-2023: add macos and windows back to os matrix

* GIT-2023: expermiental flag to conditionally skip failure

* GIT-2023: enable using custom actions

* GIT-2023: fix matrix config rendering type

* GIT-2023: fix naming issue with os label

* GIT-2023: enable type-checking env for tox

* GIT-2023: enable pypy3.7 support

* GIT-2023: enable pypy experimental flag

* GIT-2023: add pypy tox env config

* add max timeout of 5 min for pypy tests

* GIT-2023: add timeout for each actions

* GIT-2023: fix codeQL workflow actions

* GIT-2023: limit test matrix to ubuntu and support on demand

* GIT-2023: enable docker image publish on release

* GIT-2023: fix on-demand pypy action

* GIT-2023: enable pypi publish workflow

* GIT-2023: enable verbose logs for py3.9

* GIT-2023: reduce py3.9 verbosity

* GIT-2023: enable docs linter

* GIT-2023: extend test matrix to include macos + windows

* GIT-2023: move windows based workflow to standalone task

* GIT-2023: fix windows test matrix

* GIT-2023: mark py39-no-ext as flaky test

* GIT-2023: mark flaky test

* GIT-2023: make timeout internal to steps for ease of management

* GIT-2023: rename image publish step name

* GIT-2023: mark keep alive client timeout for linux only

* GIT-2023: enable retries on test failure

Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
2021-04-06 23:32:01 +03:00
Frederik Gelder
8f06d035cb
fixing static request handler logging exception on 404 (#2099)
* fixing static request handler logging exception when not necessary, adding test to verify exception is gone on 404

* Fixup tests

* Fix tests

* resolve test failure

Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
2021-04-06 22:20:25 +03:00
Arthur Goldberg
42b1e7143e
deprecate abort (#2077) 2021-04-05 18:01:48 +03:00
Adam Hopkins
dfd1787a49
Make sure that blueprints with no slash is maintained when applied (#2085)
* Make sure that blueprints with no slash is maintained when applied

* Remove unneeded import
2021-03-23 02:28:42 +02:00
Adam Hopkins
4998fd54c0
Disable response timeout on websocket connections (#2081)
* Disable response timeout on websocket connections

* Add response timeout ignore test to websockets

* add logging assertion

* Move test items inside test context
2021-03-23 01:20:17 +02:00
Adam Hopkins
938d2b5923
Static dir 2075 (#2076)
* Add support for nested static directories

* Add support for nested static directories

* Bump version 21.3.1
2021-03-21 15:03:54 +02:00
Arthur Goldberg
6763e2bb0a
fix?: recursion error on Sanic subclass initialisation (#2072)
* fix?: recursion error on Sanic subclass init

* tests: add test case for sanic subclass initialisation

* Remove BaseSanic metaclass

Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
2021-03-21 10:09:31 +02:00
Adam Hopkins
15a8b5c894
Perf improv (#2074)
* handler improvements for performance

* Resovle tests

* Linting

* Add tests
2021-03-21 09:47:21 +02:00
Adam Hopkins
8a2ea626c6
RFC/1684 Context objects (#2063)
* Initial setup

* connection context

* Add tests

* move ctx to conn_info

* Move __setattr__ for __fake_slots__ check into base calss
2021-03-17 20:55:52 +02:00
Adam Hopkins
7bed5a5c3c
Add convenience decorators for new listeners (#2064) 2021-03-16 11:21:05 +02:00
Adam Hopkins
2fea954dcf
Add signal reservations (#2060)
* Add signal reservations

* Simplify reservations
2021-03-14 15:21:59 +02:00
Adam Hopkins
d4660d0ca7
Add add_signal method (#2061) 2021-03-14 14:06:27 +02:00
Adam Hopkins
824f41d6e0
RFC/1630 Signals (#2042)
* Temp working version of initial signal api

* fix signals router finalizing

* Additional tests

* Add event test

* finalize test

* remove old comment

* Add some missing annotations

* multiple apps per BP support

* deepsource?

* rtemove deepsource

* nominal change

* fix blueprints test

* trivial change to trigger build

* signal docstring

* squash

* squash

* Add a couple new tests

* Add some suggestions from review

* Remove inaccessible code

* Change where to condition
2021-03-14 10:09:07 +02:00
Adam Hopkins
b1a57a8b62
JSON encoder change via app (#2055) 2021-03-11 17:09:18 +02:00
Adam Hopkins
d76925cf35
Make get_app name optional (#2053) 2021-03-11 16:27:56 +02:00
Harsha Narayana
2c25af8cf5
GIT-2045: enable versioning and strict slash on BlueprintGroup (#2047)
* GIT-2045: enable versioning and strict slash on BlueprintGroup

* GIT-2045: convert named tuple into typed format + unit tests

* GIT-2045: add example code for versioned bpg

* GIT-2045: None value for strict slashes check

* GIT-2045: refactor handler types and add benchmark for urlparse

* GIT-2045: reduce urlparse benchmark iterations

* GIT-2045: add unit test and url merge behavior

* GIT-2045: cleanup example code and remove print

* GIT-2045: add test for slash duplication avoidence

* GIT-2045: fix issue with tailing / getting appended

* GIT-2045: use Optional instead of Union for Typing

* GIT-2045: use string for version arg

* GIT-2045: combine optional with union
2021-03-07 14:54:45 +02:00
Aksh Gupta
0d2d62eae5
chore: refactor code quality issues (#2044) 2021-03-05 10:26:03 +02:00
Adam Hopkins
93a697f6ea
Add __str__ and __repr__ to Sanic and Bluepring (#2043) 2021-03-03 16:58:18 +02:00
Adam Hopkins
a733d32715
Add raw header info to request object (#2032) 2021-03-03 16:33:34 +02:00
Adam Hopkins
27f64ddae2
Router tweaks (#2031)
* Add trailing slash when defined and strict_slashes

* Add partial matching, and fix some issues with url_for

* Cover additional edge cases

* cleanup tests
2021-03-01 15:30:52 +02:00
Adam Hopkins
4b968dc611
Listeners for main server process (#2018)
* Initial POC

* Add test case

* Resolve create_server and Gunicorn serve)

* add testr coverage
2021-03-01 15:03:26 +02:00
Adam Hopkins
37f0a51063 Remove Python 3.6 support 2021-02-21 23:28:28 +02:00
Adam Hopkins
7f63ad5484 Add some test coverage 2021-02-15 21:50:20 +02:00
Adam Hopkins
55a5ab4be1 squash 2021-02-15 14:01:32 +02:00
Adam Hopkins
5377a6eee3 squash 2021-02-15 13:54:08 +02:00
Adam Hopkins
6057da71f3 Resolve test suite 2021-02-15 13:45:29 +02:00
Adam Hopkins
b850e49cb3 test coverage with param change 2021-02-09 16:17:53 +02:00
Adam Hopkins
5f17e9591b worker 2021-02-08 14:09:41 +02:00
Adam Hopkins
64f0496d9e ASGI working 2021-02-08 12:43:10 +02:00
Adam Hopkins
0d5b2a0f69 debug and working stage--squash 2021-02-08 12:18:29 +02:00
Adam Hopkins
c08b153cee Resolve some more tests 2021-02-07 11:38:37 +02:00
Adam Hopkins
a434ffa8b7 interim 2021-02-04 00:42:24 +02:00
Adam Hopkins
3f1e9ff528 Clean up use cases: 2021-02-03 22:36:44 +02:00
Adam Hopkins
94e5f82a81 squash 2021-02-01 09:56:58 +02:00
Adam Hopkins
7b47a4bebc squash 2021-01-31 16:31:04 +02:00
Adam Hopkins
83705b91c2 squash 2021-01-28 09:34:51 +02:00
Adam Hopkins
5545264cea
Remove test client (#2009)
* Initial

* remove testmanager

* Resolve tests
2021-01-28 09:22:22 +02:00
Adam Hopkins
e04f206c50 Add SanicBase 2021-01-28 09:18:06 +02:00
Adam Hopkins
c32e7fd678 Resolve tests 2021-01-25 02:39:13 +02:00
Adam Hopkins
76ef641743 Resolve tests 2021-01-25 02:14:48 +02:00
Adam Hopkins
1f0f4ef5d5 remove testmanager 2021-01-19 16:34:52 +02:00
Adam Hopkins
933d005e5d squash 2021-01-19 16:17:07 +02:00
Adam Hopkins
f8f215772c squash 2021-01-19 16:11:09 +02:00
Adam Hopkins
a0066e5752 Initial 2021-01-19 15:54:20 +02:00
Adam Hopkins
0d7e2f0d67
Add request.id (#2005) 2021-01-19 04:25:39 +02:00
Ashley Sommer
6c03dd87b1
Allow Pathlib Path objects to be passed to app.static() helper (#2008)
* Allow Pathlib Path objects to be passed to the app.static file endpoint register helper.

* fixed import sort

* Raise error if static file path is not an accepted object type
Added more tests to improve coverage on the new type checks.
2021-01-19 03:53:14 +02:00