Skip to content

Commit

Permalink
flex requirements to allow newer versions, reqs. adjustments for pyth…
Browse files Browse the repository at this point in the history
…onista on iOS
  • Loading branch information
victordomingos committed Apr 17, 2022
1 parent dcc5397 commit 266486f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion optimize_images/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '1.5.0'
__version__ = '1.5.1'
from optimize_images.api import optimize_as_batch
2 changes: 1 addition & 1 deletion optimize_images/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
show_final_report,
show_img_exception,
human)
from optimize_images.watch import watch_for_new_files

def count_gen(gen):
l = list(gen)
Expand Down Expand Up @@ -92,6 +91,7 @@ def optimize_batch(src_path, watch_dir, recursive, quality, remove_transparency,
conv_big, force_del, bg_color, grayscale,
ignore_size_comparison, fast_mode, output_config)

from optimize_images.watch import watch_for_new_files
watch_for_new_files(watch_task)
return

Expand Down
6 changes: 3 additions & 3 deletions requirements_for_desktop.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Pillow==8.2.0
piexif==1.1.3
watchdog==2.1.2
Pillow>=8.2.0
piexif>=1.1.3
watchdog>=2.1.2
20 changes: 15 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# encoding: utf-8
import os
import platform
import sys

from setuptools import setup, find_packages
Expand Down Expand Up @@ -27,6 +28,17 @@ def read_readme(file_name):
with open(os.path.join(os.path.dirname(__file__), file_name)) as f:
return f.read()

def get_requirements():
install_requirements=['piexif>=1.1.3']
device = platform.machine()

if device.startswith('iPad') or device.startswith('iPhone'):
return install_requirements

install_requirements.append('Pillow>=8.2.0')
install_requirements.append('watchdog>=2.1.2')
return install_requirements


setup(name='optimize-images',
version=__import__('optimize_images').__version__,
Expand Down Expand Up @@ -62,6 +74,8 @@ def read_readme(file_name):
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Topic :: Utilities',
'Topic :: Multimedia :: Graphics',
'Topic :: Multimedia :: Graphics :: Graphics Conversion',
Expand All @@ -71,11 +85,7 @@ def read_readme(file_name):
'image-compression image-optimization image-optimisation seo '
'seo-optimization website-performance cli recursive non-recursive',

install_requires=[
'piexif==1.1.3',
'Pillow==8.2.0',
'watchdog==2.1.2',
],
install_requires=get_requirements(),

entry_points={
'console_scripts': ['optimize-images = optimize_images.__main__:main']
Expand Down

0 comments on commit 266486f

Please sign in to comment.