Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.13.5"
python-version: "3.14.9"

- name: Run ruff check
run: uv run ruff check
Expand All @@ -75,6 +78,9 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.13.5"
python-version: "3.14.9"

- name: Run ty
run: uv run ty check
Expand All @@ -92,6 +98,9 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.13.5"
python-version: "3.14.9"

- name: Run tests
run: uv run pytest --cov
Expand All @@ -109,6 +118,9 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.13.5"
python-version: "3.14.9"

- name: Run deptry
run: uv run --group audit deptry .
Expand Down
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
deadnix
ls-lint
nixfmt
python314
statix
uv
])
++ [
(pkgs.callPackage ./nix/python.nix { })
(pkgs.callPackage ./nix/uv.nix { })
# lefthook before 2.1.6 runs hooks under a pty, which agent sandboxes deny.
nixpkgs-unstable.legacyPackages.${system}.lefthook
];
Expand Down
22 changes: 22 additions & 0 deletions nix/python.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
fetchurl,
mailcap,
python314,
}:

# TODO: Drop this and use pkgs.python314 once the nixpkgs input has >= 3.14.9.
# 3.14.9 replaces the compromised emSign root in the bundled pip/certifi CA store.
# nixpkgs' mimetypes patch no longer applies to 3.14.9's `knownfiles`, so the same
# substitution is done in postPatch instead.
(python314.override { mimetypesSupport = false; }).overrideAttrs (previousAttrs: rec {
version = "3.14.9";
src = fetchurl {
url = "https://www.python.org/ftp/python/${version}/Python-${version}.tar.xz";
hash = "sha256-4C2awhzr2m5GQ1NpdEqSxlzHzYZpaXaUEiz5f/rNHlM=";
};

postPatch = (previousAttrs.postPatch or "") + ''
substituteInPlace Lib/mimetypes.py \
--replace-fail '"/etc/mime.types",' '"${mailcap}/etc/mime.types",'
'';
})
43 changes: 43 additions & 0 deletions nix/uv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
fetchurl,
lib,
stdenvNoCC,
versionCheckHook,
}:

# TODO: Drop this and use pkgs.uv once the nixpkgs input has >= 0.13.5.
# Official build of uv 0.13.5. 0.13.4 drops the compromised emSign root from its bundled CA store,
# but 0.13.5 is the first release that can install managed CPython 3.14.9.
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "uv";
version = "0.13.5";

src = fetchurl {
url = "https://github.com/astral-sh/uv/releases/download/${finalAttrs.version}/uv-aarch64-apple-darwin.tar.gz";
hash = "sha256-dD+FA1oZluyzUGWeAc2frqlwmCm+CbG0sDxz6vPJzXM=";
};

dontBuild = true;
dontStrip = true;

installPhase = ''
runHook preInstall
install -Dm755 -t "$out/bin" uv uvx
runHook postInstall
'';

nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;

meta = {
description = "Python package and project manager, official macOS build";
homepage = "https://github.com/astral-sh/uv";
license = with lib.licenses; [
asl20
mit
];
mainProgram = "uv";
platforms = [ "aarch64-darwin" ];
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
};
})
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "template-python"
version = "0.1.0"
description = ""
readme = "README.md"
requires-python = "== 3.14.*"
requires-python = ">= 3.14.9, < 3.15"
dependencies = []

[tool.hatch.build.targets.wheel]
Expand Down
7 changes: 4 additions & 3 deletions uv.lock

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

Loading