Skip to content

Commit e275a11

Browse files
committed
Update taxi flake to use newest python and taxi-zebra version
1 parent 741d307 commit e275a11

File tree

7 files changed

+94
-54
lines changed

7 files changed

+94
-54
lines changed

.github/workflows/python-package.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
python-version: ["38", "39", "310", "311"]
15+
python-version: ["310", "311", "312", "313"]
1616

1717
steps:
1818
- uses: actions/checkout@v3
@@ -31,8 +31,11 @@ jobs:
3131
if: "steps.nix-cache.outputs.cache-hit == 'true'"
3232
run: "nix-store --import < /tmp/nixcache"
3333

34-
- name: Run tests
35-
run: nix build -L .#checks.x86_64-linux.taxiPython${{ matrix.python-version }}
34+
- name: Run taxi tests
35+
run: nix build -L .#checks.x86_64-linux.taxi-python${{ matrix.python-version }}
36+
37+
- name: Build taxi with all plugins
38+
run: nix build -L .#taxi-with-all-plugins
3639

3740
- name: "Export Nix store cache"
3841
if: "steps.nix-cache.outputs.cache-hit != 'true'"

doc/userguide.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ python3: command not found
143143
Run the following command::
144144

145145
$ python --version
146-
Python 3.8.5
146+
Python 3.13.4
147147

148-
Check that the version is at least 3.7. If that’s the case, replace ``python3``
148+
Check that the version is at least 3.10. If that’s the case, replace ``python3``
149149
by ``python`` when running commands. If that’s not the case, install Python 3.
150150

151151
First steps with Taxi

flake.lock

Lines changed: 27 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,48 @@
99
};
1010

1111
outputs = { self, nixpkgs, flake-utils, ... }:
12-
let
13-
# Recursively merge a list of attribute sets. Following elements take
14-
# precedence over previous elements if they have conflicting keys.
15-
recursiveMerge = with nixpkgs.lib; foldl recursiveUpdate { };
16-
in recursiveMerge [
17-
(flake-utils.lib.eachDefaultSystem (system:
18-
let
19-
pkgs = nixpkgs.legacyPackages.${system};
20-
taxi = pkgs.callPackage ./pkgs.nix { };
21-
in {
22-
packages = { inherit taxi; };
23-
defaultPackage = taxi;
24-
devShell = pkgs.callPackage ./shell.nix { };
25-
checks = let
26-
testWithPython = (pythonPackage:
27-
pkgs.callPackage ./tests.nix {
28-
python3 = pythonPackage;
29-
taxi = pkgs.callPackage ./pkgs.nix { python3 = pythonPackage; };
30-
});
31-
in {
32-
# TODO generate this dynamically
33-
taxiPython38 = testWithPython pkgs.python38;
34-
taxiPython39 = testWithPython pkgs.python39;
35-
taxiPython310 = testWithPython pkgs.python310;
36-
taxiPython311 = testWithPython pkgs.python311;
12+
flake-utils.lib.eachDefaultSystem (
13+
system:
14+
let
15+
pkgs = import nixpkgs {
16+
inherit system;
17+
overlays = [ self.overlays.default ];
18+
};
19+
20+
taxi = pkgs.callPackage ./pkgs.nix { };
21+
22+
pythonVersions = [ "310" "311" "312" "313" ];
23+
24+
makeCheckForPython = pythonVersion: let
25+
python3 = pkgs."python${pythonVersion}";
26+
in
27+
pkgs.callPackage ./tests.nix {
28+
inherit python3;
29+
taxi = pkgs.callPackage ./pkgs.nix { inherit python3; };
3730
};
38-
}))
31+
32+
checksForPython = builtins.listToAttrs (
33+
map (pythonVersion: {
34+
name = "taxi-python${pythonVersion}";
35+
value = makeCheckForPython pythonVersion;
36+
}) pythonVersions
37+
);
38+
in
3939
{
40-
overlay = final: prev: rec {
41-
# Prevents collision with taxi from nixpkgs (sftp app)
42-
taxi-cli = self.packages.${prev.stdenv.hostPlatform.system}.taxi;
40+
packages = {
41+
default = taxi;
42+
taxi = taxi;
43+
taxi-with-all-plugins = taxi.withPlugins (p: builtins.attrValues p);
4344
};
45+
46+
devShells.default = pkgs.callPackage ./shell.nix {};
47+
48+
checks = checksForPython;
4449
}
45-
];
50+
)
51+
// {
52+
overlays.default = final: prev: {
53+
taxi-cli = final.callPackage ./pkgs.nix { };
54+
};
55+
};
4656
}

pkgs.nix

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ let
4545

4646
nativeCheckInputs = [ python3.pkgs.pytestCheckHook python3.pkgs.freezegun ];
4747

48-
passthru = { inherit withPlugins; };
48+
passthru = { inherit withPlugins availablePlugins; };
4949

5050
meta = {
5151
homepage = "https://github.com/sephii/taxi";
@@ -56,16 +56,18 @@ let
5656

5757
taxiZebra = python3.pkgs.buildPythonPackage rec {
5858
pname = "taxi_zebra";
59-
version = "4.0.0";
59+
version = "5.0.0";
6060

6161
src = fetchFromGitHub {
6262
owner = "liip";
6363
repo = "taxi-zebra";
6464
rev = version;
65-
sha256 = "sha256-syEGpv8CZOD+TLQskylTnwqCKJRPVVImRfyEwP+9Nuc=";
65+
sha256 = "sha256-vwlCdeWvbmoKYdEwKVmBkQTokOY4MGaxnOU3t0CRDS4=";
6666
};
6767

68+
format = "pyproject";
6869
buildInputs = [ taxi ];
70+
nativeBuildInputs = [ python3.pkgs.setuptools python3.pkgs.wheel ];
6971
propagatedBuildInputs = [ python3.pkgs.requests python3.pkgs.click ];
7072

7173
meta = {
@@ -135,4 +137,4 @@ let
135137
clockify = taxiClockify;
136138
};
137139
in
138-
taxi
140+
taxi

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = [
55
{name = "Sylvain Fankhauser", email = "sephi@fhtagn.top"},
66
]
77
readme = "README.rst"
8-
requires-python = ">=3.8"
8+
requires-python = ">=3.10"
99
dynamic = ["version"]
1010
dependencies = [
1111
"click>=3.3",

shell.nix

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
{ callPackage, python3, ... }:
2-
(callPackage ./pkgs.nix { inherit python3; }).overrideAttrs (old: {
3-
src = ./.;
4-
propagatedBuildInputs = old.propagatedBuildInputs ++ [ python3.pkgs.pytest ];
5-
})
1+
{ pkgs ? import <nixpkgs> {} }:
2+
let
3+
taxi = pkgs.callPackage ./pkgs.nix { inherit (pkgs) python3; };
4+
in
5+
pkgs.mkShell {
6+
name = "taxi-dev-shell";
7+
8+
buildInputs = [
9+
taxi
10+
pkgs.python3.pkgs.pytest
11+
];
12+
}

0 commit comments

Comments
 (0)