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

vulture: init at 1.6 #94396

Merged
merged 2 commits into from Aug 2, 2020
Merged

vulture: init at 1.6 #94396

merged 2 commits into from Aug 2, 2020

Conversation

@mcwitt
Copy link
Contributor

mcwitt commented Aug 1, 2020

Motivation for this change

Adds the vulture tool for detecting dead code in Python.

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.
Copy link
Member

davidak left a comment

Thanks for your contribution! The code looks good.

It seems dependencies are missing:

ERROR: could not install deps [coverage, pytest, pytest-cov]; v = InvocationError(u'/build/vulture-1.6/.tox/py/bin/python -m pip install coverage pytest pytest-cov', 1)

3 packages failed to build:
python27Packages.vulture python37Packages.vulture python38Packages.vulture

https://gist.github.com/davidak/71903b64737e4d30a6e287c754c1e3ac

@mcwitt
Copy link
Contributor Author

mcwitt commented Aug 1, 2020

@davidak thanks for catching that. I hadn't yet tried to build with sandboxing (but now realize that is super important!). I think the issue was trying to run the tests with tox (which does some impure stuff trying to create virtualenvs and pip-install test dependencies).

I found a couple of examples of packages using tox where we either fall back pytest or disable checks altogether. For now I opted to use pytest directly, and that builds ok in sandbox for me.

pkgs/development/python-modules/vulture/default.nix Outdated Show resolved Hide resolved
@@ -7697,6 +7697,7 @@ in {

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

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

This comment has been minimized.

Copy link
@jonringer

jonringer Aug 1, 2020

Contributor

please try to add this in a semi-sorted fashion. Appending to the end will cause merge conflicts to others who do the same.

This comment has been minimized.

Copy link
@mcwitt

mcwitt Aug 1, 2020

Author Contributor

Fixed in 0674589.

Copy link
Contributor

jonringer left a comment

should be two commits:

maintainers: add mcwitt
pythonPackages.vulture: init at 1.6
mcwitt = {
email = "mcwitt@gmail.com";
github = "mcwitt";
githubId = 319411;
name = "Matt Wittmann";
};
Comment on lines +5184 to +5189

This comment has been minimized.

Copy link
@jonringer

jonringer Aug 2, 2020

Contributor

Please make this into a separate commit:

maintainers: add mcwitt

This comment has been minimized.

Copy link
@mcwitt

mcwitt Aug 2, 2020

Author Contributor

Done in d988033.

@mcwitt mcwitt force-pushed the mcwitt:vulture/init branch from 7227e60 to 7a09ccc Aug 2, 2020
mcwitt added 2 commits Aug 2, 2020
@mcwitt mcwitt force-pushed the mcwitt:vulture/init branch from 7a09ccc to 1d829d5 Aug 2, 2020
Copy link
Contributor

jonringer left a comment

LGTM

Result of nixpkgs-review pr 94396 1

3 packages built: - python27Packages.vulture - python37Packages.vulture - python38Packages.vulture

@jonringer jonringer merged commit 00501bd into NixOS:master Aug 2, 2020
14 checks passed
14 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="1d829d5"; rev="1d829d558592171ff81fc0767b318e93d97fad63"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="1d829d5"; rev="1d829d558592171ff81fc0767b318e93d97fad63"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="1d829d5"; rev="1d829d558592171ff81fc0767b318e93d97fad63"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="1d829d5"; rev="1d829d558592171ff81fc0767b318e93d97fad63"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="1d829d5"; rev="1d829d558592171ff81fc0767b318e93d97fad63"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="1d829d5"; rev="1d829d558592171ff81fc0767b318e93d97fad63"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="1d829d5"; rev="1d829d558592171ff81fc0767b318e93d97fad63"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.