Skip to content

Commit 0ecfa71

Browse files
authored
Patch (#28)
* fix tests * fix integration tests * restrict python version to 3.10, 3.11 or 3.12 * update changelog * exclude python 3.12 * fix: pa.DataFrameModel
1 parent 4934513 commit 0ecfa71

17 files changed

Lines changed: 144 additions & 120 deletions

.github/workflows/actions.yml

Lines changed: 68 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,35 @@ name: dac actions
33
on:
44
push:
55
branches:
6-
- '*'
6+
- "*"
77
tags:
8-
- '*'
8+
- "*"
99

1010
jobs:
11-
1211
check-style:
1312
runs-on: ubuntu-latest
1413
steps:
15-
- name: Checkout 🔖
16-
uses: actions/checkout@v3
17-
with:
18-
fetch-depth: 1
19-
- name: Setup python 🐍
20-
uses: actions/setup-python@v4
21-
with:
22-
python-version: '3.12'
23-
- name: Setup cache 💾
24-
uses: actions/cache@v3
25-
with:
26-
path: ~/.cache/pre-commit
27-
key: pre-commit
28-
- name: Prepare pre-commit 🙆‍♂️👗
29-
run: |
30-
python -m venv venv || . venv/bin/activate
31-
pip install -U pip wheel setuptools pre-commit
32-
pre-commit install
33-
- name: Run pre-commit 👗🚀
34-
run: |
35-
pre-commit run --all-files
14+
- name: Checkout 🔖
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 1
18+
- name: Setup python 🐍
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: "3.12"
22+
- name: Setup cache 💾
23+
uses: actions/cache@v3
24+
with:
25+
path: ~/.cache/pre-commit
26+
key: pre-commit
27+
- name: Prepare pre-commit 🙆‍♂️👗
28+
run: |
29+
python -m venv venv || . venv/bin/activate
30+
pip install -U pip wheel setuptools pre-commit
31+
pre-commit install
32+
- name: Run pre-commit 👗🚀
33+
run: |
34+
pre-commit run --all-files
3635
3736
test:
3837
runs-on: "${{ matrix.os }}"
@@ -41,60 +40,60 @@ jobs:
4140
os: ["ubuntu-latest"]
4241
version: ["3.9", "3.10", "3.11"]
4342
steps:
44-
- name: Checkout 🔖
45-
uses: actions/checkout@v3
46-
with:
47-
fetch-depth: 1
48-
- name: Setup python 🐍
49-
uses: actions/setup-python@v4
50-
with:
51-
python-version: "${{ matrix.version }}"
52-
- name: Prepare tests 🙆‍♂️🔬
53-
run: |
54-
python -m venv venv || . venv/bin/activate
55-
pip install -U pip wheel setuptools
56-
pip install -r requirements-test.txt
57-
- name: Run tests 🔬🚀
58-
run: |
59-
pytest test --run-slow
43+
- name: Checkout 🔖
44+
uses: actions/checkout@v3
45+
with:
46+
fetch-depth: 1
47+
- name: Setup python 🐍
48+
uses: actions/setup-python@v4
49+
with:
50+
python-version: "${{ matrix.version }}"
51+
- name: Prepare tests 🙆‍♂️🔬
52+
run: |
53+
python -m venv venv || . venv/bin/activate
54+
pip install -U pip wheel setuptools
55+
pip install -r requirements-test.txt
56+
- name: Run tests 🔬🚀
57+
run: |
58+
pytest test --run-slow
6059
6160
docs:
6261
needs: [test, check-style]
6362
if: ${{ github.ref == 'refs/heads/main' }}
6463
runs-on: ubuntu-latest
6564
steps:
66-
- name: Checkout 🔖
67-
uses: actions/checkout@v3
68-
- name: Deploy docs
69-
uses: mhausenblas/mkdocs-deploy-gh-pages@master
70-
env:
71-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72-
CONFIG_FILE: mkdocs.yml
73-
REQUIREMENTS: requirements-docs.txt
65+
- name: Checkout 🔖
66+
uses: actions/checkout@v3
67+
- name: Deploy docs
68+
uses: mhausenblas/mkdocs-deploy-gh-pages@master
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
CONFIG_FILE: mkdocs.yml
72+
REQUIREMENTS: requirements-docs.txt
7473

7574
pypi-release:
7675
needs: [test, check-style]
7776
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
7877
runs-on: ubuntu-latest
7978
steps:
80-
- name: Checkout 🔖
81-
uses: actions/checkout@v3
82-
with:
83-
fetch-depth: 1
84-
- name: Setup python 🐍
85-
uses: actions/setup-python@v4
86-
with:
87-
python-version: "3.12"
88-
- name: Prepare release 🙆‍♂️📦test
89-
run: |
90-
python -m venv venv || . venv/bin/activate
91-
pip install -U pip wheel setuptools build twine
92-
- name: Build 🛠️📦
93-
run: |
94-
python -m build
95-
- name: Release 📦🚀
96-
env:
97-
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
98-
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
99-
run: |
100-
python -m twine upload dist/*
79+
- name: Checkout 🔖
80+
uses: actions/checkout@v3
81+
with:
82+
fetch-depth: 1
83+
- name: Setup python 🐍
84+
uses: actions/setup-python@v4
85+
with:
86+
python-version: "3.12"
87+
- name: Prepare release 🙆‍♂️📦test
88+
run: |
89+
python -m venv venv || . venv/bin/activate
90+
pip install -U pip wheel setuptools build twine
91+
- name: Build 🛠️📦
92+
run: |
93+
python -m build
94+
- name: Release 📦🚀
95+
env:
96+
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
97+
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
98+
run: |
99+
python -m twine upload dist/*

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
Anything MAY change at any time. The public API SHOULD NOT be considered stable.").
1111
While in this phase, we will denote breaking changes with a minor increase.
1212

13+
## 0.4.3
14+
15+
### Fixed
16+
17+
* Bump all dependencies to the latest version and introduce necessary adaptation in the source code (affecting only `dac info`):
18+
- `build~=0.9` -> `build==1.2.2`
19+
- `toml~=0.10` -> `toml==0.10.2`
20+
- `typer[all]~=0.7` -> `typer[all]==0.15.2`
21+
- `wheel~=0.38` -> `wheel==0.45.1`
22+
* Prevent installation with python > `3.11`
23+
1324
## 0.4.2
1425

1526
### Fixed

pyproject.toml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,30 @@ name = "dac"
33
dynamic = ["version"]
44
description = "Tool to distribute data as code"
55
readme = "README.md"
6-
requires-python = ">=3.9"
6+
requires-python = ">=3.9,<3.12"
77
license = { text = "MIT" }
88
authors = [
9-
{ name = "Francesco Calcavecchia", email = "francesco.calcavecchia@gmail.com" },
9+
{ name = "Francesco Calcavecchia", email = "francesco.calcavecchia@gmail.com" },
1010
]
1111
maintainers = [
12-
{ name = "Francesco Calcavecchia", email = "francesco.calcavecchia@gmail.com" },
12+
{ name = "Francesco Calcavecchia", email = "francesco.calcavecchia@gmail.com" },
1313
]
1414
classifiers = [
15-
"Programming Language :: Python :: 3",
16-
"Development Status :: 3 - Alpha",
17-
"Intended Audience :: Developers",
18-
"Topic :: Software Development :: Build Tools",
19-
"License :: OSI Approved :: MIT License",
20-
"Topic :: Scientific/Engineering",
21-
"Operating System :: OS Independent",
15+
"Programming Language :: Python :: 3",
16+
"Development Status :: 3 - Alpha",
17+
"Intended Audience :: Developers",
18+
"Topic :: Software Development :: Build Tools",
19+
"License :: OSI Approved :: MIT License",
20+
"Topic :: Scientific/Engineering",
21+
"Operating System :: OS Independent",
2222
]
2323

24-
dependencies = ["build~=0.9", "toml~=0.10", "typer[all]~=0.7", "wheel~=0.38"]
24+
dependencies = [
25+
"build==1.2.2",
26+
"toml==0.10.2",
27+
"typer[all]==0.15.2",
28+
"wheel==0.45.1",
29+
]
2530

2631
# [project.optional-dependencies]
2732
#

requirements-test.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-e .
2-
pandas~=1.5
3-
pandera~=0.13
2+
pandas~=2.2
3+
pandera~=0.23.1
44
pyarrow
5-
pytest~=7.2
5+
pytest~=8.3

src/dac/_cli.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import platform
2+
import re
23
import sys
3-
from importlib.metadata import requires, version
4+
from importlib.metadata import PackageNotFoundError, requires, version
45
from pathlib import Path
56
from typing import Optional
67

@@ -105,8 +106,11 @@ def info():
105106
requirements = requires(dac.__name__)
106107
assert requirements is not None
107108
for r in requirements:
108-
lib_name = r.split(" ")[0]
109-
table.add_row(lib_name, version(lib_name.split("[")[0]))
109+
lib_name = re.match(r"^[a-zA-Z0-9]*", r).group(0)
110+
try:
111+
table.add_row(lib_name, version(lib_name.split("[")[0]))
112+
except PackageNotFoundError as e:
113+
table.add_row(lib_name, e.msg)
110114
table.add_row("python", sys.version)
111115
table.add_row("platform", platform.platform())
112116
console.print(table)

test/cli_utilities.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
from tempfile import TemporaryDirectory
2+
from typing import Optional
3+
4+
from click.testing import Result
5+
from typer.testing import CliRunner
6+
7+
from dac._cli import app
8+
from dac._input.config import PackConfig
29
from test.data import (
310
generate_random_project_name,
411
get_path_to_self_contained_load_as_pandas,
512
get_path_to_self_contained_schema,
613
get_test_project_version,
714
)
8-
from typing import Optional
9-
10-
from click.testing import Result
11-
from dac._cli import app
12-
from dac._input.config import PackConfig
13-
from typer.testing import CliRunner
1415

1516
runner = CliRunner()
1617

test/data/load/parquet_as_pandas.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44

55

66
def load() -> pd.DataFrame:
7-
return pd.read_parquet(Path(__file__).parent / "sample.parquet")
7+
df = pd.read_parquet(Path(__file__).parent / "sample.parquet")
8+
df["datetime1"] = df["datetime1"].astype("datetime64[ns]")
9+
return df
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
pandas~=1.0
1+
pandas~=2.0
22
pyarrow
3-
pandera~=0.13.4
3+
pandera~=0.23.1

test/data/schema/incompatible_with_sample_df.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pandera.typing import Series
55

66

7-
class Schema(pa.SchemaModel):
7+
class Schema(pa.DataFrameModel):
88
int1: Series[int] = pa.Field(nullable=False)
99
float1: Series[int] = pa.Field()
1010
string1: Series[float] = pa.Field()

test/data/schema/invalid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pandera.typing import Series
55

66

7-
class SchemaWithWrongName(pa.SchemaModel):
7+
class SchemaWithWrongName(pa.DataFrameModel):
88
int1: Series[int] = pa.Field(nullable=False)
99
float1: Series[float] = pa.Field()
1010
string1: Series[str] = pa.Field()

0 commit comments

Comments
 (0)