Skip to content

Commit da150b1

Browse files
authored
Bug: Fix dependency compatibility warnings and sparse string inference (#220) (#221)
* sparse series handling fixes + deprecation warning fixes + pyproject.toml cleanup * remove uv.lock * ci updates * updated precommit * lint fixes for 3.9 to 3.14 * ci updates * running pre-commit hooks manually * running pre-commit hooks manually * running pre-commit hooks manually --------- Signed-off-by: Ian Eaves <ian.k.eaves@gmail.com>
1 parent 43aa17e commit da150b1

90 files changed

Lines changed: 314 additions & 245 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ jobs:
1515
- name: Install GraphViz
1616
run: sudo apt-get install graphviz
1717

18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v6
1919

2020
- name: Configurating Git
2121
run: |
2222
git config --local user.email "action@github.com"
2323
git config --local user.name "GitHub Action"
2424
25-
- name: Set up Python 3.8
26-
uses: actions/setup-python@v1
25+
- name: Set up Python 3.13
26+
uses: actions/setup-python@v6
2727
with:
28-
python-version: 3.8
28+
python-version: "3.13"
2929

30-
- uses: actions/cache@v1
30+
- uses: actions/cache@v4
3131
name: Cache pip dependencies
3232
with:
3333
path: ~/.cache/pip

.github/workflows/pypi.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v6
1515
name: Checkout repo
1616

1717
- name: Set up Python 3.12
18-
uses: actions/setup-python@v1
18+
uses: actions/setup-python@v6
1919
with:
20-
python-version: 3.12
21-
22-
- uses: actions/cache@v1
20+
python-version: "3.12"
21+
22+
- uses: actions/cache@v4
2323
name: Cache pip dependencies
2424
with:
2525
path: ~/.cache/pip

.github/workflows/tests.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,40 @@ on:
77
branches: [ master, develop ]
88

99
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v6
15+
- name: Set up Python 3.14
16+
uses: actions/setup-python@v6
17+
with:
18+
python-version: "3.14"
19+
- name: Install lint dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install pre-commit
23+
- name: Lint with pre-commit
24+
run: |
25+
pre-commit run --all-files
26+
1027
test:
1128
strategy:
1229
matrix:
1330
os: [ ubuntu-latest ]
14-
python: [ 3.9, "3.10", 3.11, 3.12, 3.13 ]
31+
python: [ "3.9", "3.10", "3.11", "3.12", "3.13", "3.14" ]
1532
runs-on: ${{ matrix.os }}
1633

1734
steps:
18-
- uses: actions/checkout@v2
35+
- uses: actions/checkout@v6
1936
- name: Set up Python ${{ matrix.python }}
20-
uses: actions/setup-python@v1
37+
uses: actions/setup-python@v6
2138
with:
2239
python-version: ${{ matrix.python }}
2340
- name: Install dependencies
2441
run: |
2542
python -m pip install --upgrade pip
2643
pip install -e .[testing]
27-
- name: Lint with pre-commit
28-
run: |
29-
pre-commit run --all-files
3044
- name: Test with pytest
3145
run: |
3246
pytest -p no:spark -m "not spark_test"

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
repos:
22
- repo: https://github.com/asottile/pyupgrade
3-
rev: v3.17.0
3+
rev: v3.21.1
44
hooks:
55
- id: pyupgrade
6-
args: ['--py36-plus','--exit-zero-even-if-changed']
6+
args: ['--py39-plus','--exit-zero-even-if-changed']
77
- repo: https://github.com/pycqa/isort
88

99
rev: 5.13.2
@@ -39,4 +39,4 @@ repos:
3939
- repo: https://github.com/pre-commit/pygrep-hooks
4040
rev: v1.10.0
4141
hooks:
42-
- id: rst-backticks
42+
- id: rst-backticks

examples/data_analysis/categorical.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from typing import List, Sequence
1+
from collections.abc import Sequence
2+
from typing import List
23

34
import numpy as np
45
import pandas as pd
@@ -23,7 +24,7 @@ def to_category(series: pd.Series) -> pd.Series:
2324
)
2425

2526

26-
def _get_relations(cls) -> List[TypeRelation]:
27+
def _get_relations(cls) -> list[TypeRelation]:
2728
from visions.types import Generic
2829

2930
relations = [

examples/ml_problem_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Sequence
1+
from collections.abc import Sequence
22

33
import numpy as np
44
import pandas as pd

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@ name = "visions"
88
dynamic = ["version"]
99
description = "Visions"
1010
readme = "README.md"
11-
license = { text = "BSD License" }
11+
license = "BSD-4-Clause"
12+
license-files = ["LICENSE"]
1213
authors = [
1314
{ name = "Dylan Profiler", email = "visions@ictopzee.nl" }
1415
]
15-
requires-python = ">=3.8"
16+
requires-python = ">=3.9"
1617
classifiers = [
17-
"Programming Language :: Python :: 3",
1818
"Programming Language :: Python :: 3.9",
1919
"Programming Language :: Python :: 3.10",
2020
"Programming Language :: Python :: 3.11",
2121
"Programming Language :: Python :: 3.12",
2222
"Programming Language :: Python :: 3.13",
23+
"Programming Language :: Python :: 3.14",
2324
]
2425

2526
dependencies = [

src/visions/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
from visions.types import *
1313
from visions.typesets import *
1414

15-
__version__ = "0.8.1"
15+
__version__ = "0.8.2"

src/visions/backends/numpy/array_utils.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import functools
2-
from typing import Callable, Sequence, Tuple, TypeVar, Union
2+
from collections.abc import Sequence
3+
from typing import Callable, Tuple, TypeVar, Union
34

45
import numpy as np
56

@@ -39,7 +40,7 @@ def inner(array: np.ndarray, *args, **kwargs) -> bool:
3940
return inner
4041

4142

42-
def _base_all_type(array: np.ndarray, dtypes: Union[type, Tuple[type, ...]]) -> bool:
43+
def _base_all_type(array: np.ndarray, dtypes: Union[type, tuple[type, ...]]) -> bool:
4344
return all(isinstance(v, dtypes) for v in array)
4445

4546

@@ -48,7 +49,7 @@ def _base_all_type(array: np.ndarray, dtypes: Union[type, Tuple[type, ...]]) ->
4849
# There are alternative implementations with forceobj=True which work in all cases
4950
# including the use of isinstance, but in those cases worst case performance can be substantially worse
5051
# than the default python implementation.
51-
def all_type_numba(dtype: Union[Tuple, T]):
52+
def all_type_numba(dtype: Union[tuple, T]):
5253
@nb.jit(nopython=True)
5354
def inner(array: np.ndarray) -> bool:
5455
for i in nb.prange(array.size):
@@ -58,10 +59,10 @@ def inner(array: np.ndarray) -> bool:
5859

5960
return inner
6061

61-
def all_type(array: np.ndarray, dtypes: Union[type, Tuple[type, ...]]) -> bool:
62+
def all_type(array: np.ndarray, dtypes: Union[type, tuple[type, ...]]) -> bool:
6263
return _base_all_type(array, dtypes)
6364

6465
else:
6566

66-
def all_type(array: np.ndarray, dtypes: Union[type, Tuple[type, ...]]) -> bool:
67+
def all_type(array: np.ndarray, dtypes: Union[type, tuple[type, ...]]) -> bool:
6768
return _base_all_type(array, dtypes)

src/visions/backends/numpy/sequences.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
from typing import Dict, Sequence
1+
from collections.abc import Sequence
2+
from typing import Dict
23
from urllib.parse import urlparse
34

45
import numpy as np
56

67

7-
def get_sequences() -> Dict[str, Sequence]:
8+
def get_sequences() -> dict[str, Sequence]:
89
sequences = {
910
"complex_series_float": [
1011
complex(0, 0),

0 commit comments

Comments
 (0)