Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/main/tox-gte-3.20-and-lt-4.15
Browse files Browse the repository at this point in the history
  • Loading branch information
arengel authored Mar 18, 2024
2 parents 2c37790 + 506c7e5 commit c757ef3
Show file tree
Hide file tree
Showing 21 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ repos:

# Linter and formatter that replaces flake8, isort, etc.
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.2
rev: v0.3.3
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies = [
[project.optional-dependencies]
dev = [
"build>=0.9",
"ruff>0.0.215,<0.2.3",
"ruff>0.0.215,<0.3.4",
"tox>=3.20,<4.15",
"twine>=4.0",
]
Expand All @@ -51,13 +51,13 @@ tests = [
"pytest>=6.2,<8.1", # test framework
"pytest-console-scripts>=1.1,<1.5", # Allow automatic testing of scripts
"pytest-cov>=2.10,<4.2", # Pytest plugin for working with coverage
"ruff>0.0.215,<0.2.3",
"ruff>0.0.215,<0.3.4",
"tox>=3.20,<4.15", # Python test environment manager
"tqdm >= 4.63,< 4.67",
"requests_mock",
]
optional = [
"plotly>5.10,<5.20",
"plotly>5.10,<5.21",
"sqlalchemy>1.4,<2.1",
]
pudl-test = []
Expand Down
1 change: 1 addition & 0 deletions src/etoolbox/_optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Could do something more like this:
https://github.com/pola-rs/polars/blob/master/py-polars/polars/dependencies.py
"""

import warnings

try:
Expand Down
1 change: 1 addition & 0 deletions src/etoolbox/datazip/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Core :class:`.DataZip` object plus mixins and wrappers."""

from etoolbox.datazip.core import DataZip
from etoolbox.datazip.mixin import IOMixin

Expand Down
1 change: 1 addition & 0 deletions src/etoolbox/datazip/_test_classes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Mocks and other objects for testing :class:`.DataZip`."""

from __future__ import annotations

from typing import NamedTuple
Expand Down
6 changes: 2 additions & 4 deletions src/etoolbox/datazip/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
class DZableObj(Protocol):
"""Protocol for an object that can be serialized with :class:`DataZip`."""

def __getstate__(self) -> dict | tuple[dict | None, dict]:
...
def __getstate__(self) -> dict | tuple[dict | None, dict]: ...

def __setstate__(self, state: dict | tuple[dict | None, dict]) -> None:
...
def __setstate__(self, state: dict | tuple[dict | None, dict]) -> None: ...


JSONABLE = float | int | dict | list | str | bool | None
Expand Down
1 change: 1 addition & 0 deletions src/etoolbox/datazip/core.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Code for :class:`.DataZip`."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions src/etoolbox/datazip/mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
The goal is to build this out so that most custom classes can be stored and recovered by
inheriting this mixin.
"""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions src/etoolbox/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities, etc."""

from etoolbox.utils.arrays import compare_dfs, isclose
from etoolbox.utils.match import Const, FuncCall, InSet, RegexEqual, Var

Expand Down
1 change: 1 addition & 0 deletions src/etoolbox/utils/arrays.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities for working with :mod:`pandas` objects."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions src/etoolbox/utils/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
Available:
https://www.dropbox.com/s/w1bs8ckekki9ype/PyITPatternMatchingTalk.pdf?dl=0
"""

import re


Expand Down
1 change: 1 addition & 0 deletions src/etoolbox/utils/misc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Miscellaneous helpers and utilities."""

from io import DEFAULT_BUFFER_SIZE, BytesIO
from pathlib import Path

Expand Down
1 change: 0 additions & 1 deletion src/etoolbox/utils/pudl_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
SOFTWARE.
"""


import logging
import re

Expand Down
7 changes: 3 additions & 4 deletions src/etoolbox/utils/remote_zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,9 @@ def __len__(self):
return self._size

def __repr__(self):
return "<_PartialBuffer off={} size={} stream={}>".format(
self._offset,
self._size,
self._stream,
return (
f"<_PartialBuffer off={self._offset} "
f"size={self._size} stream={self._stream}>"
)

def read(self, size=0):
Expand Down
1 change: 1 addition & 0 deletions src/etoolbox/utils/testing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Helpers for tests."""

import numpy as np
import pandas as pd
import polars as pl
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Defines useful fixtures, command line args.
"""

import gzip
import logging
import shutil
Expand Down
1 change: 1 addition & 0 deletions tests/unit/datazip_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Core :class:`.DataZip` tests."""

import functools
import importlib
import json
Expand Down
1 change: 1 addition & 0 deletions tests/unit/utils_arrays_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test for :mod:`etoolbox.utils.arrays`."""

import numpy as np
import pandas as pd
from etoolbox.utils.arrays import compare_dfs, isclose
Expand Down
1 change: 1 addition & 0 deletions tests/unit/utils_misc_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test utils.misc."""

from etoolbox.utils.misc import download, ungzip


Expand Down
1 change: 1 addition & 0 deletions tests/unit/utils_pudl_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test pretend PudlTabl."""

import os
from unittest import mock

Expand Down
1 change: 1 addition & 0 deletions tests/unit/utils_testing_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for testing utils."""

import importlib
import math

Expand Down

0 comments on commit c757ef3

Please sign in to comment.