diff --git a/.drone.star b/.drone.star index e7fd7b7..87f8215 100644 --- a/.drone.star +++ b/.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"], }, diff --git a/Makefile b/Makefile index a16dbb7..c560611 100644 --- a/Makefile +++ b/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: diff --git a/docs/source/conf.py b/docs/source/conf.py index 5e84925..98117c3 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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'] \ No newline at end of file +html_static_path = ["_static"] diff --git a/pyproject.toml b/pyproject.toml index 8a52e20..377683d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/unhacs/main.py b/unhacs/main.py index a78905f..ab8c799 100644 --- a/unhacs/main.py +++ b/unhacs/main.py @@ -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(".") diff --git a/unhacs/packages.py b/unhacs/packages.py index 56ee27a..25ac26b 100644 --- a/unhacs/packages.py +++ b/unhacs/packages.py @@ -1,7 +1,6 @@ from dataclasses import dataclass from pathlib import Path - DEFAULT_PACKAGE_FILE = "unhacs.txt"