diff --git a/flow-python/gen_whl.sh b/flow-python/gen_whl.sh index 48d0838..3289f82 100755 --- a/flow-python/gen_whl.sh +++ b/flow-python/gen_whl.sh @@ -1,24 +1,23 @@ # build py36~38 version +CONDA_BASE=$(conda info --base) +source $CONDA_BASE/etc/profile.d/conda.sh conda activate py36 cargo build --example run_with_plugins --release -cp ../target/release/examples/run_with_plugins ./pyflow/ -ldd pyflow/run_with_plugins +cp ../target/release/examples/run_with_plugins ./pyflow/run_with_plugins_inner rm -rf ./build -python3 whl-py36-setup.py bdist_wheel -p linux-x86_64 -d py36_dist --python-tag py36 +py='py36' python3 setup.py bdist_wheel -p linux-x86_64 -d py36_dist conda activate py37 cargo build --example run_with_plugins --release -cp ../target/release/examples/run_with_plugins ./pyflow/ -ldd pyflow/run_with_plugins +cp ../target/release/examples/run_with_plugins ./pyflow/run_with_plugins_inner rm -rf ./build -python3 whl-py37-setup.py bdist_wheel -p linux-x86_64 -d py37_dist --python-tag py37 +py='py37' python3 setup.py bdist_wheel -p linux-x86_64 -d py37_dist conda activate py38 cargo build --example run_with_plugins --release -cp ../target/release/examples/run_with_plugins ./pyflow/ -ldd pyflow/run_with_plugins +cp ../target/release/examples/run_with_plugins ./pyflow/run_with_plugins_inner rm -rf ./build -python3 whl-py38-setup.py bdist_wheel -p linux-x86_64 -d py38_dist --python-tag py38 +py='py38' python3 setup.py bdist_wheel -p linux-x86_64 -d py38_dist rm -rf dist @@ -26,3 +25,4 @@ mkdir dist cp py36_dist/pyflow-0.1.0-py36-none-linux_x86_64.whl dist/ cp py37_dist/pyflow-0.1.0-py37-none-linux_x86_64.whl dist/ cp py38_dist/pyflow-0.1.0-py38-none-linux_x86_64.whl dist/ +rm -rf py36_dist py37_dist py38_dist diff --git a/flow-python/setup.py b/flow-python/setup.py index 52a9043..cab2062 100644 --- a/flow-python/setup.py +++ b/flow-python/setup.py @@ -9,11 +9,47 @@ #!/usr/bin/env python # coding=utf-8 -from setuptools import setup +from setuptools import setup, find_packages +import sys +import os -setup( - name="pyflow", - version="0.1.0", - packages=["pyflow"], -) +if __name__ == '__main__': + py = os.getenv('py') + if py is None: + py = 'py{}{}'.format(sys.version_info[0], sys.version_info[1]) + assert py.startswith('py3') + minor = int(py[-1]) + setup( + options={'bdist_wheel':{'python_tag': py}}, + name="pyflow", + version="0.1.0", + packages=["pyflow"], + author="Megvii IPU-SDK Team", + author_email="megengine@megvii.com", + url="https://github.com/MegEngine/MegFlow", + include_package_data=True, + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Rust', + 'Programming Language :: Python :: 3.{}'.format(minor), + 'Topic :: Software Development :: Libraries :: Application Frameworks', + 'Topic :: Scientific/Engineering', + 'Topic :: Scientific/Engineering :: Mathematics', + 'Topic :: Scientific/Engineering :: Artificial Intelligence', + 'Topic :: Software Development', + 'Topic :: Software Development :: Libraries', + 'Topic :: Software Development :: Libraries :: Python Modules', + ], + python_requires='>=3.{},<3.{}'.format(minor, minor+1), + package_data={ + "":['run_with_plugins_inner'] + }, + entry_points={ + 'console_scripts':['run_with_plugins=pyflow.command_line:main'], + }, + ) diff --git a/flow-python/whl-py36-setup.py b/flow-python/whl-py36-setup.py deleted file mode 100644 index 4ce3f64..0000000 --- a/flow-python/whl-py36-setup.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -# MegFlow is Licensed under the Apache License, Version 2.0 (the "License") -# -# Copyright (c) 2019-2021 Megvii Inc. All rights reserved. -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -#!/usr/bin/env python -# coding=utf-8 -from setuptools import setup, find_packages - -setup( - name="pyflow", - version="0.1.0", - packages=["pyflow"], - author="Megvii IPU-SDK Team", - author_email="megengine@megvii.com", - url="https://github.com/MegEngine/MegFlow", - include_package_data=True, - classifiers=[ - 'Development Status :: 3 - Alpha', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: Apache Software License', - 'Natural Language :: English', - 'Operating System :: POSIX :: Linux', - 'Programming Language :: C++', - 'Programming Language :: Rust', - 'Programming Language :: Python :: 3.6', - 'Topic :: Software Development :: Libraries :: Application Frameworks', - 'Topic :: Scientific/Engineering', - 'Topic :: Scientific/Engineering :: Mathematics', - 'Topic :: Scientific/Engineering :: Artificial Intelligence', - 'Topic :: Software Development', - 'Topic :: Software Development :: Libraries', - 'Topic :: Software Development :: Libraries :: Python Modules', - ], - python_requires='>=3.6,<3.7', - package_data={ - "":['run_with_plugins'] - }, - entry_points={ - 'console_scripts':['run_with_plugins_python_wrap=pyflow.command_line:main'], - }, - -) - diff --git a/flow-python/whl-py37-setup.py b/flow-python/whl-py37-setup.py deleted file mode 100644 index 48f8d98..0000000 --- a/flow-python/whl-py37-setup.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -# MegFlow is Licensed under the Apache License, Version 2.0 (the "License") -# -# Copyright (c) 2019-2021 Megvii Inc. All rights reserved. -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -#!/usr/bin/env python -# coding=utf-8 -from setuptools import setup, find_packages - -setup( - name="pyflow", - version="0.1.0", - packages=["pyflow"], - author="Megvii IPU-SDK Team", - author_email="megengine@megvii.com", - url="https://github.com/MegEngine/MegFlow", - include_package_data=True, - classifiers=[ - 'Development Status :: 3 - Alpha', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: Apache Software License', - 'Natural Language :: English', - 'Operating System :: POSIX :: Linux', - 'Programming Language :: C++', - 'Programming Language :: Rust', - 'Programming Language :: Python :: 3.7', - 'Topic :: Software Development :: Libraries :: Application Frameworks', - 'Topic :: Scientific/Engineering', - 'Topic :: Scientific/Engineering :: Mathematics', - 'Topic :: Scientific/Engineering :: Artificial Intelligence', - 'Topic :: Software Development', - 'Topic :: Software Development :: Libraries', - 'Topic :: Software Development :: Libraries :: Python Modules', - ], - python_requires='>=3.7,<3.8', - package_data={ - "":['run_with_plugins'] - }, - entry_points={ - 'console_scripts':['run_with_plugins_python_wrap=pyflow.command_line:main'], - }, - -) - diff --git a/flow-python/whl-py38-setup.py b/flow-python/whl-py38-setup.py deleted file mode 100644 index 6b35525..0000000 --- a/flow-python/whl-py38-setup.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -# MegFlow is Licensed under the Apache License, Version 2.0 (the "License") -# -# Copyright (c) 2019-2021 Megvii Inc. All rights reserved. -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -#!/usr/bin/env python -# coding=utf-8 -from setuptools import setup, find_packages - -setup( - name="pyflow", - version="0.1.0", - packages=["pyflow"], - author="Megvii IPU-SDK Team", - author_email="megengine@megvii.com", - url="https://github.com/MegEngine/MegFlow", - include_package_data=True, - classifiers=[ - 'Development Status :: 3 - Alpha', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: Apache Software License', - 'Natural Language :: English', - 'Operating System :: POSIX :: Linux', - 'Programming Language :: C++', - 'Programming Language :: Rust', - 'Programming Language :: Python :: 3.8', - 'Topic :: Software Development :: Libraries :: Application Frameworks', - 'Topic :: Scientific/Engineering', - 'Topic :: Scientific/Engineering :: Mathematics', - 'Topic :: Scientific/Engineering :: Artificial Intelligence', - 'Topic :: Software Development', - 'Topic :: Software Development :: Libraries', - 'Topic :: Software Development :: Libraries :: Python Modules', - ], - python_requires='>=3.8,<3.9', - package_data={ - "":['run_with_plugins'] - }, - entry_points={ - 'console_scripts':['run_with_plugins_python_wrap=pyflow.command_line:main'], - }, - -) - diff --git a/flow-rs/Cargo.toml b/flow-rs/Cargo.toml index 44b1fd9..782af6d 100644 --- a/flow-rs/Cargo.toml +++ b/flow-rs/Cargo.toml @@ -11,7 +11,7 @@ serde = { version = "1.0", features = ["derive"] } toml = "0.5.8" lazy_static = "1.4.0" ctor = "0.1" -pyo3 = "0.14.1" +pyo3 = "0.14" dyn-clone = "1.0.4" async-std = { version = "1.9.0", features = ["unstable", "attributes", "tokio1"] } stackful = { git = "https://github.com/nbdd0121/stackful.git", rev = "4789e26" } @@ -19,15 +19,15 @@ futures-util = "0.3" futures-core = "0.3.15" concurrent-queue = "1.2.2" event-listener = "2.4.0" -numpy = "0.14.1" +numpy = "0.14" ctrlc = "3.1.9" log = "0.4.14" oneshot = "0.1.2" warp = "0.3" serde_json = "1.0" -libc = "0.2.100" [dev-dependencies] clap = "3.0.0-beta.2" flow-plugins = {path="../flow-plugins"} rand = "0.8.4" +libc = "0.2"