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
17 changes: 15 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ env:
PIP_DISABLE_PIP_VERSION_CHECK: "1" # Reduce noise in logs

jobs:
pre-commit:
env:
SKIP: pytest,pytype,tox,no-commit-to-branch
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: 3.11
- uses: pre-commit/[email protected]
- uses: pre-commit-ci/[email protected]
if: always()

test:
strategy:
# See: https://github.com/xenserver/python-libs/pull/26#discussion_r1179482169
Expand All @@ -43,13 +56,13 @@ jobs:
env:
PYTHON_VERSION_USED_FOR_COVERAGE: ${{ '3.11' }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0 # Needed by diff-cover to get the changed lines: origin/master..HEAD
- name: Set up Python ${{ matrix.python-version }}
# Python 3.11 is not supported in the nektos/act container, so we skip this step
if: ${{ !(matrix.python-version == '3.11' && github.actor == 'nektos/act') }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ repos:
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: docs/source/index.rst
- id: check-yaml
- id: check-added-large-files
args: ['--maxkb=50']
Expand Down
22 changes: 6 additions & 16 deletions README-Unicode.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,9 @@ To fix these issues, `xcp.compat`, provides a wrapper for `open()`.
It adds `encoding="utf-8", errors="replace"`
to enable UTF-8 conversion and handle encoding errors:

```py
# xcp/utf8mode.py
if sys.version_info >= (3, 0):
def utf8open(*args, **kwargs):
if len(args) > 1 and "b" in args[1]:
return open(*args, **kwargs)
return open(*args, encoding="utf-8", errors="replace", **kwargs)
else:
utf8open = open
# xcp/{cmd,pci,environ?,logger?}.py tests/test_{pci,biodevname?,...?}.py
+ from .utf8mode import utf8open
...
- open(filename)
+ utf8open(filename)
```

```py
def utf8open(*args, **kwargs):
if len(args) > 1 and "b" in args[1]:
return open(*args, **kwargs)
return open(*args, encoding="utf-8", errors="replace", **kwargs)
```
2 changes: 1 addition & 1 deletion docs/source/include-toplevel-CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
```{include} ../../CONTRIBUTING.md
:parser: myst
:parser: myst
2 changes: 1 addition & 1 deletion docs/source/include-toplevel-DOCUMENTING.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
```{include} ../../DOCUMENTING.md
:parser: myst
:parser: myst
2 changes: 1 addition & 1 deletion docs/source/include-toplevel-README-Unicode.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
```{include} ../../README-Unicode.md
:parser: myst
:parser: myst
2 changes: 1 addition & 1 deletion docs/source/include-toplevel-README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
```{include} ../../README.md
:parser: myst
:parser: myst
134 changes: 0 additions & 134 deletions stubs/pytest_httpserver.pyi

This file was deleted.

Loading