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

[WIP] Upgrade Astral to 2.2 #48282

Closed
wants to merge 28 commits into from
Closed

[WIP] Upgrade Astral to 2.2 #48282

wants to merge 28 commits into from

Conversation

FMKaiba
Copy link
Contributor

@FMKaiba FMKaiba commented Mar 24, 2021

Breaking change

Proposed change

Updates the Astral Package to 2.2. This assists users running home-assistant on distros with dependancies attached to a more recent version of Astral such as seen in Arch linux

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

Example entry for configuration.yaml:

# Example configuration.yaml

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

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.
  • 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:

Differences between Astral 2.2 and 1.10.1
sffjunkie/astral@1.10.1...2.2
See Version Changes at this link for main differences
https://astral.readthedocs.io/en/latest/index.html

@homeassistant
Copy link
Contributor

Hi @FMKaiba,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@probot-home-assistant
Copy link

Hey there @Swamp-Ig, mind taking a look at this pull request as its been labeled with an integration (sun) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@FMKaiba FMKaiba changed the title Upgrade Astral to 2.2 [WIP] Upgrade Astral to 2.2 Mar 24, 2021
@frenck
Copy link
Member

frenck commented Mar 24, 2021

Thanks for bumping the dependency! However, could you please update the PR description to contain at least one (or multiple) of the following:

  • A link to the release notes of this package version, and all versions in between.
  • A link to the changelog of this package.
  • A link to a Git(Hub) diff/compare view from the current version to the bumped version.

This allows us to review upstream changes, which is needed to decide this change is working as intended and/or if we can include it in, for example, a patch release of Home Assistant.

Thanks already! 👍

@FMKaiba
Copy link
Contributor Author

FMKaiba commented Mar 26, 2021

Thanks for bumping the dependency! However, could you please update the PR description to contain at least one (or multiple) of the following:

  • A link to the release notes of this package version, and all versions in between.
  • A link to the changelog of this package.
  • A link to a Git(Hub) diff/compare view from the current version to the bumped version.

This allows us to review upstream changes, which is needed to decide this change is working as intended and/or if we can include it in, for example, a patch release of Home Assistant.

Thanks already! 👍

I've updated on the pull request to reflect that information, thank you. As it stands currently the pull request is in WIP due to tests failing. Despite working properly in production, My lack of knowledge is showing was trying to determine why the tests are failing. I will do some reading and continue to update

@frenck frenck marked this pull request as draft March 26, 2021 11:02
@frenck
Copy link
Member

frenck commented Mar 26, 2021

Marking it draft until ready 👍

@FMKaiba
Copy link
Contributor Author

FMKaiba commented Mar 27, 2021

I have determined the problem with the tests, it is the tests themselves. It was based off the the previous data from astral. Now using more accurate values the tests have been re-written.
To verify please you the resource: https://www.esrl.noaa.gov/gmd/grad/solcalc/ which is the most up to date via NOAA, which is what the more up to date version of astral is based on.

I still am failing one test of TOD and cannot seem to figure out why. If anyone has any idea please feel free to weight in.

@Swamp-Ig
Copy link
Contributor

I have determined the problem with the tests, it is the tests themselves.

Ahh yeh sorry I should have commented. The tests were written to match Astral's output, not the real world. I remember this now from when I was working on it ages ago. Not doing much HA stuff these days.

It might be worth adding a test to ensure stuff like the Sun actually sets after it rises, although really Astral should have integrated the test cases I sent in to them, I don't know if they did however.

@FMKaiba
Copy link
Contributor Author

FMKaiba commented Mar 28, 2021

I have determined the problem with the tests, it is the tests themselves.

Ahh yeh sorry I should have commented. The tests were written to match Astral's output, not the real world. I remember this now from when I was working on it ages ago. Not doing much HA stuff these days.

It might be worth adding a test to ensure stuff like the Sun actually sets after it rises, although really Astral should have integrated the test cases I sent in to them, I don't know if they did however.

No problem, that made sense when I reviewed the code. What is now preventing the tests seems to be an issue inherit in Astral, Norwegian Winters are not handled correctly. The fact the sun does not set for multiple days does not work with the new logic of astral.

See: sffjunkie/astral#67

Until this is resolved by Astral this Pull Request has no value. I can close the pull request if we wanted to, or keep open to adjust for a fix in Astral

@FMKaiba FMKaiba closed this Mar 31, 2021
@FMKaiba FMKaiba mentioned this pull request Apr 1, 2021
21 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Apr 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants