Skip to content

Commit

Permalink
Block typing from being installed (#37707)
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob authored Aug 26, 2020
1 parent df9de8e commit e96d8a9
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 42 deletions.
26 changes: 6 additions & 20 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -610,19 +605,14 @@ 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
. venv/bin/activate
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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions azure-pipelines-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down Expand Up @@ -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 .
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/hdmi_cec/manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/miflora/manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 4 additions & 4 deletions homeassistant/package_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

7 changes: 0 additions & 7 deletions requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions script/gen_requirements_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down

0 comments on commit e96d8a9

Please sign in to comment.