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
* fix(bench): new-site params for root db credentials
allow root credentials for postgresql
use common cli option name for both database types
* fix(bench): backward compatible db params
Co-authored-by: gavin <gavin18d@gmail.com>
* fix(bench): use common db cred params
use --db-root-username and --db-root-password
* feat(bench): add --set-default to bench new-site
* fix: do not set default root user
* fix: indentation
Co-authored-by: gavin <gavin18d@gmail.com>
* Update installer.py
* fix: Drop table only if it exists
* revert: "Update installer.py"
This reverts commit 0e8370ede8a9c2b1c0687e5c216ecf67566da0f5.
Co-authored-by: Suraj Shetty <surajshetty3416@gmail.com>
Previous order was:
1. Delete DocTypes
2. Delete linked records
3. Drop tables
Now if linked records belonged to deleted doctypes it causes
uninstallation failure.
Changed order to:
1. Delete linked records
2. Delete DocTypes
3. Drop tables
Remove_app assumed that all link fileds linking to "Module Def" are
called "module", this causes uninstall failure and leaves bench in
pseudo-irrecoverable state. (requiring some manual cleanup)
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 several unnecessary comprehensions from functions that accept a generator.
- Using `[x for x in iter]` causes a list to be built first then passed to the outer function.
- `any` and `all` can take generator instead. This makes memory usage O(1) and actually makes these functions short-circuiting. E.g. if the first condition fails then `all` will immediately return false instead of evaluating all the entries.
- `sum`, `min`, `max` => memory usage become O(1)
- `list`, `set`, `.join()` => roughly halves memory usage, as list is not required to be built.
- lastly, it's two fewer characters to read/think about.