Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/master' into migrate/uv/examples
Resolve modify/delete conflicts in examples/docker-flask/ by keeping the
deletion: the example was migrated to examples/flask-example/ using uv and
a pyproject.toml/uv.lock, superseding the old Dockerfile and requirements.txt.
  • Loading branch information
hasansezertasan committed Jul 27, 2026
commit 93cbed939d21b616c0eb5fb3ff8e38b532e03361
4 changes: 2 additions & 2 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
black-code-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
- uses: psf/black@stable
with:
version: "23.12.0"
version: "26.5.1"

2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
with:
submodules: 'recursive'
- name: Install packages
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pythonpackage-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
matrix:
python-version: ['3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
with:
submodules: 'recursive'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6.2.0
uses: actions/setup-python@v7.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -40,7 +40,7 @@ jobs:
env:
ESCPOS_CAPABILITIES_FILE: D:\a\python-escpos\python-escpos\capabilities-data\dist\capabilities.json
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@v7
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
with:
submodules: 'recursive'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6.2.0
uses: actions/setup-python@v7.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
env:
ESCPOS_CAPABILITIES_FILE: /home/runner/work/python-escpos/python-escpos/capabilities-data/dist/capabilities.json
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@v7
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
Expand Down
10 changes: 5 additions & 5 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
pyusb
Pillow>=2.0
qrcode>=4.0
Pillow>=12.0
qrcode>=8.0
pyserial
sphinx-rtd-theme==3.1.0
setuptools
setuptools-scm
docutils>=0.12
sphinxcontrib-spelling>=8.0.0
python-barcode>=0.15.0,<1
docutils>=0.22
sphinxcontrib-spelling>=8.0.2
python-barcode>=0.16.0,<1
importlib-metadata
importlib_resources
sphinxcontrib.datatemplates
Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ ignore_missing_imports = true

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


[tool.tox.gh.python]
"3.14" = ["3.14"]
"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]
Expand All @@ -49,7 +49,7 @@ deps = [
"pytest-cov",
"pytest-mock",
"hypothesis>=6.83",
"python-barcode>=0.15.0,<1",
"python-barcode>=0.16.0,<1",
]
extras = ["all"]
commands = [["pytest"]]
Expand All @@ -72,9 +72,9 @@ changedir = "doc"
deps = [
"sphinx>=7.2.3",
"setuptools_scm",
"python-barcode>=0.15.0,<1",
"python-barcode>=0.16.0,<1",
"sphinx-argparse",
"sphinxcontrib-spelling>=8.0.0",
"sphinxcontrib-spelling>=8.0.2",
"sphinxcontrib.datatemplates",
"sphinx-autodoc-typehints",
"sphinx_rtd_theme",
Expand Down Expand Up @@ -107,7 +107,7 @@ commands = [
[tool.tox.env.flake8]
base_python = ["python"]
deps = ["flake8", "flake8-docstrings"]
commands = [["flake8"]]
commands = [["flake8", "--version"], ["flake8"]]


[tool.tox.env.mypy]
Expand Down
15 changes: 7 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ classifiers =
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Programming Language :: Python :: 3.14
Programming Language :: Python :: Implementation :: CPython
Topic :: Software Development :: Libraries :: Python Modules
Topic :: Office/Business :: Financial :: Point-Of-Sale
Expand All @@ -38,9 +37,9 @@ python_requires = >=3.8
zip_safe = false
include_package_data = true
install_requires =
Pillow>=2.0
qrcode>=4.0
python-barcode>=0.15.0,<1
Pillow>=12.0
qrcode>=8.0
python-barcode>=0.16.0,<1
setuptools
six
platformdirs
Expand All @@ -57,8 +56,8 @@ tests_require =
scripttest
mock
hypothesis>=6.83
flake8
sphinxcontrib-spelling>=8.0.0
flake8>7
sphinxcontrib-spelling>=8.0.2

[options.extras_require]
usb =
Expand All @@ -78,4 +77,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, D401
extend-ignore = E203, W503
1 change: 0 additions & 1 deletion src/escpos/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def load(self, config_path=None) -> None:
:param config_path: An optional file path, file handle, or byte string
for the configuration file.
"""

if not config_path:
config_path = os.path.join(
platformdirs.user_config_dir(self._app_name), self._config_file
Expand Down
10 changes: 4 additions & 6 deletions src/escpos/escpos.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def _read(self) -> bytes:
raise NotImplementedError()

def set_sleep_in_fragment(self, sleep_time_ms: int) -> None:
"""Configures the currently active sleep time after sending a fragment.
"""Configure the currently active sleep time after sending a fragment.

If during printing an image an issue like "USBTimeoutError: [Errno 110]
Operation timed out" occurs, setting this value to roughly 300
Expand Down Expand Up @@ -599,11 +599,9 @@ def barcode(
if (not capable["hw"] and not capable["sw"]) or (
not capable["sw"] and force_software
):
raise BarcodeTypeError(
f"""Profile {
self.profile.profile_data['name']
} - hw barcode: {capable['hw']}, sw barcode: {capable['sw']}"""
)
raise BarcodeTypeError(f"""Profile {
self.profile.profile_data['name']
} - hw barcode: {capable['hw']}, sw barcode: {capable['sw']}""")

bc_alnum = "".join([char for char in bc.upper() if char.isalnum()])
capable_bc = {
Expand Down
2 changes: 1 addition & 1 deletion src/escpos/magicencode.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def reset_encoding(self):
"""Invalidate cached encoding state after a printer-side code page reset.

Some printers silently reset their active code page after certain
commands (e.g. image rendering, font switches, hardware init).
commands (e.g. image rendering, font switches, hardware initialization).
Calling this method discards both the cached current encoding and the
set of previously-used encodings so that the next write() call
performs a fresh code page selection and re-emits CODEPAGE_CHANGE.
Expand Down
6 changes: 3 additions & 3 deletions src/escpos/printer/cups.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ def __init__(self, printer_name: str = "", *args, **kwargs) -> None:
self.job_name = ""
self.pending_job = False

self._device: Union[
Literal[False], Literal[None], Type[cups.Connection]
] = False
self._device: Union[Literal[False], Literal[None], Type[cups.Connection]] = (
False
)

@property
def printers(self) -> dict:
Expand Down
6 changes: 3 additions & 3 deletions src/escpos/printer/usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ def __init__(
if idProduct:
self.usb_args["idProduct"] = idProduct

self._device: Union[
Literal[False], Literal[None], Type[usb.core.Device]
] = False
self._device: Union[Literal[False], Literal[None], Type[usb.core.Device]] = (
False
)

@dependency_usb
def open(self, raise_not_found: bool = True) -> None:
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.