This commit is contained in:
parent
8e54d7a74d
commit
66b291cb73
39
.drone.star
39
.drone.star
@ -1,10 +1,11 @@
|
||||
# Build pipelines
|
||||
|
||||
PYTHON_VERSIONS = [
|
||||
"3.6",
|
||||
"3.7",
|
||||
"3.8",
|
||||
"3.9",
|
||||
"3.10",
|
||||
"3.11",
|
||||
"3.12",
|
||||
"latest",
|
||||
]
|
||||
|
||||
@ -46,27 +47,21 @@ def tests():
|
||||
"name": "tests",
|
||||
"workspace": get_workspace(),
|
||||
"steps": [
|
||||
tox_step("python:"+version)
|
||||
test_step("python:"+version)
|
||||
for version in PYTHON_VERSIONS
|
||||
] + [
|
||||
tox_step("pypy:"+version, "pypy3", "pypy3")
|
||||
for version in PYPY3_VERSIONS
|
||||
],
|
||||
}]
|
||||
|
||||
|
||||
# Builds a single python test step
|
||||
def tox_step(docker_tag, python_cmd="python", tox_env="py3"):
|
||||
def test_step(docker_tag, python_cmd="python"):
|
||||
return {
|
||||
"name": "test {}".format(docker_tag.replace(":", "")),
|
||||
"image": docker_tag,
|
||||
"environment": {
|
||||
"TOXENV": tox_env,
|
||||
},
|
||||
"commands": [
|
||||
"{} -V".format(python_cmd),
|
||||
"pip install tox",
|
||||
"tox",
|
||||
"pip install poetry",
|
||||
"make lint test",
|
||||
],
|
||||
}
|
||||
|
||||
@ -130,27 +125,27 @@ def push_to_pypi():
|
||||
"name": "push to test pypi",
|
||||
"image": "python:3",
|
||||
"environment": {
|
||||
"TWINE_USERNAME": {
|
||||
"from_secret": "PYPI_USERNAME",
|
||||
},
|
||||
"TWINE_PASSWORD": {
|
||||
"POETRY_PYPI_TOKEN_TESTPYPI": {
|
||||
"from_secret": "TEST_PYPI_PASSWORD",
|
||||
},
|
||||
},
|
||||
"commands": ["make upload-test"],
|
||||
"commands": [
|
||||
"pip install poetry",
|
||||
"make upload-test",
|
||||
],
|
||||
},
|
||||
{
|
||||
"name": "push to pypi",
|
||||
"image": "python:3",
|
||||
"environment": {
|
||||
"TWINE_USERNAME": {
|
||||
"from_secret": "PYPI_USERNAME",
|
||||
},
|
||||
"TWINE_PASSWORD": {
|
||||
"POETRY_PYPI_TOKEN_PYPI": {
|
||||
"from_secret": "PYPI_PASSWORD",
|
||||
},
|
||||
},
|
||||
"commands": ["make upload"],
|
||||
"commands": [
|
||||
"pip install poetry",
|
||||
"make upload",
|
||||
],
|
||||
"when": {
|
||||
"event": ["tag"],
|
||||
},
|
||||
|
6
Makefile
6
Makefile
@ -17,6 +17,10 @@ install:
|
||||
.PHONY: devenv
|
||||
devenv: install
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
poetry run pre-commit run --all-files
|
||||
|
||||
# Runs tests
|
||||
.PHONY: test
|
||||
test:
|
||||
@ -58,7 +62,7 @@ dist-clean: clean
|
||||
# Install pre-commit hooks
|
||||
.PHONY: install-hooks
|
||||
install-hooks: devenv
|
||||
pre-commit install -f --install-hooks
|
||||
poetry run pre-commit install -f --install-hooks
|
||||
|
||||
# Generates test coverage
|
||||
.coverage:
|
||||
|
@ -17,9 +17,9 @@
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
project = 'unhacs'
|
||||
copyright = '2021, iamthefij'
|
||||
author = 'iamthefij'
|
||||
project = "unhacs"
|
||||
copyright = "2021, iamthefij"
|
||||
author = "iamthefij"
|
||||
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
@ -27,11 +27,10 @@ author = 'iamthefij'
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
]
|
||||
extensions = []
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
templates_path = ["_templates"]
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
@ -44,9 +43,9 @@ exclude_patterns = []
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
html_theme = 'alabaster'
|
||||
html_theme = "alabaster"
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
html_static_path = ["_static"]
|
||||
|
@ -22,3 +22,7 @@ types-requests = "^2.32.0.20240602"
|
||||
|
||||
[tool.poetry.scripts]
|
||||
unhacs = 'unhacs.main:main'
|
||||
|
||||
[tool.isort]
|
||||
force_single_line = true
|
||||
profile = "black"
|
||||
|
@ -13,7 +13,6 @@ from unhacs.packages import Package
|
||||
from unhacs.packages import read_packages
|
||||
from unhacs.packages import write_packages
|
||||
|
||||
|
||||
DEFAULT_HASS_CONFIG_PATH = Path(".")
|
||||
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
DEFAULT_PACKAGE_FILE = "unhacs.txt"
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user