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.autoflake: init at 1.0 #31879

Merged
merged 4 commits into from Nov 22, 2017

Conversation

yuriaisaka
Copy link
Contributor

Motivation for this change

autoflake ( https://pypi.python.org/pypi/autoflake ) is a tool that automatically removes unused imports and unused variables from Python code.

Primarily, it is a standalone tool, but we put it under python-modules following the way how the similar package pythonPackages.autopep8 is packaged.

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"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@@ -0,0 +1,20 @@
{ stdenv, buildPythonPackage, fetchPypi, pyflakes }:

buildPythonPackage rec {
Copy link
Member

@Mic92 Mic92 Nov 21, 2017

Choose a reason for hiding this comment

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

This does not look a library to me. If so, can you use buildPythonApplication and move it to all-packages.nix?

@@ -661,6 +661,8 @@ in {
};
};

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

autopep8 = callPackage ../development/python-modules/autopep8 { };
Copy link
Member

Choose a reason for hiding this comment

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

autopep8 might be also a candidate... but this does not need to be done in this pr.

@yuriaisaka
Copy link
Contributor Author

yuriaisaka commented Nov 21, 2017

@Mic92 Thank you very much for the suggestions, I agree that this (and perhaps also autopep8) fit nicer to all-packages.nix. (Ping @bjornfor ?)

Anyways, I've updated the pr and made it a Python3 app.
Hope now it conforms to https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/python.md

@@ -511,6 +511,8 @@ with pkgs;
python3Packages = python34Packages;
};

autoflake = callPackage ../development/python-modules/autoflake { };
Copy link
Member

Choose a reason for hiding this comment

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

maybe:

pkgs/development/tools/analysis/

as a directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I'll do that, thanks!

Or, maybe can I dig pkgs/development/tools/python/ and use the directory?
Langs like guile, haskell, ocaml, java, .. seem to be doing that.
go is a notable exception and spreads goimports, gotags etc right under developement/tools.

@Mic92
Copy link
Member

Mic92 commented Nov 22, 2017

Thanks!

@yuriaisaka yuriaisaka deleted the pr-py-autoflake-init branch November 27, 2017 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants