Skip to content

Commit

Permalink
Merge branch 'develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ianare authored May 2, 2023
2 parents 8f1ba15 + 317ed87 commit 988ed96
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 31 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@ jobs:
static-check:
name: Run Static Analysis
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: "3.10"

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-dev-${{ hashFiles('setup.py') }}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
pytest:
name: Run Tests
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
timeout-minutes: 30
strategy:
matrix:
Expand All @@ -20,16 +20,17 @@ jobs:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-test-${{ hashFiles('setup.py') }}
Expand Down
11 changes: 2 additions & 9 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -364,13 +364,6 @@ max-line-length=120
# Maximum number of lines in a module.
max-module-lines=1000

# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,
dict-separator

# Allow the body of a class to be on the same line as the declaration if body
# contains single statement.
single-line-class-stmt=no
Expand Down Expand Up @@ -472,7 +465,7 @@ max-bool-expr=5
max-branches=10

# Maximum number of locals for function / method body.
max-locals=20
max-locals=25

# Maximum number of parents for a class (see R0901).
max-parents=7
Expand All @@ -484,7 +477,7 @@ max-public-methods=20
max-returns=10

# Maximum number of statements in function / method body.
max-statements=50
max-statements=60

# Minimum number of public methods for a class (see R0903).
min-public-methods=2
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Supported formats: TIFF, JPEG, PNG, Webp, HEIC
Compatibility
*************

EXIF.py is tested and officially supported on Python 3.5 to 3.10
EXIF.py is tested and officially supported on Python 3.5 to 3.11

Starting with version ``3.0.0``, Python2 compatibility is dropped *completely* (syntax errors due to type hinting).

Expand Down
7 changes: 5 additions & 2 deletions exifread/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,14 +496,17 @@ def decode_maker_note(self) -> None:
self.dump_ifd(0, 'MakerNote', tag_dict=makernote.apple.TAGS)
self.offset = offset
return

if make == 'DJI':
endian = self.endian
self.endian = 'I'
offset = self.offset
self.offset += note.field_offset
self.dump_ifd(0, 'MakerNote', tag_dict=makernote.dji.TAGS)
self.offset = offset
self.endian = endian
return

# Canon
if make == 'Canon':
self.dump_ifd(note.field_offset, 'MakerNote',
Expand Down
7 changes: 4 additions & 3 deletions exifread/jpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ def _get_base(base, data) -> int:
increment = _increment_base(data, base)
logger.debug(" Increment base by %s", increment)
base += increment
logger.debug(
" There is useful EXIF-like data here (quality, comment, copyright), " "but we have no parser for it."
)
logger.debug((
" There is useful EXIF-like data here (quality, comment, copyright), "
"but we have no parser for it."
))
else:
try:
increment = _increment_base(data, base)
Expand Down
1 change: 1 addition & 0 deletions exifread/tags/makernote/dji.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""

TAGS = {
0x01: ('Make', ),
0x03: ('SpeedX', ),
0x04: ('SpeedY', ),
0x05: ('SpeedZ', ),
Expand Down
4 changes: 2 additions & 2 deletions exifread/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ def get_gps_coords(tags: dict) -> tuple:
lat_ref_val = tags[lat_ref_tag_name].values
lat_coord_val = [c.decimal() for c in tags[lat_tag_name].values]

lng_coord = sum([c/60**i for i, c in enumerate(lng_coord_val)])
lng_coord = sum(c / 60**i for (i, c) in enumerate(lng_coord_val))
lng_coord *= (-1) ** (lng_ref_val == 'W')

lat_coord = sum([c/60**i for i, c in enumerate(lat_coord_val)])
lat_coord = sum(c / 60**i for (i, c) in enumerate(lat_coord_val))
lat_coord *= (-1) ** (lat_ref_val == 'S')

return (lat_coord, lng_coord)
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
readme_file = open("README.rst", "rt").read()

dev_requirements = [
"mypy==0.950",
"pylint==2.13.8",
"mypy==1.2.0",
"pylint==2.14.4",
]

setup(
Expand Down

0 comments on commit 988ed96

Please sign in to comment.