Skip to content
This repository was archived by the owner on Aug 10, 2022. It is now read-only.

Commit e710bb1

Browse files
authored
Merge pull request #4 from applitools/update-setuppy-to-run-on-old-version-of-setutools
Make setup.py compatible with old version of setuptools
2 parents dfd3403 + def86d1 commit e710bb1

File tree

3 files changed

+41
-18
lines changed

3 files changed

+41
-18
lines changed

eyes_core/setup.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import re
22
import codecs
3+
import sys
34
from os import path
45

56
from setuptools import setup, find_packages
@@ -23,6 +24,19 @@ def get_version(package_name):
2324
return version
2425

2526

27+
install_requires = [
28+
'attrs>=18',
29+
'Pillow>=5.0.0',
30+
'requests>=2.1.0',
31+
# uses for check if the mobile platform is used in the test
32+
'Appium-Python-Client>=0.31'
33+
]
34+
# using this way of defining instead of 'typing>=3.5.2; python_version<="3.4"'
35+
# for run on old version of setuptools without issues
36+
if sys.version_info < (3, 5):
37+
# typing module was added as builtin in Python 3.5
38+
install_requires.append('typing >= 3.5.2')
39+
2640
setup(
2741
name='eyes_core',
2842
version=get_version('core'),
@@ -46,12 +60,7 @@ def get_version(package_name):
4660
"Topic :: Software Development :: Testing"
4761
],
4862
keywords='applitools eyes eyes_core',
49-
install_requires=[
50-
'attrs>=18',
51-
'Pillow>=5.0.0',
52-
'requests>=2.1.0',
53-
'typing>=3.5.2; python_version<="3.4"',
54-
],
63+
install_requires=install_requires,
5564
package_data={
5665
'': ['README.rst', 'LICENSE'],
5766
'core': ['py.typed'],

eyes_images/setup.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import re
22
import codecs
3+
import sys
34
from os import path
45

56
from setuptools import setup, find_packages
@@ -23,6 +24,16 @@ def get_version(package_name):
2324
return version
2425

2526

27+
install_requires = [
28+
'eyes-core=={}'.format(get_version('images')),
29+
'Pillow>=5.0.0',
30+
]
31+
# using this way of defining instead of 'typing>=3.5.2; python_version<="3.4"'
32+
# for run on old version of setuptools without issues
33+
if sys.version_info < (3, 5):
34+
# typing module was added as builtin in Python 3.5
35+
install_requires.append('typing >= 3.5.2')
36+
2637
setup(
2738
name='eyes_images',
2839
version=get_version('images'),
@@ -46,11 +57,7 @@ def get_version(package_name):
4657
"Topic :: Software Development :: Testing"
4758
],
4859
keywords='applitools eyes eyes_images',
49-
install_requires=[
50-
'eyes-core=={}'.format(get_version('images')),
51-
'Pillow>=5.0.0',
52-
'typing>=3.5.2; python_version<="3.4"',
53-
],
60+
install_requires=install_requires,
5461
package_data={
5562
'': ['README.rst', 'LICENSE'],
5663
'core': ['py.typed'],

eyes_selenium/setup.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import re
22
import codecs
3+
import sys
34
from os import path
45

56
from setuptools import setup, find_packages
@@ -23,6 +24,18 @@ def get_version(package_name):
2324
return version
2425

2526

27+
install_requires = [
28+
'eyes-core=={}'.format(get_version('selenium')),
29+
'tinycss2>=0.6.1',
30+
'selenium>=2.53.0',
31+
'Pillow>=5.0.0',
32+
]
33+
# using this way of defining instead of 'typing>=3.5.2; python_version<="3.4"'
34+
# for run on old version of setuptools without issues
35+
if sys.version_info < (3, 5):
36+
# typing module was added as builtin in Python 3.5
37+
install_requires.append('typing >= 3.5.2')
38+
2639
setup(
2740
name='eyes_selenium',
2841
version=get_version('selenium'),
@@ -46,13 +59,7 @@ def get_version(package_name):
4659
"Topic :: Software Development :: Testing"
4760
],
4861
keywords='applitools eyes eyes_selenium',
49-
install_requires=[
50-
'eyes-core=={}'.format(get_version('selenium')),
51-
'tinycss2>=0.6.1',
52-
'selenium>=2.53.0',
53-
'Pillow>=5.0.0',
54-
'typing>=3.5.2; python_version<="3.4"',
55-
],
62+
install_requires=install_requires,
5663
package_data={
5764
'': ['README.rst', 'LICENSE'],
5865
'eyes_selenium': ['py.typed'],

0 commit comments

Comments
 (0)