Skip to content

Commit eef72c5

Browse files
authored
Merge pull request #76 from bckohan/v1.2.x
Version 2.0
2 parents 00756c8 + 8d7e27c commit eef72c5

File tree

398 files changed

+16028
-5132
lines changed

Some content is hidden

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

398 files changed

+16028
-5132
lines changed

.github/workflows/lint.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: lint
22

3-
on: [push, pull_request, workflow_dispatch]
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
inputs:
8+
debug:
9+
description: 'Set to on, to open ssh debug session.'
10+
required: true
11+
default: 'off'
412

513
jobs:
614

@@ -45,22 +53,19 @@ jobs:
4553
poetry run pip install --upgrade pip
4654
poetry install -E rich
4755
poetry run pip install -U "django~=${{ matrix.django-version }}"
48-
# - name: Setup tmate session
49-
# uses: mxschmitt/action-tmate@v3
50-
# with:
51-
# detached: true
52-
# timeout-minutes: 60
56+
- name: Install Emacs
57+
if: ${{ github.event.inputs.debug == 'on' }}
58+
run: |
59+
sudo apt install emacs
60+
- name: Setup tmate session
61+
if: ${{ github.event.inputs.debug == 'on' }}
62+
uses: mxschmitt/action-tmate@v3
63+
with:
64+
detached: true
65+
timeout-minutes: 60
5366
- name: Run Static Analysis
5467
run: |
5568
source .venv/bin/activate
56-
isort django_typer --check
57-
black django_typer --check
58-
pylint django_typer
59-
mypy django_typer
60-
pyright
61-
poetry check
62-
pip check
69+
./check.sh --no-fix
6370
python -m readme_renderer ./README.md -o /tmp/README.html
64-
cd ./doc
65-
doc8 --ignore-path build --max-line-length 100
6671
echo "$(poetry env info --path)/bin" >> $GITHUB_PATH

.github/workflows/test.yml

Lines changed: 52 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
name: test
22

33
on:
4-
push: # runs on everything
5-
pull_request: # runs on everything
4+
push:
5+
pull_request:
66
workflow_dispatch:
77
inputs:
8-
debug_enabled:
9-
type: boolean
10-
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
11-
required: false
12-
default: false
8+
debug:
9+
description: 'Set to on, to open ssh debug session.'
10+
required: true
11+
default: 'off'
12+
schedule:
13+
- cron: '0 13 * * *' # Runs at 6 am pacific every day
1314

1415
jobs:
1516

@@ -50,11 +51,16 @@ jobs:
5051
poetry run pip install --upgrade pip
5152
poetry install
5253
poetry run pip install -U "Django~=${{ matrix.django-version }}"
53-
# - name: Setup tmate session
54-
# uses: mxschmitt/action-tmate@v3
55-
# with:
56-
# detached: true
57-
# timeout-minutes: 60
54+
- name: Install Emacs
55+
if: ${{ github.event.inputs.debug == 'on' }}
56+
run: |
57+
sudo apt install emacs
58+
- name: Setup tmate session
59+
if: ${{ github.event.inputs.debug == 'on' }}
60+
uses: mxschmitt/action-tmate@v3
61+
with:
62+
detached: true
63+
timeout-minutes: 60
5864
- name: Run Unit Tests
5965
run: |
6066
poetry run pip install colorama
@@ -107,9 +113,19 @@ jobs:
107113
run: |
108114
sudo apt-get update
109115
sudo apt-get install -y fish
116+
- name: Install Emacs
117+
if: ${{ github.event.inputs.debug == 'on' }}
118+
run: |
119+
sudo apt install emacs
120+
- name: Setup tmate session
121+
if: ${{ github.event.inputs.debug == 'on' }}
122+
uses: mxschmitt/action-tmate@v3
123+
with:
124+
detached: true
125+
timeout-minutes: 60
110126
- name: Run Unit Tests
111127
run: |
112-
poetry run pytest django_typer/tests/completion_tests.py
128+
poetry run pytest django_typer/tests/shellcompletion/*
113129
mv .coverage linux-complete-py${{ matrix.python-version }}-dj${{ matrix.django-version }}.coverage
114130
115131
- name: Store coverage files
@@ -136,7 +152,6 @@ jobs:
136152
- uses: actions/checkout@v4
137153
- name: Set up Python ${{ matrix.python-version }}
138154
uses: actions/setup-python@v5
139-
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
140155
with:
141156
python-version: ${{ matrix.python-version }}
142157

@@ -154,8 +169,8 @@ jobs:
154169
echo " compinit" >> ~/.zshrc
155170
echo "fi" >> ~/.zshrc
156171
echo "fpath+=~/.zfunc" >> ~/.zshrc
157-
chmod go-w /usr/local/share
158-
chmod -R go-w /usr/local/share/zsh
172+
chmod go-w /opt/homebrew/share
173+
chmod -R go-w /opt/homebrew/share/zsh
159174
source ~/.zshrc
160175
sudo chsh -s /bin/zsh runner
161176
# - name: Install Bash Completions
@@ -169,6 +184,10 @@ jobs:
169184
# run: |
170185
# brew install sbt
171186
# brew install fish
187+
- name: Install Emacs
188+
if: ${{ github.event.inputs.debug == 'on' }}
189+
run: |
190+
brew install emacs
172191
- name: Install Poetry
173192
uses: snok/install-poetry@v1
174193
with:
@@ -181,10 +200,16 @@ jobs:
181200
poetry run pip install --upgrade pip
182201
poetry install
183202
poetry run pip install -U "Django~=${{ matrix.django-version }}"
203+
- name: Setup tmate session
204+
if: ${{ github.event.inputs.debug == 'on' }}
205+
uses: mxschmitt/action-tmate@v3
206+
with:
207+
detached: true
208+
timeout-minutes: 60
184209
- name: Run Unit Tests
185210
shell: zsh {0}
186211
run: |
187-
poetry run pytest django_typer/tests/completion_tests.py::ZshShellTests || exit 1
212+
poetry run pytest django_typer/tests/shellcompletion/test_zsh.py || exit 1
188213
mv .coverage macos-complete-py${{ matrix.python-version }}-dj${{ matrix.django-version }}.coverage
189214
190215
- name: Store coverage files
@@ -245,11 +270,16 @@ jobs:
245270
runs-on: ubuntu-latest
246271

247272
steps:
248-
# - name: Setup tmate session
249-
# uses: mxschmitt/action-tmate@v3
250-
# with:
251-
# detached: true
252-
# timeout-minutes: 15
273+
- name: Install Emacs
274+
if: ${{ github.event.inputs.debug == 'on' }}
275+
run: |
276+
sudo apt install emacs
277+
- name: Setup tmate session
278+
if: ${{ github.event.inputs.debug == 'on' }}
279+
uses: mxschmitt/action-tmate@v3
280+
with:
281+
detached: true
282+
timeout-minutes: 60
253283
- uses: actions/checkout@v4
254284
- uses: actions/setup-python@v5
255285
with:

CONTRIBUTING.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,20 @@ poetry run make html
4646

4747
## Static Analysis
4848

49-
`django-typer` uses [Pylint](https://www.pylint.org/) for Python linting and [mypy](http://mypy-lang.org/) and [pyright](https://github.com/microsoft/pyright) for static type
50-
checking. Header imports are also standardized using [isort](https://pycqa.github.io/isort/) and formatting is
51-
done with [black](https://black.readthedocs.io/en/stable/). Before any PR is accepted the following must be run, and
52-
static analysis tools should not produce any errors or warnings. Disabling
53-
certain errors or warnings where justified is acceptable:
49+
`django-typer` uses [ruff](https://docs.astral.sh/ruff/) for Python linting, header import
50+
standardization and code formatting. [mypy](http://mypy-lang.org/) and
51+
[pyright](https://github.com/microsoft/pyright) are used for static type checking. Before any PR
52+
is accepted the following must be run, and static analysis tools should not produce any errors or
53+
warnings. Disabling certain errors or warnings where justified is acceptable:
5454

5555
```bash
56-
poetry run isort django_typer
57-
poetry run black django_typer
58-
poetry run pylint django_typer
59-
poetry run mypy django_typer
60-
pyright
61-
poetry check
62-
poetry run pip check
63-
poetry run python -m readme_renderer ./README.md
56+
./check.sh
57+
```
58+
59+
To run static analysis without automated fixing you can run:
60+
61+
```bash
62+
./check.sh --no-fix
6463
```
6564

6665
## Running Tests

0 commit comments

Comments
 (0)