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

Bump tool versions #288

Merged
merged 5 commits into from
Mar 14, 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: 2 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- python-version: "3.12"
env:
TOXENV: pylint
- python-version: "3.11" # Keep in sync with .readthedocs.yml
- python-version: "3.12"
env:
TOXENV: docs
- python-version: "3.12"
Expand All @@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.12"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
sudo apt-get install libxml2-dev libxslt-dev

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/PyCQA/bandit
rev: 1.7.7
rev: 1.7.8
hooks:
- id: bandit
args: [-r, -c, .bandit.yml]
Expand All @@ -9,10 +9,10 @@ repos:
hooks:
- id: flake8
- repo: https://github.com/psf/black.git
rev: 24.1.1
rev: 24.2.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
- id: isort
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build:
tools:
# For available versions, see:
# https://docs.readthedocs.io/en/stable/config-file/v2.html#build-tools-python
python: "3.11" # Keep in sync with .github/workflows/checks.yml
python: "3.12" # Keep in sync with .github/workflows/checks.yml
python:
install:
- requirements: docs/requirements.txt
Expand Down
6 changes: 3 additions & 3 deletions parsel/csstranslator.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def xpath_pseudo_element(
method = getattr(self, method_name, None)
if not method:
raise ExpressionError(
f"The functional pseudo-element ::{pseudo_element.name}() is unknown" # noqa: E231
f"The functional pseudo-element ::{pseudo_element.name}() is unknown"
)
xpath = method(xpath, pseudo_element)
else:
Expand All @@ -105,7 +105,7 @@ def xpath_pseudo_element(
method = getattr(self, method_name, None)
if not method:
raise ExpressionError(
f"The pseudo-element ::{pseudo_element} is unknown" # noqa: E231
f"The pseudo-element ::{pseudo_element} is unknown"
)
xpath = method(xpath)
return xpath
Expand All @@ -116,7 +116,7 @@ def xpath_attr_functional_pseudo_element(
"""Support selecting attribute values using ::attr() pseudo-element"""
if function.argument_types() not in (["STRING"], ["IDENT"]):
raise ExpressionError(
f"Expected a single string or ident for ::attr(), got {function.arguments!r}" # noqa: E231
f"Expected a single string or ident for ::attr(), got {function.arguments!r}"
)
return XPathExpr.from_xpath(xpath, attribute=function.arguments[0].value)

Expand Down
2 changes: 1 addition & 1 deletion parsel/selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from .utils import extract_regex, flatten, iflatten, shorten

_SelectorType = TypeVar("_SelectorType", bound="Selector")
_ParserType = Union[etree.XMLParser, etree.HTMLParser]
_ParserType = Union[etree.XMLParser, etree.HTMLParser] # type: ignore[type-arg]
# simplified _OutputMethodArg from types-lxml
_TostringMethodType = Literal[
"html",
Expand Down
2 changes: 1 addition & 1 deletion parsel/xpathfuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def set_xpathfunc(fname: str, func: Optional[Callable]) -> None: # type: ignore
.. _`in lxml documentation`: https://lxml.de/extensions.html#xpath-extension-functions

"""
ns_fns = etree.FunctionNamespace(None) # type: ignore[attr-defined]
ns_fns = etree.FunctionNamespace(None)
if func is not None:
ns_fns[fname] = func
else:
Expand Down
1 change: 1 addition & 0 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ disable=c-extension-no-member,
no-else-return,
no-member,
parse-error,
protected-access,
raise-missing-from,
redefined-builtin,
too-few-public-methods,
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
version="1.8.1",
description="Parsel is a library to extract data from HTML and XML using XPath and CSS selectors",
long_description=readme + "\n\n" + history,
long_description_content_type="text/x-rst",
author="Scrapy project",
author_email="info@scrapy.org",
url="https://github.com/scrapy/parsel",
Expand Down
16 changes: 8 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ commands = py.test --cov=parsel --cov-report=xml {posargs:docs parsel tests}
[testenv:typing]
deps =
{[testenv]deps}
types-jmespath==1.0.2.6
types-lxml==2022.11.8
types-psutil==5.9.5.6
types-setuptools==67.2.0.1
types-jmespath==1.0.2.20240106
types-lxml==2024.2.9
types-psutil==5.9.5.20240311
types-setuptools==69.1.0.20240310
py==1.11.0
mypy==1.0.0
mypy==1.9.0
commands =
mypy {posargs:parsel tests} --strict

[testenv:pylint]
deps =
{[testenv]deps}
pylint==3.0.0
pylint==3.1.0
commands =
pylint docs parsel tests setup.py

Expand All @@ -43,8 +43,8 @@ commands =
[testenv:twinecheck]
basepython = python3
deps =
twine==4.0.2
build==0.10.0
twine==5.0.0
build==1.1.1
commands =
python -m build --sdist
twine check dist/*
Expand Down