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

python: remove unneeded name attributes, remove rec, make afew an application #33758

Closed
wants to merge 11 commits into from

Conversation

flokli
Copy link
Contributor

@flokli flokli commented Jan 11, 2018

Motivation for this change

As I found out, it's not necessary to specify the name for python packages if we set pname and version. Additionally, get rid of the rec, and change the afew package to be a python application (what it is, it's not a library).

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
    • other Linux distributions
  • 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.

@@ -1,10 +1,12 @@
{ stdenv, buildPythonPackage, fetchPypi, blessings, mock, nose, pyte, pytest, wcwidth }:

buildPythonPackage rec {
let
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the separate let block?

@flokli
Copy link
Contributor Author

flokli commented Jan 12, 2018 via email

sha256 = "121w7bd53xyibllxxbfykjj76n81kn1vgjqd22izyh67y8qyyk5r";
};

propagatedBuildInputs = with pythonPackages; [
Copy link
Member

Choose a reason for hiding this comment

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

Setuptools_scm is a build time input

setuptools_scm pythonPackages.notmuch chardet
] ++ stdenv.lib.optional (!pythonPackages.isPy3k) subprocess32;

SETUPTOOLS_SCM_PRETEND_VERSION = "${version}";
Copy link
Member

Choose a reason for hiding this comment

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

preBuild is this likely a better place for this one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

seems like this isn't required anymore at all, as we're fetching from pypi - and setuptools_scm is able to figure out the version on its own


postInstall = ''
wrapProgram $out/bin/afew \
--prefix LD_LIBRARY_PATH : ${notmuch}/lib
Copy link
Member

Choose a reason for hiding this comment

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

Can this be fixed by hardcoring the path to the lib. Using LD_LIBRARY_PATH should be prevented

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's already hardcoded into pythonPackages.notmuch. Will strip this.

--prefix LD_LIBRARY_PATH : ${notmuch}/lib
'';

meta = with stdenv.lib; {
Copy link
Member

Choose a reason for hiding this comment

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

License?

@FRidh
Copy link
Member

FRidh commented Jan 12, 2018

Why do you want to prevent the recursive set?

@flokli
Copy link
Contributor Author

flokli commented Jan 12, 2018

@FRidh I was under the impression rec is costly and should be avoided if not really needed. Seems I'm mistaken?

Thanks for reviewing the other things, seems like this slipped through in previous PRs. WIll update soonish.

@FRidh
Copy link
Member

FRidh commented Jan 14, 2018

There is no need to avoid rec here.

@flokli
Copy link
Contributor Author

flokli commented Jan 14, 2018

@FRidh Updated.

@FRidh
Copy link
Member

FRidh commented Jan 20, 2018

@flokli can you squash the afew changes.

@FRidh
Copy link
Member

FRidh commented Jan 20, 2018

Included changes in #34077.

@FRidh FRidh closed this Jan 20, 2018
@FRidh FRidh mentioned this pull request Jan 20, 2018
8 tasks
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

4 participants