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.getmac: init at 0.8.2 #78015

Merged
merged 1 commit into from Jan 21, 2020

Conversation

colemickens
Copy link
Member

Motivation for this change

This is needed by home-assistant when the braviatv component is used.

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

otherwise LGTM

sha256 = "08d4iv5bjl1s4i9qhzf3pzjgj1rgbwi0x26qypf3ycgdj0a6gvh2";
};

doCheck = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

default for buildPythonPackage, you can remove

Suggested change
doCheck = true;

sha256 = "08d4iv5bjl1s4i9qhzf3pzjgj1rgbwi0x26qypf3ycgdj0a6gvh2";
};

doCheck = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

pulled from their tox.ini, but we aren't too concerned about coverage and a few other metrics:

  checkPhase = ''
    pytest
  '';

};

doCheck = true;
checkInputs = [ pytest ];
Copy link
Contributor

Choose a reason for hiding this comment

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

pulled from their tox.ini, but we aren't too concerned about coverage and a few other metrics:

Suggested change
checkInputs = [ pytest ];
checkInputs = [ pytest ];
checkPhase = ''
pytest
'';

};

doCheck = true;
checkInputs = [ pytest ];
Copy link
Contributor

Choose a reason for hiding this comment

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

pulled from their tox.ini, but we aren't too concerned about coverage and a few other metrics:

Suggested change
checkInputs = [ pytest ];
checkInputs = [ pytest ];
checkPhase = ''
pytest
'';

@colemickens
Copy link
Member Author

Thanks @jonringer. I'm getting test failures. Does Nix(OS) sandboxing actually hide interfaces from the sandbox entirely? It could explain this.

=================================== FAILURES ===================================
_____________________________ test_cli_main_basic ______________________________
tests/test_cli.py:20: in test_cli_main_basic
    assert run_cmd(BASE_CMD) == get_mac_address()
E   AssertionError: assert '' == None
E    +  where '' = run_cmd(['/nix/store/s7vw8y02cqzx8bnjxl4bkhlnwvz6ws1s-python3-3.7.6/bin/python3.7', '-m', 'getmac'])
E    +  and   None = get_mac_address()
____________________________ test_cli_main_verbose _____________________________
tests/test_cli.py:24: in test_cli_main_verbose
    assert get_mac_address() in run_cmd(BASE_CMD + ["--verbose"])
E   TypeError: 'in <string>' requires string as left operand, not NoneType
_____________________________ test_cli_main_debug ______________________________
tests/test_cli.py:28: in test_cli_main_debug
    assert get_mac_address() in run_cmd(BASE_CMD + ["--verbose", "--debug"])
E   TypeError: 'in <string>' requires string as left operand, not NoneType
________________________ test_cli_multiple_debug_levels ________________________
tests/test_cli.py:49: in test_cli_multiple_debug_levels
    assert get_mac_address() in run_cmd(BASE_CMD + ["-v", "-dd"])
E   TypeError: 'in <string>' requires string as left operand, not NoneType

----------------------

I'll keep taking a look (maybe we can selectively disable just these tests), but of course any tips are appreciated. Sincere thanks for all the effort you took to review all of this multiple times. I really appreciate the pointers.

@colemickens
Copy link
Member Author

There we go! Those tests were just testing the CLI behavior, so I disabled them. Builds for py2 and py3. Should be good to go.

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.

diff LGTM
commit LGTM
has tests 👍

[4 built, 5 copied (0.6 MiB), 0.1 MiB DL]
https://github.com/NixOS/nixpkgs/pull/78015
3 package built:
python27Packages.getmac python37Packages.getmac python38Packages.getmac

@jonringer
Copy link
Contributor

@GrahamcOfBorg build python27Packages.getmac python37Packages.getmac python38Packages.getmac

@jonringer jonringer merged commit 817d6c8 into NixOS:master Jan 21, 2020
@colemickens colemickens deleted the nixpkgs-ha-pkgs-getmac branch January 30, 2020 09:35
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

2 participants