diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..ba67b6cd --- /dev/null +++ b/.gitattributes @@ -0,0 +1,59 @@ +* text=auto + +*.md text +*.txt text + +# Graphics +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.tif binary +*.tiff binary +*.ico binary +# SVG treated as an asset (binary) by default. +*.svg text + +# Scripts +*.bash text eol=lf +*.sh text eol=lf +# These are explicitly windows files and should use crlf +*.bat text eol=crlf +*.cmd text eol=crlf +*.ps1 text eol=crlf + +# Serialisation +*.json text +*.toml text +*.xml text +*.yaml text +*.yml text + +# Archives +*.7z binary +*.gz binary +*.tar binary +*.zip binary +*.exe binary + +# +# Exclude files from exporting +# + +.gitattributes export-ignore +.gitignore export-ignore + + +# Basic .gitattributes for a python repo. + +# Source files +# ============ +*.pxd text diff=python +*.py text diff=python +*.py3 text diff=python +*.pyc text diff=python +*.pyd text diff=python +*.pyo text diff=python +*.pyw text diff=python +*.pyx text diff=python +*.pyz text diff=python \ No newline at end of file diff --git a/BasicDevTests.py b/BasicDevTests.py index dbb45090..d7f38154 100644 --- a/BasicDevTests.py +++ b/BasicDevTests.py @@ -1,80 +1,80 @@ -## -# Quick script to check that python code in the package -# aligns with pep8 and file encoding. I have not found -# a way to enforce that with tools like flake8 -# -# There must be a better way. :) -# -# Copyright (c) Microsoft Corporation -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -## - -import glob -import os -import sys -import logging - - -def TestEncodingOk(apath, encodingValue): - try: - with open(apath, "rb") as fobj: - fobj.read().decode(encodingValue) - except Exception as exp: - logging.critical("Encoding failure: file: {0} type: {1}".format(apath, encodingValue)) - logging.error("EXCEPTION: while processing {1} - {0}".format(exp, apath)) - return False - return True - - -def TestFilenameLowercase(apath): - if apath != apath.lower(): - logging.critical(f"Lowercase failure: file {apath} not lower case path") - logging.error(f"\n\tLOWERCASE: {apath.lower()}\n\tINPUTPATH: {apath}") - return False - return True - - -def TestNoSpaces(apath): - if " " in apath: - logging.critical(f"NoSpaces failure: file {apath} has spaces in path") - return False - return True - - -def TestRequiredLicense(apath): - lic = ["SPDX-License-Identifier: BSD-2-Clause-Patent"] - try: - with open(apath, "rb") as fobj: - contents = fobj.read().decode() - found = False - for l in lic: - if l in contents: - found = True - break - if not found: - logging.critical(f"License failure: file {apath} has incorrect, invalid, or unsupported license") - return False - except Exception as exp: - logging.critical(f"License failure: Exception trying to read file: {apath}") - logging.error("EXCEPTION: while processing {1} - {0}".format(exp, apath)) - return False - return True - - -p = os.path.join(os.getcwd(), "edk2toollib") -pyfiles = glob.glob(os.path.join(p, "**", "*.py"), recursive=True) -error = 0 -for a in pyfiles: - aRelativePath = os.path.relpath(a, os.getcwd()) - if(not TestEncodingOk(a, "ascii")): - error += 1 - if(not TestFilenameLowercase(aRelativePath)): - error += 1 - if(not TestNoSpaces(aRelativePath)): - error += 1 - if(not TestRequiredLicense(a)): - error += 1 - -logging.critical(f"Found {error} error(s) in {len(pyfiles)} file(s)") -sys.exit(error) +## +# Quick script to check that python code in the package +# aligns with pep8 and file encoding. I have not found +# a way to enforce that with tools like flake8 +# +# There must be a better way. :) +# +# Copyright (c) Microsoft Corporation +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +import glob +import os +import sys +import logging + + +def TestEncodingOk(apath, encodingValue): + try: + with open(apath, "rb") as fobj: + fobj.read().decode(encodingValue) + except Exception as exp: + logging.critical("Encoding failure: file: {0} type: {1}".format(apath, encodingValue)) + logging.error("EXCEPTION: while processing {1} - {0}".format(exp, apath)) + return False + return True + + +def TestFilenameLowercase(apath): + if apath != apath.lower(): + logging.critical(f"Lowercase failure: file {apath} not lower case path") + logging.error(f"\n\tLOWERCASE: {apath.lower()}\n\tINPUTPATH: {apath}") + return False + return True + + +def TestNoSpaces(apath): + if " " in apath: + logging.critical(f"NoSpaces failure: file {apath} has spaces in path") + return False + return True + + +def TestRequiredLicense(apath): + lic = ["SPDX-License-Identifier: BSD-2-Clause-Patent"] + try: + with open(apath, "rb") as fobj: + contents = fobj.read().decode() + found = False + for l in lic: + if l in contents: + found = True + break + if not found: + logging.critical(f"License failure: file {apath} has incorrect, invalid, or unsupported license") + return False + except Exception as exp: + logging.critical(f"License failure: Exception trying to read file: {apath}") + logging.error("EXCEPTION: while processing {1} - {0}".format(exp, apath)) + return False + return True + + +p = os.path.join(os.getcwd(), "edk2toollib") +pyfiles = glob.glob(os.path.join(p, "**", "*.py"), recursive=True) +error = 0 +for a in pyfiles: + aRelativePath = os.path.relpath(a, os.getcwd()) + if(not TestEncodingOk(a, "ascii")): + error += 1 + if(not TestFilenameLowercase(aRelativePath)): + error += 1 + if(not TestNoSpaces(aRelativePath)): + error += 1 + if(not TestRequiredLicense(a)): + error += 1 + +logging.critical(f"Found {error} error(s) in {len(pyfiles)} file(s)") +sys.exit(error) diff --git a/ConfirmVersionAndTag.py b/ConfirmVersionAndTag.py index 271e6dab..f712f93f 100644 --- a/ConfirmVersionAndTag.py +++ b/ConfirmVersionAndTag.py @@ -1,27 +1,27 @@ -## @file -# Quick script to check that the wheel/package created is aligned on a git tag. -# Official releases should not be made from non-tagged code. -# -# Copyright (c) Microsoft Corporation -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -## - -import glob -import os -import sys - -p = os.path.join(os.getcwd(), "dist") -whlfile = glob.glob(os.path.join(p, "*.whl")) -if(len(whlfile) != 1): - for filename in whlfile: - print(filename) - raise Exception("Too many wheel files") -rfn = os.path.relpath(whlfile[0], os.getcwd()) -v = rfn.split("-")[1] -if v.count(".") != 2: - raise Exception("Version %s not in format major.minor.patch" % v) -if "dev" in v: - raise Exception("No Dev versions allowed to be published.") -print("version: " + str(v)) -sys.exit(0) +## @file +# Quick script to check that the wheel/package created is aligned on a git tag. +# Official releases should not be made from non-tagged code. +# +# Copyright (c) Microsoft Corporation +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +import glob +import os +import sys + +p = os.path.join(os.getcwd(), "dist") +whlfile = glob.glob(os.path.join(p, "*.whl")) +if(len(whlfile) != 1): + for filename in whlfile: + print(filename) + raise Exception("Too many wheel files") +rfn = os.path.relpath(whlfile[0], os.getcwd()) +v = rfn.split("-")[1] +if v.count(".") != 2: + raise Exception("Version %s not in format major.minor.patch" % v) +if "dev" in v: + raise Exception("No Dev versions allowed to be published.") +print("version: " + str(v)) +sys.exit(0) diff --git a/edk2toollib/bin/__init__.py b/edk2toollib/bin/__init__.py index af9d1678..1ec2c632 100644 --- a/edk2toollib/bin/__init__.py +++ b/edk2toollib/bin/__init__.py @@ -1,7 +1,7 @@ -## -# File to mark this a python package -# -# Copyright (c) Microsoft Corporation -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -## +## +# File to mark this a python package +# +# Copyright (c) Microsoft Corporation +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## diff --git a/edk2toollib/log/__init__.py b/edk2toollib/log/__init__.py index af9d1678..1ec2c632 100644 --- a/edk2toollib/log/__init__.py +++ b/edk2toollib/log/__init__.py @@ -1,7 +1,7 @@ -## -# File to mark this a python package -# -# Copyright (c) Microsoft Corporation -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -## +## +# File to mark this a python package +# +# Copyright (c) Microsoft Corporation +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## diff --git a/edk2toollib/tpm/__init__.py b/edk2toollib/tpm/__init__.py index af9d1678..1ec2c632 100644 --- a/edk2toollib/tpm/__init__.py +++ b/edk2toollib/tpm/__init__.py @@ -1,7 +1,7 @@ -## -# File to mark this a python package -# -# Copyright (c) Microsoft Corporation -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -## +## +# File to mark this a python package +# +# Copyright (c) Microsoft Corporation +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## diff --git a/edk2toollib/uefi/__init__.py b/edk2toollib/uefi/__init__.py index af9d1678..1ec2c632 100644 --- a/edk2toollib/uefi/__init__.py +++ b/edk2toollib/uefi/__init__.py @@ -1,7 +1,7 @@ -## -# File to mark this a python package -# -# Copyright (c) Microsoft Corporation -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -## +## +# File to mark this a python package +# +# Copyright (c) Microsoft Corporation +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## diff --git a/edk2toollib/uefi/edk2/__init__.py b/edk2toollib/uefi/edk2/__init__.py index af9d1678..1ec2c632 100644 --- a/edk2toollib/uefi/edk2/__init__.py +++ b/edk2toollib/uefi/edk2/__init__.py @@ -1,7 +1,7 @@ -## -# File to mark this a python package -# -# Copyright (c) Microsoft Corporation -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -## +## +# File to mark this a python package +# +# Copyright (c) Microsoft Corporation +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## diff --git a/edk2toollib/uefi/edk2/parsers/__init__.py b/edk2toollib/uefi/edk2/parsers/__init__.py index af9d1678..1ec2c632 100644 --- a/edk2toollib/uefi/edk2/parsers/__init__.py +++ b/edk2toollib/uefi/edk2/parsers/__init__.py @@ -1,7 +1,7 @@ -## -# File to mark this a python package -# -# Copyright (c) Microsoft Corporation -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -## +## +# File to mark this a python package +# +# Copyright (c) Microsoft Corporation +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## diff --git a/edk2toollib/windows/__init__.py b/edk2toollib/windows/__init__.py index af9d1678..1ec2c632 100644 --- a/edk2toollib/windows/__init__.py +++ b/edk2toollib/windows/__init__.py @@ -1,7 +1,7 @@ -## -# File to mark this a python package -# -# Copyright (c) Microsoft Corporation -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -## +## +# File to mark this a python package +# +# Copyright (c) Microsoft Corporation +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## diff --git a/edk2toollib/windows/capsule/__init__.py b/edk2toollib/windows/capsule/__init__.py index af9d1678..1ec2c632 100644 --- a/edk2toollib/windows/capsule/__init__.py +++ b/edk2toollib/windows/capsule/__init__.py @@ -1,7 +1,7 @@ -## -# File to mark this a python package -# -# Copyright (c) Microsoft Corporation -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -## +## +# File to mark this a python package +# +# Copyright (c) Microsoft Corporation +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## diff --git a/license.txt b/license.txt index b649705e..a78b25be 100644 --- a/license.txt +++ b/license.txt @@ -1,52 +1,52 @@ -Copyright (c) 2019, TianoCore and contributors. All rights reserved. -Copyright (c) Microsoft All rights reserved. - -SPDX-License-Identifier: BSD-2-Clause-Patent - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -Subject to the terms and conditions of this license, each copyright holder -and contributor hereby grants to those receiving rights under this license -a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable -(except for failure to satisfy the conditions of this license) patent -license to make, have made, use, offer to sell, sell, import, and otherwise -transfer this software, where such license applies only to those patent -claims, already acquired or hereafter acquired, licensable by such copyright -holder or contributor that are necessarily infringed by: - -(a) their Contribution(s) (the licensed copyrights of copyright holders and - non-copyrightable additions of contributors, in source or binary form) - alone; or - -(b) combination of their Contribution(s) with the work of authorship to - which such Contribution(s) was added by such copyright holder or - contributor, if, at the time the Contribution is added, such addition - causes such combination to be necessarily infringed. The patent license - shall not apply to any other combinations which include the - Contribution. - -Except as expressly stated above, no rights or licenses from any copyright -holder or contributor is granted under this license, whether expressly, by -implication, estoppel or otherwise. - -DISCLAIMER - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. +Copyright (c) 2019, TianoCore and contributors. All rights reserved. +Copyright (c) Microsoft All rights reserved. + +SPDX-License-Identifier: BSD-2-Clause-Patent + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +Subject to the terms and conditions of this license, each copyright holder +and contributor hereby grants to those receiving rights under this license +a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable +(except for failure to satisfy the conditions of this license) patent +license to make, have made, use, offer to sell, sell, import, and otherwise +transfer this software, where such license applies only to those patent +claims, already acquired or hereafter acquired, licensable by such copyright +holder or contributor that are necessarily infringed by: + +(a) their Contribution(s) (the licensed copyrights of copyright holders and + non-copyrightable additions of contributors, in source or binary form) + alone; or + +(b) combination of their Contribution(s) with the work of authorship to + which such Contribution(s) was added by such copyright holder or + contributor, if, at the time the Contribution is added, such addition + causes such combination to be necessarily infringed. The patent license + shall not apply to any other combinations which include the + Contribution. + +Except as expressly stated above, no rights or licenses from any copyright +holder or contributor is granted under this license, whether expressly, by +implication, estoppel or otherwise. + +DISCLAIMER + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/readme.md b/readme.md index cca0603c..4c3fde58 100644 --- a/readme.md +++ b/readme.md @@ -1,85 +1,85 @@ -# Tianocore Edk2 PyTool Library (edk2toollib) - -This is a Tianocore maintained project consisting of a python library supporting UEFI firmware development. This package's intent is to provide an easy way to organize and share python code to facilitate reuse across environments, tools, and scripts. Inclusion of this package and dependency management is best managed using Pip/Pypi. - -This is a supplemental package and is not required to be used for edk2 builds. - -## Content - -The package contains classes and modules that can be used as the building blocks of tools that are relevant to UEFI firmware developers. These modules should attempt to provide generic support and avoid tightly coupling with specific use cases. It is expected these modules do not provide direct interaction with the user (through command line interfaces) but instead are intended to be wrapped in other scripts/tools which contains the specific usage and interface. - -Examples: - -* File parsers for edk2 specific file types. These parse the file and provide an object for interacting with the content. -* UEFI specific services for encoding/decoding binary structures. -* UEFI defined values and interfaces for usage in python -* Python wrappers for other system cli tools ( signtool, catalog file generation, inf file generation, etc) -* Python utilities to provide consistent logging, command invocation, path resolution, etc - -## License - -All content in this repository is licensed under [BSD-2-Clause Plus Patent License](license.txt). - -[![PyPI - License](https://img.shields.io/pypi/l/edk2_pytool_library.svg)](https://pypi.org/project/edk2-pytool-library/) - -## Usage - -NOTE: It is strongly recommended that you use python virtual environments. Virtual environments avoid changing the global python workspace and causing conflicting dependencies. Virtual environments are lightweight and easy to use. [Learn more](https://docs.python.org/3/library/venv.html) - -* To install run `pip install --upgrade edk2-pytool-library` -* To use in your python code - ```python - from edk2toollib. import - ``` - -## Release Version History - -### Version 0.9.1 - -* Features: - * Add support for getting WinSdk tools on platforms without VS2017 or newer - * FindToolInWinSdk in locate_tools.py throws a FileNotFoundException when it cannot find the tool requested, previouly it returned None - * Add support for limiting vswhere to certain versions of visual studio (VS2017 and VS2019 supported) - -### Version 0.9.00 - -Initial release of library with functionality ported from Project Mu. -For history and documentation prior to this see the original Project Mu project -https://github.com/microsoft/mu_pip_python_library - -## Current Status - -[![PyPI](https://img.shields.io/pypi/v/edk2_pytool_library.svg)](https://pypi.org/project/edk2-pytool-library/) - -| Host Type | Toolchain | Branch | Build Status | Test Status | Code Coverage | -| :-------- | :-------- | :---- | :----- | :---- | :--- | -| Linux Ubuntu 1604 | Python 3.7.x | master | [![Build Status](https://dev.azure.com/tianocore/edk2-pytools-library/_apis/build/status/edk2-pytool-library%20-%20PR%20Gate%20-%20Linux)](https://dev.azure.com/tianocore/edk2-pytools-library/_build/latest?definitionId=1) | ![Azure DevOps tests](https://img.shields.io/azure-devops/tests/tianocore/edk2-pytools-library/1.svg) | ![Azure DevOps coverage](https://img.shields.io/azure-devops/coverage/tianocore/edk2-pytools-library/1.svg) | -| Windows Server 2019 | Python 3.7.x | master | [![Build Status](https://dev.azure.com/tianocore/edk2-pytools-library/_apis/build/status/Edk2-PyTool-Library%20PR%20build%20-%20Win%20-%20VS2019)](https://dev.azure.com/tianocore/edk2-pytools-library/_build/latest?definitionId=2) | ![Azure DevOps tests](https://img.shields.io/azure-devops/tests/tianocore/edk2-pytools-library/2.svg)| ![Azure DevOps coverage](https://img.shields.io/azure-devops/coverage/tianocore/edk2-pytools-library/2.svg) | - -## Contribution Process - -This project welcomes all types of contributions. -For issues, bugs, and questions it is best to open a [github issue](https://github.com/tianocore/edk2-pytool-library/issues). - -### Code Contributions - -For code contributions this project leverages github pull requests. See github tutorials, help, and documentation for complete descriptions. -For best success please follow the below process. - -1. Contributor opens an issue describing problem or new desired functionality -2. Contributor forks repository in github -3. Contributor creates branch for work in their fork -4. Contributor makes code changes, writes relevant unit tests, authors documentation and release notes as necessary. -5. Contributor runs tests locally -6. Contributor submits PR to master branch of tianocore/edk2-pytool-library - 1. PR reviewers will provide feedback on change. If any modifications are required, contributor will make changes and push updates. - 2. PR automation will run and validate tests pass - 3. If all comments resolved, maintainers approved, and tests pass the PR will be squash merged and closed by the maintainers. - -## Maintainers - -See the [github team](https://github.com/orgs/tianocore/teams/edk-ii-tool-maintainers) for more details. - -## Documentation - -See the github repo __docs__ folder +# Tianocore Edk2 PyTool Library (edk2toollib) + +This is a Tianocore maintained project consisting of a python library supporting UEFI firmware development. This package's intent is to provide an easy way to organize and share python code to facilitate reuse across environments, tools, and scripts. Inclusion of this package and dependency management is best managed using Pip/Pypi. + +This is a supplemental package and is not required to be used for edk2 builds. + +## Content + +The package contains classes and modules that can be used as the building blocks of tools that are relevant to UEFI firmware developers. These modules should attempt to provide generic support and avoid tightly coupling with specific use cases. It is expected these modules do not provide direct interaction with the user (through command line interfaces) but instead are intended to be wrapped in other scripts/tools which contains the specific usage and interface. + +Examples: + +* File parsers for edk2 specific file types. These parse the file and provide an object for interacting with the content. +* UEFI specific services for encoding/decoding binary structures. +* UEFI defined values and interfaces for usage in python +* Python wrappers for other system cli tools ( signtool, catalog file generation, inf file generation, etc) +* Python utilities to provide consistent logging, command invocation, path resolution, etc + +## License + +All content in this repository is licensed under [BSD-2-Clause Plus Patent License](license.txt). + +[![PyPI - License](https://img.shields.io/pypi/l/edk2_pytool_library.svg)](https://pypi.org/project/edk2-pytool-library/) + +## Usage + +NOTE: It is strongly recommended that you use python virtual environments. Virtual environments avoid changing the global python workspace and causing conflicting dependencies. Virtual environments are lightweight and easy to use. [Learn more](https://docs.python.org/3/library/venv.html) + +* To install run `pip install --upgrade edk2-pytool-library` +* To use in your python code + ```python + from edk2toollib. import + ``` + +## Release Version History + +### Version 0.9.1 + +* Features: + * Add support for getting WinSdk tools on platforms without VS2017 or newer + * FindToolInWinSdk in locate_tools.py throws a FileNotFoundException when it cannot find the tool requested, previouly it returned None + * Add support for limiting vswhere to certain versions of visual studio (VS2017 and VS2019 supported) + +### Version 0.9.00 + +Initial release of library with functionality ported from Project Mu. +For history and documentation prior to this see the original Project Mu project +https://github.com/microsoft/mu_pip_python_library + +## Current Status + +[![PyPI](https://img.shields.io/pypi/v/edk2_pytool_library.svg)](https://pypi.org/project/edk2-pytool-library/) + +| Host Type | Toolchain | Branch | Build Status | Test Status | Code Coverage | +| :-------- | :-------- | :---- | :----- | :---- | :--- | +| Linux Ubuntu 1604 | Python 3.7.x | master | [![Build Status](https://dev.azure.com/tianocore/edk2-pytools-library/_apis/build/status/edk2-pytool-library%20-%20PR%20Gate%20-%20Linux)](https://dev.azure.com/tianocore/edk2-pytools-library/_build/latest?definitionId=1) | ![Azure DevOps tests](https://img.shields.io/azure-devops/tests/tianocore/edk2-pytools-library/1.svg) | ![Azure DevOps coverage](https://img.shields.io/azure-devops/coverage/tianocore/edk2-pytools-library/1.svg) | +| Windows Server 2019 | Python 3.7.x | master | [![Build Status](https://dev.azure.com/tianocore/edk2-pytools-library/_apis/build/status/Edk2-PyTool-Library%20PR%20build%20-%20Win%20-%20VS2019)](https://dev.azure.com/tianocore/edk2-pytools-library/_build/latest?definitionId=2) | ![Azure DevOps tests](https://img.shields.io/azure-devops/tests/tianocore/edk2-pytools-library/2.svg)| ![Azure DevOps coverage](https://img.shields.io/azure-devops/coverage/tianocore/edk2-pytools-library/2.svg) | + +## Contribution Process + +This project welcomes all types of contributions. +For issues, bugs, and questions it is best to open a [github issue](https://github.com/tianocore/edk2-pytool-library/issues). + +### Code Contributions + +For code contributions this project leverages github pull requests. See github tutorials, help, and documentation for complete descriptions. +For best success please follow the below process. + +1. Contributor opens an issue describing problem or new desired functionality +2. Contributor forks repository in github +3. Contributor creates branch for work in their fork +4. Contributor makes code changes, writes relevant unit tests, authors documentation and release notes as necessary. +5. Contributor runs tests locally +6. Contributor submits PR to master branch of tianocore/edk2-pytool-library + 1. PR reviewers will provide feedback on change. If any modifications are required, contributor will make changes and push updates. + 2. PR automation will run and validate tests pass + 3. If all comments resolved, maintainers approved, and tests pass the PR will be squash merged and closed by the maintainers. + +## Maintainers + +See the [github team](https://github.com/orgs/tianocore/teams/edk-ii-tool-maintainers) for more details. + +## Documentation + +See the github repo __docs__ folder