Skip to content

Commit

Permalink
chore: Refresh dependencies
Browse files Browse the repository at this point in the history
- Move dev related extras to PEP735
- Create new user oriented extras for type checker
  • Loading branch information
abelcheung committed Nov 3, 2024
1 parent 6c4a644 commit eb40d1b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
fail-fast: false
matrix:
myver:
- 1.10.0
- 1.10.1
- 1.11.0
- 1.11.1
- 1.11.2
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

## Important note

- Since `2024.08.07`, each release will contain multiple builds; besides normal version, there is an alternative build suitable for multiple XML element subclassing. Please check out [relevant Installation section](#choosing-the-build) for detail (hint: many people don't need to bother with this). Also note that this release requires `mypy 1.11`.
- Since `2024.08.07`, each release will contain multiple builds; besides normal version, there is an alternative build suitable for multiple XML element subclassing. Please check out [relevant Installation section](#choosing-the-build) for detail (hint: many people don't need to bother with this). Also note that this release requires `mypy 1.11` if one chooses to use `mypy` for type checking. `pyright` version requirement (`1.1.351`) is not changed.

## Introduction

This repository contains [external type annotations](https://peps.python.org/pep-0561/) for [`lxml`](http://lxml.de/). It can be used by type-checking tools (currently supporting [`mypy`](https://pypi.org/project/mypy/) and [`pyright`](https://github.com/Microsoft/pyright)) to check code that uses `lxml`, or used within IDEs like [VSCode](https://code.visualstudio.com/) to facilitate development.
This repository contains [external type annotations](https://peps.python.org/pep-0561/) for [`lxml`](http://lxml.de/). It can be used by type-checking tools (currently supporting [`pyright`](https://github.com/Microsoft/pyright) and [`mypy`](https://pypi.org/project/mypy/)) to check code that uses `lxml`, or used within IDEs like [VSCode](https://code.visualstudio.com/) to facilitate development.

## Goal ① : Completion

Expand Down Expand Up @@ -39,7 +39,8 @@ Check out [project page](https://github.com/abelcheung/types-lxml/projects) for

## Goal ② : Support multiple type checkers

Currently the annotations are validated for both `mypy` and `pyright`.
Currently the annotations are validated for both `pyright` and `mypy`, with `pyright` recommended because of its greater flexibility and early adoption
of newer type checking features.

In the future, there is plan to bring even more type checker support.

Expand Down
37 changes: 17 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,14 @@ classifiers = [
[project.urls]
homepage = 'https://github.com/abelcheung/types-lxml'

# Although mypy 1.10 itself produce no problem in stub,
# it is basically unusable for real life code that uses lxml,
# not until following improvement is done in 1.11.
# https://mypy.readthedocs.io/en/stable/changelog.html#type-inference-improvements

[project.optional-dependencies]
test = [
'tox ~= 4.22',
'mypy ~= 1.11',
# microsoft/pyright#9286 and microsoft/pyright#9296
'pyright >= 1.1.387',
'typeguard >= 3.0; python_full_version < "3.12.4"',
'typeguard >= 4.3.0; python_full_version >= "3.12.4"',
'pytest >= 7.0, < 9',
'html5lib == 1.1',
'pytest-mypy-plugins >= 2.0',
'lxml >= 4.9',
'beautifulsoup4 ~= 4.8'
]
mypy = ['mypy ~= 1.11']
pyright = ['pyright >= 1.1.351']

# mostly pinned for tox testing
# mostly pinned for tox testing except dev group
[dependency-groups]
basic = [
"types-beautifulsoup4 == 4.12.0.20240907",
"types-beautifulsoup4 == 4.12.0.20241020",
"typing_extensions == 4.12.2; python_version < '3.13'",
"cssselect == 1.2.0",
]
Expand All @@ -85,6 +69,19 @@ lxml50 = ["lxml == 5.0.2"]
lxml51 = ["lxml == 5.1.1"]
lxml52 = ["lxml == 5.2.2"]
lxml53 = ["lxml == 5.3.0"]
dev = [
'tox ~= 4.22',
'mypy >= 1.11.2',
# microsoft/pyright#9286 and microsoft/pyright#9296
'pyright >= 1.1.387',
'typeguard >= 3.0; python_full_version < "3.12.4"',
'typeguard >= 4.3.0; python_full_version >= "3.12.4"',
'pytest >= 7.0, < 9',
'html5lib == 1.1',
'pytest-mypy-plugins >= 2.0',
'lxml >= 4.9',
'beautifulsoup4 ~= 4.8',
]

[tool.pdm.version]
source = 'scm'
Expand Down

0 comments on commit eb40d1b

Please sign in to comment.