Skip to content

Commit

Permalink
Merge pull request apache#2 from apache/python-sdk
Browse files Browse the repository at this point in the history
Syncing from original
  • Loading branch information
venbijjam authored Oct 14, 2016
2 parents 22698ec + 56ab1a4 commit e3d6095
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sdks/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ set up your machine's Python development environment.
#### Install ``pip``

`pip` is Python's package manager. If you already have `pip` installed
(type `pip -V` to check), skip this step.
(type `pip -V` to check), please make sure to have at least version 7.0.0.

There are several ways to install `pip`; use whichever works for you.

Expand Down
32 changes: 31 additions & 1 deletion sdks/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@

"""Apache Beam SDK for Python setup file."""

from distutils.version import StrictVersion

import os
import platform
import warnings

import setuptools

from pkg_resources import get_distribution, DistributionNotFound


def get_version():
global_names = {}
Expand All @@ -40,6 +46,30 @@ def get_version():
TBD
'''

REQUIRED_PIP_VERSION = '7.0.0'
_PIP_VERSION = get_distribution('pip').version
if StrictVersion(_PIP_VERSION) < StrictVersion(REQUIRED_PIP_VERSION):
warnings.warn(
"You are using version {0} of pip. " \
"However, version {1} is recommended.".format(
_PIP_VERSION, REQUIRED_PIP_VERSION
)
)


REQUIRED_CYTHON_VERSION = '0.23.2'
try:
_CYTHON_VERSION = get_distribution('cython').version
if StrictVersion(_CYTHON_VERSION) < StrictVersion(REQUIRED_CYTHON_VERSION):
warnings.warn(
"You are using version {0} of cython. " \
"However, version {1} is recommended.".format(
_CYTHON_VERSION, REQUIRED_CYTHON_VERSION
)
)
except DistributionNotFound:
# do nothing if Cython is not installed
pass

# Currently all compiled modules are optional (for performance only).
if platform.system() == 'Windows':
Expand All @@ -59,7 +89,7 @@ def get_version():
'google-apitools>=0.5.2',
'httplib2>=0.8',
'mock>=1.0.1',
'oauth2client>=2.0.1',
'oauth2client>=2.0.1,<4.0.0',
'protorpc>=0.9.1',
'python-gflags>=2.0',
'pyyaml>=3.10',
Expand Down

0 comments on commit e3d6095

Please sign in to comment.