Skip to content

Commit 5ab6e2e

Browse files
authored
Remove Python version 3.6 support and add Github Action to run multiple python versions (#770)
1 parent 14f4a1c commit 5ab6e2e

File tree

4 files changed

+45
-9
lines changed

4 files changed

+45
-9
lines changed

.github/workflows/python_build.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
python-version: 3.7
2222
- name: Check Python
2323
run: |
24-
pip install black isort mypy types-dataclasses
24+
pip install black isort mypy types-dataclasses typing-extensions
2525
make check-python
2626
- name: Install minimal stable with clippy and rustfmt
2727
uses: actions-rs/toolchain@v1
@@ -157,3 +157,31 @@ jobs:
157157
run: |
158158
source venv/bin/activate
159159
make test-pyspark
160+
161+
multi-python-running:
162+
name: Running with Python ${{ matrix.python-version }}
163+
runs-on: ubuntu-latest
164+
strategy:
165+
matrix:
166+
python-version: ['3.7', '3.8', '3.9', '3.10']
167+
168+
steps:
169+
- uses: actions/checkout@v3
170+
171+
- name: Set up Python ${{ matrix.python-version }}
172+
uses: actions/setup-python@v4
173+
with:
174+
python-version: ${{ matrix.python-version }}
175+
176+
- name: Build and install deltalake
177+
run: |
178+
pip install virtualenv
179+
virtualenv venv
180+
source venv/bin/activate
181+
make setup
182+
maturin develop
183+
184+
- name: Run deltalake
185+
run: |
186+
source venv/bin/activate
187+
python -c 'import deltalake'

python/deltalake/deltalake.pyi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
import sys
12
from typing import Any, Callable, Dict, List, Optional, Union
23

4+
if sys.version_info >= (3, 8):
5+
from typing import Literal
6+
else:
7+
from typing_extensions import Literal
8+
39
import pyarrow as pa
4-
from typing_extensions import Literal
510

611
from deltalake.writer import AddAction
712

python/deltalake/writer.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,17 @@
2222
if TYPE_CHECKING:
2323
import pandas as pd
2424

25+
import sys
26+
27+
if sys.version_info >= (3, 8):
28+
from typing import Literal
29+
else:
30+
from typing_extensions import Literal
31+
2532
import pyarrow as pa
2633
import pyarrow.dataset as ds
2734
import pyarrow.fs as pa_fs
2835
from pyarrow.lib import RecordBatchReader
29-
from typing_extensions import Literal
3036

3137
from .deltalake import PyDeltaTableError
3238
from .deltalake import write_new_deltalake as _write_new_deltalake

python/pyproject.toml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "deltalake"
77
description = "Native Delta Lake Python binding based on delta-rs with Pandas integration"
88
readme = "README.md"
99
license = {file = "LICENSE.txt"}
10-
requires-python = ">=3.6"
10+
requires-python = ">=3.7"
1111
keywords = ["deltalake", "delta", "datalake", "pandas", "arrow"]
1212
classifiers = [
1313
"Development Status :: 3 - Alpha",
@@ -16,13 +16,11 @@ classifiers = [
1616
]
1717
dependencies = [
1818
"pyarrow>=7",
19-
'numpy<1.20.0;python_version<="3.6"',
20-
'dataclasses;python_version<="3.6"',
19+
'typing-extensions;python_version<"3.8"',
2120
]
2221

2322
[project.optional-dependencies]
2423
pandas = [
25-
'types-dataclasses;python_version<="3.6"',
2624
"pandas"
2725
]
2826
devel = [
@@ -36,8 +34,7 @@ devel = [
3634
"pytest-timeout",
3735
"sphinx<=4.5",
3836
"sphinx-rtd-theme",
39-
"toml",
40-
"typing-extensions"
37+
"toml"
4138
]
4239
pyspark = [
4340
"pyspark",

0 commit comments

Comments
 (0)