Skip to content

Commit

Permalink
feat(python): support python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored and gforsyth committed Mar 8, 2024
1 parent f68524c commit 7056dea
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-generated-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: actions/setup-python@v5
id: install_python
with:
python-version: "3.11"
python-version: "3.12"
cache: pip
cache-dependency-path: requirements-dev.txt

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ibis-backends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,11 @@ jobs:
deps:
- "'pandas@>2'"
- "'numpy@>1.24'"
- python-version: "3.12"
pyspark-version: "3.5"
deps:
- "'pandas@>2'"
- "'numpy@>1.24'"
steps:
- name: checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ibis-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: actions/setup-python@v5
id: install_python
with:
python-version: "3.11"
python-version: "3.12"
cache: poetry

- name: install system dependencies
Expand Down
25 changes: 6 additions & 19 deletions .github/workflows/ibis-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- name: checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -101,14 +102,7 @@ jobs:

test_shapely_duckdb_import:
name: Test shapely and duckdb import
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
python-version:
- "3.11"
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
Expand All @@ -120,10 +114,10 @@ jobs:
uses: actions/setup-python@v5
id: install_python
with:
python-version: ${{ matrix.python-version }}
python-version: "3.12"
cache: poetry

- name: install ${{ matrix.os }} system dependencies
- name: install system dependencies
run: |
set -euo pipefail
Expand All @@ -141,14 +135,7 @@ jobs:
# FIXME(kszucs): re-enable this build
if: false
name: Doctests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
python-version:
- "3.11"
runs-on: ubuntu-latest
steps:
- name: install system dependencies
run: |
Expand All @@ -167,7 +154,7 @@ jobs:
uses: actions/setup-python@v5
id: install_python
with:
python-version: ${{ matrix.python-version }}
python-version: "3.12"
cache: poetry

- name: install ibis with all extras
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nix-skip-helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- run: echo "No build required"
1 change: 1 addition & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- name: checkout
uses: actions/checkout@v4
Expand Down
7 changes: 4 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@
in
rec {
packages = {
inherit (pkgs) ibis39 ibis310 ibis311;
inherit (pkgs) ibis39 ibis310 ibis311 ibis312;

default = pkgs.ibis311;
default = pkgs.ibis312;

inherit (pkgs) update-lock-files gen-all-extras gen-examples check-release-notes-spelling;
};
Expand All @@ -136,8 +136,9 @@
ibis39 = mkDevShell pkgs.ibisDevEnv39;
ibis310 = mkDevShell pkgs.ibisDevEnv310;
ibis311 = mkDevShell pkgs.ibisDevEnv311;
ibis312 = mkDevShell pkgs.ibisDevEnv312;

default = ibis311;
default = ibis312;

preCommit = pkgs.mkShell {
name = "preCommit";
Expand Down
2 changes: 1 addition & 1 deletion ibis/backends/tests/test_temporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ def test_now_from_projection(alltypes):
ts = result.now
assert len(result) == n
assert ts.nunique() == 1
assert ~pd.isna(ts.iat[0])
assert not pd.isna(ts.iat[0])


DATE_BACKEND_TYPES = {
Expand Down
6 changes: 4 additions & 2 deletions nix/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ in
ibis39 = pkgs.callPackage ./ibis.nix { python3 = pkgs.python39; };
ibis310 = pkgs.callPackage ./ibis.nix { python3 = pkgs.python310; };
ibis311 = pkgs.callPackage ./ibis.nix { python3 = pkgs.python311; };
ibis312 = pkgs.callPackage ./ibis.nix { python3 = pkgs.python312; };

ibisDevEnv39 = mkPoetryDevEnv pkgs.python39;
ibisDevEnv310 = mkPoetryDevEnv pkgs.python310;
ibisDevEnv311 = mkPoetryDevEnv pkgs.python311;
ibisDevEnv312 = mkPoetryDevEnv pkgs.python312;

ibisSmallDevEnv = mkPoetryEnv {
python = pkgs.python311;
python = pkgs.python312;
groups = [ "dev" ];
extras = [ ];
};
Expand Down Expand Up @@ -73,7 +75,7 @@ in
gen-examples = pkgs.writeShellApplication {
name = "gen-examples";
runtimeInputs = [
pkgs.ibisDevEnv311
pkgs.ibisDevEnv312
(pkgs.rWrapper.override {
packages = with pkgs.rPackages; [
Lahman
Expand Down
8 changes: 8 additions & 0 deletions poetry-overrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,12 @@ self: super: {
rm $out/${self.python.sitePackages}/pyflink/__pycache__/version.*.pyc
'';
});

thrift = super.thrift.overridePythonAttrs (attrs: {
# ignore silly bytecode-compilation-on-install for Pythons >= 3.12
postPatch = (attrs.postPatch or "") +
self.pkgs.lib.optionalString (self.pkgs.lib.versionAtLeast self.python.version "3.12") ''
substituteInPlace setup.cfg --replace 'optimize = 1' 'optimize = 0'
'';
});
}
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ filterwarnings = [
"ignore:is_sparse is deprecated and will be removed in a future version:DeprecationWarning",
# google-api-core
"ignore:Please install grpcio-status to obtain helpful grpc error messages.",
# dateutil tz
'ignore:datetime\.datetime\.utcfromtimestamp\(\) is deprecated and scheduled for removal:DeprecationWarning',
# types using custom tp_new are deprecated in python 3.12
"ignore:Type .+ uses PyType_Spec with a metaclass that has custom tp_new:DeprecationWarning",
]
empty_parameter_set_mark = "fail_at_collect"
markers = [
Expand Down

0 comments on commit 7056dea

Please sign in to comment.