From dd076264eb62cd1cd7fe053abe5dbd567025a5dc Mon Sep 17 00:00:00 2001 From: Sergey Lyubimtsev Date: Fri, 11 Mar 2022 11:09:17 +0300 Subject: [PATCH] add pre-release description for wheels packages (2) (#10813) * add pre-release description for wheels packages * refactoring * lines * Revert "lines" This reverts commit 01a74dc16871cc253ed3c129450037f28504adb5. * linters * linters * nighly revision of docs URL --- docs/install_guides/pre-release-note.md | 2 ++ src/bindings/python/wheel/setup.py | 26 ++++++++++++++++--- tools/openvino_dev/setup.py | 33 +++++++++++++++++++------ 3 files changed, 51 insertions(+), 10 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..e3ff90622fb 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() in {'Windows' , 'Darwin'} else '' machine = platform.machine() if machine == 'x86_64' or machine == 'AMD64': @@ -428,6 +428,15 @@ def get_package_dir(install_cfg): 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): sys.exit(f'Unsupported platform: {sys.platform}, expected: linux, win32, darwin') @@ -442,6 +451,17 @@ 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'] +docs_url = 'https://docs.openvino.ai/latest/index.html' + +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) + docs_url = 'https://docs.openvino.ai/nightly/index.html' + + setup( version=os.getenv('WHEEL_VERSION', '0.0.0'), build=os.getenv('WHEEL_BUILD', '000'), @@ -451,10 +471,10 @@ 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'), + url=os.getenv('WHEEL_URL', docs_url), cmdclass={ 'build': CustomBuild, 'install': CustomInstall, diff --git a/tools/openvino_dev/setup.py b/tools/openvino_dev/setup.py index 62d7072b1ee..8db664abd4a 100644 --- a/tools/openvino_dev/setup.py +++ b/tools/openvino_dev/setup.py @@ -206,16 +206,35 @@ with (SCRIPT_DIR / 'requirements.txt').open() as 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'] +docs_url = 'https://docs.openvino.ai/latest/index.html' + +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) + docs_url = 'https://docs.openvino.ai/nightly/index.html' + 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', docs_url), + 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',