Skip to content
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

Add behave #28628

Closed
wants to merge 4 commits into from
Closed

Add behave #28628

wants to merge 4 commits into from

Conversation

alunduil
Copy link
Contributor

@alunduil alunduil commented Aug 28, 2017

Motivation for this change

Adding package for behave. Please, let me know if I missed anything. I think I understood the examples and documentation correctly but would love to know any tips as well.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@alunduil alunduil requested a review from FRidh as a code owner August 28, 2017 03:13
Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added some comments to one expression. They apply to the other expressions as well. Please fix that.

nativeBuildInputs = [ mock nose pyhamcrest strace ];
propagatedBuildInputs = [ glibcLocales parse parse-type six ];

patchPhase = ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

postPatch

propagatedBuildInputs = [ glibcLocales parse parse-type six ];

patchPhase = ''
# Fix `bin/behave` shebang …
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

doCheck = true;

checkPhase = ''
export LANG="en_US.UTF-8"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

version = "1.2.5";
name = "${pname}-${version}";

src = fetchurl {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetchPypi

};

nativeBuildInputs = [ mock nose pyhamcrest strace ];
propagatedBuildInputs = [ glibcLocales parse parse-type six ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

glibcLocales should not be propagated

sha256 = "81b731ac5187e31e4aad2594944fa914943683a9818320846d037c5ebd6d5d0b";
};

nativeBuildInputs = [ mock nose pyhamcrest strace ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test runner requirements can be added to checkInputs

@@ -0,0 +1,27 @@
{ stdenv, fetchurl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have pytestrunner

@alunduil
Copy link
Contributor Author

Thanks! I didn't know if fetchPypi was kosher and the indentation stuff makes sense. I completely missed pytestrunner. Thanks for pointing these out. I've rebased my fixes for these issues into their respective commits. Let me know if anything else looks amiss.

@alunduil
Copy link
Contributor Author

I've cleaned up an issue I found with the licenses but I'm not sure how to handle the license for parse (it only indicates the license through the pypi classifiers as BSD). I've currently set the parse license to all BSD licenses but this doesn't feel correct. Can you let me know what the best case would be for this?


parse-type = callPackage ../development/python-modules/parse-type { };

pytest-runner = callPackage ../development/python-modules/pytest-runner { };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forget to remove this line.


postPatch = ''
# Fix `bin/behave` shebang …
sed -e "1s@/usr/bin/env python@${python.interpreter}@" -i bin/behave
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use patchShebangs here

];

checkPhase = ''
${python.interpreter} test_parse.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FRidh is there actually a reason ${python.interpreter} is used all over the place in python-modules instead of just python which should be in PATH?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because we have different interpreters, like python3 (which nowadays have a symlink from python) and pypy.

Copy link
Member

@Mic92 Mic92 Aug 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there cases where both interpreters end up in buildPythonPackage?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope not because then we would have issues also with PYTHONPATH.

In the end you need to be able to write python test_parse.py or pypy test_parse.py so I don't see any other way than using a variable like that here.

@FRidh
Copy link
Member

FRidh commented Aug 29, 2017

The license can be found in the footer of the Python files, e.g.
https://github.com/r1chardj0n3s/parse/blob/master/test_parse.py#L797
I don't know what license this is. Its not a BSD license, although it does seem to be inspired by the original BSD license.

};

patches = [
(fetchpatch {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this patch for? Can you include a comment.

Copy link
Member

@FRidh FRidh Aug 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, nevermind, the patch name clarifies it.

@alunduil
Copy link
Contributor Author

I think I got the latest batch of finds. Let me know if there is anything else that looks amiss and I'll keep my eye on the travis run. Thanks for all the suggestions so far.

@alunduil
Copy link
Contributor Author

alunduil commented Sep 2, 2017

Does anyone have any suggestions on how to get the last test on travis to succeed? Also, are there any other suggestions blocking this merge?

@FRidh
Copy link
Member

FRidh commented Sep 6, 2017

Thank you. Added it to #29009.

@FRidh FRidh closed this Sep 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants