New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/python: add pytest-bdd module. #72495
Conversation
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/pytest-bdd-on-shell-nix/4616/6 |
propagatedBuildInputs = [ glob2 Mako parse parse-type py pytest six ]; | ||
|
||
# Tests require extra dependencies | ||
doCheck = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that fine... just add them to checkInputs
doCheck = false; | |
checkInputs = [ mock ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After running the following command:
find pkgs/development/python-modules -name default.nix | xargs grep doCheck | grep pytest
I suspect we really need that doCheck = false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no... doCheck = false;
will make it skip the checkPhase entirely
Here's how i would do this expression:
{ stdenv, buildPythonPackage, fetchFromGitHub
, execnet
, glob2
, Mako
, mock
, parse
, parse-type
, py
, pytest
, six
}:
buildPythonPackage rec {
pname = "pytest-bdd";
version = "3.2.1";
# tests are not included in pypi tarball
src = fetchFromGitHub {
owner = "pytest-dev";
repo = pname;
rev = version;
sha256 = "02y28l5h1m9grj54p681qvv7nrhd7ly9jkqdchyw4p0lnmcmnsrd";
};
propagatedBuildInputs = [ glob2 Mako parse parse-type py pytest six ];
checkInputs = [ execnet mock pytest ];
checkPhase = ''
pytest
'';
meta = with stdenv.lib; {
description = "BDD library for the py.test runner";
homepage = https://github.com/pytest-dev/pytest-bdd;
license = licenses.mit;
maintainers = with maintainers; [ jm2dev ];
};
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks to that "fetchFromGitHub" now I'm aware of the available fetchers, and I suspect you have plenty of experience with python pips.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a co-owner of the nixpkgs python packages, only done a few hundred
also, to adhere to contributing guidelines, please rename the PR and commit to:
|
you need to add yourself to maintainers, please look at #72312 as an example of commit message and history :) |
Hi, do we have any updates on this PR? |
jm2dev = { | ||
email = "jomarcar@gmail.com"; | ||
github = "jm2dev"; | ||
githubId = 474643; | ||
name = "José Miguel Martínez Carrasco"; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be a separate commit, look at #74389 as an example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please reverse the order of the commits:
git rebase -i HEAD^^
# switch the two lines
# save
git push --force ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise checking out the package commit will fail to evaluate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Output of git log --oneline
after following your instructions (and pushing to gh):
0bced444e7f (HEAD -> pytest-bdd, origin/pytest-bdd) pythonPackages.pytest-bdd: init at 3.2.1
b1601d57ec9 maintainers: add jm2dev
though github web doesn't show this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I looked at your branch, and it still showed it the other way. guess it is just the web view
8a68b6c
to
78fa57a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diff LGTM
commits LGTM
[5 built, 0.0 MiB DL]
https://github.com/NixOS/nixpkgs/pull/72495
3 package were built:
python27Packages.pytest-bdd python37Packages.pytest-bdd python38Packages.pytest-bdd
@GrahamcOfBorg build python27Packages.pytest-bdd python37Packages.pytest-bdd python38Packages.pytest-bdd |
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @