diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml new file mode 100644 index 0000000..a065039 --- /dev/null +++ b/.github/workflows/merge.yml @@ -0,0 +1,45 @@ +name: Latest release + +env: + CACHE_VERSION: 1 + DEFAULT_PYTHON: "3.13" + +# Only run on merges +on: + pull_request: + types: closed + branches: + - main + +jobs: + publishing: + name: Build and publish Python 🐍 distributions 📦 to PyPI + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + # Only trigger on merges, not just closes + if: github.event.pull_request.merged == true + steps: + - name: Check out committed code + uses: actions/checkout@v4 + - name: Set up Python ${{ env.DEFAULT_PYTHON }} + id: python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.DEFAULT_PYTHON }} + - name: Prepare poetry + run: | + pip install uv + uv venv --seed venv + . venv/bin/activate + uv pip install poetry + - name: Dependencies and build + run: | + . venv/bin/activate + poetry install --no-root + poetry build + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip-existing: true diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml new file mode 100644 index 0000000..27f303d --- /dev/null +++ b/.github/workflows/verify.yml @@ -0,0 +1,52 @@ +name: Latest commit + +env: + CACHE_VERSION: 1 + DEFAULT_PYTHON: "3.13" + PRE_COMMIT_HOME: ~/.cache/pre-commit + VENV: venv + +on: + schedule: + - cron: "2 4 * * 0" # weekly + workflow_dispatch: + push: +# pull_request: + +jobs: + # Check shellscripts + shellcheck: + name: Shellcheck + runs-on: ubuntu-latest + steps: + - name: Check out committed code + uses: actions/checkout@v4 + - name: Run ShellCheck + uses: ludeeus/action-shellcheck@master + + test-publishing: + name: Build and publish Python 🐍 distributions 📦 to TestPyPI + runs-on: ubuntu-latest + environment: testpypi + permissions: + id-token: write + steps: + - name: Check out committed code + uses: actions/checkout@v4 + - name: Prepare poetry + run: | + pip install uv + uv venv --seed venv + . venv/bin/activate + uv pip install poetry + - name: Dependencies and build + run: | + . venv/bin/activate + poetry install --no-root + poetry build + - name: Publish distribution 📦 to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + continue-on-error: true + with: + repository-url: https://test.pypi.org/legacy/ + skip-existing: true diff --git a/.gitignore b/.gitignore index eba1a63..94f98cd 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,9 @@ venv __pycache__ *.pyc .*.swp -/*.egg_info +/*.egg-info /build/ +dist tests/__pycache__ .mypy_cache .vscode diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..320406d --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,2 @@ +default: true +MD013: false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 95187d4..da4b4d0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,16 +40,16 @@ repos: - --quiet-level=2 exclude_types: [csv, json] exclude: ^userdata/|^fixtures/ - - repo: https://github.com/PyCQA/bandit - rev: 1.8.5 - hooks: - - id: bandit - name: "Bandit checking" - args: - - --quiet - - --format=custom - - --configfile=tests/bandit.yaml - files: ^(airos|tests)/.+\.py$ +# - repo: https://github.com/PyCQA/bandit +# rev: 1.8.5 +# hooks: +# - id: bandit +# name: "Bandit checking" +# args: +# - --quiet +# - --format=custom +# - --configfile=tests/bandit.yaml +# files: ^(airos|tests)/.+\.py$ - repo: https://github.com/adrienverge/yamllint.git rev: v1.37.1 hooks: diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..51e2cea --- /dev/null +++ b/.yamllint @@ -0,0 +1,61 @@ +ignore: | + .github* +rules: + braces: + level: error + min-spaces-inside: 0 + max-spaces-inside: 1 + min-spaces-inside-empty: -1 + max-spaces-inside-empty: -1 + brackets: + level: error + min-spaces-inside: 0 + max-spaces-inside: 0 + min-spaces-inside-empty: -1 + max-spaces-inside-empty: -1 + colons: + level: error + max-spaces-before: 0 + max-spaces-after: 1 + commas: + level: error + max-spaces-before: 0 + min-spaces-after: 1 + max-spaces-after: 1 + comments: + level: error + require-starting-space: true + min-spaces-from-content: 2 + comments-indentation: + level: error + document-end: + level: error + present: false + document-start: + level: error + present: false + empty-lines: + level: error + max: 1 + max-start: 0 + max-end: 1 + hyphens: + level: error + max-spaces-after: 1 + indentation: + level: error + spaces: 2 + indent-sequences: true + check-multi-line-strings: false + key-duplicates: + level: error + line-length: disable + new-line-at-end-of-file: + level: error + new-lines: + level: error + type: unix + trailing-spaces: + level: error + truthy: + level: error diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d44874a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 by @CoMPaTech + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..43cf59e --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Ubiquity airOS Module diff --git a/airos/__init__.py b/airos/__init__.py index ccfa2f7..516ca7a 100644 --- a/airos/__init__.py +++ b/airos/__init__.py @@ -1,3 +1 @@ """Ubiquity AirOS python module.""" - - diff --git a/pyproject.toml b/pyproject.toml index 3136b76..703aaa0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "airos" -version = "0.0.1" +version = "0.0.3a0" license = "MIT" description = "Ubiquity airOS module(s) for Python 3." readme = "README.md"