Skip to content

Commit 13d1b95

Browse files
committed
Merge branch 'sushmey-dev-branch' of https://github.com/Sushmey/zulip-terminal into sushmey-dev-branch
2 parents 15211e9 + fb6d9c5 commit 13d1b95

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+5323
-902
lines changed

.github/workflows/lint-and-test.yml

Lines changed: 101 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
# Cancel previous runs within same workflow and if within a PR (all branch runs complete)
1111
# (head_ref [branch name] is unique to and only for PRs, otherwise use always-unique run_id)
12-
concurrency:
12+
concurrency:
1313
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1414
cancel-in-progress: true
1515

@@ -31,9 +31,9 @@ jobs:
3131
- name: Run mypy
3232
run: ./tools/run-mypy
3333

34-
flake8:
34+
ruff:
3535
runs-on: ubuntu-latest
36-
name: Lint - PEP8 & more (flake8)
36+
name: Lint - PEP8 & more (ruff)
3737
steps:
3838
- uses: actions/checkout@v3
3939
with:
@@ -45,8 +45,8 @@ jobs:
4545
cache-dependency-path: 'setup.py'
4646
- name: Install with linting tools
4747
run: pip install .[linting]
48-
- name: Run flake8
49-
run: flake8 zulipterminal/ tests/ setup.py `tools/python_tools.py`
48+
- name: Run ruff
49+
run: ruff zulipterminal/ tests/ setup.py `tools/python_tools.py`
5050

5151
isort:
5252
runs-on: ubuntu-latest
@@ -57,7 +57,7 @@ jobs:
5757
persist-credentials: false
5858
- uses: actions/setup-python@v4
5959
with:
60-
python-version: 3.6
60+
python-version: 3.7
6161
cache: 'pip'
6262
cache-dependency-path: 'setup.py'
6363
- name: Install with linting tools
@@ -75,14 +75,31 @@ jobs:
7575
persist-credentials: false
7676
- uses: actions/setup-python@v4
7777
with:
78-
python-version: 3.6
78+
python-version: 3.7
7979
cache: 'pip'
8080
cache-dependency-path: 'setup.py'
8181
- name: Install with linting tools
8282
run: pip install .[linting]
8383
- name: Check code & tests meet black standards
8484
run: black --check zulipterminal/ tests/ setup.py `tools/python_tools.py`
8585

86+
spellcheck:
87+
runs-on: ubuntu-latest
88+
name: Lint - Spellcheck
89+
steps:
90+
- uses: actions/checkout@v3
91+
with:
92+
persist-credentials: false
93+
- uses: actions/setup-python@v4
94+
with:
95+
python-version: 3.7
96+
cache: 'pip'
97+
cache-dependency-path: 'setup.py'
98+
- name: Install with linting tools
99+
run: pip install .[linting]
100+
- name: Check spelling
101+
run: ./tools/run-spellcheck
102+
86103
hotkeys:
87104
runs-on: ubuntu-latest
88105
name: Lint - Hotkeys linting & docs sync check
@@ -92,13 +109,13 @@ jobs:
92109
persist-credentials: false
93110
- uses: actions/setup-python@v4
94111
with:
95-
python-version: 3.6
112+
python-version: 3.7
96113
cache: 'pip'
97114
cache-dependency-path: 'setup.py'
98115
- name: Minimal install
99116
run: pip install .
100-
- name: Run generate_hotkeys
101-
run: ./tools/generate_hotkeys.py --check-only
117+
- name: Run lint-hotkeys
118+
run: ./tools/lint-hotkeys
102119

103120
docstrings:
104121
runs-on: ubuntu-latest
@@ -109,30 +126,89 @@ jobs:
109126
persist-credentials: false
110127
- uses: actions/setup-python@v4
111128
with:
112-
python-version: 3.6
129+
python-version: 3.7
113130
cache: 'pip'
114131
cache-dependency-path: 'setup.py'
115132
- name: Minimal install
116133
run: pip install .
117134
- name: Run lint-docstring
118135
run: ./tools/lint-docstring
119136

120-
pytest:
137+
base_pytest:
138+
runs-on: ubuntu-latest
139+
name: Install & test - CPython 3.7 (ubuntu), codecov
140+
steps:
141+
- uses: actions/checkout@v3
142+
with:
143+
persist-credentials: false
144+
- name: Install Python version
145+
uses: actions/setup-python@v4
146+
with:
147+
python-version: 3.7
148+
cache: 'pip'
149+
cache-dependency-path: 'setup.py'
150+
- name: Output Python version
151+
run: python --version
152+
- name: Upgrade pip
153+
run: python -m pip install --upgrade pip
154+
- name: Ensure regular package installs from checkout
155+
run: pip install .
156+
- name: Install test dependencies
157+
run: pip install .[testing]
158+
- name: Run tests with pytest
159+
run: pytest --cov-report=xml
160+
- name: Upload coverage to Codecov
161+
uses: codecov/codecov-action@v3
162+
163+
isolated-commits:
164+
runs-on: ubuntu-latest
165+
name: Ensure isolated PR commits
166+
needs:
167+
- mypy
168+
- ruff
169+
- isort
170+
- black
171+
- spellcheck
172+
- hotkeys
173+
- docstrings
174+
- base_pytest
175+
steps:
176+
- uses: actions/checkout@v3
177+
if: github.event_name == 'pull_request'
178+
with:
179+
persist-credentials: false
180+
ref: ${{ github.event.pull_request.head.sha }}
181+
fetch-depth: 0
182+
- uses: actions/setup-python@v4
183+
if: github.event_name == 'pull_request'
184+
with:
185+
python-version: 3.7
186+
cache: 'pip'
187+
cache-dependency-path: 'setup.py'
188+
- name: Run check-branch
189+
if: github.event_name == 'pull_request'
190+
# Note that we install at each step since dependencies may change
191+
run:
192+
git fetch https://github.com/zulip/zulip-terminal main;
193+
CHECK="pip install .[linting,testing,typing] && ./tools/lint-all && pytest" ./tools/check-branch FETCH_HEAD
194+
195+
pytest-on-other-platforms:
196+
needs: isolated-commits
121197
strategy:
122198
# Not failing fast allows all matrix jobs to try & finish even if one fails early
123199
fail-fast: false
124200
matrix:
125201
env:
126-
- {PYTHON: 3.6, OS: ubuntu-latest, NAME: "CPython 3.6 (ubuntu)"}
127-
- {PYTHON: 3.7, OS: ubuntu-latest, NAME: "CPython 3.7 (ubuntu)"}
128-
- {PYTHON: 3.8, OS: ubuntu-latest, NAME: "CPython 3.8 (ubuntu)"}
129-
- {PYTHON: 3.9, OS: ubuntu-latest, NAME: "CPython 3.9 (ubuntu)", CODECOV: true}
130-
- {PYTHON: "3.10", OS: ubuntu-latest, NAME: "CPython 3.10 (ubuntu)"}
131-
- {PYTHON: 'pypy-3.6', OS: ubuntu-latest, NAME: "PyPy 3.6 (ubuntu)"}
132-
- {PYTHON: 'pypy-3.7', OS: ubuntu-latest, NAME: "PyPy 3.7 (ubuntu)"}
133-
- {PYTHON: 'pypy-3.8', OS: ubuntu-latest, NAME: "PyPy 3.8 (ubuntu)"}
134-
- {PYTHON: 'pypy-3.9', OS: ubuntu-latest, NAME: "PyPy 3.9 (ubuntu)"}
135-
- {PYTHON: 3.9, OS: macos-latest, NAME: "CPython 3.9 (macos)"}
202+
- {PYTHON: 3.8, OS: ubuntu-latest, NAME: "CPython 3.8 (ubuntu)", EXPECT: "Linux"}
203+
- {PYTHON: 3.9, OS: ubuntu-latest, NAME: "CPython 3.9 (ubuntu)", EXPECT: "Linux"}
204+
- {PYTHON: "3.10", OS: ubuntu-latest, NAME: "CPython 3.10 (ubuntu)", EXPECT: "Linux"}
205+
- {PYTHON: "3.11", OS: ubuntu-latest, NAME: "CPython 3.11 (ubuntu)", EXPECT: "Linux"}
206+
- {PYTHON: 'pypy-3.7', OS: ubuntu-latest, NAME: "PyPy 3.7 (ubuntu)", EXPECT: "Linux"}
207+
- {PYTHON: 'pypy-3.8', OS: ubuntu-latest, NAME: "PyPy 3.8 (ubuntu)", EXPECT: "Linux"}
208+
- {PYTHON: 'pypy-3.9', OS: ubuntu-latest, NAME: "PyPy 3.9 (ubuntu)", EXPECT: "Linux"}
209+
- {PYTHON: '3.x', OS: macos-latest, NAME: "CPython 3.x [latest] (macos)", EXPECT: "MacOS"}
210+
env:
211+
EXPECT: ${{ matrix.env.EXPECT }}
136212
runs-on: ${{ matrix.env.OS }}
137213
name: Install & test - ${{ matrix.env.NAME}}
138214
steps:
@@ -154,11 +230,9 @@ jobs:
154230
run: sudo apt install libxml2-dev libxslt1-dev
155231
- name: Ensure regular package installs from checkout
156232
run: pip install .
233+
- name: Check we detect the platform correctly
234+
run: python -c "from zulipterminal.platform_code import detected_platform; import os; e, d = os.environ['EXPECT'], detected_platform(); assert d == e, f'{d} != {e}'"
157235
- name: Install test dependencies
158236
run: pip install .[testing]
159237
- name: Run tests with pytest
160-
run: pytest --cov-report=xml
161-
- name: Upload coverage to Codecov
162-
uses: codecov/codecov-action@v2
163-
# We avoid extra work by just running codecov on one python version
164-
if: matrix.env.CODECOV
238+
run: pytest --cov-report=

.gitlint

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ ignore=title-trailing-punctuation, body-is-missing, body-min-length, title-must-
44
# ZT: These are custom rules written for Zulip-Terminal, included by default
55
extra-path=tools/gitlint-extra-rules.py
66

7+
# Added to acknowledge that eg. ignore-by-title regex
8+
regex-style-search=True
9+
710
# verbosity should be a value between 1 and 3, the commandline -v flags take precedence over this
811
# verbosity = 2
912

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ While not composed of as many significant changes as 0.5.0, this is a meaningful
364364
- Support nested lists (bulleted and numbered)
365365
- Style reaction counts which include yourself differently (inverted colors, typically)
366366
- Sort reactions alphabetically for consistency
367-
- Support color depths other than 256-colors; try --color-depth=1 for a retro, high-constrast experience!
367+
- Support color depths other than 256-colors; try --color-depth=1 for a retro, high-contrast experience!
368368
- Improve specificity of colors in default theme, enhancing rendering and consistency in 256 color mode
369369
- Use triangle symbol (▶) to separate streams and topics, instead of simply '>'
370370
- The 'bar' extending from topics or private message recipients is now thinner and colored if a stream

0 commit comments

Comments
 (0)