Skip to content

Commit

Permalink
feat(python): support python 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Dec 16, 2024
1 parent 80a185c commit 0efac8f
Show file tree
Hide file tree
Showing 6 changed files with 218 additions and 126 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ jobs:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
include:
- os: ubuntu-arm64-24.04 # aarch64-linux
python-version: "3.12"
- os: macos-14 # aarch64-darwin
python-version: "3.12"
- os: macos-14 # aarch64-darwin
python-version: "3.13"
steps:
- name: checkout
uses: actions/checkout@v4
Expand Down
8 changes: 5 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -154,24 +154,26 @@
in
rec {
packages = {
default = packages.ibis312;
default = packages.ibis313;

inherit (pkgs) ibis310 ibis311 ibis312
inherit (pkgs) ibis310 ibis311 ibis312 ibis313
update-lock-files check-release-notes-spelling;
};

checks = {
ibis310-pytest = pkgs.ibis310.passthru.tests.pytest;
ibis311-pytest = pkgs.ibis311.passthru.tests.pytest;
ibis312-pytest = pkgs.ibis312.passthru.tests.pytest;
ibis313-pytest = pkgs.ibis313.passthru.tests.pytest;
};

devShells = rec {
ibis310 = mkDevShell pkgs.ibisDevEnv310;
ibis311 = mkDevShell pkgs.ibisDevEnv311;
ibis312 = mkDevShell pkgs.ibisDevEnv312;
ibis313 = mkDevShell pkgs.ibisDevEnv313;

default = ibis312;
default = ibis313;

preCommit = pkgs.mkShell {
name = "preCommit";
Expand Down
11 changes: 9 additions & 2 deletions nix/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ let
# Use base package set from pyproject.nix builders
(pkgs.callPackage pyproject-nix.build.packages {
inherit python;
stdenv = pkgs.stdenv.override {
targetPlatform = pkgs.stdenv.targetPlatform // {
darwinSdkVersion = "12.0";
};
};
}).overrideScope
(lib.composeManyExtensions ([
pyproject-build-systems.overlays.default
Expand Down Expand Up @@ -96,10 +101,12 @@ in
ibis310 = mkEnv pkgs.python310;
ibis311 = mkEnv pkgs.python311;
ibis312 = mkEnv pkgs.python312;
ibis313 = mkEnv pkgs.python313;

ibisDevEnv310 = mkDevEnv pkgs.python310;
ibisDevEnv311 = mkDevEnv pkgs.python311;
ibisDevEnv312 = mkDevEnv pkgs.python312;
ibisDevEnv313 = mkDevEnv pkgs.python313;

ibisSmallDevEnv = mkEnv'
{
Expand All @@ -108,7 +115,7 @@ in
};
editable = false;
}
pkgs.python312;
pkgs.python313;

duckdb = super.duckdb.overrideAttrs (
_: lib.optionalAttrs (stdenv.isAarch64 && stdenv.isLinux) {
Expand Down Expand Up @@ -149,7 +156,7 @@ in
gen-examples = pkgs.writeShellApplication {
name = "gen-examples";
runtimeInputs = [
pkgs.ibisDevEnv312
pkgs.ibisDevEnv313
(pkgs.rWrapper.override {
packages = with pkgs.rPackages; [
Lahman
Expand Down
21 changes: 16 additions & 5 deletions nix/pyproject-overrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ let
toolz.setuptools = [ ];
typing-extensions.flit-core = [ ];
debugpy.setuptools = [ ];
google-crc32c.setuptools = [ ];
lz4.setuptools = [ ];
snowflake-connector-python.setuptools = [ ];
} // lib.optionalAttrs stdenv.hostPlatform.isDarwin {
duckdb = {
setuptools = [ ];
Expand All @@ -39,15 +42,23 @@ let
};
in
(lib.optionalAttrs stdenv.hostPlatform.isDarwin {
pyarrow = prev.pyarrow.overrideAttrs (attrs: {
pyproj = prev.pyproj.overrideAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs or [ ] ++ [
final.setuptools
final.setuptools-scm
final.cython
final.numpy
pkgs.cmake
pkgs.arrow-cpp
pkgs.proj
];
PROJ_DIR = "${lib.getBin pkgs.proj}";
PROJ_INCDIR = "${lib.getDev pkgs.proj}";
});

psygnal = prev.psygnal.overrideAttrs (_: {
src = pkgs.fetchFromGitHub {
owner = "pyapp-kit";
repo = prev.psygnal.pname;
rev = "refs/tags/v${prev.psygnal.version}";
hash = "sha256-eGJWtmw2Ps3jII4T8E6s3djzxfqcSdyPemvejal0cn4=";
};
});
}) // lib.mapAttrs (name: spec: addBuildSystems prev.${name} spec) buildSystemOverrides // {
mysqlclient = prev.mysqlclient.overrideAttrs (attrs: {
Expand Down
6 changes: 3 additions & 3 deletions requirements-dev.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0efac8f

Please sign in to comment.