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

Block typing from being installed #37707

Merged
merged 2 commits into from
Aug 26, 2020
Merged

Block typing from being installed #37707

merged 2 commits into from
Aug 26, 2020

Conversation

balloob
Copy link
Member

@balloob balloob commented Jul 10, 2020

Breaking change

Integrations hdmi_cec and miflora have been disabled because they depend on Python package typing which breaks the Python package installer.

Proposed change

Typing breaks any Python installation it is installed in after 3.5. We should block all dependencies that require it instead of uninstalling it all the time.

This PR can be installed after:

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

@probot-home-assistant probot-home-assistant bot added bugfix core small-pr PRs with less than 30 lines. labels Jul 10, 2020
@frenck
Copy link
Member

frenck commented Jul 10, 2020

Good to merge after builds pass 👍

@balloob
Copy link
Member Author

balloob commented Jul 10, 2020

@frenck I have updated our requirements files to explicitly reference our constraint files. I have updated the GitHub workflow file accordingly. Could you review?

@frenck
Copy link
Member

frenck commented Jul 10, 2020

As per Discord chat, this won't work with our current wheels.

Besides, it seems that building a fresh environment using this causes issues:

ERROR: Could not find a version that satisfies the requirement typing==1000000000.0.0 (from -c homeassistant/package_constraints.txt (line 46)) (from versions: 3.5.0b1, 3.5.0, 3.5.0.1, 3.5.1.0, 3.5.2.2, 3.5.3.0, 3.6.1, 3.6.2, 3.6.4, 3.6.6, 3.7.4, 3.7.4.1)
ERROR: No matching distribution found for typing==1000000000.0.0 (from -c homeassistant/package_constraints.txt (line 46))

@balloob
Copy link
Member Author

balloob commented Jul 10, 2020

Wheel builder updated in home-assistant/wheels#116

Yes, this PR will not pass until we get pyHS100 dropped.

@balloob balloob mentioned this pull request Jul 10, 2020
20 tasks
rytilahti added a commit to GadgetReactor/pyHS100 that referenced this pull request Jul 10, 2020
* update the shipped README to include the location of the follow up project
* remove typing from dependencies, fixes home-assistant/core#37707
@rytilahti
Copy link
Member

I just pushed out the very last pyhs100 release 0.3.5.1, containing only the removal of typing dep and adding a notice to the readme saying the package has been deprecated, hope that helps :-)

@balloob
Copy link
Member Author

balloob commented Jul 11, 2020

Ugh, I realized that I have been checking which thing relies on typing based on the test requirements installed instead of all requirements. Need to upgrade 3 more. Have put them in the description.

@balloob
Copy link
Member Author

balloob commented Jul 11, 2020

Shout out to @scop which I see has already been working on getting typing limited to Python < 3.5 everywhere 👍

@balloob
Copy link
Member Author

balloob commented Jul 11, 2020

I've pulled some unrelated changes from this PR and kept it to bare minimum so it's easier to rebase and keep up to date.

@balloob balloob merged commit e96d8a9 into dev Aug 26, 2020
@balloob balloob deleted the block-typing branch August 26, 2020 12:51
@scop
Copy link
Member

scop commented Aug 26, 2020

FWIW the only breakage resulting from installing a version of typing (and/or enum34) into site-packages I'm aware of is pip shooting itself into the foot because it ends up stuffing site-packages before stdlib into sys.path for its self-invocations, see discussion at pypa/pip#8214.

So in that sense unless there's more to this I'm not aware of, the "This overrides a built-in Python package" comment attached to this change is somewhat misleading and kind of points the finger at the wrong direction.

Just FTR as I happened to dig into the typing issue some more a few days back. Back then I also experimented with similar constraints changes and managed to trigger unwanted uninstallability side effects, but hope this change doesn't introduce them. Will report back if I happen to notice any.

@balloob
Copy link
Member Author

balloob commented Aug 26, 2020

Thanks, clarified the breaking change. I still think that we should make sure we don't have any dependency that allows pip to shoot themselves in the foot.

@scop
Copy link
Member

scop commented Aug 27, 2020

Sure, preventing that is a fine stopgap fix.

weissm pushed a commit to weissm/core that referenced this pull request Aug 28, 2020
leikoilja pushed a commit to leikoilja/core that referenced this pull request Sep 6, 2020
basnijholt added a commit to basnijholt/home-assistant that referenced this pull request Sep 8, 2020
Danielhiversen pushed a commit that referenced this pull request Sep 8, 2020
* add miflora again, reverts part of github.com//pull/37707

* edit CODEOWNERS
balloob pushed a commit that referenced this pull request Sep 8, 2020
* add miflora again, reverts part of github.com//pull/37707

* edit CODEOWNERS
@newAM
Copy link
Contributor

newAM commented Sep 26, 2020

Last we heard from the author of pyCEC was a month ago.

If I forked pyCEC and made a release under a new name to pypi as a stopgap to re-enable this integration would this be accepted in a pull-request?

@Fufs
Copy link

Fufs commented Sep 27, 2020

Honestly, the only thing preventing me from updating is the thought of losing hdmi_cec. Please fix this asap.

@frenck
Copy link
Member

frenck commented Sep 27, 2020

@newAM @Fufs Please reframe from leaving comments on closed/merged/handled pull requests. Thanks 👍
@Fufs This is not our issue to fix, but an upstream problem.

@home-assistant home-assistant locked and limited conversation to collaborators Sep 27, 2020
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.

8 participants