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.py-air-control: init at 2.1.0 #105078

Merged
merged 3 commits into from Dec 3, 2020

Conversation

urbas
Copy link
Contributor

@urbas urbas commented Nov 26, 2020

Motivation for this change

This Python package was not yet packaged in nixpkgs.

Package size:

$ nix path-info -sh $(nix-build . -A python3Packages.py-air-control)
/nix/store/07ssfnqs4gp89pscij442nd51bvdj771-python3.8-py-air-control-2.1.0       116.9K
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.

cc @SuperSandro2000

Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

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

Please disable it on python27 and disable the tests because the package has none.

running egg_info
writing py_air_control.egg-info/PKG-INFO
writing dependency_links to py_air_control.egg-info/dependency_links.txt
writing entry points to py_air_control.egg-info/entry_points.txt
writing requirements to py_air_control.egg-info/requires.txt
writing top-level names to py_air_control.egg-info/top_level.txt
reading manifest file 'py_air_control.egg-info/SOURCES.txt'
writing manifest file 'py_air_control.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
Finished executing setuptoolsCheckPhase

@urbas
Copy link
Contributor Author

urbas commented Nov 26, 2020

@SuperSandro2000: disabled the tests and disabled on python27.

I also took the liberty and did the same for the coapthon3 package (which I added recently). I did so in separate commits though.

Copy link
Contributor

@lukegb lukegb left a comment

Choose a reason for hiding this comment

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

A few things to ask you...

pkgs/development/python-modules/coapthon3/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/py-air-control/default.nix Outdated Show resolved Hide resolved
pkgs/top-level/python-packages.nix Outdated Show resolved Hide resolved
@@ -0,0 +1,23 @@
{ buildPythonPackage, coapthon3, fetchPypi, lib, pycryptodomex }:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this useful as a Python module, or is it an application (i.e. is it really just for the "airctrl" CLI)?

If the former, this is great :)

If the latter, consider putting this elsewhere in the tree and then using "python3Packages.callPackage" from "all-packages.nix" instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's the former.

To give more context: I am using py-air-control as a library in another Python module. Here's an example of how it's used.

The final goal is to continuously measure air quality, publish the measurements to Prometheus, and visualize in Grafana (all in NixOS on a Raspberry Pi). I hope this makes sense.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure! Nice :)

(ooh, I really want to start doing air quality measurement...)

@SuperSandro2000
Copy link
Member

On darwin it gets stuck at

[1/0/5 built, 0.0 MiB DL] building python3.7-CoAPthon3-1.0.1 (pytestCheckPhase): ======================= 38 failed, 2 deselected in 2.36s =======================

@SuperSandro2000
Copy link
Member

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

4 packages built:
  • python37Packages.coapthon3
  • python37Packages.py-air-control
  • python38Packages.coapthon3
  • python38Packages.py-air-control

@urbas
Copy link
Contributor Author

urbas commented Nov 28, 2020

On darwin it gets stuck at

[1/0/5 built, 0.0 MiB DL] building python3.7-CoAPthon3-1.0.1 (pytestCheckPhase): ======================= 38 failed, 2 deselected in 2.36s =======================

I have seen this happen on x86 before I disabled the two failing tests. I think there's something wrong with the tear-down logic when tests fail.

Tests create some servers, which in turn create a bunch of threads. Maybe the failed tests leave behind some lingering non-daemon threads which prevent pytest to shut down properly.

In any case, since all these tests fail on darwin and they take more than 10 minutes I will just disable them.

I will try to contribute some fast and robust unit tests to both coapthon3 and py-air-control projects. We can then invoke only the unit tests rather than these slow and brittle integration tests.

@urbas
Copy link
Contributor Author

urbas commented Nov 28, 2020

Btw, I now also verified this builds on aarch64 (NixOS on Raspberry Pi 4).

Edit: Also verified it actually works on aarch64 too (got the whole thing up and running with metrics scraped by Prometheus and visualised in Grafana).

@lukegb
Copy link
Contributor

lukegb commented Dec 1, 2020

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

4 packages built:
  • python37Packages.coapthon3
  • python37Packages.py-air-control
  • python38Packages.coapthon3
  • python38Packages.py-air-control

@SuperSandro2000
Copy link
Member

Tests create some servers, which in turn create a bunch of threads. Maybe the failed tests leave behind some lingering non-daemon threads which prevent pytest to shut down properly.

In any case, since all these tests fail on darwin and they take more than 10 minutes I will just disable them.

Yeah, we do not want to waste reviewers and builders time with that.

I will try to contribute some fast and robust unit tests to both coapthon3 and py-air-control projects. We can then invoke only the unit tests rather than these slow and brittle integration tests.

This won't block the PR but great that you try to improve the project.

@SuperSandro2000
Copy link
Member

@urbas I think we need to do the same with the other package.

[1/1/5 built, 2 copied (71.0/71.0 MiB), 19.3 MiB DL] building python3.7-py-air-control-2.1.0 (pytestCheckPhase): ====================== 12 deselected, 20 errors in 1.84s ==================

@urbas
Copy link
Contributor Author

urbas commented Dec 2, 2020

@urbas I think we need to do the same with the other package.

[1/1/5 built, 2 copied (71.0/71.0 MiB), 19.3 MiB DL] building python3.7-py-air-control-2.1.0 (pytestCheckPhase): ====================== 12 deselected, 20 errors in 1.84s ==================

Oh smokes, I hoped at least those would pass. I disabled them now. 👍

@SuperSandro2000
Copy link
Member

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

6 packages built:
  • python37Packages.coapthon3
  • python37Packages.py-air-control
  • python38Packages.coapthon3
  • python38Packages.py-air-control
  • python39Packages.coapthon3
  • python39Packages.py-air-control

@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 105078 run on x86_64-darwin 1

6 packages built:
  • python37Packages.coapthon3
  • python37Packages.py-air-control
  • python38Packages.coapthon3
  • python38Packages.py-air-control
  • python39Packages.coapthon3
  • python39Packages.py-air-control

@SuperSandro2000 SuperSandro2000 merged commit 879cea8 into NixOS:master Dec 3, 2020
@urbas urbas deleted the py-air-control branch December 5, 2020 12:24
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

4 participants