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

python3Packages.hjson: fix wrapper #105398

Merged
merged 1 commit into from Dec 8, 2020
Merged

python3Packages.hjson: fix wrapper #105398

merged 1 commit into from Dec 8, 2020

Conversation

@bhipple
Copy link
Contributor

@bhipple bhipple commented Nov 29, 2020

And add a basic import test with the standard hook.

Motivation for this change
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.
@bhipple bhipple requested review from FRidh and jonringer as code owners Nov 29, 2020
@bhipple
Copy link
Contributor Author

@bhipple bhipple commented Nov 29, 2020

CC @SuperSandro2000 @lukegb as a follow-up to #105309, I propose we simply rm the upstream wrappers; they don't really seem necessary. Thoughts?

@rissson
Copy link
Member

@rissson rissson commented Nov 29, 2020

Instead of removing them, can we maybe wrap them so people can use this tool from the cli too?

@bhipple
Copy link
Contributor Author

@bhipple bhipple commented Nov 29, 2020

I spent a little while messing around with wrapProgram and wrapPythonPrograms, but wasn't quite sure how to make it work after re-reading the manual. Any tips? Agreed it would be nicer to leave the wrappers than to remove them.

@rissson
Copy link
Member

@rissson rissson commented Nov 29, 2020

I mean, bin/hjson just contains python -m hjson.tool "$@", so we're wrapping a shell program really. Maybe this would be better as a pythonApp?

@bhipple bhipple changed the title python3Packages.hjson: remove upstream bin/ wrappers python3Packages.hjson: fix wrapper Dec 5, 2020
@bhipple
Copy link
Contributor Author

@bhipple bhipple commented Dec 5, 2020

...
running test
............................................................................................................
----------------------------------------------------------------------
Ran 108 tests in 2.500s

OK
Finished executing setuptoolsCheckPhase
/nix/store/i5vczg3za00s2015zgj0w5y95hzampni-python3.8-hjson-3.0

Looks much better now!

$ /nix/store/i5vczg3za00s2015zgj0w5y95hzampni-python3.8-hjson-3.0.2/bin/hjson --help
Hjson, a user interface for JSON

Usage:
  hjson [options]
  hjson [options] <input>
  hjson (-h | --help)
  hjson (-V | --version)

Options:
  -h --help     Show this screen.
  -j            Output as formatted JSON.
  -c            Output as JSON.
  -V --version  Show version.

rissson
rissson approved these changes Dec 5, 2020
@SuperSandro2000
Copy link
Member

@SuperSandro2000 SuperSandro2000 commented Dec 7, 2020

Result of nixpkgs-review pr 105398 run on x86_64-linux 1

3 packages built:
  • python37Packages.hjson
  • python38Packages.hjson
  • python39Packages.hjson

@SuperSandro2000
Copy link
Member

@SuperSandro2000 SuperSandro2000 commented Dec 7, 2020

Result of nixpkgs-review pr 105398 1

3 packages built:
  • python37Packages.hjson
  • python38Packages.hjson
  • python39Packages.hjson

And add a basic import test with the standard hook.
@SuperSandro2000 SuperSandro2000 merged commit f26d039 into NixOS:master Dec 8, 2020
17 checks passed
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