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.pkgs: msgpack changes and neovim update #34809

Merged
merged 4 commits into from Feb 10, 2018
Merged

Conversation

typetetris
Copy link
Contributor

Motivation for this change

provide pythonPackages.neovim at 0.2.1 so CheckHealth in nvim doesn't complain any more.
(And deoplete-clang2 works as expected with this.)

As pythonPackages.neovim at 0.2.1 needs msgpack >= 5.0.0, bump msgpack to 0.5.4

This changed the package name (in the python ecosystem) from msgpack-python to msgpack,
so provide msgpack-transitional which provides the python package msgpack under its
deprecated name msgpack-python and change referrers to depend on that instead.

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"
    • some, not all, as many failed on my because of async-timeout or libQt
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

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.

This changed the package name (in the python ecosystem) from msgpack-python to msgpack,
so provide msgpack-transitional which provides the python package msgpack under its
deprecated name msgpack-python and change referrers to depend on that instead.

The PyPI name is changed, but the module name seems to be the same. No need to provide both then.

@@ -10552,12 +10552,29 @@ in {
};

msgpack = buildPythonPackage rec {
Copy link
Member

Choose a reason for hiding this comment

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

We are moving Python expressions out of pkgs/top-level/python-packages.nix into pkgs/development/python-modules/<module>/default.nix.

Please move the expression there, and call it from pkgs/top-level/python-packages.nix using callPackage ../development/python-modules/<package> { };.

name = "msgpack-${version}";
version = "0.5.4";

src = pkgs.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

py.test
'';

buildInputs = with self; [ pytest ];
Copy link
Member

Choose a reason for hiding this comment

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

checkInputs

propagatedBuildInputs = with self; [ ];
};

msgpack-transitional = buildPythonPackage rec {
Copy link
Member

Choose a reason for hiding this comment

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

We are moving Python expressions out of pkgs/top-level/python-packages.nix into pkgs/development/python-modules/<module>/default.nix.

Please move the expression there, and call it from pkgs/top-level/python-packages.nix using callPackage ../development/python-modules/<package> { };.

@@ -20422,12 +20439,12 @@ EOF
trollius = callPackage ../development/python-modules/trollius {};

neovim = buildPythonPackage rec {
Copy link
Member

Choose a reason for hiding this comment

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

We are moving Python expressions out of pkgs/top-level/python-packages.nix into pkgs/development/python-modules/<module>/default.nix.

Please move the expression there, and call it from pkgs/top-level/python-packages.nix using callPackage ../development/python-modules/<package> { };.

Copy link
Member

@dotlambda dotlambda left a comment

Choose a reason for hiding this comment

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

Please remove name from all expressions and only provide pname and version

@typetetris
Copy link
Contributor Author

The module name has changed. If you compare the downloaded tarballs for msgpack and msgpack-transitional you will see that they differ in module name and in the setup.py file. For msgpack-python it contains an additional TRANSITIONAL=true.

If I only had one of them either the other packages now depending on msgpack-transitional failed or neovim-0.2.1 failed.

@typetetris
Copy link
Contributor Author

Will do the other changes.

@FRidh
Copy link
Member

FRidh commented Feb 10, 2018

So, actually, the module name has not changed, but the package name has. And that name is relevant for setuptools and pip, sigh.

I suggest having a msgpack attribute, and a msgpack-python attribute (instead of msgpack-transitional).

msgpack = callPackage ...;

msgpack-python = super.msgpack.overridePythonAttrs {
  pname = "msgpack-python";
  postPatch = ''
    substituteInPlace setup.py --replace "TRANSITIONAL = False" "TRANSITIONAL = True"
  '';
};

@typetetris
Copy link
Contributor Author

That is fine by me.

Why is that postPatch thing necessary? Shouldn't changing the pname result in the other tarball being downloaded and everything is fine for msgpack-python?

@FRidh
Copy link
Member

FRidh commented Feb 10, 2018

Why is that postPatch thing necessary? Shouldn't changing the pname result in the other tarball being downloaded and everything is fine for msgpack-python?

If you want to download also the tarball, one would have to write src = oldAttrs.override {inherit pname; sha256 = "..."};. In this case, there is no need for it because the only change is this constant which we can easily modify ourselves.

@typetetris
Copy link
Contributor Author

Made (hopefully) all the changes, please have a look, it it is ok.

Didn't know whom to bother with maintainership.

@dotlambda
Copy link
Member

Please make one commit per package

@@ -20422,12 +20414,12 @@ EOF
trollius = callPackage ../development/python-modules/trollius {};

neovim = buildPythonPackage rec {
Copy link
Member

Choose a reason for hiding this comment

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

Please move neovim out of python-packages.nix

@@ -20422,12 +20414,12 @@ EOF
trollius = callPackage ../development/python-modules/trollius {};

neovim = buildPythonPackage rec {
version = "0.2.0";
version = "0.2.1";
name = "neovim-${version}";
Copy link
Member

Choose a reason for hiding this comment

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

no name

@@ -20422,12 +20414,12 @@ EOF
trollius = callPackage ../development/python-modules/trollius {};

neovim = buildPythonPackage rec {
version = "0.2.0";
version = "0.2.1";
name = "neovim-${version}";

src = pkgs.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

@typetetris
Copy link
Contributor Author

Sorry, totally forgot about neovim expression too.

Just to be sure:
You want me to clean my git history to have one commit per package?

Would the following structure be ok?

  • move msgpack expression out of python-packages
  • bump version of msgpack
  • add msgpack-python
  • bump version of neovim

@dotlambda
Copy link
Member

Yes, that seems fine. However, remeber to name your commits e.g. pythonPackages.msgpack: rename to msgpack-python. See https://nixos.org/nixpkgs/manual/#chap-submitting-changes.

@dotlambda
Copy link
Member

Actually, I think you should have the following commits:

  • bump neovim (and move it at the same time)
  • remame msgpack
  • add msgpack

@typetetris
Copy link
Contributor Author

bump neovim first would be a breaking commit, as it needs the bumped version of msgpack.

@dotlambda
Copy link
Member

Ah I see. Then do that at the end

@FRidh
Copy link
Member

FRidh commented Feb 10, 2018

@typetetris your proposal is good.

@typetetris
Copy link
Contributor Author

Sorry, now it is a bit of both, but hopefully the cleanest git history I could come up with. Will rework the neovim commit now and alter that in next few minutes.

sha256 = "13ckbs2qc4dww7fddnm9cw116j4spgxqab49ijmj6jr178ypwl80";
};

propagatedBuildInputs = [ ];
Copy link
Member

Choose a reason for hiding this comment

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

If it's empty, you can leave it out completely.

buildPythonPackage rec {
pname = "msgpack";
version = "0.5.4";
name = "${pname}-${version}";
Copy link
Member

Choose a reason for hiding this comment

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

no name

homepage = https://github.com/msgpack/msgpack-python;
description = "MessagePack serializer implementation for Python";
license = lib.licenses.asl20;
# maintainer = ?? ;
Copy link
Member

Choose a reason for hiding this comment

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

How about adding yourself as maintainer? Btw, the attribute should be called maintainers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I don't use it myself. Just wanted to update the version to get the neovim python client going again at version 0.2.1. Isn't that a bit weak motivation to declare myself maintainer and actually I am just trying nixos at the moment. I don't know how long I will be around at nixos.

Copy link
Member

Choose a reason for hiding this comment

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

Well, if you're not sure, then better remove the line completely. But feel free to add yourself once you're convinced to stick with NixOS :)
At the very least, you're using it because you're using neovim. So a maintained package does benefit you (and others).

@typetetris
Copy link
Contributor Author

There is a comment in the neovim nix expression, that we can't do the checks as they need pkgs.neovim which would create a circular dependency. Is it the same with checkInputs or could I add pkgs.neovim there and activate the tests?

@typetetris
Copy link
Contributor Author

wait a moment, something odd happened ...

@typetetris
Copy link
Contributor Author

So, done as far as I could.

Open points:

  • maintainers for msgpack
  • comment in pkgs/developent/python-modules/neovim/default.nix about tests and circular dependencies.

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.

puh hopefully my pr is acceptable now :)

Almost :)

}:

buildPythonPackage rec {
pname = "msgpack";
Copy link
Member

Choose a reason for hiding this comment

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

2 space indentation

checkPhase = ''
py.test
msgpack-python = self.msgpack.overridePythonAttrs {
pname = "msgpack-python";
Copy link
Member

Choose a reason for hiding this comment

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

2 space indentation

}:

buildPythonPackage rec {
pname = "neovim";
Copy link
Member

Choose a reason for hiding this comment

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

2 space indentation

and refactored to reuse the nix expression of
pythonPackages.msgpack
changed dependency msgpack-python to msgpack to make
it build
@typetetris
Copy link
Contributor Author

corrected indentation

@FRidh FRidh changed the title bumped pythonPackages.msgpack, pythonPackages.neovim and created pythonPackages.msgpack-transitional python.pkgs: msgpack changes and neovim update Feb 10, 2018
@FRidh FRidh merged commit a4db058 into NixOS:master Feb 10, 2018
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