first commit

This commit is contained in:
alexpolo1
2023-06-27 09:24:33 +02:00
commit 06486ba860
33 changed files with 2615 additions and 0 deletions

1
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1 @@
* @iMicknl

39
.github/ISSUE_TEMPLATE/bug.md vendored Normal file
View File

@@ -0,0 +1,39 @@
---
name: Bug report
about: "Create a bug report for a bug you found in the Python Sagemcom API"
---
## Versions
| Key | Value |
| ----------------- | ----- |
| Package version | |
| Python Version | |
| F@st Router Model | |
## Describe the bug
Give a clear and concise description of what the bug is.
## To Reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
## Expected behavior
Give a clear and concise description of what you expected to happen.
## Screenshots
If applicable, add screenshots to help explain your problem.
## Additional context
Add any other context about the problem here.
[bug]

View File

@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest a feature for the Python Sagemcom API
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
[enhancement]

View File

@@ -0,0 +1,39 @@
---
name: Unsupported F@st model
about: "Is your F@st model not supported by this package? Let's have a look if we can make the required changes."
---
## Model information
| Key | Value |
| ------------------------ | ----- |
| Model name | |
| Hardware Version | |
| Software Version | |
## Describe the bug
Give a clear and concise description of what the bug is.
## To Reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
## Expected behavior
Give a clear and concise description of what you expected to happen.
## Screenshots
If applicable, add screenshots to help explain your problem.
## Additional context
Add any other context about the problem here.
[bug]

15
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: "daily"
time: "08:00"
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: "daily"
time: "08:00"
open-pull-requests-limit: 10

5
.github/pr-labeler.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
feature: ['feature/*', 'feat/*']
enhancement: enhancement/*
bug: fix/*
breaking: breaking/*
documentation: doc/*

21
.github/release-drafter.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name-template: 'v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
exclude-labels:
- 'exclude-from-changelog'
categories:
- title: '⚠️ Breaking changes'
label: 'breaking'
- title: '🚀 Features'
label: 'feature'
- title: '✨ Enhancement'
label: 'enhancement'
- title: '📘 Documentation'
label: 'documentation'
- title: '🐛 Bug Fixes'
label: 'bug'
template: |
## What's changed
$CHANGES
## Contributors to this release
$CONTRIBUTORS

49
.github/workflows/main.yaml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: Linters
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
analyse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Set up Poetry
uses: Gr1N/setup-poetry@v7
- name: Cache venv
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ hashFiles('**/poetry.lock') }}
- name: Cache pre-commit
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit/
key: ${{ runner.os }}-pre-commit-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('**/.pre-commit-config.yaml') }} # yamllint disable-line
- name: Install dependencies
run: poetry install
- name: Register problems matchers
run: |
echo "::add-matcher::.github/workflows/matchers/pylint.json"
echo "::add-matcher::.github/workflows/matchers/flake8.json"
echo "::add-matcher::.github/workflows/matchers/mypy.json"
echo "::add-matcher::.github/workflows/matchers/python.json"
- name: Apply all pre-commit
run: poetry run pre-commit run -a

30
.github/workflows/matchers/flake8.json vendored Normal file
View File

@@ -0,0 +1,30 @@
{
"problemMatcher": [
{
"owner": "flake8-error",
"severity": "error",
"pattern": [
{
"regexp": "^(.*):(\\d+):(\\d+):\\s([EF]\\d{3}\\s.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
]
},
{
"owner": "flake8-warning",
"severity": "warning",
"pattern": [
{
"regexp": "^(.*):(\\d+):(\\d+):\\s([CDNW]\\d{3}\\s.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
]
}
]
}

16
.github/workflows/matchers/mypy.json vendored Normal file
View File

@@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "mypy",
"pattern": [
{
"regexp": "^(.+):(\\d+):\\s(error|warning):\\s(.+)$",
"file": 1,
"line": 2,
"severity": 3,
"message": 4
}
]
}
]
}

32
.github/workflows/matchers/pylint.json vendored Normal file
View File

@@ -0,0 +1,32 @@
{
"problemMatcher": [
{
"owner": "pylint-error",
"severity": "error",
"pattern": [
{
"regexp": "^(.+):(\\d+):(\\d+):\\s(([EF]\\d{4}):\\s.+)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4,
"code": 5
}
]
},
{
"owner": "pylint-warning",
"severity": "warning",
"pattern": [
{
"regexp": "^(.+):(\\d+):(\\d+):\\s(([CRW]\\d{4}):\\s.+)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4,
"code": 5
}
]
}
]
}

18
.github/workflows/matchers/python.json vendored Normal file
View File

@@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "python",
"pattern": [
{
"regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$",
"file": 1,
"line": 2
},
{
"regexp": "^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$",
"message": 2
}
]
}
]
}

12
.github/workflows/pr-labeler.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
name: PR Labeler
on:
pull_request:
types: [opened]
jobs:
pr-labeler:
runs-on: ubuntu-latest
steps:
- uses: TimonVS/pr-labeler-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

30
.github/workflows/publish-pypi-test.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
# yamllint disable-file
# This workflows will upload a Python Package
# using Poetry when a release is created
name: Publish Python Package (test)
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Set up Poetry
uses: Gr1N/setup-poetry@v7
- name: Build and publish to PyPi
env:
POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.TEST_PYPI_API_TOKEN }}
run: |
poetry config http-basic.testpypi ${{ secrets.TEST_PYPI_API_TOKEN }} ""
poetry build
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry publish -r testpypi

15
.github/workflows/release-drafter.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: Release Drafter
on:
push:
branches:
- master
jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- name: Update release draft
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

41
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
# This workflow will upload a Python Package using
# Poetry when a release is published
name: Publish Python Package (PyPi)
on:
release:
types: [published]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Set up Poetry
uses: Gr1N/setup-poetry@v7
- name: Bump Poetry version
run: |
tag=${{ github.event.release.tag_name }}
version_number=${tag#?}
poetry version $version_number
- name: Commit changes
uses: EndBug/add-and-commit@v4
with:
message: "Bump version to ${{ github.event.release.tag_name }}"
add: "pyproject.toml"
ref: "master"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish to PyPi
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
poetry build
poetry publish