Skip to content

Commit

Permalink
Merge pull request #73 from DrGFreeman/fix-ci+update-python-versions
Browse files Browse the repository at this point in the history
Update supported Python versions and fix/refactor CI
  • Loading branch information
DrGFreeman authored Feb 11, 2024
2 parents eed0782 + 3ab99f1 commit 423bdc8
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 156 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: checks
on:
push:
pull_request:
schedule:
- cron: "40 22 * * 6"

concurrency:
group: check-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: test with ${{ matrix.py }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
py:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
os:
- ubuntu-latest
- windows-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup python for test ${{ matrix.py }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py }}
- name: Install tox
run: python -m pip install tox-gh>=1.2
- name: Setup test suite
run: tox -vv --notest
- name: Run test suite
run: tox
73 changes: 0 additions & 73 deletions .github/workflows/linux-checks.yml

This file was deleted.

57 changes: 0 additions & 57 deletions .github/workflows/windows-checks.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v4.5.0
hooks:
- id: check-case-conflict
- id: check-toml
Expand All @@ -15,17 +15,17 @@ repos:
- id: black

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/PyCQA/flake8
rev: 3.8.4
rev: 7.0.0
hooks:
- id: flake8

- repo: https://github.com/econchick/interrogate
rev: 1.3.2
rev: 1.5.0
hooks:
- id: interrogate
exclude: ^(setup.py)
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[![unit-tests-linux](https://github.com/drgfreeman/dynamo-pandas/actions/workflows/linux-checks.yml/badge.svg)](https://github.com/DrGFreeman/dynamo-pandas/actions/workflows/linux-checks.yml)
[![unit-tests-windows](https://github.com/drgfreeman/dynamo-pandas/actions/workflows/windows-checks.yml/badge.svg)](https://github.com/DrGFreeman/dynamo-pandas/actions/workflows/windows-checks.yml)
[![unit-tests-linux](https://github.com/drgfreeman/dynamo-pandas/actions/workflows/checks.yml/badge.svg)](https://github.com/DrGFreeman/dynamo-pandas/actions/workflows/checks.yml)
[![Documentation Status](https://readthedocs.org/projects/dynamo-pandas/badge/?version=latest)](https://dynamo-pandas.readthedocs.io/en/latest/?badge=latest)

# dynamo-pandas
Expand Down
2 changes: 1 addition & 1 deletion dynamo_pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
from .dynamo_pandas import keys
from .dynamo_pandas import put_df

__version__ = "1.3.0"
__version__ = "1.4.0-dev"

__all__ = ["get_df", "keys", "put_df", "__version__"]
4 changes: 2 additions & 2 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
moto
moto[dynamodb]>=5,<6
pytest
pytest-cov
pytest-randomly
pytest-randomly
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,17 @@ def find_meta(meta):
long_description=read("README.md"),
long_description_content_type="text/markdown",
packages=find_packages(),
python_requires=">=3.7",
install_requires=["pandas>=1"],
python_requires=">=3.8",
install_requires=["pandas>=1.2"],
extras_require={"boto3": ["boto3"]},
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"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",
],
)
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os

import boto3
from moto import mock_dynamodb
from moto import mock_aws
import pytest
from test_data import large_table_items
from test_data import test_df
Expand All @@ -23,7 +23,7 @@ def aws_credentials():
@pytest.fixture()
def ddb_client(aws_credentials):
"""Fixture to mock the dynamodb client using moto."""
with mock_dynamodb():
with mock_aws():
yield boto3.client("dynamodb")


Expand Down
12 changes: 6 additions & 6 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ def test_attributes_returns_specified_columns(self, test_df_table):
assert df.equals(
pd.DataFrame(
[
{"A": "abc", "E": "2000-01-01 00:00:00+00:00", "id": 0},
{"A": None, "E": "2000-12-31 23:59:59+00:00", "id": 1},
{"id": 0, "A": "abc", "E": "2000-01-01 00:00:00+00:00"},
{"id": 1, "A": None, "E": "2000-12-31 23:59:59+00:00"},
]
)
)
Expand All @@ -159,9 +159,9 @@ def test_attributes_and_keys(self, test_df_table):
assert df.equals(
pd.DataFrame(
[
{"A": "abc", "E": "2000-01-01 00:00:00+00:00", "id": 0},
{"A": None, "E": "2000-12-31 23:59:59+00:00", "id": 1},
{"A": None, "E": None, "id": 2},
{"id": 0, "A": "abc", "E": "2000-01-01 00:00:00+00:00"},
{"id": 1, "A": None, "E": "2000-12-31 23:59:59+00:00"},
{"id": 2, "A": None, "E": None},
]
)
)
Expand Down Expand Up @@ -312,7 +312,7 @@ def test_with_dtype(self):
test_items,
dtype=dict(
# C="timedelta64[ns]", # Ref. #24
D="datetime64",
D="datetime64[ns]",
E="datetime64[ns, UTC]",
F="Int32",
),
Expand Down
22 changes: 16 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
[tox]
minversion = 3.10
envlist = py{37, 38}-pandas10, py{37, 38, 39, 310}-pandaslatest, linting
minversion = 4
envlist = py{38, 39}-pandas12, py{38, 39, 310, 311, 312}-pandaslatest, linting

[gh]
python =
3.12 = py312-pandaslatest
3.11 = py311-pandaslatest
3.10 = py310-pandaslatest, linting
3.9 = py39-pandas12, py39-pandaslatest
3.8 = py38-pandas12, py38-pandaslatest

[testenv]
setenv =
Expand All @@ -12,21 +20,23 @@ download = true
deps =
.[boto3]
-rrequirements-test.txt
pandas10: pandas>=1,<1.1
pandas10: numpy<=1.20
pandas12: pandas>=1.2,<1.3
pandas12: numpy<=1.20
commands = pytest -v --cov={envsitepackagesdir}/dynamo_pandas --cov-report term-missing {posargs}

[testenv:linting]
basepython = python310
deps = pre-commit
skipdist = true
usedevelop = true
skipinstall = true
commands = pre-commit run --all-files

[pytest]
filterwarnings =
error
; error
ignore:.*is a deprecated alias:DeprecationWarning
ignore:numpy.ufunc size changed:RuntimeWarning
ignore:The distutils package:DeprecationWarning
ignore:distutils Version classes are deprecated:DeprecationWarning
ignore:distutils Version classes are deprecated:DeprecationWarning
ignore:.*Pyarrow:DeprecationWarning

0 comments on commit 423bdc8

Please sign in to comment.