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

Update the code that checks for package updates #66

Merged
merged 2 commits into from
Oct 24, 2023
Merged

Update the code that checks for package updates #66

merged 2 commits into from
Oct 24, 2023

Conversation

nfelt14
Copy link
Collaborator

@nfelt14 nfelt14 commented Oct 24, 2023

fix: Replaced a third-party package used to check for updates with a few lines of code to perform a request and parse the returned json. This prevents a PermissionsError from happening on some systems. Also added a flag to enable the check for updates, it now defaults to off.

Proposed changes

This fixes a potential PermissionsError by replacing a third-party package with a direct usage of requests.get(). A config option was added, defaulting to False, that can enable a check for updates when the DeviceManager is first instantiated if the user wants to have that behavior.

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Functionality update (non-breaking change which updates or changes existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • CI/CD update (an update to the CI/CD workflows, scripts, and/or configurations)
  • Documentation update (an update to enhance the user experience when reading through the docs)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have followed the guidelines in the CONTRIBUTING document
  • I have signed the CLA
  • I have checked to ensure there aren't other open Pull Requests for the same update/change
  • I have performed a self-review of my code
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • Basic linting passes locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have added necessary documentation (if appropriate)
  • I have updated the Changelog with a brief description of my changes

…few lines of code to perform a request and parse the returned json. This prevents a PermissionsError from happening on some systems. Also added a flag to enable the check for updates, it now defaults to off.
@nfelt14 nfelt14 added bug Something isn't working enhancement New feature or request labels Oct 24, 2023
@nfelt14 nfelt14 self-assigned this Oct 24, 2023
@nfelt14 nfelt14 requested a review from a team as a code owner October 24, 2023 16:29
@nfelt14 nfelt14 temporarily deployed to package-build October 24, 2023 16:29 — with GitHub Actions Inactive
@nfelt14 nfelt14 requested a review from a team October 24, 2023 16:29
@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

Merging #66 (29ef33f) into main (a7cadd7) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #66   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          168       168           
  Lines         3757      3761    +4     
  Branches       646       644    -2     
=========================================
+ Hits          3757      3761    +4     
Files Coverage Δ
src/tm_devices/device_manager.py 100.00% <ø> (ø)
...rc/tm_devices/helpers/constants_and_dataclasses.py 100.00% <100.00%> (ø)
src/tm_devices/helpers/functions.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@nfelt14 nfelt14 temporarily deployed to package-build October 24, 2023 16:32 — with GitHub Actions Inactive
@nfelt14 nfelt14 enabled auto-merge (squash) October 24, 2023 16:34
@nfelt14 nfelt14 merged commit 9e0a137 into tektronix:main Oct 24, 2023
34 checks passed
nfelt14 added a commit that referenced this pull request Oct 24, 2023
* fix: Replaced a third-party package used to check for updates with a few lines of code to perform a request and parse the returned json. This prevents a PermissionsError from happening on some systems. Also added a flag to enable the check for updates, it now defaults to off.
v12ganesh pushed a commit to v12ganesh/tm_devices that referenced this pull request Mar 28, 2024
* fix: Replaced a third-party package used to check for updates with a few lines of code to perform a request and parse the returned json. This prevents a PermissionsError from happening on some systems. Also added a flag to enable the check for updates, it now defaults to off.
Signed-off-by: v12ganesh [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants