From 7ceca771e359154512a4467c7b7b0a88befbb353 Mon Sep 17 00:00:00 2001 From: Sergey Lyubimtsev Date: Sat, 5 Mar 2022 16:21:03 +0300 Subject: [PATCH] add pre-release description for wheels packages --- docs/install_guides/pre-release-note.md | 2 ++ src/bindings/python/wheel/setup.py | 20 +++++++++++++++-- tools/openvino_dev/setup.py | 29 +++++++++++++++++++------ 3 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 docs/install_guides/pre-release-note.md diff --git a/docs/install_guides/pre-release-note.md b/docs/install_guides/pre-release-note.md new file mode 100644 index 00000000000..678b1f20224 --- /dev/null +++ b/docs/install_guides/pre-release-note.md @@ -0,0 +1,2 @@ + +> **NOTE**: This version is pre-release software and has not undergone full release validation or qualification. No support is offered on pre-release software and APIs/behavior are subject to change. It should NOT be incorporated into any production software/solution and instead should be used only for early testing and integration while awaiting a final release version of this software. diff --git a/src/bindings/python/wheel/setup.py b/src/bindings/python/wheel/setup.py index bbc9465a415..d671a95cf85 100644 --- a/src/bindings/python/wheel/setup.py +++ b/src/bindings/python/wheel/setup.py @@ -27,7 +27,7 @@ WHEEL_LIBS_PACKAGE = 'openvino.libs' PYTHON_VERSION = f'python{sys.version_info.major}.{sys.version_info.minor}' LIBS_DIR = 'bin' if platform.system() == 'Windows' else 'lib' -CONFIG = 'Release' if platform.system() == 'Windows' or platform.system() == 'Darwin' else '' +CONFIG = 'Release' if platform.system() == 'Windows' else '' machine = platform.machine() if machine == 'x86_64' or machine == 'AMD64': @@ -427,6 +427,13 @@ def get_package_dir(install_cfg): py_package_path = dirs[0] return py_package_path +def concat_files(output_file, input_files): + with open(output_file, 'w', encoding='utf-8') as outfile: + for filename in input_files: + with open(filename, 'r', encoding='utf-8') as infile: + content = infile.read() + outfile.write(content) + return output_file platforms = ['linux', 'win32', 'darwin'] if not any(pl in sys.platform for pl in platforms): @@ -442,6 +449,15 @@ package_data: typing.Dict[str, list] = {} pkg_name = os.getenv('WHEEL_PACKAGE_NAME', 'openvino') ext_modules = find_prebuilt_extensions(get_dir_list(PY_INSTALL_CFG)) if pkg_name == 'openvino' else [] +description_md = SCRIPT_DIR.parents[3] / 'docs' / 'install_guides' / 'pypi-openvino-rt.md' +md_files = [description_md, SCRIPT_DIR.parents[3] / 'docs' / 'install_guides' / 'pre-release-note.md'] + +if(os.getenv('CI_BUILD_DEV_TAG')): + output = Path.cwd() / 'build' / 'pypi-openvino-rt.md' + output.parent.mkdir(exist_ok=True) + description_md = concat_files(output, md_files) + + setup( version=os.getenv('WHEEL_VERSION', '0.0.0'), build=os.getenv('WHEEL_BUILD', '000'), @@ -451,7 +467,7 @@ setup( author=os.getenv('WHEEL_AUTHOR', 'Intel(R) Corporation'), description=os.getenv('WHEEL_DESC', 'OpenVINO(TM) Runtime'), install_requires=get_dependencies(os.getenv('WHEEL_REQUIREMENTS', SCRIPT_DIR.parents[0] / 'requirements.txt')), - long_description=get_description(os.getenv('WHEEL_OVERVIEW', SCRIPT_DIR.parents[3] / 'docs/install_guides/pypi-openvino-rt.md')), + long_description=get_description(os.getenv('WHEEL_OVERVIEW', description_md)), long_description_content_type='text/markdown', download_url=os.getenv('WHEEL_DOWNLOAD_URL', 'https://github.com/openvinotoolkit/openvino/tags'), url=os.getenv('WHEEL_URL', 'https://docs.openvino.ai/latest/index.html'), diff --git a/tools/openvino_dev/setup.py b/tools/openvino_dev/setup.py index 62d7072b1ee..c2961ff263c 100644 --- a/tools/openvino_dev/setup.py +++ b/tools/openvino_dev/setup.py @@ -205,17 +205,32 @@ with (SCRIPT_DIR / 'requirements.txt').open() as requirements: in pkg_resources.parse_requirements(requirements) ] +def concat_files(output_file, input_files): + with open(output_file, 'w', encoding='utf-8') as outfile: + for filename in input_files: + with open(filename, 'r', encoding='utf-8') as infile: + content = infile.read() + outfile.write(content) + return output_file + +description_md = SCRIPT_DIR.parents[1] / 'docs' / 'install_guides' / 'pypi-openvino-dev.md' +md_files = [description_md, SCRIPT_DIR.parents[1] / 'docs' / 'install_guides' / 'pre-release-note.md'] + +if(os.getenv('CI_BUILD_DEV_TAG')): + output = Path.cwd() / 'build' / 'pypi-openvino-dev.md' + output.parent.mkdir(exist_ok=True) + description_md = concat_files(output, md_files) setup( name='openvino-dev', version=os.getenv('OPENVINO_VERSION', '0.0.0'), - author='IntelĀ® Corporation', - license='OSI Approved :: Apache Software License', - author_email='openvino_pushbot@intel.com', - url='https://docs.openvino.ai/latest/index.html', - download_url='https://github.com/openvinotoolkit/openvino/tags', - description='OpenVINO(TM) Development Tools', - long_description=get_description(SCRIPT_DIR.parents[1] / 'docs/install_guides/pypi-openvino-dev.md'), + author=os.getenv('WHEEL_AUTHOR', 'IntelĀ® Corporation'), + license=os.getenv('WHEEL_LICENCE_TYPE', 'OSI Approved :: Apache Software License'), + author_email=os.getenv('WHEEL_AUTHOR_EMAIL', 'openvino_pushbot@intel.com'), + url=os.getenv('WHEEL_URL', 'https://docs.openvino.ai/latest/index.html'), + download_url=os.getenv('WHEEL_DOWNLOAD_URL', 'https://github.com/openvinotoolkit/openvino/tags'), + description=os.getenv('WHEEL_DESC', 'OpenVINO(TM) Development Tools'), + long_description=get_description(os.getenv('WHEEL_OVERVIEW', description_md)), long_description_content_type='text/markdown', classifiers=[ 'Programming Language :: Python :: 3',