mirror of
https://github.com/sezanzeb/input-remapper
synced 2024-11-18 03:25:52 +00:00
ee6b48ac32
* Run linters and unit tests with github actions * Reformat with black, 22.1.0 (compiled: yes) * Remove native deps as should no longer be needed * Remove pylint from workflows * Remove unused Gtk dependency in test_daemon.py * Install subset of python deps with apt-get for ci
49 lines
1.3 KiB
Nix
49 lines
1.3 KiB
Nix
# shell.nix - used with nix-shell to get a development environment with necessary dependencies
|
|
# Should be enough to run unit tests, integration tests and the service won't work
|
|
# If you don't use nix, don't worry about/use this file
|
|
let
|
|
pkgs = import <nixpkgs> { };
|
|
python = pkgs.python310;
|
|
in
|
|
pkgs.mkShell {
|
|
nativeBuildInputs = [
|
|
pkgs.pkg-config
|
|
pkgs.wrapGAppsHook
|
|
];
|
|
buildInputs = [
|
|
pkgs.gobject-introspection
|
|
pkgs.gtk3
|
|
pkgs.bashInteractive
|
|
pkgs.gobject-introspection
|
|
pkgs.xlibs.xmodmap
|
|
pkgs.gtksourceview4
|
|
(python.withPackages (
|
|
python-packages: with python-packages; [
|
|
pip
|
|
wheel
|
|
setuptools # for pkg_resources
|
|
types-setuptools
|
|
|
|
evdev
|
|
pydbus
|
|
pygobject3
|
|
pydantic
|
|
|
|
psutil # only used in tests
|
|
]
|
|
))
|
|
];
|
|
# https://nixos.wiki/wiki/Python#Emulating_virtualenv_with_nix-shell
|
|
shellHook = ''
|
|
# Tells pip to put packages into $PIP_PREFIX instead of the usual locations.
|
|
# See https://pip.pypa.io/en/stable/user_guide/#environment-variables.
|
|
export PIP_PREFIX=$(pwd)/venv
|
|
export PYTHONPATH="$PIP_PREFIX/${python.sitePackages}:$PYTHONPATH"
|
|
export PATH="$PIP_PREFIX/bin:$PATH"
|
|
unset SOURCE_DATE_EPOCH
|
|
|
|
python setup.py egg_info
|
|
pip install `grep -v '^\[' *.egg-info/requires.txt` || true
|
|
'';
|
|
}
|