From e96d8a961c11bb4be327899cc19274f2702731d1 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 26 Aug 2020 14:51:41 +0200 Subject: [PATCH] Block typing from being installed (#37707) --- .github/workflows/ci.yaml | 26 +++++-------------- Dockerfile | 1 - azure-pipelines-ci.yml | 6 ----- .../components/hdmi_cec/manifest.json | 1 + .../components/miflora/manifest.json | 1 + homeassistant/package_constraints.txt | 8 +++--- requirements_all.txt | 7 ----- script/gen_requirements_all.py | 8 +++--- 8 files changed, 16 insertions(+), 42 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9b5aca3051c5f6..fae621670ecba4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -50,10 +50,6 @@ jobs: . venv/bin/activate pip install -U pip setuptools pip install -r requirements.txt -r requirements_test.txt - # Uninstalling typing as a workaround. Eventually we should make sure - # all our dependencies drop typing. - # Find offending deps with `pipdeptree -r -p typing` - pip uninstall -y typing - name: Restore pre-commit environment from cache id: cache-precommit uses: actions/cache@v2 @@ -595,8 +591,7 @@ jobs: steps: - name: Check out code from GitHub uses: actions/checkout@v2 - - name: - Restore full Python ${{ matrix.python-version }} virtual environment + - name: Restore full Python ${{ matrix.python-version }} virtual environment id: cache-venv uses: actions/cache@v2 with: @@ -610,8 +605,7 @@ jobs: ${{ env.CACHE_VERSION}}-${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('requirements_test.txt') }}-${{ hashFiles('requirements_all.txt') }} ${{ env.CACHE_VERSION}}-${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('requirements_test.txt') }} ${{ env.CACHE_VERSION}}-${{ runner.os }}-venv-${{ matrix.python-version }}- - - name: - Create full Python ${{ matrix.python-version }} virtual environment + - name: Create full Python ${{ matrix.python-version }} virtual environment if: steps.cache-venv.outputs.cache-hit != 'true' run: | python -m venv venv @@ -619,10 +613,6 @@ jobs: pip install -U pip setuptools wheel pip install -r requirements_all.txt pip install -r requirements_test.txt - # Uninstalling typing as a workaround. Eventually we should make sure - # all our dependencies drop typing. - # Find offending deps with `pipdeptree -r -p typing` - pip uninstall -y typing pip install -e . pylint: @@ -636,8 +626,7 @@ jobs: steps: - name: Check out code from GitHub uses: actions/checkout@v2 - - name: - Restore full Python ${{ matrix.python-version }} virtual environment + - name: Restore full Python ${{ matrix.python-version }} virtual environment id: cache-venv uses: actions/cache@v2 with: @@ -671,8 +660,7 @@ jobs: steps: - name: Check out code from GitHub uses: actions/checkout@v2 - - name: - Restore full Python ${{ matrix.python-version }} virtual environment + - name: Restore full Python ${{ matrix.python-version }} virtual environment id: cache-venv uses: actions/cache@v2 with: @@ -708,8 +696,7 @@ jobs: steps: - name: Check out code from GitHub uses: actions/checkout@v2 - - name: - Restore full Python ${{ matrix.python-version }} virtual environment + - name: Restore full Python ${{ matrix.python-version }} virtual environment id: cache-venv uses: actions/cache@v2 with: @@ -769,8 +756,7 @@ jobs: steps: - name: Check out code from GitHub uses: actions/checkout@v2 - - name: - Restore full Python ${{ matrix.python-version }} virtual environment + - name: Restore full Python ${{ matrix.python-version }} virtual environment id: cache-venv uses: actions/cache@v2 with: diff --git a/Dockerfile b/Dockerfile index daaa2999127a38..cbcc948f5dcf8c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,6 @@ COPY . homeassistant/ RUN \ pip3 install --no-cache-dir --no-index --only-binary=:all: --find-links "${WHEELS_LINKS}" \ -r homeassistant/requirements_all.txt \ - && pip3 uninstall -y typing \ && pip3 install --no-cache-dir --no-index --only-binary=:all: --find-links "${WHEELS_LINKS}" \ -e ./homeassistant \ && python3 -m compileall homeassistant/homeassistant diff --git a/azure-pipelines-ci.yml b/azure-pipelines-ci.yml index 6b2975f1b20b28..613e386b2497d7 100644 --- a/azure-pipelines-ci.yml +++ b/azure-pipelines-ci.yml @@ -166,9 +166,6 @@ stages: . venv/bin/activate pip install -U pip setuptools pytest-azurepipelines pytest-xdist -c homeassistant/package_constraints.txt pip install -r requirements_test_all.txt - # This is a TEMP. Eventually we should make sure our 4 dependencies drop typing. - # Find offending deps with `pipdeptree -r -p typing` - pip uninstall -y typing - script: | . venv/bin/activate pip install -e . @@ -211,9 +208,6 @@ stages: pip install -U pip setuptools wheel pip install -r requirements_all.txt pip install -r requirements_test.txt - # This is a TEMP. Eventually we should make sure our 4 dependencies drop typing. - # Find offending deps with `pipdeptree -r -p typing` - pip uninstall -y typing - script: | . venv/bin/activate pip install -e . diff --git a/homeassistant/components/hdmi_cec/manifest.json b/homeassistant/components/hdmi_cec/manifest.json index 3d2ea355e02cb8..c3817d25776dae 100644 --- a/homeassistant/components/hdmi_cec/manifest.json +++ b/homeassistant/components/hdmi_cec/manifest.json @@ -1,4 +1,5 @@ { + "disabled": "Dependency contains code that breaks Home Assistant.", "domain": "hdmi_cec", "name": "HDMI-CEC", "documentation": "https://www.home-assistant.io/integrations/hdmi_cec", diff --git a/homeassistant/components/miflora/manifest.json b/homeassistant/components/miflora/manifest.json index fde971541945cf..96558c82fec651 100644 --- a/homeassistant/components/miflora/manifest.json +++ b/homeassistant/components/miflora/manifest.json @@ -1,4 +1,5 @@ { + "disabled": "Dependency contains code that breaks Home Assistant.", "domain": "miflora", "name": "Mi Flora", "documentation": "https://www.home-assistant.io/integrations/miflora", diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index 261dd5dd34dd05..22ce4e772d24df 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -39,11 +39,11 @@ urllib3>=1.24.3 # Constrain httplib2 to protect against CVE-2020-11078 httplib2>=0.18.0 -# Not needed for our supported Python versions -enum34==1000000000.0.0 - # This is a old unmaintained library and is replaced with pycryptodome pycrypto==1000000000.0.0 -# This is built-in and breaks pip if installed +# This overrides a built-in Python package +enum34==1000000000.0.0 +typing==1000000000.0.0 uuid==1000000000.0.0 + diff --git a/requirements_all.txt b/requirements_all.txt index 87dcc0d5e152b3..c26e0322b17390 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -361,7 +361,6 @@ blinkstick==1.1.8 blockchain==1.4.4 # homeassistant.components.decora -# homeassistant.components.miflora # bluepy==1.3.0 # homeassistant.components.bme680 @@ -913,9 +912,6 @@ meteofrance-api==0.1.1 # homeassistant.components.mfi mficlient==0.3.0 -# homeassistant.components.miflora -miflora==0.6.0 - # homeassistant.components.mill millheater==0.3.4 @@ -1177,9 +1173,6 @@ py-synology==0.2.0 # homeassistant.components.seventeentrack py17track==2.2.2 -# homeassistant.components.hdmi_cec -pyCEC==0.4.13 - # homeassistant.components.control4 pyControl4==0.0.6 diff --git a/script/gen_requirements_all.py b/script/gen_requirements_all.py index ef70852277ce5d..5947fd9ed5fd6c 100755 --- a/script/gen_requirements_all.py +++ b/script/gen_requirements_all.py @@ -68,14 +68,14 @@ # Constrain httplib2 to protect against CVE-2020-11078 httplib2>=0.18.0 -# Not needed for our supported Python versions -enum34==1000000000.0.0 - # This is a old unmaintained library and is replaced with pycryptodome pycrypto==1000000000.0.0 -# This is built-in and breaks pip if installed +# This overrides a built-in Python package +enum34==1000000000.0.0 +typing==1000000000.0.0 uuid==1000000000.0.0 + """ IGNORE_PRE_COMMIT_HOOK_ID = (