Skip to content

Commit ef61f20

Browse files
authored
Merge pull request #27 from LachJones/master
Claim strong typing
2 parents 6c4df8e + 2e31398 commit ef61f20

File tree

6 files changed

+11
-5
lines changed

6 files changed

+11
-5
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ jobs:
2525
run: |
2626
python -m pip install --upgrade pip
2727
python -m pip install .
28+
- name: Type Checking
29+
run: |
30+
python -m pip install mypy
31+
python -m mypy iso639
2832
- name: Test
2933
run: |
3034
pip install pytest

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@ Pushing changes to your forked repository should trigger a [workflow](https://gi
6464
flake8
6565
black --check .
6666
isort --check-only .
67+
mypy iso639
6768
```
6869

69-
`iso639-lang` uses `flake8` for linting, `black` for formatting and `isort` for sorting imports. The configuration of these tools is available in the `.flake8` and `pyproject.toml` files.
70+
`iso639-lang` uses `flake8` for linting, `black` for formatting, `isort` for sorting imports and `mypy` for type checking. The configuration of these tools is available in the `.flake8` and `pyproject.toml` files.
7071

7172

7273
## Submitting Changes

iso639/datafile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
from typing import Any
33

44
try:
5-
from importlib.resources import files
5+
from importlib.resources import files # type: ignore[attr-defined, import-not-found]
66
except ImportError:
77
# Compatibility for Python <3.9
8-
from importlib_resources import files
8+
from importlib_resources import files # type: ignore[no-redef, import-not-found]
99

1010

1111
FILENAMES = {

iso639/py.typed

Whitespace-only changes.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ line_length = 79
4545
packages = ["iso639", "iso639.data"]
4646

4747
[tool.setuptools.package-data]
48-
iso639 = ["data/*.json"]
48+
iso639 = ["data/*.json", "py.typed"]

requirements-dev.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ isort>=5.13.2
55
lxml>=5.3.0
66
pandas>=2.0.3
77
requests>=2.32.3
8-
pytest>=8.3.2
8+
pytest>=8.3.2
9+
mypy>=1.13.0

0 commit comments

Comments
 (0)