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

Claim strong typing #27

Merged
merged 3 commits into from
Nov 11, 2024
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
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
Loading