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

(jira-cli) init at 2.2 #30833

Merged
merged 3 commits into from May 17, 2018
Merged

(jira-cli) init at 2.2 #30833

merged 3 commits into from May 17, 2018

Conversation

nyarly
Copy link
Contributor

@nyarly nyarly commented Oct 26, 2017

No description provided.

@FRidh
Copy link
Member

FRidh commented Oct 26, 2017

What is the reason for not using the packages in python-packages.nix?

@nyarly
Copy link
Contributor Author

nyarly commented Oct 26, 2017

There's no reason per se. I just used pypi2nix to build this - it's my first python nix expression.

Can you advise on how to use the python packages instead? My impression is of a lot of effort - is there gain to be had?

@nyarly
Copy link
Contributor Author

nyarly commented Nov 22, 2017

Ping on this PR?

@FRidh
Copy link
Member

FRidh commented Nov 25, 2017

pyp2nix can be used in Nixpkgs as a last resort. Otherwise the common packages should be used.

Copy link
Member

@matthewbauer matthewbauer left a comment

Choose a reason for hiding this comment

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

See @FRidh's comments.

@nyarly
Copy link
Contributor Author

nyarly commented Apr 21, 2018

@matthewbauer @FRidh I'll take a crack at the conversion.

@nyarly nyarly requested a review from FRidh as a code owner April 22, 2018 03:00
@nyarly
Copy link
Contributor Author

nyarly commented Apr 22, 2018

@matthewbauer @FRidh I spent some time with this but am now stymied by Could not find a version that satisfies the requirement argparse; python_version < "3.2" (from jira==1.0.10) (from versions: ).

I see that argparse is nulled out intentionally in the pythonPackages expression, so I'm not sure how to proceed.

@FRidh
Copy link
Member

FRidh commented Apr 22, 2018

@nyarly argparse is part of the standard library of Python since 2.7. There is no reason for packages to any longer depend on it. The solution here is to patch the (typically) setup.py file to remove that dependency.

@nyarly
Copy link
Contributor Author

nyarly commented Apr 22, 2018

Okay, this is working with the distro python packages now.

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.

The comments apply also to the other expressions.

And please read the contribution guidelines regarding Python packages.

@@ -5097,6 +5097,26 @@ in {
};
};

keyrings = {
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> { };.

@@ -5097,6 +5097,26 @@ in {
};
};

keyrings = {
alt = 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.

This doesn't look good. It's supposed to be keyrings-alt. Don't nest it just so you get a dot.

alt = buildPythonPackage rec {
name = "keyrings.alt-${version}";
version = "2.3";
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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The fetchurl from the mirror was in imitation of other expressions here. I'll happily change mine, but can I suggest that should be done across the python-packages modules?

propagatedBuildInputs = [ self.six ];

#
doCheck = false;
Copy link
Member

Choose a reason for hiding this comment

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

Why are the tests disabled? Please include a comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In every case it was "I couldn't get the tests to run and pass." In no small part this is that Python isn't one of my working languages, and hunting down "how does this package run tests" is challenging.

#
doCheck = false;

meta = with pkgs.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.

maintainer?

Copy link
Member

Choose a reason for hiding this comment

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

homepage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have no idea about the homepage. I assume pypi2nix would've added that if it were available from pypi.

As to maintainer: should I add myself?

@@ -0,0 +1,31 @@
{ pkgs, stdenv, pythonPackages }:
Copy link
Member

Choose a reason for hiding this comment

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

Don't pass in pkgs, only the exact packages you need.

inherit (pkgs) libffi openssl;
inherit (pythonPackages) fetchPypi buildPythonPackage;
in
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.

This is an application, use buildPythonApplication.

substituteInPlace requirements/main.txt --replace "argparse" ""
'';

doCheck = false;
Copy link
Member

Choose a reason for hiding this comment

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

Why are the tests disabled? Please include a comment.

@nyarly
Copy link
Contributor Author

nyarly commented Apr 23, 2018

@FRidh Re: the python contribution guide, I assume you mean https://nixos.org/nixpkgs/manual/#python? I had, and was under the impression I was following those guidelines. There are certainly errors in this PR as is, which I'm working on.

@matthewbauer matthewbauer dismissed their stale review April 24, 2018 15:07

looks good to me

@@ -2993,6 +2993,23 @@ in {

};

hiro = 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
Contributor Author

Choose a reason for hiding this comment

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

Aha - I'd misunderstood as applying to the keyrings set until you'd realized that alt was only a child to get the .. I'll take this on presently.

@@ -5097,6 +5114,29 @@ in {
};
};

keyrings-alt = 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> { };.

@@ -5097,6 +5114,29 @@ in {
};
};

keyrings-alt = buildPythonPackage rec {
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.

The name attribute is added by buildPython* and should therefore be removed.


# Fails with "ImportError: cannot import name mock"
doCheck = false;
#checkInputs = with self; [ pytest unittest2 mock keyring ];
Copy link
Member

Choose a reason for hiding this comment

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

This can be uncommented; they will be ignored when doCheck = false;

@@ -6880,6 +6920,34 @@ in {

jinja2_pluralize = callPackage ../development/python-modules/jinja2_pluralize { };

jira = 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> { };.

@@ -6880,6 +6920,34 @@ in {

jinja2_pluralize = callPackage ../development/python-modules/jinja2_pluralize { };

jira = buildPythonPackage rec {
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.

The name attribute is added by buildPython* and should therefore be removed.

@@ -7742,6 +7810,25 @@ in {
};
};

requests-oauthlib = 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> { };.

@@ -7742,6 +7810,25 @@ in {
};
};

requests-oauthlib = buildPythonPackage rec {
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.

The name attribute is added by buildPython* and should therefore be removed.


# Tests rely on VCR cassettes being written during tests. R/O nix store prevents this.
doCheck = false;
#checkInputs = with pythonPackages; [ vcrpy mock hiro ];
Copy link
Member

Choose a reason for hiding this comment

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

uncomment

@nyarly
Copy link
Contributor Author

nyarly commented Apr 26, 2018

@FRidh is there existing documentation about the move into python-modules? I think it probably makes sense, but AFAICT the header of top-level/python-packages.nix and the Python section of the manual don't refer to it (yet.) If not, is it okay if I issue a separate PR to that effect?

@nyarly
Copy link
Contributor Author

nyarly commented Apr 30, 2018

@FRidh How about now?

@nyarly
Copy link
Contributor Author

nyarly commented May 13, 2018

@FRidh Merged master (with alternative version of the jira package) into this branch. How's it look now?

@FRidh
Copy link
Member

FRidh commented May 13, 2018

How about now?

Oh, I missed that.

Please don't do any merges, but instead rebase.

@FRidh
Copy link
Member

FRidh commented May 13, 2018

See also the contributing guidelines; one commit per logical change, which in that case would correspond to a commit per package.

@nyarly
Copy link
Contributor Author

nyarly commented May 13, 2018

@FRidh I can't find contribution guidelines about git usage within nixpkgs. I have to admit to some frustration about the process around adding this expression. I'm willing to wrap up with a rebase, but I'd like to know that I'm done before I do that.

@FRidh
Copy link
Member

FRidh commented May 13, 2018

@nyarly https://nixos.org/nixpkgs/manual/#idm140737315810544
mentions logical units and rebasing onto master. That one should not merge is not mentioned. Maybe it should be added?

I can understand the frustration, there are a lot of requirements and we're not always that quick with replying; there are just too many PR's and issues to handle by the community.

In any case, the changes themselves look good.

@nyarly
Copy link
Contributor Author

nyarly commented May 13, 2018

@FRidh I appreciate your empathy. And I also understand that the number of PRs and issues outstrips the amount of time and attention available to review them. Thanks for all you're doing, and specifically for giving feedback to bring this home.

I've rebased and squashed this onto master. I hope it tells a clear narrative.

@FRidh
Copy link
Member

FRidh commented May 13, 2018

Still needed is a commit per package. You can squash your commits, do a soft reset, and then create a commit for each.

@nyarly
Copy link
Contributor Author

nyarly commented May 13, 2018

@FRidh This is what you're looking for?

@nyarly
Copy link
Contributor Author

nyarly commented May 16, 2018

@FRidh Friendly reminder of this PR.

@FRidh FRidh merged commit de55b71 into NixOS:master May 17, 2018
@FRidh
Copy link
Member

FRidh commented May 17, 2018

Yep, thanks. In the future please also prepend the package set the packages are defined in.

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