From 3603dde2e015c340cac1a2f1a0f3d35d44c51c98 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Tue, 2 Jun 2020 11:37:37 -0700 Subject: [PATCH 1/1] Don't depend upon xdg It's not yet available in a stable release branch of nixpkgs. We don't want to force folks to use unstable to use pinch. Revert this commit after 20.09 is released and everyone's had time to upgrade. --- pinch.py | 12 +++++++++++- shell.nix | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pinch.py b/pinch.py index 732a91f..003ee70 100644 --- a/pinch.py +++ b/pinch.py @@ -25,7 +25,17 @@ from typing import ( Tuple, ) -import xdg +# Use xdg module when it's less painful to have as a dependency + + +class XDG(types.SimpleNamespace): + XDG_CACHE_HOME: str + + +xdg = XDG( + XDG_CACHE_HOME=os.getenv( + 'XDG_CACHE_HOME', + os.path.expanduser('~/.cache'))) Digest16 = NewType('Digest16', str) diff --git a/shell.nix b/shell.nix index 11e4f03..b408ea4 100644 --- a/shell.nix +++ b/shell.nix @@ -1,7 +1,7 @@ { pkgs ? import { } }: pkgs.mkShell rec { doCheck = true; - buildInputs = with pkgs; [ (python3.withPackages (ps: with ps; [ xdg ])) ]; + buildInputs = with pkgs; [ python3 ]; checkInputs = with pkgs; [ mypy python3Packages.autopep8 -- 2.44.1