Commit graph

1771 commits

Author SHA1 Message Date
Ankush Menat
c1c4a7dd48
perf: speed up @request_cache by ~2x (#28803)
- Eagerly initialize request_cache, all requests use it, so what is the
  point of doing it lazily?
- Reduce accesses to `frappe.local` namespace, get cache once and reuse
  it in rest of the execution.

Before: 1250ns +/- 1%
After: 645ns +/- 1%

Source: Trust me bro.
(no really, for now just trust me or look at the diff)
2024-12-17 07:35:38 +00:00
Ankush Menat
5bf50b6bc2 perf: Avoid patching QB in every request 2024-12-17 10:58:31 +05:30
David Arnold
d17136cd04
fix: redirect cssutils logger to file (#28692) 2024-12-08 13:42:18 +05:30
David Arnold
fef569e284
refactor: simplify bencher (#28694)
* chore: flatten bencher class layout

* chore: rename bencher to clarify

* docs: add file level docstrings
2024-12-07 14:10:03 +00:00
David Arnold
3d71f594d8
refactor: bench class inauguration (#28158)
* 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
2024-12-06 19:07:34 +01:00
David Arnold
75377aaaf5
refactor(typing): type filters (#28218)
* chore(typing): type filters

* chore(typing): type filters for get_list et al

* fix: dashboard chart filter expression

* test: fix case with new-style right hand object to equality check

* chore: place new typed filter under typing verification

* chore: remove debug print statment

* chore: inverse logic of type guard

* fix: add float to filter value types

* chore: clarify value naming
2024-12-04 23:18:53 +00:00
Akhil Narang
84ef6ec677
refactor: fixup with ruff 0.8.1
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-12-04 13:18:04 +05:30
Faris Ansari
f7c005dc09
Merge pull request #28629 from netchampfaris/autoincrement-renaming
fix: allow renaming autoincrement documents
2024-12-02 14:25:05 +05:30
Faris Ansari
3b014a2548 test: rename autoincrement document 2024-11-30 16:49:04 +05:30
David Arnold
e2a8c7fed3
test: fix universal type checker based on downstream use and more testing (#28619)
* test: fix universal type checker based on downstream use and more testing

* fix: type validation error reporting

* fix: types; various

* chore: switch off test-time type checking

still too many errors
2024-11-28 23:35:32 +01:00
David Arnold
c7eb914679
chore: fixup type hint oversight (#28467) 2024-11-14 13:27:42 +00:00
David Arnold
268c33d3ed
fix(typing): hack-hint to type checkers for ide use (#28257) 2024-10-24 21:16:05 +02:00
David Arnold
8d6f8bce01
chore(typing): add some more typing to frappe.__init__ (#28215) 2024-10-21 11:30:11 +00:00
David Arnold
f7a7cef54a
chore: split custom types into types module (#28204) 2024-10-20 23:01:36 +00:00
Akhil Narang
ff0fe1228e
Merge pull request #28118 from Priyansh121096/fix
refactor: Replace hard-coded pg default port with PostgresDatabase.default_port
2024-10-14 16:00:20 +05:30
Priyansh Agrawal
92a0ffb191 refactor: Replace hard-coded pg default port with PostgresDatabase.default_port 2024-10-13 18:00:48 +00:00
Ankush Menat
a25df17efb
Revert "refactor: Replace hard-coded pg default port with PostgresDatabase.de…" (#28117)
This reverts commit cfb04b93e1.
2024-10-13 13:05:50 +00:00
David Arnold
bd07ae994d
feat: may copy MappingProxyType (#28083) 2024-10-11 04:01:23 +00:00
David Arnold
443c38daa9
refactor: toml test records for readability (#28065)
* refactor: toml test records for readability

* fix: maintain backwards compatibility

* refactor: transform in-tree records

* chore: don't use deprecated functions (treewide)

* chore: revert migration of tests which depend on old test records list

* feat: add cls.globalTestRecords on IntegrationTestCase
2024-10-10 13:24:02 +02:00
David Arnold
8cfeb156df
devx: add deprecation dumpster (#27887)
* feat: Add deprecation_dumpster.py file

* docs: add jovial and jocose docstring for frappe/deprecation_dumpster.py

* refactor: fill the dumpster with its own kind

* refactor: move to the deprecation dumpster

* chore: color coding class

* fix: only check import error when import errors
2024-10-08 18:56:10 +02:00
David Arnold
c2c9d9062a
Testing Improvements 3 (#27995)
* feat: set doctype on test classes

* refactor: Transform `make_test_records` into a generator

* feat: lazy create doctype records on first use

* perf: improve file walker

* fix: submission queue test

* refactor: improve logging a bit

* fix: global records install for app (semifix)
2024-10-06 15:04:47 +00:00
Priyansh Agrawal
cfb04b93e1
refactor: Replace hard-coded pg default port with PostgresDatabase.default_port (#27989) 2024-10-05 17:59:26 +00:00
Akhil Narang
c044680c3f
Merge pull request #27505 from dj12djdjs/fix-link-title-href
fix: show link title in generated form hrefs
2024-09-13 18:17:15 +05:30
Rushabh Mehta
ddee23f5ad fix(ui): sortable sidebar, fixes to breadcrumbs etc 2024-09-06 14:12:36 +05:30
Devin Slauenwhite
a2f4013e1e fix: show link title in generated form hrefs 2024-08-22 20:35:25 -04:00
Rushabh Mehta
1d678146a9 fix(styles): cleaner sidebars for list and form 2024-08-14 16:13:57 +05:30
Philipp Gruener
7df4185f87 fix: removed TODO marks 2024-07-08 15:16:51 +02:00
Philipp Gruener
1b56b4f3f7 fix: Reset to orig env vars in specs 2024-07-05 15:44:04 +02:00
Philipp Gruener
abba28be3b feat: Added env db options for db, password and pg_schema 2024-07-05 12:05:20 +02:00
gruener
c6af3ab8d3
Merge branch 'frappe:develop' into feature/db_env_credentials 2024-07-04 23:16:19 +02:00
Philipp Gruener
a63cd89607 fix: Fixed wrong quotes for changes 2024-07-04 22:24:42 +02:00
Philipp Gruener
442ad03d7b feat: Adds possibility of permitting DB credentials via ENV vars instead of persisting them on the volume. 2024-07-04 22:24:21 +02:00
mahsem
659baa1591
fix: make error title translatable (#26922) 2024-07-01 19:12:58 +02:00
Ankush Menat
1269e31170
fix: cast port to integer (#26623)
Not using cint to avoid converting bad input to 0.
2024-05-31 12:44:14 +05:30
Ankush Menat
4fbeb4617a
fix: Use true stderr for dumping trace (#26524)
closes https://github.com/frappe/frappe/issues/26302
2024-05-22 07:00:29 +00:00
Ankush Menat
e240c6bdf8
perf: Avoid caching module_app (#26349)
module_app is just reverse of app_module.

This saves ~1.5% of overhead.
2024-05-07 07:06:44 +00:00
Ankush Menat
8ab308838b feat: Keep certain keys persistent in cache 2024-05-04 15:08:35 +05:30
Ankush Menat
79d18c1fbb
fix: print debug log to stderr (#26128) 2024-04-23 13:22:29 +00:00
Akhil Narang
f2c109394e
Merge pull request #26001 from kittiu/patch-3
fix: unknown charset windows-874 problem on incoming mail
2024-04-22 12:52:31 +05:30
Akhil Narang
441379e7a8
refactor: don't modify email library's dictionary
Keep our own map of alternative character sets

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-04-22 12:23:59 +05:30
Ankush Menat
a49189ad6e fix: register faulthandler on true stderr only
https://github.com/frappe/frappe/issues/25613
2024-04-18 13:38:12 +05:30
Akhil Narang
bf931598a2
Revert "Merge pull request #25755 from akhilnarang/optional-skip-msgprint"
This reverts commit f8121b99df, reversing
changes made to 14e2d95947.
2024-04-01 21:42:12 +05:30
Akhil Narang
ca83ad580c
feat: allow skipping msgprint
If we're handling the exception on our own, we don't need to show the user anything
Example: https://github.com/frappe/frappe/blob/version-15/frappe/desk/doctype/event/event.py#L398

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-04-01 14:21:47 +05:30
David
39d4318a27
feat: enable db socket connection 2024-03-29 10:29:50 +01:00
Akhil Narang
07f93e2817
fix(generate_hash): Deprecate txt parameter - its not used.
`length` has a default value anyway, no need of checking and setting a default.

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-29 12:12:15 +05:30
Ankush Menat
dbcf7ad30c refactor: update usage of modified everywhere 2024-03-27 11:23:13 +05:30
Ankush Menat
6560d4587a fix: debug stuck process by sending SIGUSR1
It will print stack to stderr.
2024-03-18 11:59:47 +05:30
Revant Nandgaonkar
77618cde1f
feat: connect to redis sentinel for redis cache (#25398) 2024-03-14 13:54:46 +05:30
Ankush Menat
4ef0740ad5 fix: print frappe.log message 2024-03-12 20:20:07 +05:30
Akhil Narang
88c5da4d62
Merge pull request #25149 from akhilnarang/minor-fixes
fix(setup_module_map): fix caching
2024-02-28 17:53:32 +05:30