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

hassfest: Unable to parse package version when requirement contains git #92

Closed
mill1000 opened this issue Aug 4, 2023 · 8 comments
Closed

Comments

@mill1000
Copy link

mill1000 commented Aug 4, 2023

I'm attempting to run hassfest against a custom component that currently uses a git repository as a requirement. I'm using the format specified by the docs here.

e.g.

"requirements": ["git+https://github.com/mill1000/midea-msmart.git"],

hassfest is failing with the following error:

Error: R] [REQUIREMENTS] Unable to parse package version (+https://github.com/mill1000/midea-msmart.git) for git.

@rytilahti
Copy link
Member

@andyb2000
Copy link

andyb2000 commented Aug 6, 2024

This appears to still be an issue, however based o the updated docs

{
  "requirements": ["<project> @ git+https://github.com/<user>/<project>.git@<git ref>"]
}

hassfest errors out with Error: R] [REQUIREMENTS] Requirement ...blah... contains a space

It seems to be failing due to the SPACE@SPACE
Is this a fault in hassfest or hass? @ludeeus is this something you're aware of?

@mpw96
Copy link

mpw96 commented Aug 29, 2024

Components that declare a requirement as stated above do work as expected. It seems that just the hassfest test is not aware of this format.

@andyb2000
Copy link

Hi @mpw96 perhaps you can help/clarify.

This still doesn't seem to be working.
In my manifest.json:

{
  "domain": "husqvarna_automower_ble",
  "name": "Husqvarna Automower BLE",
  "bluetooth": [
    {
      "connectable": true,
      "service_uuid": "98bd0001-0b0e-421a-84e5-ddbf75dc6de4"
    }
  ],
  "codeowners": ["@alistair23", "@andyb2000"],
  "config_flow": true,
  "dependencies": ["bluetooth_adapters"],
  "documentation": "https://github.com/andyb2000/HACS-husqvarna_automower_ble/",
  "iot_class": "local_polling",
  "issue_tracker": "https://github.com/andyb2000/HACS-husqvarna_automower_ble/issues",
  "requirements": ["automower_ble @ git+https://github.com/alistair23/AutoMower-BLE.git@main"],
  "version": "0.1.1"
}

This is still rejected by hassfest@master with the error:

Integration husqvarna_automower_ble - /github/workspace/custom_components/husqvarna_automower_ble:
Error: R] [REQUIREMENTS] Requirement "automower_ble @ git+https://github.com/alistair23/AutoMower-BLE.git@main" contains a space

Error: Process completed with exit code 1.

Which is still how the documentation at https://developers.home-assistant.io/docs/creating_integration_manifest/#custom-requirements-during-development--testing specifies we reference public github repo's for requirements.

"requirements": [" @ git+https://github.com//.git@"]

Is the documentation wrong or is hassfest validation wrong?

@mpw96
Copy link

mpw96 commented Oct 30, 2024

Hi I just wanted hassfest in my component not to cmplain anymore, that's why I proposed the change - I hope I didn't make things worse for anybody! Here is what works for me:

  "requirements": [
    "git+https://github.com/mpw96/goecharger.git@0.1.1"
  ],

So your code should be like this I think:

...
"requirements": ["git+https://github.com/alistair23/AutoMower-BLE.git@main"],
...

Does it work?

@mpw96
Copy link

mpw96 commented Oct 31, 2024

So what @mill1000 needs should actually work now.

@mill1000
Copy link
Author

I ran a test here and it seems to be working: mill1000/midea-ac-py#268

@andyb2000
Copy link

"requirements": ["git+https://github.com/alistair23/AutoMower-BLE.git@main"],

thanks, yes using this formatting now works, I'll put a PR in to update documentation as I think that will still be throwing people off.

Thanks all :)

andyb2000 added a commit to andyb2000/developers.home-assistant that referenced this issue Nov 4, 2024
…nal git library

As in issue home-assistant#92 (home-assistant/actions#92) this update to documentation corrects this in line with hassfest validation.
MartinHjelmare pushed a commit to home-assistant/developers.home-assistant that referenced this issue Nov 4, 2024
As in issue #92 (home-assistant/actions#92) this update to documentation corrects this in line with hassfest validation.
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 a pull request may close this issue.

4 participants