Skip to content

Commit fe1062f

Browse files
authored
Merge pull request #1 from CoMPaTech/pypi
Actions
2 parents 36c43be + 8632c04 commit fe1062f

File tree

10 files changed

+195
-14
lines changed

10 files changed

+195
-14
lines changed

.github/workflows/merge.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Latest release
2+
3+
env:
4+
CACHE_VERSION: 1
5+
DEFAULT_PYTHON: "3.13"
6+
7+
# Only run on merges
8+
on:
9+
pull_request:
10+
types: closed
11+
branches:
12+
- main
13+
14+
jobs:
15+
publishing:
16+
name: Build and publish Python 🐍 distributions 📦 to PyPI
17+
runs-on: ubuntu-latest
18+
environment: pypi
19+
permissions:
20+
id-token: write
21+
# Only trigger on merges, not just closes
22+
if: github.event.pull_request.merged == true
23+
steps:
24+
- name: Check out committed code
25+
uses: actions/checkout@v4
26+
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
27+
id: python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: ${{ env.DEFAULT_PYTHON }}
31+
- name: Prepare poetry
32+
run: |
33+
pip install uv
34+
uv venv --seed venv
35+
. venv/bin/activate
36+
uv pip install poetry
37+
- name: Dependencies and build
38+
run: |
39+
. venv/bin/activate
40+
poetry install --no-root
41+
poetry build
42+
- name: Publish distribution 📦 to PyPI
43+
uses: pypa/gh-action-pypi-publish@release/v1
44+
with:
45+
skip-existing: true

.github/workflows/verify.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Latest commit
2+
3+
env:
4+
CACHE_VERSION: 1
5+
DEFAULT_PYTHON: "3.13"
6+
PRE_COMMIT_HOME: ~/.cache/pre-commit
7+
VENV: venv
8+
9+
on:
10+
schedule:
11+
- cron: "2 4 * * 0" # weekly
12+
workflow_dispatch:
13+
push:
14+
# pull_request:
15+
16+
jobs:
17+
# Check shellscripts
18+
shellcheck:
19+
name: Shellcheck
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Check out committed code
23+
uses: actions/checkout@v4
24+
- name: Run ShellCheck
25+
uses: ludeeus/action-shellcheck@master
26+
27+
test-publishing:
28+
name: Build and publish Python 🐍 distributions 📦 to TestPyPI
29+
runs-on: ubuntu-latest
30+
environment: testpypi
31+
permissions:
32+
id-token: write
33+
steps:
34+
- name: Check out committed code
35+
uses: actions/checkout@v4
36+
- name: Prepare poetry
37+
run: |
38+
pip install uv
39+
uv venv --seed venv
40+
. venv/bin/activate
41+
uv pip install poetry
42+
- name: Dependencies and build
43+
run: |
44+
. venv/bin/activate
45+
poetry install --no-root
46+
poetry build
47+
- name: Publish distribution 📦 to Test PyPI
48+
uses: pypa/gh-action-pypi-publish@release/v1
49+
continue-on-error: true
50+
with:
51+
repository-url: https://test.pypi.org/legacy/
52+
skip-existing: true

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ venv
22
__pycache__
33
*.pyc
44
.*.swp
5-
/*.egg_info
5+
/*.egg-info
66
/build/
7+
dist
78
tests/__pycache__
89
.mypy_cache
910
.vscode

.markdownlint.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
default: true
2+
MD013: false

.pre-commit-config.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ repos:
4040
- --quiet-level=2
4141
exclude_types: [csv, json]
4242
exclude: ^userdata/|^fixtures/
43-
- repo: https://github.com/PyCQA/bandit
44-
rev: 1.8.5
45-
hooks:
46-
- id: bandit
47-
name: "Bandit checking"
48-
args:
49-
- --quiet
50-
- --format=custom
51-
- --configfile=tests/bandit.yaml
52-
files: ^(airos|tests)/.+\.py$
43+
# - repo: https://github.com/PyCQA/bandit
44+
# rev: 1.8.5
45+
# hooks:
46+
# - id: bandit
47+
# name: "Bandit checking"
48+
# args:
49+
# - --quiet
50+
# - --format=custom
51+
# - --configfile=tests/bandit.yaml
52+
# files: ^(airos|tests)/.+\.py$
5353
- repo: https://github.com/adrienverge/yamllint.git
5454
rev: v1.37.1
5555
hooks:

.yamllint

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
ignore: |
2+
.github*
3+
rules:
4+
braces:
5+
level: error
6+
min-spaces-inside: 0
7+
max-spaces-inside: 1
8+
min-spaces-inside-empty: -1
9+
max-spaces-inside-empty: -1
10+
brackets:
11+
level: error
12+
min-spaces-inside: 0
13+
max-spaces-inside: 0
14+
min-spaces-inside-empty: -1
15+
max-spaces-inside-empty: -1
16+
colons:
17+
level: error
18+
max-spaces-before: 0
19+
max-spaces-after: 1
20+
commas:
21+
level: error
22+
max-spaces-before: 0
23+
min-spaces-after: 1
24+
max-spaces-after: 1
25+
comments:
26+
level: error
27+
require-starting-space: true
28+
min-spaces-from-content: 2
29+
comments-indentation:
30+
level: error
31+
document-end:
32+
level: error
33+
present: false
34+
document-start:
35+
level: error
36+
present: false
37+
empty-lines:
38+
level: error
39+
max: 1
40+
max-start: 0
41+
max-end: 1
42+
hyphens:
43+
level: error
44+
max-spaces-after: 1
45+
indentation:
46+
level: error
47+
spaces: 2
48+
indent-sequences: true
49+
check-multi-line-strings: false
50+
key-duplicates:
51+
level: error
52+
line-length: disable
53+
new-line-at-end-of-file:
54+
level: error
55+
new-lines:
56+
level: error
57+
type: unix
58+
trailing-spaces:
59+
level: error
60+
truthy:
61+
level: error

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) 2020 by @CoMPaTech
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Ubiquity airOS Module

airos/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
"""Ubiquity AirOS python module."""
2-
3-

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "airos"
7-
version = "0.0.1"
7+
version = "0.0.3a0"
88
license = "MIT"
99
description = "Ubiquity airOS module(s) for Python 3."
1010
readme = "README.md"

0 commit comments

Comments
 (0)