diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 7d50e5a..1e6b89a 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -8,27 +8,27 @@ jobs: strategy: matrix: include: - - python-version: 3 + - python-version: 3.12 env: TOXENV: black - - python-version: 3 + - python-version: 3.12 env: TOXENV: bandit - - python-version: 3 + - python-version: 3.12 env: TOXENV: flake8 - - python-version: 3.8 + - python-version: 3.12 env: TOXENV: typing - - python-version: 3.8 + - python-version: 3.12 env: TOXENV: pylint steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d46a54a..6a30b64 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,12 +8,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Set up Python 3.8 - uses: actions/setup-python@v2 + - name: Set up Python 3.12 + uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.12 - name: Publish to PyPI run: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4bedabd..42581fb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,13 +8,13 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -35,10 +35,10 @@ jobs: 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@v4 with: python-version: 3.8 @@ -62,10 +62,10 @@ jobs: os: [macos-latest, windows-latest] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.8 diff --git a/itemadapter/adapter.py b/itemadapter/adapter.py index 3105748..e485b1e 100644 --- a/itemadapter/adapter.py +++ b/itemadapter/adapter.py @@ -67,7 +67,6 @@ def field_names(self) -> KeysView: class _MixinAttrsDataclassAdapter: - _fields_dict: dict item: Any @@ -163,7 +162,6 @@ def get_field_names_from_class(cls, item_class: type) -> Optional[List[str]]: class PydanticAdapter(AdapterInterface): - item: Any @classmethod @@ -212,7 +210,6 @@ def __len__(self) -> int: class _MixinDictScrapyItemAdapter: - _fields_dict: dict item: Any diff --git a/setup.py b/setup.py index 1a60454..d52407c 100644 --- a/setup.py +++ b/setup.py @@ -29,6 +29,7 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Framework :: Scrapy", "Intended Audience :: Developers", "Topic :: Internet :: WWW/HTTP", diff --git a/tests/test_adapter.py b/tests/test_adapter.py index 1c8f7e2..24c29e5 100644 --- a/tests/test_adapter.py +++ b/tests/test_adapter.py @@ -99,7 +99,6 @@ def test_non_item(self): class BaseTestMixin: - item_class = None item_class_nested = None @@ -228,7 +227,6 @@ def test_field_names_from_class_empty(self): class DictTestCase(unittest.TestCase, BaseTestMixin): - item_class = dict item_class_nested = dict @@ -255,7 +253,6 @@ def test_field_names_from_class(self): class ScrapySubclassedItemTestCase(NonDictTestMixin, unittest.TestCase): - item_class = ScrapySubclassedItem item_class_nested = ScrapySubclassedItemNested item_class_subclassed = ScrapySubclassedItemSubclassed @@ -269,7 +266,6 @@ def test_get_value_keyerror_item_dict(self): class PydanticModelTestCase(NonDictTestMixin, unittest.TestCase): - item_class = PydanticModel item_class_nested = PydanticModelNested item_class_subclassed = PydanticModelSubclassed @@ -277,7 +273,6 @@ class PydanticModelTestCase(NonDictTestMixin, unittest.TestCase): class DataClassItemTestCase(NonDictTestMixin, unittest.TestCase): - item_class = DataClassItem item_class_nested = DataClassItemNested item_class_subclassed = DataClassItemSubclassed @@ -285,7 +280,6 @@ class DataClassItemTestCase(NonDictTestMixin, unittest.TestCase): class AttrsItemTestCase(NonDictTestMixin, unittest.TestCase): - item_class = AttrsItem item_class_nested = AttrsItemNested item_class_subclassed = AttrsItemSubclassed diff --git a/tests/test_interface.py b/tests/test_interface.py index 21c0783..1c16a77 100644 --- a/tests/test_interface.py +++ b/tests/test_interface.py @@ -73,7 +73,6 @@ def get_field_meta_from_class(cls, item_class: type, field_name: str) -> Mapping class BaseFakeItemAdapterTest(unittest.TestCase): - item_class = FakeItemClass adapter_class = BaseFakeItemAdapter @@ -183,7 +182,6 @@ def test_field_names(self): class MetadataFakeItemAdapterTest(BaseFakeItemAdapterTest): - item_class = FakeItemClass adapter_class = MetadataFakeItemAdapter @@ -209,7 +207,6 @@ def test_get_field_meta_from_class(self): class FieldNamesFakeItemAdapterTest(BaseFakeItemAdapterTest): - item_class = FakeItemClass adapter_class = FieldNamesFakeItemAdapter diff --git a/tox.ini b/tox.ini index 104e25f..253e190 100644 --- a/tox.ini +++ b/tox.ini @@ -18,30 +18,30 @@ commands = [testenv:flake8] basepython = python3 deps = - flake8>=3.7.9 + flake8==6.1.0 commands = flake8 --exclude=.git,.tox,venv* {posargs:itemadapter tests} [testenv:typing] basepython = python3 deps = - mypy==0.991 + mypy==1.5.1 attrs pydantic scrapy commands = mypy --install-types --non-interactive \ - --show-error-codes --ignore-missing-imports {posargs:itemadapter} + --ignore-missing-imports {posargs:itemadapter} [testenv:black] basepython = python3 deps = - black==22.12.0 + black==23.9.1 commands = black --check {posargs:itemadapter tests} [testenv:pylint] deps = - pylint==2.11.1 + pylint==3.0.0 commands = pylint {posargs:itemadapter}