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