From 65cbe0b8671eaf41f2b09f34a9a05fd135c1fd7c Mon Sep 17 00:00:00 2001 From: Andrey Rakhmatullin Date: Thu, 18 Apr 2024 11:49:54 +0500 Subject: [PATCH 1/3] Bump linter versions. --- .pre-commit-config.yaml | 6 +++--- itemloaders/__init__.py | 1 + itemloaders/processors.py | 1 + itemloaders/utils.py | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f88de9f..8e631fe 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,12 +5,12 @@ repos: - id: black language_version: python3 repo: https://github.com/ambv/black - rev: 23.3.0 + rev: 24.4.0 - hooks: - id: isort language_version: python3 repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 5.13.2 - hooks: - id: flake8 language_version: python3 @@ -21,4 +21,4 @@ repos: - flake8-docstrings - flake8-string-format repo: https://github.com/pycqa/flake8 - rev: 6.1.0 + rev: 7.0.0 diff --git a/itemloaders/__init__.py b/itemloaders/__init__.py index deb80f4..aaa5c2b 100644 --- a/itemloaders/__init__.py +++ b/itemloaders/__init__.py @@ -3,6 +3,7 @@ See documentation in docs/topics/loaders.rst """ + from contextlib import suppress from itemadapter import ItemAdapter diff --git a/itemloaders/processors.py b/itemloaders/processors.py index c4aa039..7bef67c 100644 --- a/itemloaders/processors.py +++ b/itemloaders/processors.py @@ -3,6 +3,7 @@ See documentation in docs/topics/loaders.rst """ + from collections import ChainMap from itemloaders.common import wrap_loader_context diff --git a/itemloaders/utils.py b/itemloaders/utils.py index 984bb8c..3103858 100644 --- a/itemloaders/utils.py +++ b/itemloaders/utils.py @@ -2,6 +2,7 @@ Copy/paste from scrapy source at the moment, to ensure tests are working. Refactoring to come later """ + import inspect from functools import partial from typing import Generator From e88a71e16e1800b0d5f84ee18bf7f7e30c6cd2d7 Mon Sep 17 00:00:00 2001 From: Andrey Rakhmatullin Date: Thu, 18 Apr 2024 12:00:02 +0500 Subject: [PATCH 2/3] Update GitHub CI configs. --- .github/workflows/main.yml | 10 +++++----- .github/workflows/publish.yml | 18 ++++++++---------- tox.ini | 6 +++--- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3e7a46c..d4b1cd4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,10 +7,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.12" - - uses: pre-commit/action@v3.0.0 + - uses: pre-commit/action@v3.0.1 tests: runs-on: ubuntu-latest @@ -18,10 +18,10 @@ jobs: fail-fast: false matrix: include: - - python-version: 3 + - python-version: '3.12' env: TOXENV: docs - - python-version: 3 + - python-version: '3.12' env: TOXENV: twinecheck - python-version: 3.8 @@ -56,7 +56,7 @@ jobs: sudo apt-get update 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 }} - name: Install dependencies diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2ed218a..19ae675 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,21 +6,19 @@ jobs: publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: - python-version: 3 + python-version: 3.12 - name: Install dependencies run: | python -m pip install --upgrade pip - pip install --upgrade setuptools wheel twine + pip install --upgrade build twine - name: Build run: | - python setup.py sdist bdist_wheel + python -m build - name: Upload - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - run: | - twine upload dist/* + uses: pypa/gh-action-pypi-publish@v1.8.14 + with: + password: ${{ secrets.PYPI_TOKEN }} diff --git a/tox.ini b/tox.ini index 1feaf18..b365089 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py35,py36,py37,py38,py39,py310 +envlist = py38,py39,py310,py311,py312 [testenv] deps = @@ -40,8 +40,8 @@ commands = [testenv:twinecheck] basepython = python3 deps = - twine==4.0.2 - build==0.10.0 + twine==5.0.0 + build==1.2.1 commands = python -m build --sdist twine check dist/* From b4f8a29f1c49b1217d867c53f9032a05681ffee6 Mon Sep 17 00:00:00 2001 From: Andrey Rakhmatullin Date: Thu, 18 Apr 2024 12:02:18 +0500 Subject: [PATCH 3/3] Add .readthedocs.yml. --- .github/workflows/main.yml | 2 +- .readthedocs.yml | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .readthedocs.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d4b1cd4..6f0a6a8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: include: - - python-version: '3.12' + - python-version: '3.12' # Keep in sync with .readthedocs.yml env: TOXENV: docs - python-version: '3.12' diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000..fbe8493 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,14 @@ +version: 2 +formats: all +sphinx: + configuration: docs/conf.py + +build: + os: ubuntu-22.04 + tools: + python: "3.12" # Keep in sync with .github/workflows/main.yml + +python: + install: + - requirements: docs/requirements.txt + - path: .