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.zha-quirks: remove conftest as a checkInput #108846

Merged
merged 1 commit into from Jan 13, 2021

Conversation

06kellyjac
Copy link
Member

Motivation for this change

@etu I don't think zha-quirks requires conftest, below is my reasoning but LMK if I've missed anything

I've built it with and without conftest as a checkInput and the result is identical.
The only reference to conftest looking at the repo in the browser is a file called conftest.py but that's just for pytest, unrelated to conftest.
Also there's no .rego files which you'd need to have any use for conftest/open-policy-agent

Conftest helps you write tests against structured configuration data.

It's a golang cli tool not a python library


Build output with and without difference:

image

with:

============================= test session starts ==============================
platform linux -- Python 3.9.1, pytest-6.1.2, py-1.9.0, pluggy-0.13.1
rootdir: /build/source, configfile: setup.cfg, testpaths: tests
collected 402 items

tests/test_ctrl_neutral1.py .                                            [  0%]
tests/test_kof.py .                                                      [  0%]
tests/test_konke.py ssss                                                 [  1%]
tests/test_orvibo.py s                                                   [  1%]
tests/test_quirks.py ................................................... [ 14%]
........................................................................ [ 32%]
........................................................................ [ 50%]
........................................................................ [ 68%]
........................................................................ [ 86%]
................                                                         [ 90%]
tests/test_tuya.py ssssssssssss                                          [ 93%]
tests/test_xiaomi.py ..sss.............ssssssssss                        [100%]

=============================== warnings summary ===============================
../../nix/store/3qhzfcyi089wxjbhl0ndinklm68c7pa0-python3.9-asynctest-0.13.0/lib/python3.9/site-packages/asynctest/mock.py:434
  /nix/store/3qhzfcyi089wxjbhl0ndinklm68c7pa0-python3.9-asynctest-0.13.0/lib/python3.9/site-packages/asynctest/mock.py:434: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def wait(self, skip=0):

# ...

tests/test_tuya.py:153
  /build/source/tests/test_tuya.py:153: PytestCollectionWarning: cannot collect test class 'TestDevice' because it has a __init__ constructor (from: tests/test_tuya.py)
    class TestDevice(CustomDevice):

tests/test_konke.py: 4 warnings
tests/test_orvibo.py: 1 warning
tests/test_tuya.py: 12 warnings
tests/test_xiaomi.py: 13 warnings
  /nix/store/46g9p42rwqx7isq2ps39iwk83sc31pw4-python3.9-pytest-6.1.2/lib/python3.9/site-packages/_pytest/python.py:173: PytestUnhandledCoroutineWarning: async def functions are not natively supported and have been skipped.
  You need to install a suitable plugin for your async framework, for example:
    - anyio
    - pytest-asyncio
    - pytest-tornasync
    - pytest-trio
    - pytest-twisted
    warnings.warn(PytestUnhandledCoroutineWarning(msg.format(nodeid)))

-- Docs: https://docs.pytest.org/en/stable/warnings.html
================= 372 passed, 30 skipped, 44 warnings in 0.62s =================

without:

============================= test session starts ==============================
platform linux -- Python 3.9.1, pytest-6.1.2, py-1.9.0, pluggy-0.13.1
rootdir: /build/source, configfile: setup.cfg, testpaths: tests
collected 402 items

tests/test_ctrl_neutral1.py .                                            [  0%]
tests/test_kof.py .                                                      [  0%]
tests/test_konke.py ssss                                                 [  1%]
tests/test_orvibo.py s                                                   [  1%]
tests/test_quirks.py ................................................... [ 14%]
........................................................................ [ 32%]
........................................................................ [ 50%]
........................................................................ [ 68%]
........................................................................ [ 86%]
................                                                         [ 90%]
tests/test_tuya.py ssssssssssss                                          [ 93%]
tests/test_xiaomi.py ..sss.............ssssssssss                        [100%]

=============================== warnings summary ===============================
../../nix/store/3qhzfcyi089wxjbhl0ndinklm68c7pa0-python3.9-asynctest-0.13.0/lib/python3.9/site-packages/asynctest/mock.py:434
  /nix/store/3qhzfcyi089wxjbhl0ndinklm68c7pa0-python3.9-asynctest-0.13.0/lib/python3.9/site-packages/asynctest/mock.py:434: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def wait(self, skip=0):

# ...

tests/test_tuya.py:153
  /build/source/tests/test_tuya.py:153: PytestCollectionWarning: cannot collect test class 'TestDevice' because it has a __init__ constructor (from: tests/test_tuya.py)
    class TestDevice(CustomDevice):

tests/test_konke.py: 4 warnings
tests/test_orvibo.py: 1 warning
tests/test_tuya.py: 12 warnings
tests/test_xiaomi.py: 13 warnings
  /nix/store/46g9p42rwqx7isq2ps39iwk83sc31pw4-python3.9-pytest-6.1.2/lib/python3.9/site-packages/_pytest/python.py:173: PytestUnhandledCoroutineWarning: async def functions are not natively supported and have been skipped.
  You need to install a suitable plugin for your async framework, for example:
    - anyio
    - pytest-asyncio
    - pytest-tornasync
    - pytest-trio
    - pytest-twisted
    warnings.warn(PytestUnhandledCoroutineWarning(msg.format(nodeid)))

-- Docs: https://docs.pytest.org/en/stable/warnings.html
================= 372 passed, 30 skipped, 44 warnings in 0.56s =================
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.

The policy testing tool conftest isn't used in any of the pytest tests.
@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch)
If you find some bugs or got suggestions for further things to search or run please reach out to SuperSandro2000 on IRC.

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

3 packages built:
  • python37Packages.zha-quirks
  • python38Packages.zha-quirks
  • python39Packages.zha-quirks

@SuperSandro2000 SuperSandro2000 merged commit 2078ece into NixOS:master Jan 13, 2021
@06kellyjac 06kellyjac deleted the zha-quirks_conftest branch January 13, 2021 09:20
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