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
6 changes: 3 additions & 3 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.3
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: pre-commit/action@v3.0.0
14 changes: 2 additions & 12 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.12'
cache: 'poetry'
- name: Install dependencies
run: |
Expand All @@ -37,17 +37,7 @@ jobs:
uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Check Nixpkgs inputs
uses: DeterminateSystems/flake-checker-action@main
with:
fail-mode: true

- name: check flake
run: |
nix run
nix flake check -L

- name: check 23.05
run: |
nix run --override-input nixpkgs github:NixOS/nixpkgs/nixos-23.05
8 changes: 6 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ repos:
- hooks:
- id: black
repo: https://github.com/psf/black
rev: 22.12.0
rev: 25.1.0
- hooks:
- id: mypy
additional_dependencies:
- types-PyYAML==5.4.0
- types-setuptools
- types-tzlocal==4.2
- types-aiofiles==23.2.0.20240311
exclude: tests
args:
- --ignore-missing-imports
repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.0.1'
rev: 'v1.8.0'
4 changes: 4 additions & 0 deletions changelog.d/20250429_152122_os_PL_133651_bump_python312.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. A new scriv changelog fragment.

- require python 3.12 (PL-133651)
- also update the locked nix input dependencies
157 changes: 153 additions & 4 deletions flake.lock

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

57 changes: 25 additions & 32 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,37 +1,30 @@
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
flake-utils.url = "github:numtide/flake-utils";
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = { self, nixpkgs, ... }:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
#pkgs = forAllSystems (system: nixpkgs.legacyPackages.${system});
pkgs = forAllSystems (system: import nixpkgs {
inherit system;
config = {
permittedInsecurePackages = [
"python3.10-requests-2.28.2"
"python3.10-requests-2.29.0"
];
outputs = { self, nixpkgs, flake-utils, poetry2nix, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config = {
permittedInsecurePackages = [
];
};
};
lib = pkgs.callPackage "${self}/lib.nix" { poetry2nix = import poetry2nix { inherit pkgs; }; };
in
{
inherit (lib) packages devShells checks;
});
lib = forAllSystems (system: pkgs.${system}.callPackage "${self}/lib.nix" {});
in
{
packages = forAllSystems (system:
lib.${system}.packages
);

devShells = forAllSystems (system:
lib.${system}.devShells
);

checks = forAllSystems (system:
lib.${system}.checks
);
};
}
}
23 changes: 8 additions & 15 deletions lib.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
poetry2nix,
lzo,
python310,
# currently needs to be hardcoded here, as it is hardcoded in the pyproject.toml as well
python312,
mkShellNoCC,
poetry,
runCommand,
Expand Down Expand Up @@ -38,30 +39,22 @@ let
# replace poetry to avoid dependency on vulnerable python-cryptography package
nativeBuildInputs = [ super.poetry-core ] ++ builtins.filter (p: p.pname or "" != "poetry") old.nativeBuildInputs;
});
# This is hacky.
packaging = super.packaging.overrideAttrs (oldAttrs: {
src = fetchPypi {
pname = "packaging";
version = "23.2";
hash = "sha256-BI+w6UBQNlGOqvSKVZU8dQwR4aG2jg3RqdYu0MCSz8U=";
};
});
})
];
poetryEnv = poetry2nix.mkPoetryEnv {
projectDir = ./.;
python = python310;
python = python312;
overrides = poetryOverrides;
editablePackageSources = {
backy = ./src;
};
};
poetryApplication = poetry2nix.mkPoetryApplication {
projectDir = ./.;
doCheck = true;
python = python310;
overrides = poetryOverrides;
};
projectDir = ./.;
doCheck = true;
python = python312;
overrides = poetryOverrides;
};
in
{
packages = {
Expand Down
Loading
Loading