Skip to content
Open
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
6 changes: 1 addition & 5 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
# This is a basic workflow to help you get started with Actions

name: Documentation build

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "docs"
docs:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v5
Expand All @@ -29,4 +25,4 @@ jobs:
sudo apt-get install -y gcc libcups2-dev python3-dev python3-setuptools &&
sudo pip install --ignore-installed tox pycups
- name: Test doc build
run: tox -e docs
run: tox --conf pyproject.toml -e docs
10 changes: 3 additions & 7 deletions .github/workflows/pythonpackage-windows.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
name: Python package on Windows

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: windows-latest
strategy:
matrix:
python-version: ['3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v5
with:
Expand All @@ -25,7 +21,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest tox tox-gh-actions
pip install flake8 pytest tox tox-gh
If (Test-Path .\requirements.txt) { pip install -r .\requirements.txt }
- name: Lint with flake8
run: |
Expand All @@ -35,12 +31,12 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with tox
run: |
tox
tox --conf pyproject.toml
env:
ESCPOS_CAPABILITIES_FILE: D:\a\python-escpos\python-escpos\capabilities-data\dist\capabilities.json
- name: Test mypy with tox
run: |
tox -e mypy
tox --conf pyproject.toml -e mypy
env:
ESCPOS_CAPABILITIES_FILE: D:\a\python-escpos\python-escpos\capabilities-data\dist\capabilities.json
- name: Upload coverage to Codecov
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v5
Expand All @@ -30,7 +26,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y graphviz libenchant-2-2 gcc libcups2-dev python3-dev xindy
python -m pip install --upgrade pip
pip install flake8 pytest tox tox-gh-actions
pip install flake8 pytest tox tox-gh
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Check sorting of imports
uses: isort/isort-action@master
Expand All @@ -45,12 +41,12 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with tox
run: |
tox
tox --conf pyproject.toml
env:
ESCPOS_CAPABILITIES_FILE: /home/runner/work/python-escpos/python-escpos/capabilities-data/dist/capabilities.json
- name: Test mypy with tox
run: |
tox -e mypy
tox --conf pyproject.toml -e mypy
env:
ESCPOS_CAPABILITIES_FILE: /home/runner/work/python-escpos/python-escpos/capabilities-data/dist/capabilities.json
- name: Upload coverage to Codecov
Expand Down
2 changes: 1 addition & 1 deletion examples/software_columns.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Example for software_columns: Print text arranged into columns."""
"""Example for software_columns: Print text arranged into columns."""

from escpos import printer

Expand Down
130 changes: 115 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,127 @@
[tool.black]
extend-exclude = 'capabilities-data'


[tool.isort]
profile = "black"


[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--doctest-modules --cov escpos --cov-report=xml"
testpaths = [
"test",
"src",
"src/escpos",
"escpos",
]
testpaths = ["test", "src", "src/escpos", "escpos"]


[[tool.mypy.overrides]]
module = ["pytest",
"jaconv",
"scripttest",
"barcode.*",
"qrcode",
"usb.*",
"cups",
"win32print"
]
module = [
"pytest",
"jaconv",
"scripttest",
"barcode.*",
"qrcode",
"usb.*",
"cups",
"win32print",
]
ignore_missing_imports = true


[tool.tox]
requires = ["tox>=4.11"]
envlist = ["3.9", "3.10", "3.11", "3.12", "3.13", "docs", "flake8", "mypy"]


[tool.tox.gh.python]
"3.13" = ["3.13"]
"3.12" = ["3.12"]
"3.11" = ["3.11"]
"3.10" = ["3.10"]
"3.9" = ["3.9"]


[tool.tox.env_run_base]
deps = [
"jaconv",
"coverage",
"scripttest",
"mock",
"pytest>=7.4",
"pytest-cov",
"pytest-mock",
"hypothesis>=6.83",
"python-barcode>=0.15.0,<1",
]
extras = ["all"]
commands = [["pytest"]]
passenv = [
"ESCPOS_CAPABILITIES_PICKLE_DIR",
"ESCPOS_CAPABILITIES_FILE",
"CI",
"TRAVIS",
"TRAVIS_*",
"APPVEYOR",
"APPVEYOR_*",
"CODECOV_*",
]
setenv = { PY_IGNORE_IMPORTMISMATCH = "1" }


[tool.tox.env.docs]
base_python = ["python"]
changedir = "doc"
deps = [
"sphinx>=7.2.3",
"setuptools_scm",
"python-barcode>=0.15.0,<1",
"sphinx-argparse",
"sphinxcontrib-spelling>=8.0.0",
"sphinxcontrib.datatemplates",
"sphinx-autodoc-typehints",
"sphinx_rtd_theme",
"pycups",
]
commands = [
[
"sphinx-build",
"-W",
"-b",
"html",
"-d",
"{envtmpdir}/doctrees",
".",
"{envtmpdir}/html",
],
[
"sphinx-build",
"-W",
"-b",
"spelling",
"-d",
"{envtmpdir}/doctrees",
".",
"{envtmpdir}/spelling",
],
]


[tool.tox.env.flake8]
base_python = ["python"]
deps = ["flake8", "flake8-docstrings"]
commands = [["flake8"]]


[tool.tox.env.mypy]
base_python = ["python"]
deps = [
"mypy",
"types-six",
"types-mock",
"types-PyYAML",
"types-Pillow",
"types-pyserial",
"types-pywin32>=306.0.0.6",
"types-flask",
"hypothesis>=6.83",
"jaconv",
]
commands = [["mypy", "src", "test", "examples"]]
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ all =
[flake8]
exclude = .git,.venv,.tox,.github,.eggs,__pycache__,doc/conf.py,build,dist,capabilities-data,test,src/escpos/constants.py
max-line-length = 120
extend-ignore = E203, W503
extend-ignore = E203, W503, D401
64 changes: 0 additions & 64 deletions tox.ini

This file was deleted.

Loading