Skip to content

Commit 91b5c27

Browse files
authored
Remove pillow as a dependency (#1891)
1 parent 196194a commit 91b5c27

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ repos:
2828
additional_dependencies:
2929
- tomli; python_version<'3.11'
3030
- repo: https://github.com/astral-sh/ruff-pre-commit
31-
rev: "v0.6.2"
31+
rev: "v0.6.3"
3232
hooks:
3333
- id: ruff
3434
args: [--fix, --exit-non-zero-on-fix]

constraints.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ backports-tarfile==1.2.0
1414
# via jaraco-context
1515
beautifulsoup4==4.12.3
1616
# via furo
17-
certifi==2024.7.4
17+
certifi==2024.8.30
1818
# via requests
1919
cffi==1.17.0
2020
# via cryptography
@@ -106,8 +106,6 @@ parso==0.8.4
106106
# via jedi
107107
pexpect==4.9.0
108108
# via ipython
109-
pillow==10.4.0
110-
# via jira (pyproject.toml)
111109
pluggy==1.5.0
112110
# via pytest
113111
prompt-toolkit==3.0.47
@@ -232,5 +230,5 @@ wheel==0.44.0
232230
# via jira (pyproject.toml)
233231
yanc==0.3.3
234232
# via jira (pyproject.toml)
235-
zipp==3.20.0
233+
zipp==3.20.1
236234
# via importlib-metadata

jira/client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import os
1919
import re
2020
import sys
21+
import tempfile
2122
import time
2223
import urllib
2324
import warnings
@@ -40,7 +41,6 @@
4041

4142
import requests
4243
from packaging.version import parse as parse_version
43-
from PIL import Image
4444
from requests import Response
4545
from requests.auth import AuthBase
4646
from requests.structures import CaseInsensitiveDict
@@ -4422,7 +4422,10 @@ def _get_mime_type(self, buff: bytes) -> str | None:
44224422
if self._magic is not None:
44234423
return self._magic.id_buffer(buff)
44244424
try:
4425-
return mimetypes.guess_type("f." + Image.open(buff).format)[0]
4425+
with tempfile.TemporaryFile() as f:
4426+
f.write(buff)
4427+
return mimetypes.guess_type(f.name)[0]
4428+
return mimetypes.guess_type(f.name)[0]
44264429
except (OSError, TypeError):
44274430
self.log.warning(
44284431
"Couldn't detect content type of avatar image"

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ keywords = ["api", "atlassian", "jira", "rest", "web"]
2626
dependencies = [
2727
"defusedxml",
2828
"packaging",
29-
"Pillow>=2.1.0",
3029
"requests-oauthlib>=1.1.0",
3130
"requests>=2.10.0",
3231
"requests_toolbelt",

0 commit comments

Comments
 (0)