Commit graph

241 commits

Author SHA1 Message Date
Anders Kaseorg
f78e6e653b Remove remnants of bots_unmaintained.
This was deleted in commit 754a9f7880
(#567).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-13 13:29:50 -08:00
Anders Kaseorg
9c44fe5d3a tests: Add type annotations to test_lib.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-13 13:28:17 -08:00
Anders Kaseorg
059458b4ca python: Fix PAR001 Redundant parentheses.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-11 16:41:52 -08:00
Anders Kaseorg
aeb89bcae5 ruff: Enable lots of rules.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-11 16:16:17 -08:00
Anders Kaseorg
03d132e99e ruff: Fix B007 Loop control variable not used within loop body.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-30 11:44:10 -07:00
Anders Kaseorg
610683ea41 ruff: Fix RUF005 Consider unpacking instead of concatenation.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-30 11:44:10 -07:00
Anders Kaseorg
b009dcd7d3 ruff: Fix SIM108 Use ternary operator instead of if-else-block.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-29 18:17:39 -07:00
Anders Kaseorg
774edb434e ruff: Fix C400 Unnecessary generator (rewrite as a list comprehension).
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-29 17:36:51 -07:00
Anders Kaseorg
ddccf0eda3 ruff: Fix UP032 Use f-string instead of format call.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-27 22:01:58 -07:00
Anders Kaseorg
a49add3d02 lint: Replace Black with Ruff.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-27 19:08:40 -07:00
Anders Kaseorg
2a0eff653d lint: Replace isort with Ruff.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-27 19:04:29 -07:00
Anders Kaseorg
01a27a3a1b lint: Replace Flake8 with Ruff.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-27 18:58:49 -07:00
Anders Kaseorg
61abe11c1a run-mypy: Remove options that duplicate the mypy configuration.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-27 17:53:37 -07:00
Anders Kaseorg
3b4867ad46 simple_lib: Add type annotations.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-25 16:59:41 -07:00
Anders Kaseorg
01d5106e9a tools: Add type annotations.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-25 16:59:41 -07:00
Anders Kaseorg
a9e3fe9d0c zulip_trello: Add type annotations.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-25 16:21:34 -07:00
Anders Kaseorg
8eb3d4e1e2 Upgrade requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-25 13:23:51 -07:00
Anders Kaseorg
a9607dfdf9 Convert type comments to Python ≥ 3.6 variable annotations.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-18 01:04:47 -07:00
Eeshan Garg
70b86614bd tools/provision: Bump required pip version from >=9.0 to >=10.
pip 10 was the first release to support PEP 518. Using pip<10
can lead to errors when installing dependencies.

Thanks to @andersk for suggesting this fix!
2022-01-06 01:54:47 +05:30
Eeshan Garg
74d716289b tools: Delete the release-packages script.
This script has been outdated for a long time now and has been
obsoleted by some recent changes in how packages should be built
and distributed. In general, the release process is now too
complicated to automate, so we are better off just making the
release manually.
2022-01-05 08:11:58 +05:30
neiljp (Neil Pilgrim)
cca1b7d679 mypy: Add types to terminal.py. 2021-11-21 21:06:40 -08:00
Anders Kaseorg
564fc0e527 Replace the custom test runners with pytest.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-08-24 17:07:00 -07:00
Anders Kaseorg
147e9f6b81 test-bots: Remove merels exclusion.
This test was fixed in commit ab97b37ce1
(#448).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-08-24 14:22:32 -07:00
Anders Kaseorg
53e59c8c09 Rename default branch to ‘main’
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-08-24 12:50:52 -07:00
Anders Kaseorg
d1b3ac8d94 gitlint-rules: Remove convoluted binary search for imperative forms.
This also fixes the suggestions for the following words: disabled,
disables, disabling, implemented, implementing, implements, kept,
made, took, using.

(Copied from zulip/zulip@91f048c056a66eb78a102c095e714eff5f28e36e.)

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-06-14 13:36:30 -07:00
PIG208
9ce7c52a10 pyupgrade: Reformat with --py36-plus.
This includes mainly fixes of string literals using f-strings or
.format(...), as well as unpacking of list comprehensions.
2021-06-02 18:45:57 -07:00
PIG208
a54cccc012 lint: Add black as a linter. 2021-06-02 18:45:57 -07:00
PIG208
c4edf4bd2f lint: Add isort as a linter. 2021-06-02 18:45:57 -07:00
PIG208
6f3f9bf7e4 black: Reformat without skipping string normalization. 2021-06-02 18:45:57 -07:00
PIG208
fba21bb00d black: Reformat skipping string normalization. 2021-06-02 18:45:57 -07:00
PIG208
5580c68ae5 isort: Reformat using isort. 2021-06-02 18:45:57 -07:00
LoopThrough-i-j
470967cfdb lint: Set repository variable in tools/lint-commits.
refer to:
zulip/zulip#17506
2021-05-24 14:16:41 -07:00
Ganesh Pawar
7b889a122b tools: Add test-main equivalent for Powershell on Windows. 2021-03-11 10:04:31 -08:00
Anders Kaseorg
922446ddf4 test-static-analysis: Delete.
The only thing it did over ‘tools/lint --skip=gitlint’ was redundantly
run mypy again.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-03-04 14:05:38 -08:00
Anders Kaseorg
2e3c65a044 lint: Remove custom --no-gitlint option.
zulint already has --skip for this.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-03-04 14:04:53 -08:00
LoopThrough-i-j
c4a78d0832 lint: Remove gitlint from static analysis. 2021-03-04 11:37:15 -08:00
LoopThrough-i-j
cce18ed11b lint: Setup gitlint.
Setup gitlint for developers to write well formatted
commit messages.

Note: .gitlint, gitlint-rules.py and lint-commits
are taken directly from zulip/zulip with minor changes.
2021-03-04 11:36:47 -08:00
Ganesh Pawar
44b6fd395a tests: Fix tests failing on Windows.
Tests were failing on Windows since paths are case-insensitive on it.
This uses pathlib library to compare paths on all platforms.

Fixes #651
2021-03-04 11:28:35 -08:00
Debayan Ganguly
6ac2165bf1
provision: Replace virtualenv with python native venv.
- Replace virtualenv with python 3's native venv feature. The venv used is native to
  python3.5+, so there's no need for a separate dependency.
- Remove redundant activation script. An activation script is required
  to use the pip and python in the virtual environment, but because we're
  calling the pip inside the venv, we don't need one.

Fixes #625.
2021-02-24 18:20:49 -08:00
qedk
21f87b3e88 provision: Fix source command on Windows. 2020-09-20 20:38:07 -07:00
neiljp (Neil Pilgrim)
f2c8295fcb requirements: Remove unnecessary install dependency upon six & typing.
The latest release was fully python 3.5+, making these dependencies
redundant.
2020-05-05 09:20:50 -04:00
Eeshan Garg
d4ded1c5dd tools/release-packages: Stop generating universal wheels.
Since we recently dropped support for Python 2 in our PyPI packages,
we can no longer distribute them as universal wheels.
2020-04-18 20:33:17 -07:00
Anders Kaseorg
b573c1daf3 lint: Replace pycodestyle with Flake8.
Flake8 combines pycodestyle with pyflakes and automatically gives us
support for noqa comments, parallelism, configuration files, plugins,
and easy editor integration.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 20:31:14 -07:00
Anders Kaseorg
17cf26aa1f cleanup: Move line breaks before binary operators.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 20:31:14 -07:00
Anders Kaseorg
2f6623bbc4 cleanup: Remove unused imports.
Generated by autoflake.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 20:31:14 -07:00
Anders Kaseorg
5428c5f296 typing: Convert function type annotations to Python 3 style.
Generated by com2ann (slightly patched to avoid also converting
assignment type annotations, which require Python 3.6), followed by
some manual whitespace adjustment, and two fixes for use-before-define
issues:

-    def set_zulip_client(self, zulipToJabberClient: ZulipToJabberBot) -> None:
+    def set_zulip_client(self, zulipToJabberClient: 'ZulipToJabberBot') -> None:

-def init_from_options(options: Any, client: Optional[str] = None) -> Client:
+def init_from_options(options: Any, client: Optional[str] = None) -> 'Client':

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 20:31:14 -07:00
Anders Kaseorg
75d1fe2b41 lint: Upgrade zulint.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 20:31:14 -07:00
Anders Kaseorg
524d03fc3e deploy: Fix urllib.parse import.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 20:31:14 -07:00
Anders Kaseorg
d68437d5f5 Rewrite some strings using raw string syntax.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 15:04:36 -07:00
Anders Kaseorg
e30b3b094b Modernize legacy Python 2 syntax with pyupgrade.
Generated by `pyupgrade --py3-plus --keep-percent-format` followed by
manual indentation fixes.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 15:04:36 -07:00