depot/third_party/nixpkgs/pkgs/development/python-modules/seabreeze/default.nix
Default email 3e2acf8aff Project import generated by Copybara.
GitOrigin-RevId: d42cd445dde587e9a993cd9434cb43da07c4c5de
2021-05-20 18:08:51 -05:00

68 lines
1.3 KiB
Nix

{ lib
, fetchFromGitHub
, buildPythonPackage
, cython
, git
, pkgconfig
, pytest-runner
, setuptools-scm
, future
, numpy
, pyusb
, mock
, pytestCheckHook
, zipp
}:
## Usage
# In NixOS, add the package to services.udev.packages for non-root plugdev
# users to get device access permission:
# services.udev.packages = [ pkgs.python3Packages.seabreeze ];
buildPythonPackage rec {
pname = "seabreeze";
version = "1.3.0";
src = fetchFromGitHub {
owner = "ap--";
repo = "python-seabreeze";
rev = "v${version}";
sha256 = "1hm9aalpb9sdp8s7ckn75xvyiacp5678pv9maybm5nz0z2h29ibq";
leaveDotGit = true;
};
nativeBuildInputs = [
cython
git
pkgconfig
pytest-runner
setuptools-scm
];
propagatedBuildInputs = [
future
numpy
pyusb
];
postInstall = ''
mkdir -p $out/etc/udev/rules.d
cp os_support/10-oceanoptics.rules $out/etc/udev/rules.d/10-oceanoptics.rules
'';
# few backends enabled, but still some tests
checkInputs = [
pytestCheckHook
mock
zipp
];
setupPyBuildFlags = [ "--without-cseabreeze" ];
meta = with lib; {
homepage = "https://github.com/ap--/python-seabreeze";
description = "A python library to access Ocean Optics spectrometers";
maintainers = [];
license = licenses.mit;
};
}