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
2 changes: 1 addition & 1 deletion .github/workflows/build_containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USERNAME: ${{ github.actor }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: nix develop --command build-image.sh
run: ./tooling/bin/build-image.sh
29 changes: 21 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,22 @@
myPython = pkgs.python312.override {
self = myPython;
packageOverrides = pyfinal: pyprev: {
snapbin = pyfinal.buildPythonPackage {
pname = pyproject.project.name;
inherit (pyproject.project) version;
pyproject = true;
src = ./.;
propagatedBuildInputs = [ pyfinal.hatchling ];

};
# An editable package with a script that loads our mutable location
snapbin-editable = pyfinal.mkPythonEditablePackage {
# Inherit project metadata from pyproject.toml
pname = pyproject.project.name;
inherit (pyproject.project) version;

# The editable root passed as a string
root = "$DEVENV_ROOT/snapbin"; # Use environment variable expansion at runtime
root = "$DEVENV_ROOT/src"; # Use environment variable expansion at runtime
};
types-peewee =
let
Expand All @@ -67,30 +75,27 @@
};

pythonDev = myPython.withPackages (p: [
p.black
p.cryptography
p.flask
p.freezegun
p.gunicorn
p.isort
p.mypy
p.peewee
p.pylint
p.pylsp-mypy
p.pytest
p.pytest-cov
p.pytest-xdist
p.python-lsp-ruff
p.python-lsp-server
p.ruff
p.snapbin-editable
p.types-peewee
]);
pythonProd = pkgs.python312.withPackages (p: [
pythonProd = myPython.withPackages (p: [
p.cryptography
p.flask
p.gunicorn
p.peewee
p.snapbin
]);
in
{
Expand All @@ -112,6 +117,7 @@
];
};
packages = {
inherit pkgs;
snapbin-image = pkgs.dockerTools.buildImage {
name = "snapbin";
tag = "latest";
Expand Down Expand Up @@ -147,9 +153,16 @@
PC_PORT_NUM = "9999";
};
packages = [

(pkgs.buildEnv {
name = "sort-of-pastebin-devShell";
paths = [
pkgs.black
pkgs.isort
];
pathsToLink = [ "/bin" ];
})
pythonDev
pkgs.poetry
pkgs.skopeo
];
inputsFrom = [
config.process-compose."dev-services".services.outputs.devShell
Expand Down
18 changes: 5 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ name = "snapbin"
version = "0.1.0"
requires-python = ">=3.12"
description = "A little service to store and encrypt information, deleting it once it's retrieved."
authors = ["Andreas Zweili <andreas@zweili.ch>"]
license = "GPL3.0+"
readme = "README.org"
authors = [
{name = "Andreas Zweili", email = "andreas@zweili.ch"},
]
license = "GPL-3.0-or-later"
readme = {file = "README.org", content-type = "text/plain"}

[tool.pylint."MESSAGES CONTROL"]
disable = [
Expand All @@ -18,16 +20,6 @@ disable = [
"missing-class-docstring",
]

[tool.hatch.build.targets.sdit]
include = [
"snapbin",
"README.md"
]
[tool.hatch.build.targets.wheel]
packages = [
"snapbin",
]

[tool.isort]
force_single_line = true

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions tooling/bin/build-image.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
PATH="$(nix build .#pkgs.skopeo --no-link --print-out-paths)/bin:$PATH"
echo "$GITHUB_TOKEN" | skopeo login ghcr.io --username "$GITHUB_USERNAME" --password-stdin
result=$(nix build .#snapbin-image --no-link --print-out-paths)
# ${variabe,,} converts a string to lowercase
Expand Down