Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions flink-ml-framework/python/flink_ml_framework/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

"""
The flink-ml-framework version follows the PEP440.
.. seealso:: https://www.python.org/dev/peps/pep-0440
"""
__version__ = "0.4.dev0"
31 changes: 24 additions & 7 deletions flink-ml-framework/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,34 @@
# =============================================================================

import os
import re
import sys
import sysconfig
import platform
import re
import subprocess
from shutil import copyfile, copymode
import sys
from distutils.version import LooseVersion

from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext

this_directory = os.path.abspath(os.path.dirname(__file__))
version_file = os.path.join(this_directory, 'flink_ml_framework/version.py')

try:
exec(open(version_file).read())
except IOError:
print("Failed to load flink_ml_framework version file for packaging. " +
"'%s' not found!" % version_file,
file=sys.stderr)
sys.exit(-1)
VERSION = __version__ # noqa


class CMakeExtension(Extension):
def __init__(self, name, sourcedir=''):
Extension.__init__(self, name, sources=[])
self.sourcedir = os.path.abspath(sourcedir)


class CMakeBuild(build_ext):
def run(self):
try:
Expand Down Expand Up @@ -60,7 +73,7 @@ def build_extension(self, ext):
cmake_args += ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(
cfg.upper(),
extdir)]
if sys.maxsize > 2**32:
if sys.maxsize > 2 ** 32:
cmake_args += ['-A', 'x64']
build_args += ['--', '/m']
else:
Expand All @@ -70,7 +83,8 @@ def build_extension(self, ext):
build_args += ['-lpthread']

env = os.environ.copy()
env['CXXFLAGS'] = '{} -D_GLIBCXX_USE_CXX11_ABI=0 -DVERSION_INFO=\\"{}\\"'.format(
env[
'CXXFLAGS'] = '{} -D_GLIBCXX_USE_CXX11_ABI=0 -DVERSION_INFO=\\"{}\\"'.format(
env.get('CXXFLAGS', ''),
self.distribution.get_version())
if not os.path.exists(self.build_temp):
Expand All @@ -80,12 +94,15 @@ def build_extension(self, ext):
subprocess.check_call(['cmake', '--build', '.'] + build_args,
cwd=self.build_temp)


setup(
name='flink_ml_framework',
version='0.4.0',
version=VERSION,
include_package_data=True,
packages=find_packages(),
ext_modules=[CMakeExtension('flink_ml_framework/flink_ml_framework')],
cmdclass=dict(build_ext=CMakeBuild),
zip_safe=False,
url='https://github.com/flink-extended/dl-on-flink',
license='https://www.apache.org/licenses/LICENSE-2.0'
)
24 changes: 24 additions & 0 deletions flink-ml-tensorflow-2.x/python/flink_ml_tensorflow/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

"""
The flink-ml-tensorflow-2.x version follows the PEP440.
.. seealso:: https://www.python.org/dev/peps/pep-0440
"""
__version__ = "0.4.dev0"
41 changes: 29 additions & 12 deletions flink-ml-tensorflow-2.x/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,34 @@
# =============================================================================

import os
import re
import sys
import sysconfig
import platform
import re
import subprocess
from shutil import copyfile, copymode
import sys
from distutils.version import LooseVersion

from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext

this_directory = os.path.abspath(os.path.dirname(__file__))
version_file = os.path.join(this_directory, 'flink_ml_tensorflow/version.py')

try:
exec(open(version_file).read())
except IOError:
print("Failed to load flink_ml_tensorflow version file for packaging. " +
"'%s' not found!" % version_file,
file=sys.stderr)
sys.exit(-1)
VERSION = __version__ # noqa


class CMakeExtension(Extension):
def __init__(self, name, sourcedir=''):
Extension.__init__(self, name, sources=[])
self.sourcedir = os.path.abspath(sourcedir)


class CMakeBuild(build_ext):
def run(self):
try:
Expand Down Expand Up @@ -60,7 +73,7 @@ def build_extension(self, ext):
cmake_args += ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(
cfg.upper(),
extdir)]
if sys.maxsize > 2**32:
if sys.maxsize > 2 ** 32:
cmake_args += ['-A', 'x64']
build_args += ['--', '/m']
else:
Expand All @@ -70,26 +83,30 @@ def build_extension(self, ext):
build_args += ['-lpthread']

env = os.environ.copy()
env['CXXFLAGS'] = '{} -D_GLIBCXX_USE_CXX11_ABI=0 -DVERSION_INFO=\\"{}\\"'.format(
env.get('CXXFLAGS', ''),
self.distribution.get_version())
env['CXXFLAGS'] = \
'{} -D_GLIBCXX_USE_CXX11_ABI=0 -DVERSION_INFO=\\"{}\\"'.format(
env.get('CXXFLAGS', ''),
self.distribution.get_version())
if not os.path.exists(self.build_temp):
os.makedirs(self.build_temp)
subprocess.check_call(['cmake', ext.sourcedir] + cmake_args,
cwd=self.build_temp, env=env)
subprocess.check_call(['cmake', '--build', '.'] + build_args,
cwd=self.build_temp)


setup(
name='flink_ml_tensorflow_2.x',
version='0.4.0',
version=VERSION,
include_package_data=True,
packages=find_packages(),
ext_modules=[CMakeExtension('flink_ml_tensorflow/flink_ml_tensorflow')],
cmdclass=dict(build_ext=CMakeBuild),
zip_safe=False,
install_requires=['tensorflow==2.3.1', 'tensorboard==2.3.0', 'flink_ml_framework==0.4.0'],
setup_requires=['tensorflow==2.3.1'],
url='https://github.com/alibaba/flink-ai-extended/',
install_requires=['tensorflow>=2.3.1, <3.0.0',
'tensorboard>=2.3.0, <3.0.0',
f'flink_ml_framework=={VERSION}'],
setup_requires=['tensorflow>=2.3.1, <3.0.0'],
url='https://github.com/flink-extended/dl-on-flink',
license='https://www.apache.org/licenses/LICENSE-2.0'
)
24 changes: 24 additions & 0 deletions flink-ml-tensorflow/python/flink_ml_tensorflow/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

"""
The flink-ml-tensorflow version follows the PEP440.
.. seealso:: https://www.python.org/dev/peps/pep-0440
"""
__version__ = "0.4.dev0"
41 changes: 29 additions & 12 deletions flink-ml-tensorflow/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,34 @@
# =============================================================================

import os
import re
import sys
import sysconfig
import platform
import re
import subprocess
from shutil import copyfile, copymode
import sys
from distutils.version import LooseVersion

from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext

this_directory = os.path.abspath(os.path.dirname(__file__))
version_file = os.path.join(this_directory, 'flink_ml_tensorflow/version.py')

try:
exec(open(version_file).read())
except IOError:
print("Failed to load flink_ml_tensorflow version file for packaging. " +
"'%s' not found!" % version_file,
file=sys.stderr)
sys.exit(-1)
VERSION = __version__ # noqa


class CMakeExtension(Extension):
def __init__(self, name, sourcedir=''):
Extension.__init__(self, name, sources=[])
self.sourcedir = os.path.abspath(sourcedir)


class CMakeBuild(build_ext):
def run(self):
try:
Expand Down Expand Up @@ -60,7 +73,7 @@ def build_extension(self, ext):
cmake_args += ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(
cfg.upper(),
extdir)]
if sys.maxsize > 2**32:
if sys.maxsize > 2 ** 32:
cmake_args += ['-A', 'x64']
build_args += ['--', '/m']
else:
Expand All @@ -70,26 +83,30 @@ def build_extension(self, ext):
build_args += ['-lpthread']

env = os.environ.copy()
env['CXXFLAGS'] = '{} -D_GLIBCXX_USE_CXX11_ABI=0 -DVERSION_INFO=\\"{}\\"'.format(
env.get('CXXFLAGS', ''),
self.distribution.get_version())
env['CXXFLAGS'] = \
'{} -D_GLIBCXX_USE_CXX11_ABI=0 -DVERSION_INFO=\\"{}\\"'.format(
env.get('CXXFLAGS', ''),
self.distribution.get_version())
if not os.path.exists(self.build_temp):
os.makedirs(self.build_temp)
subprocess.check_call(['cmake', ext.sourcedir] + cmake_args,
cwd=self.build_temp, env=env)
subprocess.check_call(['cmake', '--build', '.'] + build_args,
cwd=self.build_temp)


setup(
name='flink_ml_tensorflow',
version='0.4.0',
version=VERSION,
include_package_data=True,
packages=find_packages(),
ext_modules=[CMakeExtension('flink_ml_tensorflow/flink_ml_tensorflow')],
cmdclass=dict(build_ext=CMakeBuild),
zip_safe=False,
install_requires=['tensorflow==1.15.0', 'tensorboard==1.15.0', 'flink_ml_framework==0.4.0'],
setup_requires=['tensorflow==1.15.0'],
url='https://github.com/alibaba/flink-ai-extended/',
install_requires=['tensorflow>=1.15.0, <2.0.0',
'tensorboard>=1.15.0, <2.0.0',
f'flink_ml_framework=={VERSION}'],
setup_requires=['tensorflow>=1.15.0, <2.0.0'],
url='https://github.com/flink-extended/dl-on-flink',
license='https://www.apache.org/licenses/LICENSE-2.0'
)