-
Notifications
You must be signed in to change notification settings - Fork 638
Add support for the mf4 io format #554
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
Conversation
This is a work in progress for which I would like to get some feed-back. The mf4 io requires Python >= 3.6.0 |
Codecov Report
@@ Coverage Diff @@
## mf4-io #554 +/- ##
==========================================
- Coverage 68.74% 64.46% -4.28%
==========================================
Files 69 67 -2
Lines 6245 6098 -147
==========================================
- Hits 4293 3931 -362
- Misses 1952 2167 +215 |
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.
Nice addition, thank you!
If this part of the PR is done, we should also focus on writing a small passage for the docs & have a look on how this can be tested. If only a writer is implemented, we could place a sample file in python-can/test/data/
and test whether all messages that we know of are in there an can be read (in the correct order).
You can also add this hot new feature to |
This looks like a great addition so far! :) |
I've updated the listener code and now the tests pass:
Once I release asammdf 5.5.0 everything will be in place for the MF4 io support |
The tests are not executed on Travis CI or AppVeyor yet. You need to:
This should probably be added to the docs as a note, like:
|
Do we want to simply not support the combination of Pypy + MF4? |
Related: travis-ci/travis-ci#9929 (comment) |
install: | ||
- if [[ "$TEST_SOCKETCAN" ]]; then sudo bash test/open_vcan.sh ; fi | ||
- travis_retry pip install .[test] | ||
- travis_retry pip install .[test,mf4] |
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.
Maybe this is not the right way to configure the tests. Maybe we should simply not support the combination of MF4 & PyPy (as mentioned above). This could be done by only installing travis_retry pip install .[test]
and instead changing setup.py
to:
import platform
is_cpython = 'CPython' == platform.python_implementation()
tests_require = [
'pytest~=4.3',
'pytest-timeout~=1.3',
'pytest-cov~=2.6',
'codecov~=2.0',
'six',
'hypothesis'
] + extras_require['serial']
if is_cpython:
tests_require += extras_require['mf4']
A very simple not in the docs should be added as well:
.. note:: *MF4* is currently only supported on CPython and not on PyPy.
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.
https://www.python.org/dev/peps/pep-0508/#environment-markers
'mf4; platform_python_implementation == "CPython"'
Maybe? Untested, but definitely want to get away from arbitrary code relating to setup. Also maybe != "PyPy"
depending on intent.
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.
@altendky This does not seem to work on my machine: I get python-can 3.2.0 does not provide the extra 'mf4'
on CPython 3.6. Removing the spaces did not help either.
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.
@danielhrisca Sorry for the long delay. With the above change, this should be ready to finally be merged.
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.
@felixdivo, I think maybe I misread the code there. Sorry. The point is to document dependencies in a way that can be retrieved regardless of what Python is being used to run setup.py. For example, what I wrote (or something like it) can go into a wheel intact and be processed when the wheel is installed. if is_cpython:
would be processed when the wheel is built and then when the wheel is used it would be fixed according to the Python used to create the wheel. This is also quite relevant to locking dependencies.
But... I was thinking at a different layer. I don't know that there's a tidy all around solution for this yet. Applying the environment markers to each dependency of the mf4 extra could make it a no-op at least and then it could be unconditionally (code-wise) included wherever. Maybe that's what I would do, I'm not quite sure.
It would be nice if the extra could be made conditionally available but my naive attempt didn't work.
https://gist.github.com/altendky/357e6a19691912593080f18ddcc39235
It would also be nice if setup.py could reference its own extras as dependencies like .[mf4]
or such but last I played with that I didn't find anything that worked.
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.
I got that idea, but it's largely unsupported for now. :( I was just trying what is implemented and what not. That shortcoming of setup.py
is really annoying as well. -.-
I raised a question about this over here. |
I would propose dropping OSX + Python 3.7-dev from our Travis CI list. @hardbyte Are you okay with that?
|
It is unsupported and causes problems. See [here](#554 (comment)).
#622 is now merged. Let's see if everything except the PyPy stuff will work. |
It is unsupported and causes problems. See [here](hardbyte#554 (comment)).
@danielhrisca Do you have time to finish this? |
@felixdivo |
Apparently the bug is not being cared about or fixed. |
I merged this into a new branch to apply some changes, and will merge that one into develop in #697. |
implements #506
(Closes #506)