Commit graph

55 commits

Author SHA1 Message Date
Ankush Menat
cbe8a41cff
build: Add responses as developer dependency (#21440)
Useful for mocking HTTP responses in tests
2023-06-20 19:50:51 +05:30
Ankush Menat
828490e01a chore: bump many more old packages 2023-06-10 20:47:27 +05:30
Ankush Menat
18e791a353 build(deps): PyPDF2 -> pypdf
closes https://github.com/frappe/frappe/issues/19861
2023-06-10 20:47:27 +05:30
Ankush Menat
8485ac5d62 build(deps): bump many dependencies
test: change code to adapt to new werkzeug client

fix: avoid setting charset

utf8 is default and assumed now by werkzeug, setting this manually is
deprecated.

fix: use string instead of bytes for setting headers

DeprecationWarning: Passing bytes as a header value is deprecated and will not be supported in Werkzeug 3.0.
12:23:34 web.1         |   response.headers["X-Page-Name"] = path.encode("ascii", errors="xmlcharrefreplace")
2023-06-10 20:47:27 +05:30
Raffael Meyer
ed3b764db9
build(deps): bump cryptography and pyOpenSSL (#21307)
cryptography to 41.0.1, pyOpenSSL to 23.2.0
2023-06-10 11:23:15 +05:30
Sagar Vora
6065179080
chore: bump requests, chardet, and dropbox to latest versions (#21080)
* chore: bump `requests` and `chardet`

* chore: bump `dropbox` to `11.36.0`, ignore `GHSA-4xqq-73wg-5mjp` during pip-audit
2023-05-24 15:05:50 +05:30
Ankush Menat
f63c420798 feat: add python posthog library 2023-04-25 13:10:14 +05:30
Ankush Menat
0cab0b830d
refactor: replace imghdr with filetype (#20680)
* refactor: replace `imaghdr` with `filetype`

```
11:52:06 worker.1      | /home/ankush/benches/develop/apps/frappe/frappe/core/doctype/file/utils.py:2: DeprecationWarning: 'imghdr' is deprecated and slated for removal in Python 3.13
```

* feat: improved extension guessing using filecontent
2023-04-13 12:19:08 +05:30
Ankush Menat
c509983ca4 build: bump redis version
https://github.com/redis/redis-py/releases
2023-03-31 13:37:55 +05:30
Ankush Menat
024faff025
build: bump pymysql (#20478)
Actual fix for this bandaid fix: https://github.com/frappe/frappe/pull/20475

Keeping pymysql hard pinned until we have better way to get last full
query.
2023-03-28 13:04:27 +05:30
Ankush Menat
229dcb3c91
fix: pin pymysql to avoid breaking behaviour (#20475)
```
  File "/home/ankush/benches/develop/apps/frappe/frappe/database/database.py", line 920, in get_default
    d = self.get_defaults(key, parent)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ankush/benches/develop/apps/frappe/frappe/database/database.py", line 936, in get_defaults
    defaults = frappe.defaults.get_defaults_for(parent)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ankush/benches/develop/apps/frappe/frappe/defaults.py", line 222, in get_defaults_for
    .run(as_dict=True)
     ^^^^^^^^^^^^^^^^^
  File "/home/ankush/benches/develop/apps/frappe/frappe/query_builder/utils.py", line 85, in execute_query
    return frappe.db.sql(query, params, *args, **kwargs)  # nosemgrep
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ankush/benches/develop/apps/frappe/frappe/database/database.py", line 264, in sql
    self.log_query(query, values, debug, explain)
  File "/home/ankush/benches/develop/apps/frappe/frappe/database/mariadb/database.py", line 203, in log_query
    self.last_query = query = self._cursor._last_executed
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Cursor' object has no attribute '_last_executed'. Did you mean: '_check_executed'?
```
2023-03-28 12:07:13 +05:30
Ankush Menat
48f63f53ab feat: configurable rounding methods 2023-03-08 10:44:44 +05:30
MouSoeng
a093f7d4b6
chore(py): upgrade babel 2.9.0 -> 2.12.1 (#20251) 2023-03-07 14:27:10 +05:30
Raffael Meyer
9f73b94a74
build(deps): bump cryptography to 39.0.1 (#20042)
Security fix: https://cryptography.io/en/latest/changelog/#v39-0-1
2023-02-15 14:59:36 +05:30
barredterra
3f528dac75 build(deps): bump ipython to 8.10.0
Minor security fix: https://ipython.readthedocs.io/en/stable/whatsnew/version8.html#ipython-8-10
2023-02-15 00:44:37 +01:00
barredterra
92e684d4fc fix: use new source for zxcvbn 2023-01-24 14:07:34 +01:00
barredterra
8aa8ea0ee2 feat: bump zxcvbn version
zxcvbn 4.4.28 no longer crashes on long, random passwords.
2023-01-24 13:46:57 +01:00
Sagar Vora
0e40dff4d7
chore: bump gitpython to 3.1.30 (#19446) 2023-01-01 16:00:11 +05:30
Ankush Menat
ee9bfed4ec
Merge pull request #19029 from gavindsouza/runtime-type-checks-api
feat(whitelisted): Runtime typing hints validation
2022-12-19 15:46:49 +05:30
Ankush Menat
e0688f25a8
chore: pin markupsafe (#19348)
We depend on it for escaping. Currently this works because of indirect
dependencies:

```
λ pipdeptree -p MarkupSafe --reverse
MarkupSafe==2.1.1
  - Jinja2==3.1.2 [requires: MarkupSafe>=2.0]
    - frappe==15.0.0.dev0 [requires: Jinja2~=3.1.2]
  - Werkzeug==2.2.2 [requires: MarkupSafe>=2.1.1]
    - frappe==15.0.0.dev0 [requires: Werkzeug~=2.2.2]
```

[skip ci]
2022-12-19 15:37:28 +05:30
gavin
2c498910ba
Merge branch 'develop' into runtime-type-checks-api 2022-12-19 15:12:06 +05:30
bosdaring
0d26627c66
build: bump pyyaml (#19331)
* Cython and PyYAML

compatible version for rhel based os

* chore: dont pin cython

Co-authored-by: Ankush Menat <ankush@frappe.io>


[skip ci]
2022-12-19 11:47:03 +05:30
Gavin D'souza
4fe260e09e refactor: transform_parameter_types
- Switch to Pydantic which is under continuous development and can
  support more types
- Equivalent Pydantic API will try to transform data if possible
- The previous point makes it such that we don't need to explicitly try
  to parse each stringified int in app code since Pydantic can do this
- Drop typeguard since it did not handle 3.10+ native typing definitions
2022-12-15 13:47:05 +05:30
Gavin D'souza
f3250808f0 fix: Use typeguard to handle base hints
Pre process exceptions that Frappe requires and pass the ruleset to
typeguard's check_type API
2022-12-15 13:47:05 +05:30
Gavin D'souza
3fd74afa47 feat(whitelisted): Runtime typing hints validation
- Run type validations if annotations exist for whitelisted functions
- Run validations only on function calls in presense of frappe.local.request

In action:

```bash
> curl -H 'Content-Type: application/json' 'http://photos:8000/api/method/frappe.handler.download_file' -d '{"file_url": ["!=", "gavin.jpg"]}'
```

Note: This ignores stringified or ForwardRef types. If you want types to
be validated make sure they are not imported under `if TYPE_CHECKING`
blocks
2022-12-15 13:47:05 +05:30
Gavin D'souza
ccbc833c6c feat: runtime check via pydantic
handle localns stringified types
2022-12-15 13:47:05 +05:30
Ankush Menat
536ddc7832
build(deps): bump click to latest version (#19248) 2022-12-12 21:48:05 +05:30
Ankush Menat
d389fffbb7
feat: inter-process file locks (#19133) 2022-12-06 16:31:51 +05:30
Ankush Menat
9dbccc98cb chore: conflicts 2022-11-17 16:48:21 +05:30
Ankush Menat
dcdc22b53f build: pin pyopenssl
(cherry picked from commit f70db1f5397e1b1795cc3ac957bb9b2519d4341f)

# Conflicts:
#	pyproject.toml
2022-11-17 16:48:21 +05:30
Ankush Menat
b0cb1adc01 ci: config cleanup and bump coverage 2022-11-09 15:58:46 +05:30
Ankush Menat
032df946be
test: bg jobs test cleanup (#18767)
* test: fix flaky RQ job tests

Sometimes stop_job doesn't succeed and causes tests to timeout. Reduced
sleep time to avoid this in tests. We are still testing all the
important features - monitoring.

* build(deps): Bump RQ to latest version

Minor bugfixes that affect us

ref: https://github.com/rq/rq/releases

* test: sanity tests for scheduled job types

* test(test_runner): dont set bench_id globally

* refactor: stop_job shouldn't throw error

The intention of use here is to stop stuck jobs or long running jobs, if
for some reason they were stopped by the time command gets executed,
there's no need to throw error.
2022-11-05 14:08:35 +05:30
Ankush Menat
0ed7600604
build: py3.11 support (#18550)
* chore: bump RestrictedPython

* ci: use py3.11 on development version

* fix: py311 compat changes

* chore: bump to final versions
2022-11-03 20:49:05 +05:30
Sagar Vora
5e679bf539
chore: bump cryptography to 38.0.3 (#18730) 2022-11-03 01:24:55 +05:30
Sagar Vora
623633f35e
chore: bump Pillow to 9.3.0 (#18683) 2022-10-31 13:24:59 +05:30
Ankush Menat
8222a60546
chore: bump pillow (#18496)
security fixes: https://pillow.readthedocs.io/en/stable/releasenotes/9.2.0.html
2022-10-23 15:56:23 +05:30
Ankush Menat
38686d44fb
build(deps): bump restricted python (#18435)
has better support for 3.10

https://github.com/zopefoundation/RestrictedPython/pull/215/files
2022-10-17 20:16:07 +05:30
Ankush Menat
4863ba154e
build(deps): bump oauthlib (#18373)
CVE-2022-36087 - https://github.com/advisories/GHSA-3pgj-pg6c-r5p7
2022-10-11 18:08:12 +05:30
Ankush Menat
c3b547f897
refactor!: scheduler without external libraries (#18331) 2022-10-10 13:09:34 +05:30
Ankush Menat
7f1655fe46
build(deps): drop pyOpenSSL dependency (#18162)
- Not used anymore
- Official documentation suggests stopping use of
pyopenssl: https://github.com/pyca/pyopenssl
2022-09-17 12:15:26 +05:30
Ankush Menat
168fcf0975 build(deps): bump redis to latest version 2022-08-31 17:04:31 +05:30
Ankush Menat
7e34da6bec build(deps): bump werkzeug
Werkzeug has faster router now
2022-08-26 10:23:09 +05:30
Ankush Menat
17d327719e build(deps): drop unused dependencies
- googlemaps
- google-auth-httplib2
- urllib3
- pypng
- pyasn1
- gitdb
2022-08-26 10:23:09 +05:30
Ankush Menat
b30a78aa40
perf: install hiredis for faster response parsing (#17893) 2022-08-22 11:39:18 +05:30
Ankush Menat
821a4df192 chore(deps): bump boto dependency 2022-08-17 20:18:14 +05:30
phot0n
a02bd94d16 chore: remove payment gateway libraries 2022-07-26 23:17:04 +05:30
gavin
7eb7ec2663
Merge branch 'develop' into cleanup 2022-07-22 15:10:34 +05:30
chillaranand
d7bb903212 refactor: Removed parse package 2022-07-18 09:43:03 +05:30
Ankush Menat
55fb8acafa
perf(DX): add watchdog as developer dependency
Werkzeug reloader is right now using an inefficient `stat` based reloader which is horrible on large codebases with low-powered devices. 

Difference: 

- `stat` based reloader basically checks each and every file if they have changed or not. 
- watchdog subscribes to platform specific change events on kernel (like kqueue, fsevents or inotify )
2022-07-17 20:07:05 +05:30
Suraj Shetty
d4166dbe20 refactor: Replace html2text with markdownify 2022-07-06 08:23:14 +05:30