-
-
Notifications
You must be signed in to change notification settings - Fork 123
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
replace the call to serial.Serial with serial.serial_for_url #386
Conversation
to support loop:// and other url-types supported in pyserial (>3.0)
Could add an entry to the docs ? Otherwise this looks good since we require pyserial >= 3.0 and this feature was introduced in 2.5 |
Added some documentation, hope this is what you were thinking about. What I am not sure about is how to add a test 🤔 |
Thanks for the doc update I believe it will do. My only remaining concern is the behavior one gets if pyvisa attempts to read/write an attribute which is not supported for a URL. I did not dive deep enough in pyserial docs to have a clear sense of what would happen then. As for testing since you can talk to the loop back you could mock a resource no ? |
If it try an
WIll work on that next |
added a unit test, but it seems i cannot trigger the test(s) from the cli on two systems with python 3.11.3 or 3.11.4:
|
I may have switched to pytest at one point I will have to double check. |
pytest seems to work (and also pointed out a deprecatuion issue.. |
CIs are not good. You may need to skip the new tests in some cases (note I did not check the exact failure). |
The CI failed due to me using |
Could it be that in the CI enviromnent no Proof:
--> We need to extend the CI env to include pyserial for the tests |
I am fine with you adding to the CI env but I would also like to see the test behind a conditional skip if pyserial is not available. |
|
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.
Looks good. I just have a nitpick regarding the CI configuration.
azure-pipelines.yml
Outdated
@@ -32,9 +32,12 @@ steps: | |||
source $HOME/miniconda3/bin/activate | |||
echo Activate environment | |||
call conda activate test_ | |||
echo Install support packages | |||
pip install pyserial | |||
echo Install project | |||
pip install git+https://github.com/pyvisa/pyvisa.git#egg=pyvisa | |||
pip install -e . |
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.
You could do pip install -e .[serial]
instead with a comment explining why we install this extra.
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.
If you would prefer it that way, I will change it.
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## main #386 +/- ##
==========================================
- Coverage 23.05% 23.02% -0.03%
==========================================
Files 22 23 +1
Lines 3292 3318 +26
Branches 456 457 +1
==========================================
+ Hits 759 764 +5
- Misses 2516 2536 +20
- Partials 17 18 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Thanks for the review. |
to support loop:// and other url-types supported in pyserial (>3.0)
tested with the follwing code on python 3.11.3, pyserial 3.5:
black . && isort -c . && flake8
with no errors