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 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 davidak left a comment

Choose a reason for hiding this comment

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

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 { };
Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 0674589.

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.

should be two commits:

maintainers: add mcwitt
pythonPackages.vulture: init at 1.6

Comment on lines +5184 to +5189
mcwitt = {
email = "mcwitt@gmail.com";
github = "mcwitt";
githubId = 319411;
name = "Matt Wittmann";
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Please make this into a separate commit:

maintainers: add mcwitt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in d988033.

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.

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
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

3 participants