Skip to content

Commit

Permalink
Merge pull request #148 from marcelm/ci
Browse files Browse the repository at this point in the history
Fix failing test on Windows with Python 3.11.9+
  • Loading branch information
rhpvorderman authored Nov 12, 2024
2 parents b7e3bc2 + bd95e6a commit 093fe21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,13 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
include:
- os: macos-13
python-version: "3.10"
- os: macos-14
python-version: "3.10"
- os: windows-latest
python-version: "3.10"
- os: ubuntu-latest
python-version: "3.10"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
8 changes: 4 additions & 4 deletions src/dnaio/singleend.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ def _detect_format_from_content(file: BinaryIO) -> Optional[str]:
"""
Return 'fasta', 'fastq' or None
"""
if file.seekable():
if hasattr(file, "peek"):
magic = file.peek(4)[0:4]
else:
# We cannot always use peek() because BytesIO objects do not suppert it
original_position = file.tell()
magic = file.read(4)
file.seek(original_position)
else:
# We cannot always use peek() because BytesIO objects do not suppert it
magic = file.peek(4)[0:4] # type: ignore
if magic.startswith(b"@") or magic == b"":
# Pretend FASTQ for empty input
return "fastq"
Expand Down

0 comments on commit 093fe21

Please sign in to comment.