Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Remove typecheck tests and clean things up #439

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,3 @@ jobs:

- name: Run tests
run: pytest

typecheck:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- name: Setup system dependencies
run: |
sudo apt-get update
sudo apt-get install binutils libproj-dev gdal-bin
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -U pip setuptools wheel
pip install -r ./requirements.txt

- name: Run tests
run: python ./scripts/typecheck_tests.py
30 changes: 0 additions & 30 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,36 +73,6 @@ To execute the unit tests, simply run:
pytest
```

We also test the stubs against the DRF's own test suite. This is done in CI but you can also do this locally.
To execute the script run:

```bash
python ./scripts/typecheck_tests.py
```

You can also optionally specify a specific version tag to test against, e.g.

```bash
python ./scripts/typecheck_tests.py --drf_version 3.12.1
```

### Generating Stubs using Stubgen

The stubs are based on auto-generated code created by Mypy's stubgen tool (see: [the stubgen docs](https://mypy.readthedocs.io/en/stable/stubgen.html)).
To make life easier we have a helper script that auto generates these stubs. To use it you can run:

```bash
python ./scripts/stubgen-drf.py
```

You can also pass an optional version tag, e.g.

```bash
python ./scripts/stubgen-drf.py --drf_version 3.12.1
```

The output for this is a gitignored folder called "stubgen" in the repo's root.

## Submission Guidelines

The workflow for contributions is fairly simple:
Expand Down
18 changes: 9 additions & 9 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[mypy]
strict_optional = True
ignore_missing_imports = True
check_untyped_defs = True
show_traceback = True
allow_redefinition = True
incremental = True
strict_optional = true
ignore_missing_imports = true
check_untyped_defs = true
show_traceback = true
allow_redefinition = true
incremental = true
disable_error_code = empty-body
# TODO: update our test error messages to match new mypy output
show_error_codes = False
force_uppercase_builtins = True
force_union_syntax = True
show_error_codes = false
force_uppercase_builtins = true
force_union_syntax = true

plugins =
mypy_django_plugin.main,
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
wheel
gitpython==3.1.31
pre-commit==3.3.3
pytest==7.4.0
pytest-mypy-plugins==1.11.1
Expand Down
32 changes: 0 additions & 32 deletions scripts/git_helpers.py

This file was deleted.

6 changes: 0 additions & 6 deletions scripts/paths.py

This file was deleted.

17 changes: 0 additions & 17 deletions scripts/stubgen-drf.py

This file was deleted.

Loading