Commit graph

71 commits

Author SHA1 Message Date
Ankush Menat
cbc5f0b8db
build(deps): update python dependencies (#22294)
* build!: Remove pycryptodome dependencies

This is added for payments app, shouldn't be added here.

ref: https://github.com/frappe/frappe/pull/9955/

* build(deps): update many python dependencies
2023-09-02 12:10:13 +00:00
Ankush Menat
9e2a0384e0
build: bump gitpython (#22290) 2023-09-02 15:29:14 +05:30
Ankush Menat
cef0399fa3 build(deps): update RestrictedPython to latest version 2023-08-31 10:51:06 +05:30
Ankush Menat
4649c8dacf
build(deps): Bump gunicorn to latest version (#22086) 2023-08-17 11:11:01 +05:30
Ankush Menat
02e1311b3a build: pin typing_extensions to major version 2023-08-11 11:54:09 +05:30
Gavin D'souza
84f134a683
fix: Add "better" typing hints 2023-08-11 11:45:47 +05:30
Sagar Vora
b4629d8c02
chore: strictly pin responses to 0.23.1 to avoid pip conflicts (#21816) 2023-07-27 10:41:20 +05:30
Smit Vora
89b9b64a55
fix: installation error, cannot import name 'DEFAULT_CIPHERS' from 'urllib3.util.ssl_' (#21810)
Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-07-26 15:00:04 +05:30
Suraj Shetty
6c509f6dd1
Merge pull request #21782 from blaggacao/bump-bleach 2023-07-25 18:21:31 +05:30
David Arnold
cf8a603dac
build(deps): update premailer 3.8.0 -> 3.10.0 (#21783) 2023-07-24 16:26:27 +05:30
David Arnold
8ff913b8ad
build(deps): update bleach 3.3.0 -> 6.0.0 2023-07-23 20:00:28 -05:00
Ankush Menat
03a582d7cd
build(deps): update pyyaml to 6.0.1 (#21728) 2023-07-19 11:41:17 +05:30
gavin
58fc6a2b94
build: Bump to stable Pydantic v2 2023-06-30 22:18:45 +05:30
gavin
faab26ce4f
Merge branch 'develop' into bump-pydantic-v2 2023-06-26 13:12:24 +05:30
Ankush Menat
0e84fdaa6c build: bump RQ 2023-06-25 17:43:11 +05:30
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
Gavin D'souza
1a7b7a589b
build(deps): Bump Pydantic from v1 to v2 2023-06-07 17:03:59 +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