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

pythonPackages.iterfzf: init at 0.5.0.20.0 #94661

Closed
wants to merge 1 commit into from

Conversation

swflint
Copy link
Contributor

@swflint swflint commented Aug 4, 2020

Motivation for this change

I'm slowly working on packaging the Remt tool for Remarkable Tablets. This package is required, and not packaged in NixOS.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Comment on lines 14 to 16
propagatedBuildInputs = [
fzf
];
Copy link
Contributor

@jonringer jonringer Aug 4, 2020

Choose a reason for hiding this comment

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

this will propagate the fzf command to the environment which should be avoided. Patching should be used instead

Suggested change
propagatedBuildInputs = [
fzf
];
prePatch = ''
substituteInPlace iterfzf/__init__.py \
--replace "EXECUTABLE_NAME = 'fzf.exe' if sys.platform == 'win32' else 'fzf'" \
"EXECUTABLE_NAME = 'fzf.exe' if sys.platform == 'win32' else '${fzf}/bin/fzf'
'';

@@ -7310,6 +7310,8 @@ in {

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

iterfzf = callPackage ../development/python-modules/iterfzf { };
Copy link
Contributor

Choose a reason for hiding this comment

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

incase a fzf package gets added to python scope

Suggested change
iterfzf = callPackage ../development/python-modules/iterfzf { };
iterfzf = callPackage ../development/python-modules/iterfzf {
inherit (pkgs) fzf;
};

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

To comply with CONTRIBUTING.md please have the commit message name be of the format

<pkg-name>: <subject-line>

for more examples, please look at https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md#submitting-changes

in your case, the commit message should be:

pythonPackages.iterfzf: init at 0.5.0.20.0"

please squash the fixup commits

@risicle
Copy link
Contributor

risicle commented Aug 15, 2020

Build on macos 10.14 fails:

...
  Using pythonImportsCheckPhase
  Sourcing python-namespaces-hook
  Sourcing setuptools-check-hook
  Using setuptoolsCheckPhase
  unpacking sources
  unpacking source archive /nix/store/mjlkkiqkh4nq54gq2ls61gbmp7f45zfv-source
  source root is source
  setting SOURCE_DATE_EPOCH to timestamp 315619200 of file source/tox.ini
  patching sources
  /nix/store/ddm1y988d42mxmz62fzg8xz3ladxz8vq-stdenv-darwin/setup: eval: line 91: unexpected EOF while looking for matching `"'

edit: and it's quite right - there's a missing " in the prePatch, same failure on linux.

@swflint
Copy link
Contributor Author

swflint commented Aug 27, 2020

Go figure. Something easy enough to fix at least.

First couple of weeks of this semester have been interesting.

Comment on lines +18 to +17
'';

Copy link
Contributor

Choose a reason for hiding this comment

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

There are no tests included. Please try to checkout from source and check if they have unit tests, and try to run them. Unit tests give a good indication that they package has a high degree of validity and correctness given the python package set.

If tests are not available, then please use pythonImportsCheck to import the most important modules. This isn't as good as unit tests, but will usually give a good indication of run-time errors. Please see pythonImportsCheck documentation for more information.


----------------------------------------------------------------------
Ran 0 tests in 0.000s

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the sources have no tests. So, I'd say pythonImportsCheck is the best we can do right now.

Comment on lines +18 to +17
'';

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the sources have no tests. So, I'd say pythonImportsCheck is the best we can do right now.

Comment on lines 7313 to 7315
iterfzf = callPackage ../development/python-modules/iterfzf {
inherit (pkgs) fzf;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

You can omit the inherit (it will be automatically passed):

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

Comment on lines 7 to 10
src = fetchFromGitHub {
owner = "dahlia";
repo = pname;
rev = version;
sha256 = "0nrfq1zj4pwlgyd8ra5wl7skdbzvnxdh7wwhyh83y7yax8sp1xvj";
};
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd recommend using the fetchPypi function instead (this way you'll benefit from automatic updates):

  src = fetchPypi {
    inherit pname version;
    sha256 = "0by5pk7w1j2xzhj4l0nw09sz9025pdskbf1b7k87kfkwgbc08vrb";
  };

@urbas
Copy link
Contributor

urbas commented Jan 16, 2021

I tried this change out in a pure nix-shell and it seems to be working:
2021-01-16 09:29:12-iterfzf

The nix-shell expression used:

nix-shell -I nixpkgs=$(pwd) -p python3Packages.ipython python3Packages.iterfzf --pure

@urbas
Copy link
Contributor

urbas commented Jan 21, 2021

Looks like there is a merge conflict. Could you rebase?

@swflint
Copy link
Contributor Author

swflint commented Jan 29, 2021

Is there anything else I need to do?

@urbas urbas requested a review from jonringer January 31, 2021 17:56
Comment on lines +25 to +27
};

}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
};
}
};
}

Comment on lines +13 to +15
substituteInPlace iterfzf/__init__.py \
--replace "EXECUTABLE_NAME = 'fzf.exe' if sys.platform == 'win32' else 'fzf'" \
"EXECUTABLE_NAME = 'fzf.exe' if sys.platform == 'win32' else '${fzf}/bin/fzf'"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
substituteInPlace iterfzf/__init__.py \
--replace "EXECUTABLE_NAME = 'fzf.exe' if sys.platform == 'win32' else 'fzf'" \
"EXECUTABLE_NAME = 'fzf.exe' if sys.platform == 'win32' else '${fzf}/bin/fzf'"
substituteInPlace iterfzf/__init__.py \
--replace "EXECUTABLE_NAME = 'fzf.exe' if sys.platform == 'win32' else 'fzf'" \
"EXECUTABLE_NAME = 'fzf.exe' if sys.platform == 'win32' else '${fzf}/bin/fzf'"

@stale
Copy link

stale bot commented Sep 19, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 19, 2021
Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

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

closing due to inactivity. Feel free to re-open.

sha256 = "0by5pk7w1j2xzhj4l0nw09sz9025pdskbf1b7k87kfkwgbc08vrb";
};

prePatch = ''
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
prePatch = ''
postPatch = ''

@stale stale bot removed 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md labels Nov 8, 2022
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

6 participants