Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
414d5d9
wip
ctalkington May 25, 2023
927cc25
wip
ctalkington May 25, 2023
11c85ac
Update tests.yaml
ctalkington May 25, 2023
fe7f54d
Update tests.yaml
ctalkington May 25, 2023
0ba04d1
Update typing.yaml
ctalkington May 25, 2023
cddb4f0
Update tests.yaml
ctalkington May 25, 2023
cd43024
Update serializer.py
ctalkington May 25, 2023
65f0982
Update tests.yaml
ctalkington May 25, 2023
320d63a
Update typing.yaml
ctalkington May 25, 2023
deba7a1
Update linting.yaml
ctalkington May 25, 2023
0993555
Update tests.yaml
ctalkington May 25, 2023
7b8e0ad
Update ruff.toml
ctalkington May 25, 2023
ef62529
Update pyproject.toml
ctalkington May 25, 2023
1a6f938
Update test_parser.py
ctalkington May 25, 2023
610eeab
Update __init__.py
ctalkington May 25, 2023
b43f9c1
Update test_parser.py
ctalkington May 25, 2023
f5ef0c3
work
ctalkington May 26, 2023
a773b7f
mypy
ctalkington May 26, 2023
3b460ed
ruff
ctalkington May 26, 2023
fa93f07
test
ctalkington May 26, 2023
f397410
codecov
ctalkington May 26, 2023
4870f01
Merge branch 'master' into ctalkington-patch-1
ctalkington May 26, 2023
193af6e
Merge branch 'master' into ctalkington-patch-1
ctalkington May 26, 2023
cdf9a4f
Merge branch 'master' into ctalkington-patch-1
ctalkington May 26, 2023
bfa6a42
Merge branch 'master' into ctalkington-patch-1
ctalkington May 26, 2023
431f033
Merge branch 'master' into ctalkington-patch-1
ctalkington May 26, 2023
0417c2d
restore codecov
ctalkington May 27, 2023
be97aed
codecov
ctalkington May 27, 2023
8854d83
Merge branch 'master' into ctalkington-patch-1
ctalkington May 27, 2023
8dcdd05
Delete create-job-attributes-request-000.bin
ctalkington May 27, 2023
d25ae46
Delete set-printer-attributes-request-000.bin
ctalkington May 27, 2023
491bc6e
Update test_serializer.py
ctalkington May 27, 2023
214de78
Update test_serializer.py
ctalkington May 27, 2023
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
58 changes: 58 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"containerEnv": {
"POETRY_VIRTUALENVS_IN_PROJECT": "true"
},
"customizations": {
"codespaces": {
"openFiles": ["README.md", "src/pyipp/ipp.py", "src/pyipp/models.py"]
},
"vscode": {
"extensions": [
"ms-python.python",
"redhat.vscode-yaml",
"esbenp.prettier-vscode",
"GitHub.vscode-pull-request-github",
"charliermarsh.ruff",
"GitHub.vscode-github-actions",
"ryanluker.vscode-coverage-gutters"
],
"settings": {
"[python]": {
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
}
},
"coverage-gutters.customizable.context-menu": true,
"coverage-gutters.customizable.status-bar-toggler-watchCoverageAndVisibleEditors-enabled": true,
"coverage-gutters.showGutterCoverage": false,
"coverage-gutters.showLineCoverage": true,
"coverage-gutters.xmlname": "coverage.xml",
"python.analysis.extraPaths": ["${workspaceFolder}/src"],
"python.defaultInterpreterPath": ".venv/bin/python",
"python.formatting.provider": "black",
"python.linting.enabled": true,
"python.linting.mypyEnabled": true,
"python.linting.pylintEnabled": true,
"python.testing.cwd": "${workspaceFolder}",
"python.testing.pytestArgs": ["--cov-report=xml"],
"python.testing.pytestEnabled": true,
"ruff.importStrategy": "fromEnvironment",
"ruff.interpreter": [".venv/bin/python"],
"terminal.integrated.defaultProfile.linux": "zsh"
}
}
},
"features": {
"ghcr.io/devcontainers-contrib/features/poetry:2": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/python:1": {
"installTools": false
}
},
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"name": "Async Python client for IPP",
"updateContentCommand": ". ${NVM_DIR}/nvm.sh && nvm install && nvm use && npm install && poetry install",
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder} && poetry run pre-commit install"
}
4 changes: 0 additions & 4 deletions .flake8

This file was deleted.

277 changes: 177 additions & 100 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,123 +9,200 @@ on:
pull_request:
workflow_dispatch:

env:
DEFAULT_PYTHON: "3.10"

jobs:
precommit:
name: ${{ matrix.name }}
codespell:
name: codespell
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.5.2
- name: Set up Poetry
run: pipx install poetry
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.6.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Install Python dependencies
run: poetry install --no-interaction
- name: Check code for common misspellings
run: poetry run pre-commit run codespell --all-files

ruff:
name: Ruff
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.5.2
- name: Set up Poetry
run: pipx install poetry
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.6.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Install Python dependencies
run: poetry install --no-interaction
- name: Run Ruff
run: poetry run ruff .

black:
name: black
runs-on: ubuntu-latest
strategy:
matrix:
include:
- id: bandit
name: Check with bandit
- id: black
name: Check code style
- id: blacken-docs
name: Check code style in documentation
- id: check-ast
name: Check Python AST
- id: check-case-conflict
name: Check for case conflicts
- id: check-docstring-first
name: Check docstring is first
- id: check-executables-have-shebangs
name: Check that executables have shebangs
- id: check-json
name: Check JSON files
- id: check-merge-conflict
name: Check for merge conflicts
- id: check-symlinks
name: Check for broken symlinks
- id: check-toml
name: Check TOML files
- id: check-yaml
name: Check YAML files
- id: codespell
name: Check code for common misspellings
- id: debug-statements
name: Debug Statements and imports (Python)
- id: detect-private-key
name: Detect Private Keys
- id: end-of-file-fixer
name: Check End of Files
- id: fix-byte-order-marker
name: Check UTF-8 byte order marker
- id: flake8
name: Enforcing style guide with flake8
- id: isort
name: Check imports are sorted
- id: poetry
name: Check pyproject file
- id: prettier
name: Check if code is prettier
- id: pylint
name: Check with pylint
- id: pyupgrade
name: Check for upgradable syntax
- id: trailing-whitespace
name: Trim Trailing Whitespace
- id: vulture
name: Check for unused Python code
- id: yamllint
name: Check YAML style
steps:
- name: Check out code from GitHub
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- name: Set up Python 3.9
uses: actions/checkout@v3.5.2
- name: Set up Poetry
run: pipx install poetry
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0 # v4
uses: actions/setup-python@v4.6.0
with:
python-version: 3.9
- name: Read .nvmrc
if: ${{ matrix.id == 'prettier' }}
id: nvm
run: echo "##[set-output name=nvmrc;]$(cat .nvmrc)"
- name: Set up Node.js ${{ steps.nvm.outputs.nvmrc }}
if: ${{ matrix.id == 'prettier' }}
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Install Python dependencies
run: poetry install --no-interaction
- name: Run black on docs
run: poetry run blacken-docs

pre-commit-hooks:
name: pre-commit-hooks
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.5.2
- name: Set up Poetry
run: pipx install poetry
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.6.0
with:
node-version: "${{ steps.nvm.outputs.nvmrc }}"
- name: Get pip cache dir
id: pip-cache
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: Install workflow dependencies
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Restore cached Python PIP packages
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Install Python dependencies
run: poetry install --no-interaction
- name: Check Python AST
run: poetry run pre-commit run check-ast --all-files
- name: Check for case conflicts
run: poetry run pre-commit run check-case-conflict --all-files
- name: Check docstring is first
run: poetry run pre-commit run check-docstring-first --all-files
- name: Check that executables have shebangs
run: poetry run pre-commit run check-executables-have-shebangs --all-files
- name: Check JSON files
run: poetry run pre-commit run check-json --all-files
- name: Check for merge conflicts
run: poetry run pre-commit run check-merge-conflict --all-files
- name: Check for broken symlinks
run: poetry run pre-commit run check-symlinks --all-files
- name: Check TOML files
run: poetry run pre-commit run check-toml --all-files
- name: Check XML files
run: poetry run pre-commit run check-xml --all-files
- name: Check YAML files
run: poetry run pre-commit run check-yaml --all-files
- name: Check YAML files
run: poetry run pre-commit run check-yaml --all-files
- name: Detect Private Keys
run: poetry run pre-commit run detect-private-key --all-files
- name: Check End of Files
run: poetry run pre-commit run end-of-file-fixer --all-files
- name: Trim Trailing Whitespace
run: poetry run pre-commit run trailing-whitespace --all-files

pylint:
name: pylint
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.5.2
- name: Set up Poetry
run: pipx install poetry
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.6.0
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip-${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('.github/workflows/requirements.txt') }}
restore-keys: |
pip-${{ runner.os }}-${{ steps.python.outputs.python-version }}-
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: Install workflow dependencies
run: |
pip install -r .github/workflows/requirements.txt
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Restore cached Python virtual environment
id: cached-poetry-dependencies
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
- name: Install Python dependencies
run: poetry install --no-interaction
- name: Run pylint
run: poetry run pre-commit run pylint --all-files

yamllint:
name: yamllint
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.5.2
- name: Set up Poetry
run: pipx install poetry
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.6.0
with:
path: .venv
key: >-
venv-${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
venv-${{ runner.os }}-${{ steps.python.outputs.python-version }}-
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Install Python dependencies
run: poetry install --no-interaction
- name: Get npm cache directory
if: ${{ matrix.id == 'prettier' }}
id: npm-cache
- name: Run yamllint
run: poetry run yamllint .

prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.5.2
- name: Set up Poetry
run: pipx install poetry
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.6.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: Install workflow dependencies
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Restore cached node modules
if: ${{ matrix.id == 'prettier' }}
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Install Python dependencies
run: poetry install --no-interaction
- name: Set up Node.js
uses: actions/setup-node@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: node-${{ runner.os }}-${{ steps.nvm.outputs.nvmrc }}-${{ hashFiles('.github/workflows/requirements.txt') }}
restore-keys: |
node-${{ runner.os }}-${{ steps.nvm.outputs.nvmrc }}-
node-version-file: ".nvmrc"
cache: "npm"
- name: Install NPM dependencies
if: ${{ matrix.id == 'prettier' }}
run: npm install
- name: Run pre-commit for ${{ matrix.id }}
run: poetry run pre-commit run ${{ matrix.id }} --all-files
- name: Run prettier
run: poetry run pre-commit run prettier --all-files
Loading