Skip to content

Commit

Permalink
Merge pull request #27 from LachJones/master
Browse files Browse the repository at this point in the history
Claim strong typing
  • Loading branch information
LBeaudoux authored Nov 11, 2024
2 parents 6c4df8e + 2e31398 commit ef61f20
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install .
- name: Type Checking
run: |
python -m pip install mypy
python -m mypy iso639
- name: Test
run: |
pip install pytest
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ Pushing changes to your forked repository should trigger a [workflow](https://gi
flake8
black --check .
isort --check-only .
mypy iso639
```

`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.
`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.


## Submitting Changes
Expand Down
4 changes: 2 additions & 2 deletions iso639/datafile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
from typing import Any

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


FILENAMES = {
Expand Down
Empty file added iso639/py.typed
Empty file.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ line_length = 79
packages = ["iso639", "iso639.data"]

[tool.setuptools.package-data]
iso639 = ["data/*.json"]
iso639 = ["data/*.json", "py.typed"]
3 changes: 2 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ isort>=5.13.2
lxml>=5.3.0
pandas>=2.0.3
requests>=2.32.3
pytest>=8.3.2
pytest>=8.3.2
mypy>=1.13.0

0 comments on commit ef61f20

Please sign in to comment.