Anders Kaseorg
a47c8ce15f
requirements: Upgrade Python requirements.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2025-09-04 19:48:55 -07:00
Alex Vandiver
3b1df07e7e
dependencies: Add zstd.
2025-08-27 09:22:56 -07:00
Anders Kaseorg
7a8b340ad2
requirements: Upgrade Python requirements.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2025-08-13 23:40:33 -07:00
Anders Kaseorg
72cc530cc1
mypy: Enable error codes deprecated, exhaustive-match.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2025-08-13 12:14:12 -07:00
Alex Vandiver
25fbb05fea
upload: Attempt to guess character set text/* which are served inline.
...
This is only `text/plain`, currently. In such cases where the
client-provided content-type also does not specify a `charset`, we use
`chardet` to make a guess, and store that guess to provide later when
serving the content. The detection is done in a streaming fashion,
and thus should not require re-downloading the full content.
2025-07-24 22:40:12 -07:00
Anders Kaseorg
3be686fa86
requirements: Upgrade Python requirements.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2025-07-15 07:32:44 -07:00
Anders Kaseorg
ea48a283b1
mypy: Add google-re2-stubs.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2025-07-14 14:33:54 -04:00
Prakhar Pratyush
8b3cef554b
settings: Add push_registration_encryption_keys
map.
...
The `push_registration_encryption_keys` map stores the
assymetric key pair generated on bouncer.
The public key will be used by the client to encrypt
registration data and the bouncer will use the corresponding
private key to decrypt.
- Updated the `generate_secrets.py` script to generate the map
during installation in dev environment.
- Added a management command to add / remove key i.e. use it
for key rotation while retaining the older key-pair for a period
of time.
2025-07-06 21:11:26 -07:00
Anders Kaseorg
a274170293
CVE-2025-52559: Generate HTML for digest message sender safely.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2025-07-02 12:12:36 -07:00
Anders Kaseorg
162a0980c0
requirements: Upgrade Python requirements.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2025-06-25 11:49:02 -07:00
Anders Kaseorg
24e8ba97cb
requirements: Upgrade Django from 5.1.10 to 5.2.3.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2025-06-11 16:25:25 -07:00
Anders Kaseorg
4e31948f90
requirements: Upgrade django-cte from 1.3.3 to 2.0.0.dev.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2025-06-11 16:25:25 -07:00
Anders Kaseorg
5a090c47ad
requirements: Upgrade Python requirements.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2025-06-06 11:35:32 -07:00
Anders Kaseorg
013be33b20
requirements: Remove python-twitter.
...
Commit dce4a3c98e
(#25816 ) removed
Twitter support.
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2025-06-06 11:35:32 -07:00
Anders Kaseorg
0b776e2c15
mypy: Add types-requests-oauthlib, types-uwsgi.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2025-06-06 11:35:32 -07:00
Anders Kaseorg
6bc7e94405
mypy: Remove unused exemption for aiosmtpd.
...
aiosmtpd added types in 1.3.0.
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2025-06-05 16:05:43 -07:00
Sahil Batra
75ac85ff4c
python: Add pydantic-partials dependency.
2025-05-20 13:25:06 -07:00
Alex Vandiver
e6bcde00e3
requirements: Add aiosmtpd.
2025-05-19 16:39:44 -07:00
Alex Vandiver
eae18738a6
signup: Add optional Altcha to realm registration.
2025-04-23 17:18:40 -07:00
Niloth P
b2910aa05c
integration-docs: Migrate PythonAPIIntegration docs.
...
To zulip/python-zulip-api, to keep them closer to their source code.
- Renamed the generate_zulip_bots_static_files to
generate_bots_integrations_static_files to accomodate the new function.
- Added a new function to
tools/setup/generate_bots_integrations_static_files to copy the
integration docs into static/generated/integrations.
- Updated integrations.py and computed_settings.py to use the new doc
paths.
- Deleted the affected integration docs.
- Updated the dependency URL.
2025-03-26 11:19:31 -07:00
Anders Kaseorg
512613ead4
requirements: Upgrade Python requirements.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2025-03-14 17:31:50 -07:00
Anders Kaseorg
7866dc5ad8
ruff: Fix S704 Unsafe use of markupsafe.Markup
detected.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2025-03-14 17:31:50 -07:00
Anders Kaseorg
f8bbf228ef
pyproject: Remove py3dns.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2025-02-25 11:53:08 -08:00
Anders Kaseorg
d7556b4060
requirements: Migrate to uv.
...
https://docs.astral.sh/uv/
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2025-02-24 22:29:24 -08:00
Anders Kaseorg
df7ad517c5
requirements: Upgrade Python requirements.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2025-02-18 22:04:43 -08:00
Anders Kaseorg
2aff7ce9b5
ruff: Remove ISC001 ignore.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2025-01-14 09:42:16 -08:00
Anders Kaseorg
2709e7a636
requirements: Upgrade Python requirements.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2024-12-21 21:06:53 -08:00
Anders Kaseorg
c48ef926e1
mypy: Add types-defusedxml.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2024-11-19 11:09:34 -08:00
Anders Kaseorg
532aee926c
requirements: Upgrade Python requirements.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2024-11-19 11:09:34 -08:00
Anders Kaseorg
b3f18b805d
ruff: Enable B008 function-call-in-default-argument.
...
https://docs.astral.sh/ruff/rules/function-call-in-default-argument/
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2024-11-10 22:43:55 -08:00
Alex Vandiver
674ca1a95d
restart-server: Wait until chain reload has completed.
...
We should not proceed and send client reload events until we know that
all of the server processes have updated to the latest version, or
they may reload into the old server version if they hit a Django
worker which has not yet restarted.
Because the logic controlling the number of workers is mildly complex,
and lives in Puppet, use the `uwsgi` Python bindings to know when the
process being reloaded is the last one, and use that to write out a
file signifying the success of the chain reload. `restart-server`
awaits the creation of this file before proceeding.
2024-08-29 12:12:34 -07:00
Anders Kaseorg
b96feb34f6
ruff: Fix SIM117 Use a single with
statement with multiple contexts.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2024-07-14 13:48:32 -07:00
Anders Kaseorg
48202389b8
ruff: Bump target-version from py38 to py310.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2024-07-13 22:28:22 -07:00
Anders Kaseorg
d6fdaff31f
ruff: Enable FURB rules.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2024-06-30 22:37:15 -07:00
Anders Kaseorg
c31cebbf68
mypy: Remove some unused ignore_missing_imports overrides.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2024-06-26 23:01:49 -07:00
Alex Vandiver
fd50f12548
requirements: Remove now-unused cairosvg.
2024-06-20 23:06:08 -04:00
Alex Vandiver
475d4800f9
thumbnailing: Add pyvips dependency.
2024-06-20 23:06:08 -04:00
Mateusz Mandera
4917e01ffb
push_notifications: Migrate to FCM HTTP v1 API.
...
The legacy API we use via python-gcm is deprecated and about to be
disabled.
Fixes #29768 .
2024-06-17 18:26:26 -07:00
Anders Kaseorg
d32d4434dd
partial: Replace returns plugin with an annotation.
...
The returns plugin hasn’t been updated for mypy ≥ 1.6. This
annotation is more limited in that it only supports a fixed number of
positional arguments and no keyword arguments, but is good enough for
our purposes.
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2024-04-29 17:14:41 -07:00
Anders Kaseorg
f618971668
ruff: Enable more rules.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2024-03-01 09:27:48 -08:00
Anders Kaseorg
570f3dd447
python: Reformat with Ruff formatter.
...
https://docs.astral.sh/ruff/formatter/
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2024-02-29 17:07:16 -08:00
Charlie Marsh
c8e77b6cac
ruff: Upgrade configuration for Ruff v0.2.0.
2024-02-02 10:30:45 -08:00
Anders Kaseorg
f8aac58a6a
docs: Update Ruff badge and links.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2023-10-26 15:51:46 -07:00
Anders Kaseorg
a50eb2e809
mypy: Enable new error explicit-override.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2023-10-12 12:28:41 -07:00
Anders Kaseorg
b4a2e71b6b
mypy: Enable new errors redundant-self, truthy-iterable.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2023-10-12 12:28:41 -07:00
Anders Kaseorg
6988622fe8
ruff: Enable B023 Function definition does not bind loop variable.
...
Python’s loop scoping is misdesigned, resulting in a very common
gotcha for functions that close over loop variables [1]. The general
problem is so bad that even the Go developers plan to break
compatibility in order to fix the same design mistake in their
language [2].
Enable the Ruff rule function-uses-loop-variable (B023) [3], which
conservatively prohibits functions from binding loop variables at all.
[1] https://docs.python-guide.org/writing/gotchas/#late-binding-closures
[2] https://go.dev/s/loopvar-design
[3] https://beta.ruff.rs/docs/rules/function-uses-loop-variable/
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2023-09-11 18:03:45 -07:00
Anders Kaseorg
cf4791264c
python: Replace functools.partial with type-safe returns.curry.partial.
...
The type annotation for functools.partial uses unchecked Any for all
the function parameters (both early and late). returns.curry.partial
uses a mypy plugin to check the parameters safely.
https://returns.readthedocs.io/en/latest/pages/curry.html
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2023-09-11 18:03:45 -07:00
Anders Kaseorg
22e8b641e1
mypy: Remove exemption for aioapns.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2023-09-09 10:10:24 -07:00
Anders Kaseorg
ddba558f1d
mypy: Remove no_implicit_reexport override.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2023-09-08 16:46:44 -07:00
Anders Kaseorg
5fe0cb3054
pyproject: Delete trailing whitespace.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2023-09-08 10:13:47 -07:00