From a0a2608203dc1423bc158fcc47259a99d48f3dc4 Mon Sep 17 00:00:00 2001 From: Ivan Arar Date: Wed, 17 Mar 2021 11:46:06 +0100 Subject: [PATCH] version fetch fix --- .gitignore | 3 ++- google_images_search/__init__.py | 2 +- google_images_search/fetch_resize_save.py | 2 +- google_images_search/meta.py | 1 + setup.py | 11 ++++++++--- 5 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 google_images_search/meta.py diff --git a/.gitignore b/.gitignore index 5ec5dbf..6bcc82e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,9 @@ /Google_Images_Search.egg-info/ /build/ /dist/ -/google_images_search/ /tests/__pycache__/ /.DS_Store .venv /tests/test_my.py +/google_images_search/__pycache__/ +/dwnld/ diff --git a/google_images_search/__init__.py b/google_images_search/__init__.py index a2e2634..b89aa53 100644 --- a/google_images_search/__init__.py +++ b/google_images_search/__init__.py @@ -1,3 +1,3 @@ from google_images_search.fetch_resize_save import \ - FetchResizeSave as GoogleImagesSearch, __version__ + FetchResizeSave as GoogleImagesSearch from google_images_search.google_api import GoogleBackendException diff --git a/google_images_search/fetch_resize_save.py b/google_images_search/fetch_resize_save.py index 5b01d51..e04d6be 100644 --- a/google_images_search/fetch_resize_save.py +++ b/google_images_search/fetch_resize_save.py @@ -5,10 +5,10 @@ from PIL import Image, UnidentifiedImageError from resizeimage import resizeimage, imageexceptions +from .meta import __version__ from .google_api import GoogleCustomSearch -__version__ = "1.3.7" IMAGES_NUM_LIMIT = 10 diff --git a/google_images_search/meta.py b/google_images_search/meta.py new file mode 100644 index 0000000..3aca76e --- /dev/null +++ b/google_images_search/meta.py @@ -0,0 +1 @@ +__version__ = '1.3.7' diff --git a/setup.py b/setup.py index 4a09149..5554508 100644 --- a/setup.py +++ b/setup.py @@ -1,16 +1,21 @@ +import os from setuptools import setup -from google_images_search.fetch_resize_save import __version__ - def readme(): with open('README.md') as f: return f.read() +def version(): + with open(os.path.join('.', 'google_images_search', 'meta.py')) as f: + contents = f.read() + return contents.split('__version__ = ')[1].strip()[1:-1] + + setup( name='Google Images Search', - version=__version__, + version=version(), description='Search for image using Google Custom Search ' 'API and resize & crop the image afterwords',