Skip to content

Commit 35bbbbf

Browse files
committed
Add base project struct
0 parents  commit 35bbbbf

File tree

9 files changed

+372
-0
lines changed

9 files changed

+372
-0
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
prek:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v5
10+
- name: Set up Python
11+
uses: actions/setup-python@v5
12+
with:
13+
python-version: "3.13"
14+
- name: Install dependencies
15+
run: |
16+
python -m pip install --upgrade pip
17+
pip install prek
18+
- name: Run prek
19+
run: |
20+
prek
21+
22+
pytest:
23+
runs-on: ubuntu-latest
24+
strategy:
25+
matrix:
26+
python-version: ["3.13", "3.14"]
27+
steps:
28+
- uses: actions/checkout@v5
29+
- name: Set up Python ${{ matrix.python-version }}
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
- name: Install dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install -r requirements-dev.txt
37+
- name: Test with pytest
38+
run: |
39+
pytest --log-cli-level=debug
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish releases to PyPI
2+
3+
on:
4+
release:
5+
types: [published, prereleased]
6+
7+
jobs:
8+
build-and-publish:
9+
name: Builds and publishes releases to PyPI
10+
environment: pypi
11+
permissions:
12+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v6.0.2
16+
- name: Set up Python
17+
uses: actions/setup-python@v6.2.0
18+
with:
19+
python-version: "3.13"
20+
- name: Install build
21+
run: |-
22+
pip install build
23+
- name: Build
24+
run: |-
25+
python -m build
26+
- name: Publish release to PyPI
27+
uses: pypa/gh-action-pypi-publish@v1.13.0

.gitignore

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[codz]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py.cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
# Pipfile.lock
96+
97+
# UV
98+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# uv.lock
102+
103+
# poetry
104+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105+
# This is especially recommended for binary packages to ensure reproducibility, and is more
106+
# commonly ignored for libraries.
107+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108+
# poetry.lock
109+
# poetry.toml
110+
111+
# pdm
112+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115+
# pdm.lock
116+
# pdm.toml
117+
.pdm-python
118+
.pdm-build/
119+
120+
# pixi
121+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122+
# pixi.lock
123+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124+
# in the .venv directory. It is recommended not to include this directory in version control.
125+
.pixi
126+
127+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128+
__pypackages__/
129+
130+
# Celery stuff
131+
celerybeat-schedule
132+
celerybeat.pid
133+
134+
# Redis
135+
*.rdb
136+
*.aof
137+
*.pid
138+
139+
# RabbitMQ
140+
mnesia/
141+
rabbitmq/
142+
rabbitmq-data/
143+
144+
# ActiveMQ
145+
activemq-data/
146+
147+
# SageMath parsed files
148+
*.sage.py
149+
150+
# Environments
151+
.env
152+
.envrc
153+
.venv
154+
env/
155+
venv/
156+
ENV/
157+
env.bak/
158+
venv.bak/
159+
.direnv/
160+
161+
# Spyder project settings
162+
.spyderproject
163+
.spyproject
164+
165+
# Rope project settings
166+
.ropeproject
167+
168+
# mkdocs documentation
169+
/site
170+
171+
# mypy
172+
.mypy_cache/
173+
.dmypy.json
174+
dmypy.json
175+
176+
# Pyre type checker
177+
.pyre/
178+
179+
# pytype static type analyzer
180+
.pytype/
181+
182+
# Cython debug symbols
183+
cython_debug/
184+
185+
# PyCharm
186+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
187+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
188+
# and can be added to the global gitignore or merged into this file. For a more nuclear
189+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
190+
# .idea/
191+
192+
# Abstra
193+
# Abstra is an AI-powered process automation framework.
194+
# Ignore directories containing user credentials, local state, and settings.
195+
# Learn more at https://abstra.io/docs
196+
.abstra/
197+
198+
# Visual Studio Code
199+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
200+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
201+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
202+
# you could uncomment the following to ignore the entire vscode folder
203+
# .vscode/
204+
205+
# Ruff stuff:
206+
.ruff_cache/
207+
208+
# PyPI configuration file
209+
.pypirc
210+
211+
# Marimo
212+
marimo/_static/
213+
marimo/_lsp/
214+
__marimo__/
215+
216+
# Streamlit
217+
.streamlit/secrets.toml

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.15.2
4+
hooks:
5+
- id: ruff
6+
args: [--fix]
7+
files: ^infrared_protocols/
8+
- id: ruff-format
9+
files: ^infrared_protocols/
10+
11+
- repo: https://github.com/DetachHead/basedpyright-prek-mirror
12+
rev: 1.38.1
13+
hooks:
14+
- id: basedpyright
15+
files: ^infrared_protocols/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Home Assistant Team
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Python Infrared Protocols for Home Assistant
2+
3+
Python package to decode and encode infrared signals for use in Home Assistant.

infrared_protocols/__init__.py

Whitespace-only changes.

pyproject.toml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[build-system]
2+
requires = ["setuptools>=78.1.1,<83.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "infrared-protocols"
7+
version = "1.0.0"
8+
license = {text = "MIT"}
9+
description = "Library to decode and encode infrared signals."
10+
readme = "README.md"
11+
classifiers = [
12+
"Programming Language :: Python :: 3",
13+
"Operating System :: OS Independent",
14+
]
15+
requires-python = ">=3.13.0"
16+
17+
[project.urls]
18+
"Homepage" = "https://github.com/home-assistant-libs/infrared-protocols"
19+
20+
[tool.setuptools]
21+
include-package-data = false
22+
23+
[tool.setuptools.packages.find]
24+
include = ["infrared_protocols*"]
25+
26+
[tool.ruff.lint]
27+
select = [
28+
# pycodestyle
29+
"E",
30+
# Pyflakes
31+
"F",
32+
# pyupgrade
33+
"UP",
34+
# flake8-bugbear
35+
"B",
36+
# isort
37+
"I",]
38+
39+
40+
[tool.ruff.lint.mccabe]
41+
max-complexity = 25
42+
43+
[tool.pyright]
44+
typeCheckingMode = "standard"
45+
46+
[project.optional-dependencies]
47+
dev = ["prek"]
48+

script/setup.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
pip install -e ".[dev]"

0 commit comments

Comments
 (0)