Skip to content

Commit

Permalink
Add python3.7 compatibility (#26)
Browse files Browse the repository at this point in the history
* Add python3.7 compatibility
  • Loading branch information
leewesleyv authored Jan 10, 2025
1 parent 2db01ad commit 1a7ce0e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,20 @@ jobs:

test:
name: unittests
runs-on: ubuntu-latest
runs-on: ubuntu-22.04 # Ubuntu LTS 22.04 is the latest image that includes Python3.7
strategy:
matrix:
toxenv:
- py37-scrapy29
- py312-scrapy29
- py38-scrapy210
- py312-scrapy210
- py38-scrapy211
- py312-scrapy211
- py312-scrapymaster
include:
- toxenv: py37-scrapy29
python-version: 3.7
- toxenv: py312-scrapy29
python-version: '3.12'

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Scrapy Webarchive is a plugin for Scrapy that allows users to capture and export

## Compatibility

* Python 3.8, 3.9, 3.10, 3.11 and 3.12
* Python 3.7, 3.8, 3.9, 3.10, 3.11 and 3.12

## Documentation

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies = [
"wacz==0.5.0",
"cdxj-indexer==1.4.5",
]
requires-python = ">=3.8,<3.13"
requires-python = ">=3.7,<3.13"
authors = []
maintainers = []
description = "A webarchive extension for Scrapy"
Expand Down
3 changes: 1 addition & 2 deletions scrapy_webarchive/wacz/storages.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import struct
import zipfile
from abc import ABC, abstractmethod
from functools import cached_property
from io import BytesIO
from urllib.parse import unquote, urlparse

Expand Down Expand Up @@ -207,7 +206,7 @@ def _calculate_range(self, metadata: dict, offset: int, size: int) -> str:
end = start + size - 1
return f"bytes={start}-{end}"

@cached_property
@property
def zip_exists(self) -> bool:
return bool(self.get_file_info())

Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ skipsdist = True
usedevelop = True

envlist =
py{38,39,310,311,312}-scrapy{29,210,211},
py{37,38,39,310,311,312}-scrapy29,
py{38,39,310,311,312}-scrapy{210,211},
py{39,310,311,312}-scrapymaster,

[testenv]
Expand All @@ -12,6 +13,7 @@ allowlist_externals = py.test
commands =
py.test tests/
basepython =
py37: python3.7
py38: python3.8
py39: python3.9
py310: python3.10
Expand Down

0 comments on commit 1a7ce0e

Please sign in to comment.