* feat: Add bench layout classes and configuration handler
Bench layout: (`frappe.bench`)
- Layout by env variable, e.g. FRAPPE_BENCH_PATH, FRAPPE_SITES_PATH, etc
- Detecting modules and apps by the presence of a sentinel .frappe file
- Site is scoped by frappe.local.site_name (thread safe)
Config handler: (`frappe.bench.sites{,.site}.config`)
- Optional config registry for better discovery; warning if not specced
- Env variable overload with `FRAPPE_` prefix
* chore: type frappe.config
* chore: type frappe.bencher
* chore: py310 compat
This seems to occur when new files are being created as we're archiving
the files on a site. Doesn't make sense to fail the entire backup
because of that.
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
* fix: checkpoint the supported schemes for connectivity
This PR implements a gateway + error that clearly hints the operator at
a misconfigured system during runtime.
Particularity, against the multiple library-provided ways of configuring
redis connection strings (in python), this hard stops if an unsupported
one is chosen by accident.
* fix: remove unknown protocol
---------
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
refactor: clean up code to py39+ supported syntax
- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes
Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
* feat: log errors on too many writes to ease debugging
* fix(ux): extract and show which app/file/function caused too many writes
* fix: postgres error checking assumes exception is postgres exception
* fix: better default for skipping frames
Typically stack is like: some_app -> your_function -> this function. So last 2 frames need to be skipped.
* fix: postgres error checking assumes exception is postgres exception
* fix: better default for skipping frames
Typically stack is like: some_app -> your_function -> this function. So last 2 frames need to be skipped.
* refactor: show Report button instead of logging
* revert: unnecessary new functionality
* test: assert exact exception
Co-authored-by: Ankush Menat <ankush@frappe.io>
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
* Remove six for PY2 compatability since our dependencies are not, PY2
is legacy.
* Removed usages of utils from future/past libraries since they are
deprecated. This includes 'from __future__ ...' and 'from past...'
statements.
* Removed compatibility imports for PY2, switched from six imports to
standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass