Hi,
I'd like to create a simple python project, and the nixos documentation
was helpul. So I have a shell.nix file with the following content:
with import <nixpkgs> {};
(
python3.withPackages (ps: [ps.ipython ps.flask ps.pytest])
).env
Then I run nix-shell on the project folder and everything seems fine.
The problem I have is that I want to add pytest-bdd but it seems that
isn't packaged for NixOS, as nix search pytest-bdd doesn't return
any results.
So I try behave instead of pytest-bdd because it is already
packaged for NixOS, but unfortunately the behave binary isn't
available, while ipython and flask are. And the behave
documentation stats a binary should be available.
So I decided to try a different approach for pytest-bdd and I
followed the example on https://nixos.org/nixpkgs/manual/#python
(15.17.1.2.1. Packaging a library).
with import <nixpkgs> {};
(
let
my_pytestbdd = python37.pkgs.buildPythonPackage rec {
pname = "pytest-bdd";
version = "3.2.1";
src = python37.pkgs.fetchPypi {
inherit pname version;
sha256 = "1ibyr40g3p6xbx1m59as3s9spyadz8wyc7zwqyzibphrw4pkvrqp";
};
doCheck = false;
meta = {
homepage = "https://github.com/pytest-dev/pytest-bdd/";
description = "BDD library for the py.test runner";
};
};
in python37.withPackages (ps: [ps.ipython ps.flask ps.pytest ps.glob2 my_pytestbdd])
).env
And I'm stuck with this message:
Processing ./pytest_bdd-3.2.1-py2.py3-none-any.whl
Collecting glob2 (from pytest-bdd==3.2.1)
ERROR: Could not find a version that satisfies the requirement glob2 (from pytest-bdd==3.2.1) (from versions: none)
ERROR: No matching distribution found for glob2 (from pytest-bdd==3.2.1)
builder for '/nix/store/d94madfidxgn5r0k9kivfidn4p2cvyjk-python3.7-pytest-bdd-3.2.1.drv' failed with exit code 1
cannot build derivation '/nix/store/ypc7hpylzvmxx8lmk5cfg8jfhrfalzgn-python3-3.7.5-env.drv': 1 dependencies couldn't be built
error: build of '/nix/store/ypc7hpylzvmxx8lmk5cfg8jfhrfalzgn-python3-3.7.5-env.drv' failed