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

Remove json dependency #63

Merged
merged 6 commits into from
Mar 1, 2024
Merged

Remove json dependency #63

merged 6 commits into from
Mar 1, 2024

Conversation

BenediktBurger
Copy link
Member

  • Removes dependency on jsonrpc2-objects and jsonrpc2-pyclient.
    These two dependencies can be written in two small files, which enables us to support older versions of Python than the dependencies allow.
  • Adds a small version of RPCServer for use in Python<3.9 instead of the version of openrpc package.
    This self written version does not yet support fully openrpc creation of method description, therefore it is good to keep openrpc as a dependency for those python versions, where it is available.

Closes #5

Copy link

codecov bot commented Feb 26, 2024

Codecov Report

Attention: Patch coverage is 93.10345% with 18 lines in your changes are missing coverage. Please review.

Project coverage is 87.63%. Comparing base (4cc7cca) to head (549f628).
Report is 2 commits behind head on main.

Files Patch % Lines
pyleco/json_utils/rpc_server_definition.py 84.81% 7 Missing and 5 partials ⚠️
pyleco/json_utils/errors.py 88.88% 4 Missing ⚠️
pyleco/coordinators/coordinator.py 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #63      +/-   ##
==========================================
+ Coverage   87.28%   87.63%   +0.35%     
==========================================
  Files          33       36       +3     
  Lines        2626     2846     +220     
  Branches      314      343      +29     
==========================================
+ Hits         2292     2494     +202     
- Misses        280      293      +13     
- Partials       54       59       +5     
Flag Coverage Δ
unittests 87.63% <93.10%> (+0.35%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BenediktBurger BenediktBurger mentioned this pull request Feb 26, 2024
@BenediktBurger
Copy link
Member Author

Working for a week in the lab.

@BenediktBurger BenediktBurger merged commit d337a29 into main Mar 1, 2024
17 checks passed
@BenediktBurger BenediktBurger deleted the remove-json-dependency branch March 1, 2024 15:36
@bilderbuchi
Copy link
Member

bilderbuchi commented Mar 4, 2024

  • Removes dependency on jsonrpc2-objects and jsonrpc2-pyclient.
    These two dependencies can be written in two small files, which enables us to support older versions of Python than the dependencies allow.

    • Adds a small version of RPCServer for use in Python<3.9 instead of the version of openrpc package.
      This self written version does not yet support fully openrpc creation of method description, therefore it is good to keep openrpc as a dependency for those python versions, where it is available.

Closes #5

A few thoughts from skimming the PR:

  • I would caution against supporting py37, as it has been EOL since last year. Py38 follows this year.
  • The package metadata has requires-python = ">=3.9", so installation should not be possible on lower Python versions anyway. I guess you need py38, nevertheless?
  • It's good that you restricted the self-written code to just use it when necessary, as it's easier to remove later, and reduce maintenance burden.

@BenediktBurger
Copy link
Member Author

Thanks for your comments

* I would caution against supporting py37, as it has been EOL since last year. Py38 follows this year.

The idea was, to include pyleco into pymodaq, which supports python 3.8 and @seb5g mentioned, that he would like to use it on an old system, which only allows python 3.7. However, I noticed, that python 3.7 is not achievable in #61 , so I dropped that idea.

* The package metadata has `requires-python = ">=3.9"`, so installation should not be possible on lower Python versions anyway. I guess you need py38, nevertheless?

This PR is the first one of two, which adds objects. The second one (#64 ) with more changes, changes also that requirement.

* It's good that you restricted the self-written code to just use it when necessary, as it's easier to remove later, and reduce maintenance burden.

Especially as it is not as complete as the imported code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RPCGenerator depends on private API
2 participants