From 783e26e8e47018061d6388c8d107b44e5ef8fdc6 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Fri, 28 Jan 2022 23:09:05 +0100 Subject: [PATCH] Use isolated build environments (#65145) --- .github/workflows/builder.yml | 6 ++++-- pyproject.toml | 4 ++++ script/release | 32 -------------------------------- 3 files changed, 8 insertions(+), 34 deletions(-) delete mode 100755 script/release diff --git a/.github/workflows/builder.yml b/.github/workflows/builder.yml index 89c4d02c942c..74016d4492cd 100644 --- a/.github/workflows/builder.yml +++ b/.github/workflows/builder.yml @@ -76,8 +76,10 @@ jobs: - name: Build package shell: bash run: | - pip install twine wheel - python setup.py sdist bdist_wheel + # Remove dist, build, and homeassistant.egg-info + # when build locally for testing! + pip install twine build + python -m build - name: Upload package shell: bash diff --git a/pyproject.toml b/pyproject.toml index 52b000bd1af4..69398645d183 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,7 @@ +[build-system] +requires = ["setuptools~=60.5", "wheel~=0.37.1"] +build-backend = "setuptools.build_meta" + [tool.black] target-version = ["py38"] exclude = 'generated' diff --git a/script/release b/script/release deleted file mode 100755 index 4dc94eb7f157..000000000000 --- a/script/release +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# Pushes a new version to PyPi. - -cd "$(dirname "$0")/.." - -head -n 5 homeassistant/const.py | tail -n 1 | grep PATCH_VERSION > /dev/null - -if [ $? -eq 1 ] -then - echo "Patch version not found on const.py line 5" - exit 1 -fi - -head -n 5 homeassistant/const.py | tail -n 1 | grep dev > /dev/null - -if [ $? -eq 0 ] -then - echo "Release version should not contain dev tag" - exit 1 -fi - -CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD` - -if [ "$CURRENT_BRANCH" != "master" ] && [ "$CURRENT_BRANCH" != "rc" ] -then - echo "You have to be on the master or rc branch to release." - exit 1 -fi - -rm -rf dist build -python3 setup.py sdist bdist_wheel -python3 -m twine upload dist/* --skip-existing