Skip to content

Commit

Permalink
Add Python 3.13 testing (#185)
Browse files Browse the repository at this point in the history
* test python 3.13

* update pre-commit
  • Loading branch information
akaszynski authored Oct 30, 2024
1 parent 21e1ca9 commit 6da8ea9
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/testing-and-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']

env:
KEEPAKEY: ${{ secrets.KEEPAKEY }}
Expand Down Expand Up @@ -44,17 +44,17 @@ jobs:
pytest -v --cov keepa --cov-report xml
- uses: codecov/codecov-action@v4
if: matrix.python-version == '3.12'
if: matrix.python-version == '3.13'
name: Upload coverage to codecov

- name: Build wheel
if: matrix.python-version == '3.12'
if: matrix.python-version == '3.13'
run: |
pip install build --disable-pip-version-check
python -m build
- name: Upload wheel
if: matrix.python-version == '3.12'
if: matrix.python-version == '3.13'
uses: actions/upload-artifact@v4
with:
name: keepa-wheel
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ tests/htmlcov/
*,cover
.coverage
.hypothesis
.venv

# key storage
tests/key
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
- id: blackdoc
files: \.py$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.5
rev: v0.7.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand All @@ -28,12 +28,12 @@ repos:
additional_dependencies: [toml]
exclude: tests/
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
rev: v3.19.0
hooks:
- id: pyupgrade
args: [--py38-plus, --keep-runtime-typing]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-merge-conflict
- id: debug-statements
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ classifiers = [
"Intended Audience :: End Users/Desktop",
"Topic :: Database :: Front-Ends",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12"
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13"
]
dependencies = [
"numpy >=1.9.3",
Expand All @@ -33,6 +33,7 @@ dynamic = ["version"]
keywords = ["keepa"]
name = "keepa"
readme = "README.rst"
requires-python = ">=3.9"

[project.optional-dependencies]
doc = [
Expand Down
3 changes: 2 additions & 1 deletion tests/test_async_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ async def test_isbn13(api):


@pytest.mark.asyncio
@pytest.mark.xfail # will fail if not run in a while due to timeout
async def test_buybox(api):
request = await api.query(PRODUCT_ASIN, history=True, buybox=True)
product = request[0]
Expand Down Expand Up @@ -245,7 +246,7 @@ async def test_productquery_offers_multiple(api):

asins = np.unique([product["asin"] for product in products])
assert len(asins) == len(PRODUCT_ASINS)
assert np.in1d(asins, PRODUCT_ASINS).all()
assert np.isin(asins, PRODUCT_ASINS).all()


@pytest.mark.asyncio
Expand Down
3 changes: 2 additions & 1 deletion tests/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def test_productquery_offers_multiple(api):

asins = np.unique([product["asin"] for product in products])
assert len(asins) == len(PRODUCT_ASINS)
assert np.in1d(asins, PRODUCT_ASINS).all()
assert np.isin(asins, PRODUCT_ASINS).all()


def test_domain(api):
Expand All @@ -341,6 +341,7 @@ def test_bestsellers(api):
assert len(asins) == valid_asins.size


@pytest.mark.xfail # will fail if not run in a while due to timeout
def test_buybox_used(api):
request = api.query(HARD_DRIVE_PRODUCT_ASIN, history=False, offers=20)
df = keepa.process_used_buybox(request[0]["buyBoxUsedHistory"])
Expand Down

0 comments on commit 6da8ea9

Please sign in to comment.