pytest + pytest-asyncio in flake.nix. 53 tests covering parser (all formats, error cases) and db (CRUD, soft delete, update, stats, pagination). Pre-commit hook runs tests when fitness bot files are staged. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
45 lines
1.3 KiB
Nix
45 lines
1.3 KiB
Nix
{
|
|
description = "BigBiggerBiggestBot — Telegram fitness tracker with Mini App";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
python = pkgs.python3;
|
|
|
|
pythonEnv = python.withPackages (ps: with ps; [
|
|
python-telegram-bot
|
|
python-dotenv
|
|
aiohttp
|
|
pytest
|
|
pytest-asyncio
|
|
]);
|
|
|
|
in
|
|
{
|
|
devShells.default = pkgs.mkShell {
|
|
packages = [ pythonEnv pkgs.cloudflared ];
|
|
shellHook = ''
|
|
echo "💪 BigBiggerBiggestBot dev shell"
|
|
echo " Run: python start.py (server + tunnel + bot)"
|
|
echo " Run: python bot.py (bot only, no mini app)"
|
|
'';
|
|
};
|
|
|
|
# `nix run` — start everything via start.py
|
|
apps.default = {
|
|
type = "app";
|
|
program = toString (pkgs.writeShellScript "run-fitness-bot" ''
|
|
export PATH="${pkgs.lib.makeBinPath [ pythonEnv pkgs.cloudflared ]}:$PATH"
|
|
exec ${pythonEnv}/bin/python "$PWD/start.py"
|
|
'');
|
|
};
|
|
}
|
|
);
|
|
}
|