Skip to content

Commit 093fe21

Browse files
authored
Merge pull request #148 from marcelm/ci
Fix failing test on Windows with Python 3.11.9+
2 parents b7e3bc2 + bd95e6a commit 093fe21

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

.github/workflows/ci.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,13 @@ jobs:
4949
runs-on: ${{ matrix.os }}
5050
strategy:
5151
matrix:
52-
os: [ubuntu-latest]
52+
os: [ubuntu-latest, windows-latest]
5353
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
5454
include:
5555
- os: macos-13
5656
python-version: "3.10"
5757
- os: macos-14
5858
python-version: "3.10"
59-
- os: windows-latest
60-
python-version: "3.10"
61-
- os: ubuntu-latest
62-
python-version: "3.10"
6359
steps:
6460
- uses: actions/checkout@v4
6561
- name: Set up Python ${{ matrix.python-version }}

src/dnaio/singleend.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,13 @@ def _detect_format_from_content(file: BinaryIO) -> Optional[str]:
126126
"""
127127
Return 'fasta', 'fastq' or None
128128
"""
129-
if file.seekable():
129+
if hasattr(file, "peek"):
130+
magic = file.peek(4)[0:4]
131+
else:
132+
# We cannot always use peek() because BytesIO objects do not suppert it
130133
original_position = file.tell()
131134
magic = file.read(4)
132135
file.seek(original_position)
133-
else:
134-
# We cannot always use peek() because BytesIO objects do not suppert it
135-
magic = file.peek(4)[0:4] # type: ignore
136136
if magic.startswith(b"@") or magic == b"":
137137
# Pretend FASTQ for empty input
138138
return "fastq"

0 commit comments

Comments
 (0)