custom_components.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. """Constants for the custom components."""
  2. from __future__ import annotations
  3. from pathlib import Path
  4. from types import SimpleNamespace
  5. class CustomComponents(SimpleNamespace):
  6. """Constants for the custom components."""
  7. # The name of the custom components source directory.
  8. SRC_DIR = Path("custom_components")
  9. # The name of the custom components pyproject.toml file.
  10. PYPROJECT_TOML = Path("pyproject.toml")
  11. # The name of the custom components package README file.
  12. PACKAGE_README = Path("README.md")
  13. # The name of the custom components package .gitignore file.
  14. PACKAGE_GITIGNORE = ".gitignore"
  15. # The name of the distribution directory as result of a build.
  16. DIST_DIR = "dist"
  17. # The name of the init file.
  18. INIT_FILE = "__init__.py"
  19. # Suffixes for the distribution files.
  20. DISTRIBUTION_FILE_SUFFIXES = [".tar.gz", ".whl"]
  21. # The name to the URL of python package repositories.
  22. REPO_URLS = {
  23. # Note: the trailing slash is required for below URLs.
  24. "pypi": "https://upload.pypi.org/legacy/",
  25. "testpypi": "https://test.pypi.org/legacy/",
  26. }
  27. # The .gitignore file for the custom component project.
  28. FILE = Path(".gitignore")
  29. # Files to gitignore.
  30. DEFAULTS = {"__pycache__/", "*.py[cod]", "*.egg-info/", "dist/"}