-
Notifications
You must be signed in to change notification settings - Fork 0
Dh dev #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dh dev #3
Changes from all commits
7dcc735
295cf29
da22b59
b0b3b5d
8da3fda
09fc6fd
d9f2b5c
6b65cc9
7de0ad1
bdc190d
2f90c6d
a40b048
225b946
cba5c60
3979c94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| pull_request: | ||
| branches: [ main, develop ] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -e ".[dev]" | ||
|
|
||
| - name: Lint with flake8 | ||
| run: | | ||
| # Stop the build if there are Python syntax errors or undefined names | ||
| flake8 src/ --count --select=E9,F63,F7,F82 --show-source --statistics | ||
| # Exit-zero treats all errors as warnings | ||
| flake8 src/ --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics | ||
|
|
||
| - name: Type check with mypy | ||
| run: | | ||
| mypy src/ | ||
| continue-on-error: true | ||
|
|
||
| - name: Test with pytest | ||
| run: | | ||
| pytest --cov=unifi_client --cov-report=xml --cov-report=term | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v3 | ||
| with: | ||
| file: ./coverage.xml | ||
| flags: unittests | ||
| name: codecov-umbrella | ||
| fail_ci_if_error: false | ||
|
|
||
| build: | ||
| needs: test | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.11' | ||
|
|
||
| - name: Install build tools | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install build twine | ||
|
|
||
| - name: Build package | ||
| run: python -m build | ||
|
|
||
| - name: Check package | ||
| run: twine check dist/* | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -205,3 +205,5 @@ cython_debug/ | |
| marimo/_static/ | ||
| marimo/_lsp/ | ||
| __marimo__/ | ||
|
|
||
| .DS_Store | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| include README.md | ||
| include LICENSE | ||
| include pyproject.toml | ||
| recursive-include src *.py | ||
|
||
| recursive-include tests *.py | ||
| global-exclude __pycache__ | ||
| global-exclude *.py[co] | ||
| global-exclude .DS_Store | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| .PHONY: help install install-dev test coverage lint format type-check clean build publish-test publish | ||
|
|
||
| help: | ||
| @echo "Available commands:" | ||
| @echo " install - Install package" | ||
| @echo " install-dev - Install package with dev dependencies" | ||
| @echo " test - Run tests" | ||
| @echo " coverage - Run tests with coverage report" | ||
| @echo " lint - Run flake8 linter" | ||
| @echo " format - Format code with black" | ||
| @echo " type-check - Run mypy type checker" | ||
| @echo " clean - Remove build artifacts" | ||
| @echo " build - Build package" | ||
| @echo " publish-test - Publish to Test PyPI" | ||
| @echo " publish - Publish to PyPI" | ||
|
|
||
| install: | ||
| pip install -e . | ||
|
|
||
| install-dev: | ||
| pip install -e ".[dev]" | ||
|
|
||
| test: | ||
| pytest -v | ||
|
|
||
| coverage: | ||
| pytest --cov=unifi_client --cov-report=html --cov-report=term-missing | ||
|
|
||
| lint: | ||
| flake8 src/ tests/ | ||
|
|
||
| format: | ||
| black src/ tests/ | ||
|
|
||
| format-check: | ||
| black --check src/ tests/ | ||
|
|
||
| type-check: | ||
| mypy src/ | ||
|
|
||
| clean: | ||
| rm -rf build/ | ||
| rm -rf dist/ | ||
| rm -rf *.egg-info | ||
| rm -rf .pytest_cache/ | ||
| rm -rf .mypy_cache/ | ||
| rm -rf htmlcov/ | ||
| rm -rf .coverage | ||
| find . -type d -name __pycache__ -exec rm -rf {} + | ||
| find . -type f -name '*.pyc' -delete | ||
|
|
||
| build: clean | ||
| python -m build | ||
|
|
||
| publish-test: build | ||
| twine upload --repository testpypi dist/* | ||
|
|
||
| publish: build | ||
| twine upload dist/* | ||
|
|
||
| all: format lint type-check test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mypy type checking step is configured with 'continue-on-error: true', which means type checking failures won't fail the CI build. Given that the pyproject.toml configures mypy with strict type checking options (disallow_untyped_defs, disallow_incomplete_defs, etc.), and the decorator at line 154-162 of unifi.py may have type annotation issues, the CI might be silently passing despite type errors. Consider either fixing the type issues and removing 'continue-on-error: true', or documenting why type checking is allowed to fail.