commit 09381d17d00e53ef8e59a7513ccf767d31e1fb43 Author: Campbell Alden Date: Thu Jul 30 00:12:33 2026 +0900 Initialize repo diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..82b2b9e --- /dev/null +++ b/.envrc @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# the shebang is ignored, but nice for editors + +if type -P lorri &>/dev/null; then + eval "$(lorri direnv)" +else + echo 'while direnv evaluated .envrc, could not find the command "lorri" [https://github.com/nix-community/lorri]' + use nix +fi diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..12a0ed5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.pyc +__pycache__/* +.env +result +todo.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..248a611 --- /dev/null +++ b/default.nix @@ -0,0 +1,2 @@ +{ pkgs ? import {} }: +pkgs.callPackage ./derivation.nix {} diff --git a/derivation.nix b/derivation.nix new file mode 100644 index 0000000..803e327 --- /dev/null +++ b/derivation.nix @@ -0,0 +1,10 @@ +{ lib, python313Packages }: +with python313Packages; +buildPythonApplication { + pname = "cereal"; + version = "0.0.1"; + propagatedBuildInputs = [ flask requests waitress]; + src = ./.; + pyproject = true; + build-system = [setuptools]; +} diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..8996527 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,49 @@ +exclude = [ + ".direnv", + ".git", + ".git-rewrite", + ".ipynb_checkpoints", + ".mypy_cache", + ".pytest_cache", + ".pytype", + ".ruff_cache", + "__pypackages__", + "result" +] + +line-length = 120 +indent-width = 4 + +target-version = "py313" + +[lint] +# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. +# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or +# McCabe complexity (`C901`) by default. +select = ["E4", "E7", "E9", "F"] +ignore = [] + +# Allow fix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[format] +quote-style = "single" +indent-style = "space" +skip-magic-trailing-comma = false +line-ending = "auto" +# Enable auto-formatting of code examples in docstrings. Markdown, +# reStructuredText code/literal blocks and doctests are all supported. +# +# This is currently disabled by default, but it is planned for this +# to be opt-out in the future. +docstring-code-format = false +# Set the line length limit used when formatting code snippets in +# docstrings. +# +# This only has an effect when the `docstring-code-format` setting is +# enabled. +docstring-code-line-length = "dynamic" diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..af47279 --- /dev/null +++ b/setup.py @@ -0,0 +1,9 @@ +from setuptools import setup, find_packages + +setup( + name='cereal', + verison='0.0.1', + packages=find_packages(), + include_package_data=True, + scripts=['./src/main.py'], +) diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..80b3c0d --- /dev/null +++ b/shell.nix @@ -0,0 +1,21 @@ +{ pkgs ? import {}}: +let + mypy = pkgs.python313.withPackages (ps: with ps; [ + requests + flask + waitress + ]); +in +with pkgs; +mkShell { + buildInputs = [ + mypy + pylint + python313Packages.ipython + python313Packages.ruff + python313Packages.python-lsp-server + python313Packages.jedi-language-server + ty + ffmpeg + ]; +} diff --git a/src/main.py b/src/main.py new file mode 100644 index 0000000..536cb12 --- /dev/null +++ b/src/main.py @@ -0,0 +1,3 @@ +#!/usr/bin/env python + +print('hello, world!')