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
Python CAN support #34473
Python CAN support #34473
Conversation
@GrahamcOfBorg eval (a commit broke master, and it is now fixed.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put the derivations into spererate files inside pkgs/development/python-modules
and use callPackage
.
pkgs/top-level/python-packages.nix
Outdated
@@ -2012,6 +2012,83 @@ in { | |||
doCheck = false; | |||
}); | |||
|
|||
can = buildPythonPackage rec { | |||
rev = "2.0.0"; | |||
name = "can-${rev}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No name
. Specify pname
and version
please.
pkgs/top-level/python-packages.nix
Outdated
|
||
canopen = buildPythonPackage rec { | ||
rev = "v0.5.1"; | ||
name = "canopen-${rev}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
pkgs/top-level/python-packages.nix
Outdated
|
||
canmatrix = buildPythonPackage rec { | ||
rev = "0.6"; | ||
name = "canmatrix-${rev}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
pkgs/top-level/python-packages.nix
Outdated
rev = "2.0.0"; | ||
name = "can-${rev}"; | ||
|
||
src = pkgs.fetchFromGitHub { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use fetchPypi
if possible. This makes it easier to override the src
.
pkgs/top-level/python-packages.nix
Outdated
@@ -2012,6 +2012,83 @@ in { | |||
doCheck = false; | |||
}); | |||
|
|||
can = buildPythonPackage rec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are moving Python expressions out of pkgs/top-level/python-packages.nix
into pkgs/development/python-modules/<module>/default.nix
.
Please move the expression there, and call it from pkgs/top-level/python-packages.nix
using callPackage ../development/python-modules/<package> { };
.
cb4e2f6
to
90b6abe
Compare
Should be ok now. |
doCheck = false; | ||
|
||
propagatedBuildInputs = | ||
[ nose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkInputs
|
||
propagatedBuildInputs = | ||
[ nose | ||
mock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkInputs
buildPythonPackage rec { | ||
pname = "python-can"; | ||
version = "2.0.0"; | ||
name = "${pname}-${version}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no name
buildPythonPackage rec { | ||
pname = "canmatrix"; | ||
version = "0.6"; | ||
name = "${pname}-${version}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no name
buildPythonPackage rec { | ||
pname = "canopen"; | ||
version = "0.5.1"; | ||
name = "${pname}-${version}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no name
|
||
# due to missing test/sample.eds | ||
# https://github.com/christiansandberg/canopen/pull/57 | ||
doCheck = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for opening the PR! As long as no new version is published on PyPI, you could also rely on fetchFromGitHub
.
@GrahamcOfBorg build python2.pkgs.canopen python3.pkgs.canopen |
Success on x86_64-linux (full log) Partial log (click to expand)
|
Success on aarch64-linux (full log) Partial log (click to expand)
|
The following enables diff --git a/pkgs/development/python-modules/canmatrix/default.nix b/pkgs/development/python-modules/canmatrix/default.nix
index c62c43dc2df..6409010aa3e 100644
--- a/pkgs/development/python-modules/canmatrix/default.nix
+++ b/pkgs/development/python-modules/canmatrix/default.nix
@@ -1,7 +1,7 @@
{ lib
, stdenv
, buildPythonPackage
-, fetchPypi
+, fetchFromGitHub
, lxml
, xlwt
, xlrd
@@ -14,9 +14,11 @@ buildPythonPackage rec {
version = "0.6";
name = "${pname}-${version}";
- src = fetchPypi {
- inherit pname version;
- sha256 = "1jv0ry3qrrkjc32a0lwznf7ix8wl2s5lccqsqcyxnr89qbkjapqb";
+ src = fetchFromGitHub {
+ owner = "ebroecker";
+ repo = pname;
+ rev = version;
+ sha256 = "1lb0krhchja2jqfsh5lsfgmqcchs1pd38akvc407jfmll96f4yqz";
};
propagatedBuildInputs =
@@ -28,6 +30,11 @@ buildPythonPackage rec {
future
];
+ checkPhase = ''
+ cd test
+ python ./test.py
+ '';
+
meta = with lib; {
homepage = https://github.com/ebroecker/canmatrix;
description = "Support and convert several CAN (Controller Area Network) database formats .arxml .dbc .dbf .kcd .sym fibex xls(x)"; However, I don't know what the expected outcome is. Their travis build more or less show the same output as this does. |
90b6abe
to
7d5d39d
Compare
7d5d39d
to
f7545fc
Compare
Had to disable doCheck in |
@GrahamcOfBorg build python2.pkgs.can python2.pkgs.canmatrix python3.pkgs.can python3.pkgs.canmatrix |
|
||
checkPhase = '' | ||
cd test | ||
python ./test.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${python.interpreter
. This is needed e.g. for pypy
Success on x86_64-linux (full log) Partial log (click to expand)
|
Success on aarch64-linux (full log) Partial log (click to expand)
|
f7545fc
to
f2f6f57
Compare
f2f6f57
to
305ed7e
Compare
Motivation for this change
CAN/CANOpen python stack
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)