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

home-assistant: add lifx component dependencies #55658

Merged
merged 4 commits into from Feb 14, 2019
Merged

Conversation

@netixx
Copy link
Contributor

@netixx netixx commented Feb 12, 2019

Motivation for this change

This commit solves #55527 by adding required
python packages and binding them in the component-packages.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option 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/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@netixx netixx requested a review from FRidh as a code owner Feb 12, 2019
@netixx
Copy link
Contributor Author

@netixx netixx commented Feb 12, 2019

Thank you @dotlambda for helping to debug my setup and making this PR possible !

Copy link
Member

@dotlambda dotlambda left a comment

Please make a separate commit for each package and add a pythonPackages. prefix to the commit messages.

pkgs/development/python-modules/aiolifx/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/aiolifx/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/aiolifx/default.nix Outdated Show resolved Hide resolved
pkgs/top-level/python-packages.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/aiolifx/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/aiolifx/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/aiolifx/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/aiolifx/default.nix Outdated Show resolved Hide resolved
@dotlambda
Copy link
Member

@dotlambda dotlambda commented Feb 12, 2019

From https://github.com/frawau/aiolifx:

aiolifx is a Python 3/asyncio library to control Lifx LED lightbulbs over your LAN.

@netixx
Copy link
Contributor Author

@netixx netixx commented Feb 13, 2019

From https://github.com/frawau/aiolifx:

aiolifx is a Python 3/asyncio library to control Lifx LED lightbulbs over your LAN.

How do I transcribe this in the nix package manager ?

@netixx
Copy link
Contributor Author

@netixx netixx commented Feb 13, 2019

Also, I included only aiolifx_effects (or aiolifx-effects) in the component dependencies, because aiolifx is a dependency, but the lifx components also uses the aiolifx directly (i.e. there are import aiolifx statements) so in a way it also has a direct dependency.

Should I add aiolifx in the component dependencies as well ?

@dotlambda
Copy link
Member

@dotlambda dotlambda commented Feb 13, 2019

From https://github.com/frawau/aiolifx:

aiolifx is a Python 3/asyncio library to control Lifx LED lightbulbs over your LAN.

How do I transcribe this in the nix package manager ?

disabled = !isPy3k

Also, I included only aiolifx_effects (or aiolifx-effects) in the component dependencies, because aiolifx is a dependency, but the lifx components also uses the aiolifx directly (i.e. there are import aiolifx statements) so in a way it also has a direct dependency.

Should I add aiolifx in the component dependencies as well ?

Please read the first two lines of component-packages.nix. You need to run parse-requirements.py.

@netixx
Copy link
Contributor Author

@netixx netixx commented Feb 13, 2019

I fixed what you suggested.

I have a chicken and egg problem with running parse-requirements.py because I need the setup with the pythonPackages commit (and my current setup already runs on a custom branch).

Do you have a magic onliner (or few liners) that I can use to quickly generate the component-packages.nix ?

@dotlambda
Copy link
Member

@dotlambda dotlambda commented Feb 13, 2019

I don't get what your problem is. Once you fixed all evaluation errors, there should be no problem running the script from your hass-lifx-fix branch.

pkgs/top-level/python-packages.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/aiolifx/default.nix Outdated Show resolved Hide resolved
@dotlambda dotlambda changed the title home-assistant: fix lifx component dependencies home-assistant: add lifx component dependencies Feb 13, 2019
@netixx
Copy link
Contributor Author

@netixx netixx commented Feb 14, 2019

I wasn't sure it was going to work on my mac, but it did! However, I ran the script and another dependency was updated (sensor.shodan). I committed both for consistency but I will remove it if you think it's more appropriate.

@dotlambda
Copy link
Member

@dotlambda dotlambda commented Feb 14, 2019

I committed both for consistency

That's fine with me.

netixx added 3 commits Feb 14, 2019
Aiolifx package provides ability to control lifx (https://www.lifx.com)
light fixtures using python. The original need was to use it with
the home-assistant package, specifically the "lifx" component.
Aiolifx_effects package extends the pythonPackages.aiolifx package to
provide the ability to program effects (strobe, fade) into lifx light
fixtures (https://www.lifx.com) using python. The original need was to
use it with the home-assistant package, specifically the "lifx"
component. Although not strictly required to control the lights, the
lifx compopent imports this package and will fail if it's not present.
Update components dependencies for home-assistant.
@dotlambda
Copy link
Member

@dotlambda dotlambda commented Feb 14, 2019

@GrahamcOfBorg build python3.pkgs.aiolifx-effects

@dotlambda dotlambda merged commit 170dc5d into NixOS:master Feb 14, 2019
12 of 13 checks passed
@netixx
Copy link
Contributor Author

@netixx netixx commented Feb 15, 2019

Thank you for your help doing this !

@netixx netixx deleted the hass-lifx-fix branch Feb 15, 2019
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