Skip to content

Commit

Permalink
Merge pull request #187 from home-assistant/synesthesiam-20241231-pyp…
Browse files Browse the repository at this point in the history
…roject

Transition to pyproject.toml
  • Loading branch information
synesthesiam authored Dec 31, 2024
2 parents 364663b + d7a07e9 commit a498d88
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 88 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 2.1.0

- Upgrade to `unicode-rbnf` 2.2
- Transition to pyproject.toml

## 2.0.4

- Trie values are accumulated on `insert` instead of being overwritten
Expand Down
1 change: 0 additions & 1 deletion hassil/VERSION

This file was deleted.

19 changes: 2 additions & 17 deletions hassil/_resources.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
"""Shared access to package resources"""

import os
import typing
from pathlib import Path
import importlib.metadata

try:
import importlib.resources

files = importlib.resources.files # type: ignore
except (ImportError, AttributeError):
# Backport for Python < 3.9
import importlib_resources # type: ignore

files = importlib_resources.files

_PACKAGE = "hassil"
_DIR = Path(typing.cast(os.PathLike, files(_PACKAGE)))

__version__ = (_DIR / "VERSION").read_text(encoding="utf-8").strip()
__version__ = importlib.metadata.version("hassil")
3 changes: 1 addition & 2 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ ignore_missing_imports = True
[mypy-yaml.*]
ignore_missing_imports = True

[mypy-hassil.grammar.*]
[mypy-unicode_rbnf.*]
ignore_missing_imports = True
ignore_errors = True
46 changes: 46 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[build-system]
requires = ["setuptools>=62.3"]
build-backend = "setuptools.build_meta"

[project]
name = "hassil"
version = "2.1.0"
license = {text = "Apache-2.0"}
description = "The Home Assistant Intent Language parser"
readme = "README.md"
authors = [
{name = "The Home Assistant Authors", email = "[email protected]"}
]
keywords = ["home", "assistant", "intent", "recognition"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Topic :: Text Processing :: Linguistic",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
requires-python = ">=3.8.0"
dependencies = [
"PyYAML>=6.0,<7",
"unicode-rbnf>=2.2,<3"
]

[project.urls]
"Source Code" = "http://github.com/home-assistant/hassil"

[tool.setuptools]
platforms = ["any"]
zip-safe = true
include-package-data = true

[tool.setuptools.packages.find]
include = ["hassil"]
exclude = ["tests", "tests.*"]

[project.scripts]
hassil = "hassil.__main__:main"
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

1 change: 1 addition & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build>=1,<2
black==24.8.0
flake8==7.1.1
mypy==1.14.0
Expand Down
2 changes: 1 addition & 1 deletion script/package
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ _VENV_DIR = _PROGRAM_DIR / ".venv"

context = venv.EnvBuilder().ensure_directories(_VENV_DIR)
subprocess.check_call(
[context.env_exe, _PROGRAM_DIR / "setup.py", "sdist", "bdist_wheel"]
[context.env_exe, "-m", "build", "--sdist", "--wheel"]
)
64 changes: 0 additions & 64 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
env_list =
py{38,39,310,311,312}
py{38,39,310,311,312,313}
minversion = 4.12.1

[testenv]
Expand Down

0 comments on commit a498d88

Please sign in to comment.