public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Gary Lin <glin@suse.com>
To: edk2-devel@lists.01.org
Cc: Yonghong Zhu <yonghong.zhu@intel.com>, Liming Gao <liming.gao@intel.com>
Subject: [PATCH 00/14] BaseTools: Adopt absolute import
Date: Tue, 10 Jul 2018 11:30:53 +0800	[thread overview]
Message-ID: <20180710033107.32359-1-glin@suse.com> (raw)

This patch series is based on "libfuturize.fixes.fix_absolute_import"
to adopt abolute import since relative import is not allowed in python3.

The command is applied to BaseTools modules individually. Most of the
patches are straightforward except the GenFds patches. It's because
there are several circular imports in GenFds and circular import is not
compatible with absolute import. To make the patches bisectable, I delay
the import of some modules in the first GenFds patch and refactor the
code in the follow-up patches to remove circular import completely.

The patch set is also available in my github branch:

https://github.com/lcp/edk2/tree/python3-absolute-import

Contributed-under: TianoCore Contribution Agreement 1.1
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Gary Lin <glin@suse.com>

Gary Lin (14):
  BaseTools: Treat GenFds.py as a python module
  BaseTools: Use absolute import in GenFds
  BaseTools: Move OverrideAttribs to OptRomInfStatement.py
  BaseTools: Move FindExtendTool to GenFdsGlobalVariable.py
  BaseTools: Move ImageBinDict to GenFdsGlobalVariable.py
  BaseTools: Use absolute import in AutoGen
  BaseTools: Use absolute import in BPDG
  BaseTools: Use absolute import in Common
  BaseTools: Use absolute import in ECC
  BaseTools: Use absolute import in Eot
  BaseTools: Use absolute import in Table
  BaseTools: Use absolute import in UPT
  BaseTools: Use absolute import in Workspace
  BaseTools: Use absolute import in Scripts

 BaseTools/BinWrappers/PosixLike/GenFds        |   2 +-
 BaseTools/BinWrappers/WindowsLike/GenFds.bat  |   3 +-
 .../plugins/EdkPlugins/basemodel/doxygen.py   |   3 +-
 .../plugins/EdkPlugins/basemodel/ini.py       |   3 +-
 BaseTools/Source/Python/AutoGen/AutoGen.py    |  17 +--
 BaseTools/Source/Python/AutoGen/GenC.py       |   7 +-
 BaseTools/Source/Python/AutoGen/GenMake.py    |   3 +-
 BaseTools/Source/Python/AutoGen/GenPcdDb.py   |   7 +-
 .../Source/Python/AutoGen/IdfClassObject.py   |   3 +-
 BaseTools/Source/Python/AutoGen/StrGather.py  |   3 +-
 BaseTools/Source/Python/BPDG/BPDG.py          |   5 +-
 BaseTools/Source/Python/BPDG/GenVpd.py        |   3 +-
 BaseTools/Source/Python/Common/Database.py    |   8 +-
 BaseTools/Source/Python/Common/EdkLogger.py   |   3 +-
 BaseTools/Source/Python/Common/Expression.py  |   3 +-
 .../Source/Python/Common/LongFilePathOs.py    |   3 +-
 BaseTools/Source/Python/Common/Misc.py        |   9 +-
 BaseTools/Source/Python/Common/Parsing.py     |   5 +-
 BaseTools/Source/Python/Common/StringUtils.py |   9 +-
 .../Python/Common/TargetTxtClassObject.py     |   9 +-
 .../Python/Common/ToolDefClassObject.py       |   9 +-
 BaseTools/Source/Python/Ecc/CParser.py        |   5 +-
 BaseTools/Source/Python/Ecc/Check.py          |   9 +-
 .../Python/Ecc/CodeFragmentCollector.py       |  13 ++-
 BaseTools/Source/Python/Ecc/Database.py       |   7 +-
 BaseTools/Source/Python/Ecc/Ecc.py            |  25 +++--
 BaseTools/Source/Python/Ecc/Exception.py      |   3 +-
 BaseTools/Source/Python/Ecc/FileProfile.py    |   5 +-
 BaseTools/Source/Python/Ecc/MetaDataParser.py |   5 +-
 .../Ecc/MetaFileWorkspace/MetaFileParser.py   |   3 +-
 .../Ecc/MetaFileWorkspace/MetaFileTable.py    |   5 +-
 BaseTools/Source/Python/Ecc/c.py              |  13 ++-
 BaseTools/Source/Python/Eot/CParser.py        |   5 +-
 .../Python/Eot/CodeFragmentCollector.py       |  11 +-
 BaseTools/Source/Python/Eot/Eot.py            |  21 ++--
 BaseTools/Source/Python/Eot/FileProfile.py    |   3 +-
 BaseTools/Source/Python/Eot/InfParserLite.py  |   5 +-
 BaseTools/Source/Python/Eot/Parser.py         |   3 +-
 BaseTools/Source/Python/Eot/Report.py         |   3 +-
 BaseTools/Source/Python/Eot/c.py              |   9 +-
 .../Source/Python/GenFds/AprioriSection.py    |   5 +-
 BaseTools/Source/Python/GenFds/Capsule.py     |  12 +-
 BaseTools/Source/Python/GenFds/CapsuleData.py |   5 +-
 .../Source/Python/GenFds/CompressSection.py   |   7 +-
 BaseTools/Source/Python/GenFds/DataSection.py |   7 +-
 .../Source/Python/GenFds/DepexSection.py      |   7 +-
 BaseTools/Source/Python/GenFds/EfiSection.py  |   7 +-
 BaseTools/Source/Python/GenFds/Fd.py          |  22 ++--
 BaseTools/Source/Python/GenFds/FdfParser.py   |  57 +++++-----
 .../Source/Python/GenFds/FfsFileStatement.py  |  11 +-
 .../Source/Python/GenFds/FfsInfStatement.py   |  19 ++--
 BaseTools/Source/Python/GenFds/Fv.py          |  20 ++--
 .../Source/Python/GenFds/FvImageSection.py    |   7 +-
 BaseTools/Source/Python/GenFds/GenFds.py      | 105 +-----------------
 .../Python/GenFds/GenFdsGlobalVariable.py     |  97 +++++++++++++++-
 BaseTools/Source/Python/GenFds/GuidSection.py |  11 +-
 .../Python/GenFds/OptRomFileStatement.py      |   3 +-
 .../Python/GenFds/OptRomInfStatement.py       |  27 +++--
 BaseTools/Source/Python/GenFds/OptionRom.py   |   6 +-
 BaseTools/Source/Python/GenFds/Region.py      |   3 +-
 .../Source/Python/GenFds/RuleComplexFile.py   |   3 +-
 .../Source/Python/GenFds/RuleSimpleFile.py    |   3 +-
 BaseTools/Source/Python/GenFds/Section.py     |   3 +-
 BaseTools/Source/Python/GenFds/UiSection.py   |   7 +-
 BaseTools/Source/Python/GenFds/VerSection.py  |   7 +-
 BaseTools/Source/Python/GenFds/Vtf.py         |   3 +-
 .../Source/Python/Table/TableDataModel.py     |   3 +-
 BaseTools/Source/Python/Table/TableDec.py     |   3 +-
 BaseTools/Source/Python/Table/TableDsc.py     |   3 +-
 .../Source/Python/Table/TableEotReport.py     |   3 +-
 BaseTools/Source/Python/Table/TableFdf.py     |   3 +-
 BaseTools/Source/Python/Table/TableFile.py    |   3 +-
 .../Source/Python/Table/TableFunction.py      |   3 +-
 .../Source/Python/Table/TableIdentifier.py    |   3 +-
 BaseTools/Source/Python/Table/TableInf.py     |   3 +-
 BaseTools/Source/Python/Table/TablePcd.py     |   3 +-
 BaseTools/Source/Python/Table/TableQuery.py   |   3 +-
 BaseTools/Source/Python/Table/TableReport.py  |   3 +-
 .../Source/Python/UPT/Library/Parsing.py      |   3 +-
 .../Source/Python/Workspace/DscBuildData.py   |   9 +-
 .../Source/Python/Workspace/InfBuildData.py   |   3 +-
 .../Source/Python/Workspace/MetaFileParser.py |   5 +-
 .../Source/Python/Workspace/MetaFileTable.py  |   5 +-
 .../Python/Workspace/WorkspaceCommon.py       |   3 +-
 .../Python/Workspace/WorkspaceDatabase.py     |   7 +-
 85 files changed, 446 insertions(+), 359 deletions(-)

-- 
2.18.0



             reply	other threads:[~2018-07-10  3:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-10  3:30 Gary Lin [this message]
2018-07-10  3:30 ` [PATCH 01/14] BaseTools: Treat GenFds.py as a python module Gary Lin
2018-07-10  3:30 ` [PATCH 02/14] BaseTools: Use absolute import in GenFds Gary Lin
2018-07-10  3:30 ` [PATCH 03/14] BaseTools: Move OverrideAttribs to OptRomInfStatement.py Gary Lin
2018-07-10  3:30 ` [PATCH 04/14] BaseTools: Move FindExtendTool to GenFdsGlobalVariable.py Gary Lin
2018-07-10  3:30 ` [PATCH 05/14] BaseTools: Move ImageBinDict " Gary Lin
2018-07-10  3:30 ` [PATCH 06/14] BaseTools: Use absolute import in AutoGen Gary Lin
2018-07-10  3:31 ` [PATCH 07/14] BaseTools: Use absolute import in BPDG Gary Lin
2018-07-12  0:52   ` Zhu, Yonghong
2018-07-12  4:23     ` Gary Lin
2018-07-10  3:31 ` [PATCH 08/14] BaseTools: Use absolute import in Common Gary Lin
2018-07-10  3:31 ` [PATCH 09/14] BaseTools: Use absolute import in ECC Gary Lin
2018-07-10  3:31 ` [PATCH 10/14] BaseTools: Use absolute import in Eot Gary Lin
2018-07-10  3:31 ` [PATCH 11/14] BaseTools: Use absolute import in Table Gary Lin
2018-07-10  3:31 ` [PATCH 12/14] BaseTools: Use absolute import in UPT Gary Lin
2018-07-10  3:31 ` [PATCH 13/14] BaseTools: Use absolute import in Workspace Gary Lin
2018-07-10  3:31 ` [PATCH 14/14] BaseTools: Use absolute import in Scripts Gary Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180710033107.32359-1-glin@suse.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox