Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: '[BUG] '
labels: bug
assignees: ''
---

## Describe the bug
A clear and concise description of what the bug is.

## To Reproduce
Steps to reproduce the behavior:
1. Run command '...'
2. With configuration '...'
3. See error

## Expected behavior
A clear and concise description of what you expected to happen.

## Error Output
```
Paste any error messages or logs here
```

## Environment
- OS: [e.g., Ubuntu 22.04]
- Python version: [e.g., 3.10.5]
- PyMultiChange version: [e.g., 1.0.0]

## Additional context
Add any other context about the problem here.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: '[FEATURE] '
labels: enhancement
assignees: ''
---

## Is your feature request related to a problem?
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.
37 changes: 37 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## Description

<!-- Provide a brief description of the changes in this PR -->

## Type of Change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement

## Testing

<!-- Describe the tests you ran to verify your changes -->

- [ ] All existing tests pass
- [ ] Added new tests for new functionality
- [ ] Manual testing performed

## Checklist

- [ ] My code follows the project's style guidelines
- [ ] I have run `ruff check` and fixed any issues
- [ ] I have run `pylint` and addressed warnings
- [ ] I have run `mypy` and fixed type errors
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally with `pytest`
- [ ] I have updated the documentation (if applicable)
- [ ] My changes generate no new warnings

## Related Issues

<!-- Link any related issues here using #issue_number -->

Closes #
144 changes: 144 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
name: CI

on:
push:
branches: [main, master, develop]
pull_request:
branches: [main, master, develop]
workflow_dispatch:

jobs:
lint:
name: Lint and Type Check
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install system dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y libsnmp-dev libffi-dev snmp-mibs-downloader

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
virtualenvs-create: true
virtualenvs-in-project: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Install project
run: poetry install --no-interaction

- name: Run Ruff
run: poetry run ruff check .

- name: Run Pylint
run: poetry run pylint pymultichange --fail-under=8.0
continue-on-error: true

- name: Run MyPy
run: poetry run mypy pymultichange
continue-on-error: true

test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install system dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y libsnmp-dev libffi-dev snmp-mibs-downloader

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
virtualenvs-create: true
virtualenvs-in-project: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Install project
run: poetry install --no-interaction

- name: Run tests
run: poetry run pytest

- name: Upload coverage reports
uses: codecov/codecov-action@v4
if: matrix.python-version == '3.12'
with:
file: ./htmlcov/index.html
fail_ci_if_error: false

build:
name: Build Package
runs-on: ubuntu-latest
needs: [lint, test]

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install system dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y libsnmp-dev libffi-dev snmp-mibs-downloader

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest

- name: Build package
run: poetry build

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
82 changes: 76 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,78 @@
*.pyc
build/*
dist/*
*.egg-info
*-old.py*
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
*.manifest
*.spec

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.log
.pytest_cache/

# Poetry
poetry.lock

# Virtual environments
env/
venv/
ENV/
env.bak/
venv.bak/
.venv/

# IDEs
.vscode/
.idea/
*.swp
*.swo
*~

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# Ruff
.ruff_cache/

# Project specific
commands*
hosts*
env/*
failure.log
*-old.py*
46 changes: 46 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[MASTER]
ignore=CVS,.git,__pycache__,.venv,venv
ignore-patterns=test_.*?py
jobs=0
persistent=yes
unsafe-load-any-extension=no

[MESSAGES CONTROL]
disable=
C0111, # missing-docstring
C0103, # invalid-name
R0913, # too-many-arguments
R0801, # duplicate-code
W0511, # fixme

[REPORTS]
output-format=colorized
reports=no
score=yes

[REFACTORING]
max-nested-blocks=5

[BASIC]
good-names=i,j,k,ex,Run,_,f,e

[FORMAT]
max-line-length=100
indent-string=' '

[DESIGN]
max-args=10
max-attributes=10
max-branches=15
max-locals=20
max-parents=7
max-public-methods=20
max-returns=6
max-statements=50
min-public-methods=0

[IMPORTS]
allow-wildcard-with-all=no

[EXCEPTIONS]
overgeneral-exceptions=builtins.Exception
Loading