Skip to content

Commit 01746b3

Browse files
Version 1.29 (#106)
- Changing to publishing to pypi with Python 3.9 - Fixing #105 fsspec/gcsfs throws an ValueError instead of a OSError (thanks to Markus) - Fixing github actions due to updates --------- Co-authored-by: Markus <[email protected]>
1 parent 763349e commit 01746b3

File tree

7 files changed

+27
-12
lines changed

7 files changed

+27
-12
lines changed

.github/workflows/pythonpublish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ on:
1010
jobs:
1111
deploy:
1212

13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-22.04
1414

1515
steps:
1616
- uses: actions/checkout@v4
1717
- name: Set up Python
1818
uses: actions/setup-python@v5
1919
with:
20-
python-version: '3.8'
20+
python-version: '3.9.22'
2121
- name: Install dependencies
2222
run: |
2323
python -m pip install --upgrade pip

.github/workflows/tests.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
os: [ubuntu-latest]
19-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
18+
os: [ubuntu-22.04]
19+
python-version: ["3.7.17", "3.8.18", "3.9.22", "3.10.17", "3.11.12", "3.12.10", "3.13.3"]
2020
include:
2121
- os: macos-latest
22-
python-version: '3.13'
22+
python-version: '3.13.3'
2323
- os: windows-latest
24-
python-version: '3.13'
24+
python-version: '3.13.3'
2525
runs-on: ${{ matrix.os }}
2626
steps:
2727
- uses: actions/checkout@v4
@@ -38,8 +38,12 @@ jobs:
3838
pip install -r requirements-test.txt
3939
pip install coveralls flake8 setuptools wheel twine
4040
41+
- name: Update coverage on newer Python versions
42+
if: ${{ matrix.python-version != '3.7.17' && matrix.python-version != '3.8.18' }}
43+
run: pip install coverage>=7.8.0 pytest-cov>=6.1.1
44+
4145
- name: Verify Code with Black
42-
if: ${{ matrix.python-version != '3.7' }}
46+
if: ${{ matrix.python-version != '3.7.17' }}
4347
run: |
4448
pip install black==24.4.2
4549
black --check puremagic test
@@ -57,6 +61,7 @@ jobs:
5761
coveralls || true
5862
5963
- name: Check distribution log description
64+
if: ${{ matrix.python-version == '3.9.22' }}
6065
shell: bash
6166
run: |
6267
python setup.py sdist bdist_wheel

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ A big thank you to everyone that has helped!
2424
- Nicholas Bollweg (bollwyvl)
2525
- Péter (peterekepeter)
2626
- mara004
27+
- Markus (tvads-markus)

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
Changelog
22
=========
33

4+
Version 1.29
5+
------------
6+
7+
- Changing to publishing to pypi with Python 3.9
8+
- Fixing #105 fsspec/gcsfs throws an ValueError instead of a OSError (thanks to Markus)
9+
- Fixing github actions due to updates
10+
411
Version 1.28
12+
------------
513

614
- Adding #99 New file support (thanks to Andy - NebularNerd)
715
- Fixing #100 FITS files no longer had mime type (thanks to ejeschke)

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2013-2024 Chris Griffith
3+
Copyright (c) 2013-2025 Chris Griffith
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
=========
12
puremagic
23
=========
34

@@ -180,7 +181,7 @@ https://cgit.freedesktop.org/xdg/shared-mime-info/
180181
License
181182
-------
182183

183-
MIT Licenced, see LICENSE, Copyright (c) 2013-2024 Chris Griffith
184+
MIT Licenced, see LICENSE, Copyright (c) 2013-2025 Chris Griffith
184185

185186
.. |CoverageStatus| image:: https://coveralls.io/repos/github/cdgriffith/puremagic/badge.svg?branch=develop
186187
:target: https://coveralls.io/github/cdgriffith/puremagic?branch=develop

puremagic/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
magic numbers. It is designed to be minimalistic and inherently cross platform
55
compatible, with no imports when used as a module.
66
7-
© 2013-2024 Chris Griffith - License: MIT (see LICENSE)
7+
© 2013-2025 Chris Griffith - License: MIT (see LICENSE)
88
99
Acknowledgements
1010
Gary C. Kessler
@@ -21,7 +21,7 @@
2121
from itertools import chain
2222

2323
__author__ = "Chris Griffith"
24-
__version__ = "1.28"
24+
__version__ = "1.29"
2525
__all__ = [
2626
"magic_file",
2727
"magic_string",
@@ -228,7 +228,7 @@ def _stream_details(stream):
228228
head = stream.read(max_head)
229229
try:
230230
stream.seek(-max_foot, os.SEEK_END)
231-
except OSError:
231+
except (OSError, ValueError): # fsspec throws ValueError
232232
# File is smaller than the max_foot size, jump to beginning
233233
stream.seek(0)
234234
foot = stream.read()

0 commit comments

Comments
 (0)