Skip to content

Instantly share code, notes, and snippets.

@chuwy
Last active September 29, 2024 14:53
Show Gist options
  • Save chuwy/748e2b949c92ed49170855f8f129197d to your computer and use it in GitHub Desktop.
Save chuwy/748e2b949c92ed49170855f8f129197d to your computer and use it in GitHub Desktop.
django-unicorn dev environment
{ pkgs ? import <nixpkgs> {} }:
let
deps = [
pkgs.python3Packages.beautifulsoup4
pkgs.python3Packages.cachetools
pkgs.python3Packages.decorator
pkgs.python3Packages.django
pkgs.python3Packages.orjson
pkgs.python3Packages.shortuuid
];
django-unicorn = pkgs.python3Packages.buildPythonPackage rec {
pname = "django_unicorn";
version = "0.61.0"; # Replace with the actual version
pyproject = true;
nativeBuildInputs = [ pkgs.python3Packages.poetry-core ] ++ deps;
src = pkgs.python3Packages.fetchPypi {
inherit pname version;
sha256 = "sha256-3T71xhB4W7aadwkmzvQJaZPiNqGwgOaV2OLuOqX09gM="; # Replace with the actual SHA256 hash
};
# Optionally disable tests if they're causing issues
doCheck = false;
};
in
pkgs.mkShell {
buildInputs = [
pkgs.python3
pkgs.python3Packages.pip
django-unicorn
] ++ deps;
shellHook = ''
echo "Django Unicorn dev environment activated"
echo "Django version: $(python -c 'import django; print(django.get_version())')"
echo "Django Unircorn is at: $(python -c 'import django_unicorn; print(django_unicorn.__path__)')"
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment