Move to `setup.cfg` and config for `build-system` (#11484)
This commit is contained in:
parent
730e9b144d
commit
ce0ced0b6a
|
@ -41,7 +41,7 @@ jobs:
|
||||||
LOKALISE_TOKEN: ${{ secrets.LOKALISE_TOKEN }}
|
LOKALISE_TOKEN: ${{ secrets.LOKALISE_TOKEN }}
|
||||||
- name: Build and release package
|
- name: Build and release package
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install twine
|
python3 -m pip install twine build
|
||||||
export TWINE_USERNAME="__token__"
|
export TWINE_USERNAME="__token__"
|
||||||
export TWINE_PASSWORD="${{ secrets.TWINE_TOKEN }}"
|
export TWINE_PASSWORD="${{ secrets.TWINE_TOKEN }}"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
include README.md
|
include README.md
|
||||||
include LICENSE.md
|
|
||||||
graft hass_frontend
|
graft hass_frontend
|
||||||
graft hass_frontend_es5
|
graft hass_frontend_es5
|
||||||
recursive-exclude * *.py[co]
|
recursive-exclude * *.py[co]
|
||||||
|
|
|
@ -26,11 +26,11 @@ module.exports = {
|
||||||
},
|
},
|
||||||
version() {
|
version() {
|
||||||
const version = fs
|
const version = fs
|
||||||
.readFileSync(path.resolve(paths.polymer_dir, "setup.py"), "utf8")
|
.readFileSync(path.resolve(paths.polymer_dir, "setup.cfg"), "utf8")
|
||||||
.match(/\d{8}\.\d+/);
|
.match(/version\W+=\W(\d{8}\.\d)/);
|
||||||
if (!version) {
|
if (!version) {
|
||||||
throw Error("Version not found");
|
throw Error("Version not found");
|
||||||
}
|
}
|
||||||
return version[0];
|
return version[1];
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
[build-system]
|
||||||
|
requires = ["setuptools~=60.5", "wheel~=0.37.1"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
|
@ -11,6 +11,6 @@ yarn install
|
||||||
|
|
||||||
script/build_frontend
|
script/build_frontend
|
||||||
|
|
||||||
rm -rf dist
|
rm -rf dist home_assistant_frontend.egg-info
|
||||||
python3 setup.py -q sdist
|
python3 -m build
|
||||||
python3 -m twine upload dist/* --skip-existing
|
python3 -m twine upload dist/* --skip-existing
|
||||||
|
|
|
@ -50,14 +50,14 @@ async function main(args) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const setup = fs.readFileSync("setup.py", "utf8");
|
const setup = fs.readFileSync("setup.cfg", "utf8");
|
||||||
const version = setup.match(/\d{8}\.\d+/)[0];
|
const version = setup.match(/\d{8}\.\d+/)[0];
|
||||||
const newVersion = method(version);
|
const newVersion = method(version);
|
||||||
|
|
||||||
console.log("Current version:", version);
|
console.log("Current version:", version);
|
||||||
console.log("New version:", newVersion);
|
console.log("New version:", newVersion);
|
||||||
|
|
||||||
fs.writeFileSync("setup.py", setup.replace(version, newVersion), "utf-8");
|
fs.writeFileSync("setup.cfg", setup.replace(version, newVersion), "utf-8");
|
||||||
|
|
||||||
if (!commit) {
|
if (!commit) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
[metadata]
|
||||||
|
name = home-assistant-frontend
|
||||||
|
version = 20220127.0
|
||||||
|
author = The Home Assistant Authors
|
||||||
|
author_email = hello@home-assistant.io
|
||||||
|
license = Apache-2.0
|
||||||
|
platforms = any
|
||||||
|
description = The Home Assistant frontend
|
||||||
|
long_description = file: README.md
|
||||||
|
long_description_content_type = text/markdown
|
||||||
|
url = https://github.com/home-assistant/frontend
|
||||||
|
|
||||||
|
[options]
|
||||||
|
packages = find:
|
||||||
|
zip_safe = False
|
||||||
|
include_package_data = True
|
||||||
|
python_requires = >= 3.4.0
|
||||||
|
|
||||||
|
[options.packages.find]
|
||||||
|
include =
|
||||||
|
hass_frontend*
|
19
setup.py
19
setup.py
|
@ -1,14 +1,7 @@
|
||||||
from setuptools import setup, find_packages
|
"""
|
||||||
|
Entry point for setuptools. Required for editable installs.
|
||||||
|
TODO: Remove file after updating to pip 21.3
|
||||||
|
"""
|
||||||
|
from setuptools import setup
|
||||||
|
|
||||||
setup(
|
setup()
|
||||||
name="home-assistant-frontend",
|
|
||||||
version="20220127.0",
|
|
||||||
description="The Home Assistant frontend",
|
|
||||||
url="https://github.com/home-assistant/frontend",
|
|
||||||
author="The Home Assistant Authors",
|
|
||||||
author_email="hello@home-assistant.io",
|
|
||||||
license="Apache-2.0",
|
|
||||||
packages=find_packages(include=["hass_frontend", "hass_frontend.*"]),
|
|
||||||
include_package_data=True,
|
|
||||||
zip_safe=False,
|
|
||||||
)
|
|
||||||
|
|
Loading…
Reference in New Issue