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

Change sharkiqpy to sharkiq #68864

Merged
merged 13 commits into from
Mar 30, 2022
Merged

Change sharkiqpy to sharkiq #68864

merged 13 commits into from
Mar 30, 2022

Conversation

JeffResc
Copy link
Contributor

@JeffResc JeffResc commented Mar 29, 2022

Proposed change

The SharkIQ integration is currently broken, see #68624.

This PR changes the underlying pypi package from sharkiqpy to sharkiq. The original maintainer of sharkiqpy seems unreachable, so I forked the repository and made the necessary changes to fix the SharkIQ vacuum integration.

Edit: If @ajmarks continues to be unavailable, I would be interested in maintaining this, as long as no one else wants to.

sharkiq Changelog

  • Updated const.py to reflect the new DEVICE_URL and LOGIN_URL to connect to the Shark API.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

@probot-home-assistant
Copy link

Hey there @ajmarks, mind taking a look at this pull request as it has been labeled with an integration (sharkiq) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@TheOneOgre
Copy link

TheOneOgre commented Mar 30, 2022

I agree that the pypi package should be updated due to @ajmarks unavailability since December of 2020. If possible, I also believe @JeffResc, your fork should have at least 1 or 2 write-access maintainers added to it on the off-chance that you disappear like @ajmarks did. (Hopefully not but things happen lol)

@JeffResc
Copy link
Contributor Author

That sounds like a good idea to me as well. If anyone is interest in maintaining the project in the event of my disappearance, please let me know.

@funkybunch
Copy link
Contributor

funkybunch commented Mar 30, 2022

@JeffResc Looks like you have https://github.com/JeffResc/sharkiq/ setup to publish to pypi via Github Actions whenever a new release is cut? If thats all automated I'm happy to help maintain & review PRs.

@AritroSaha10
Copy link

@JeffResc I'd also be willing to be a maintainer if any are still needed.

@JeffResc
Copy link
Contributor Author

JeffResc commented Mar 30, 2022

Looks like you have https://github.com/JeffResc/sharkiq/ setup to publish to pypi via Github Actions whenever a new release is cut? If thats all automated I'm happy to help maintain & review PRs.

Yep, I used that same automation on a few other repos and it works flawlessly.

@funkybunch @AritroSaha10 Added and added.

Copy link
Contributor

@funkybunch funkybunch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since merging this PR would remove the stale sharkiq repo I'd recommend also updating lines 890 and 891 in CODEOWNERS to the maintainers of the new upstream repo: @JeffResc @funkybunch @AritroSaha10.

CODEOWNERS Outdated
/homeassistant/components/*/translations/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change here is unrelated - no need to add a trailing carriage return

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be all set 👍

@JeffResc
Copy link
Contributor Author

Since merging this PR would remove the stale sharkiq repo I'd recommend also updating lines 890 and 891 in CODEOWNERS to the maintainers of the new upstream repo: @JeffResc @funkybunch @AritroSaha10.

This is all set as well now

"codeowners": ["@ajmarks"],
"iot_class": "cloud_polling",
"loggers": ["sharkiq"]
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since #68877 has been merged, please add a carriage return here, or it will fail

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be all set now

@epenet
Copy link
Contributor

epenet commented Mar 30, 2022

Translation files should not be adjusted manually.
They are also ignored by prettier config file so I'm not sure why it triggered an update in your commit:

homeassistant/components/*/translations/*.json

@JeffResc
Copy link
Contributor Author

Translation files should not be adjusted manually. They are also ignored by prettier config file so I'm not sure why it triggered an update in your commit:

homeassistant/components/*/translations/*.json

Oops, I did this manually as the pre-commit hooks inside my dev container don't seem to function properly, this should be fixed

@epenet
Copy link
Contributor

epenet commented Mar 30, 2022

I see that the new package uses very strict dependencies:
https://github.com/JeffResc/sharkiq/blob/4136e64ff3ddfa20a576909a482ecc45bcbfd044/requirements.txt#L1-2

I am a bit worried that it might cause issues in the future, when bumping those in HomeAssistant:

aiohttp==3.8.1
requests==2.27.1

@JeffResc
Copy link
Contributor Author

I see that the new package uses very strict dependencies: https://github.com/JeffResc/sharkiq/blob/4136e64ff3ddfa20a576909a482ecc45bcbfd044/requirements.txt#L1-2

I am a bit worried that it might cause issues in the future, when bumping those in HomeAssistant:

aiohttp==3.8.1
requests==2.27.1

I normally pin the exact version that it's tested on just to ensure that nothing changes between the development environment, testing environment, and production environment, but I see what you mean here.

How do you feel about:

aiohttp>=3.8.1
requests>=2.27.1

@epenet
Copy link
Contributor

epenet commented Mar 30, 2022

How do you feel about:

aiohttp>=3.8.1
requests>=2.27.1

Sounds good

@epenet
Copy link
Contributor

epenet commented Mar 30, 2022

Separately, why is there a dependency on requests? Could it not be 100% async?

Sorry - it looks like you have kept both sync and async methods available. I'm generally of the view that new packages shouldn't bother with a sync version but if you are happy to continue supporting both then that's fine.

@funkybunch
Copy link
Contributor

funkybunch commented Mar 30, 2022

Separately, why is there a dependency on requests? Could it not be 100% async?

To add additional context, this upstream repo is a fork of the existing integration which is stale with the maintainer unresponsive (that repo uses synchronous methods via requests).

I think there are a few places we should refactor and I'm happy if you wanted to create an issue on the dependency's repo to move everything to asynchronous; but, the key part of this PR is to update the dependency to a repo that is actively maintained.

For now the integration is broken because the API URL changed, but so far that is the only difference between the old stale repo and this new repo.

@epenet
Copy link
Contributor

epenet commented Mar 30, 2022

Please rebase over latest dev to fix CI (due to #68900)

@JeffResc
Copy link
Contributor Author

Please rebase over latest dev to fix CI (due to #68900)

This is all set

Separately, why is there a dependency on requests? Could it not be 100% async?

I think @funkybunch summed this up quite nicely, but there is already some discussion about this in the sharkiq repo.

@engeles20
Copy link

So what do I need to do to fix? Will the update push on it's own?

Copy link
Contributor

@epenet epenet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@funkybunch
Copy link
Contributor

funkybunch commented Mar 30, 2022

So what do I need to do to fix? Will the update push on it's own?

If your home assistant instance is pulling updates from the dev channel this will update automatically once this PR is merged in. Otherwise you'll have to wait until it is rolled out in a major/minor release.

If you want to update it manually see the discussion in this issue: #68624

Just know that if you make these changes manually they will be overwritten if you update home assistant core.

@epenet epenet added the smash Indicator this PR is close to finish for merging or closing label Mar 30, 2022
@balloob balloob merged commit 7767258 into home-assistant:dev Mar 30, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed dependency integration: sharkiq small-pr PRs with less than 30 lines. smash Indicator this PR is close to finish for merging or closing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

shark stopped working 2 days ago. vacuums shown as unavailable
8 participants