Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendoring-compatible imports #1261

Merged
merged 25 commits into from
Mar 19, 2021

Commits on Mar 19, 2021

  1. imports: Make 'download' imports vendoring-compatible

    Use "from tuf import <module>" instead of "import tuf.<module>": this
    makes it possible for vendoring tool to vendor tuf. Fix all references
    to <module> in the code.
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    8dc07cc View commit details
    Browse the repository at this point in the history
  2. imports: Make 'exceptions' imports vendoring-compatible

    Use "from tuf import <module>" instead of "import tuf.<module>": this
    makes it possible for vendoring tool to vendor tuf. Fix all references
    to <module> in the code.
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    4b078b0 View commit details
    Browse the repository at this point in the history
  3. imports: Make 'formats' imports vendoring-compatible

    Use "from tuf import <module>" instead of "import tuf.<module>": this
    makes it possible for vendoring tool to vendor tuf. Fix all references
    to <module> in the code.
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    4575637 View commit details
    Browse the repository at this point in the history
  4. imports: Make 'log' imports vendoring-compatible

    Use "from tuf import <module>" instead of "import tuf.<module>": this
    makes it possible for vendoring tool to vendor tuf. Fix all references
    to <module> in the code.
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    07b3aed View commit details
    Browse the repository at this point in the history
  5. updater: rename mirrors variables

    Make sure mirrors is not used as variable name (so it can be used for
    the module import name later).
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    696b929 View commit details
    Browse the repository at this point in the history
  6. imports: Make 'mirrors' imports vendoring compatible

    Use "from tuf import <module>" instead of "import tuf.<module>": this
    makes it possible for vendoring tool to vendor tuf. Fix all references
    to <module> in the code.
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    02046c0 View commit details
    Browse the repository at this point in the history
  7. imports: Make 'roledb' imports vendoring-compatible

    Use "from tuf import <module>" instead of "import tuf.<module>": this
    makes it possible for vendoring tool to vendor tuf. Fix all references
    to <module> in the code.
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    9550b14 View commit details
    Browse the repository at this point in the history
  8. imports: Make 'settings' imports vendoring-compatible

    Use "from tuf import <module>" instead of "import tuf.<module>": this
    makes it possible for vendoring tool to vendor tuf. Fix all references
    to <module> in the code.
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    c66c61f View commit details
    Browse the repository at this point in the history
  9. imports: Make 'sig' imports vendoring-compatible

    Use "from tuf import <module>" instead of "import tuf.<module>": this
    makes it possible for vendoring tool to vendor tuf. Fix all references
    to <module> in the code.
    
    Remove one unused import.
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    9d7047f View commit details
    Browse the repository at this point in the history
  10. imports: Fix securesystemslib.exceptions imports

    Make the import compatible with vendoring tool and alias the import so
    it does not clash with the local module. Fix all references
    to the module in the code.
    
    Remove a related repo.py comment that was badly duplicated from module
    docstring.
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    6faed27 View commit details
    Browse the repository at this point in the history
  11. imports: Make 'updater' import vendoring-compatible

    Make the updater imports compatible with vendoring tool by importing
    the Updater class directly (don't import the whole module to avoid the
    clash with the obvious variable name 'updater').
    
    Also update the example: This is not required in the clients but tuf
    source code will be vendored and this import line (even though in a
    comment) might trigger an error in future vendoring tool releases.
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    fe3dacc View commit details
    Browse the repository at this point in the history
  12. imports: Fix securesystemslib.formats imports

    Make the import compatible with vendoring tool and alias the import so
    it does not clash with the local module. Fix all references
    to the module in the code.
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    79385cc View commit details
    Browse the repository at this point in the history
  13. imports: Fix securesystemslib.keys imports

    Make them compatible with vendoring, use
      from securesystemslib import keys as sslib_keys
    to have the same style as other securesystemslib imports.
    
    Note that developer_tool already used a
       from securesystemslib.keys import ...
    for some functions so that style was used consistently there.
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    f702fdf View commit details
    Browse the repository at this point in the history
  14. imports: Fix securesystemslib.interface imports

    Make them compatible with vendoring, use
      from securesystemslib import interface as sslib_interface
    to have the same style as other securesystemslib imports.
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    a7c2b8d View commit details
    Browse the repository at this point in the history
  15. imports: Fix securesystemslib.util imports

    Make the import compatible with vendoring tool and alias the import so
    it does not clash with the local module. Fix all references
    to the module in the code.
    
    In one instance import a specific function to avoid a more complex
    redirection in the code.
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    46ebfd0 View commit details
    Browse the repository at this point in the history
  16. imports: Fix securesystemslib.storage imports

    Make them compatible with vendoring, use
      from securesystemslib import storage as sslib_storage
    to have the same style as other securesystemslib imports.
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    4b66c17 View commit details
    Browse the repository at this point in the history
  17. imports: Fix securesystemslib.hash imports

    Make them compatible with vendoring, use
      from securesystemslib import hash as sslib_hash
    to have the same style as other securesystemslib imports (and to avoid
    potential conflict with system hash()).
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    dd134a4 View commit details
    Browse the repository at this point in the history
  18. imports: Fix securesystemslib.settings imports

    Make the import compatible with vendoring tool and alias the import so
    it does not clash with the local module. Fix all references
    to the module in the code.
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    996b2a0 View commit details
    Browse the repository at this point in the history
  19. imports: Make 'keydb' imports vendoring-compatible

    Use "from tuf import <module>" instead of "import tuf.<module>": this
    makes it possible for vendoring tool to vendor tuf. Fix all references
    to <module> in the code.
    
    Also fix import orders so tuf internal imports are last.
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    538623b View commit details
    Browse the repository at this point in the history
  20. imports: Move six imports to 3rd party section

    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    0aabb82 View commit details
    Browse the repository at this point in the history
  21. imports: Remove unused imports

    The linter now understands our imports (yay), and complains a lot (boo):
    * Remove really unused imports
    * disable lints for tuf.log and securesystemslib imports: these imports
      have logging side-effects (they set default loggers for tuf and
      securesystemslib respectively) and I'm cautious about just removing
      them
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    d5b6f91 View commit details
    Browse the repository at this point in the history
  22. imports: Fix urllib3 exception import

    Make it compatible with vendoring: import the exception only to avoid
    having to rename the module locally.
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    d0e5bd2 View commit details
    Browse the repository at this point in the history
  23. requests_fetcher: Move 'tuf' import from download

    requests_fetcher uses tuf.__version__ for user-agent, move the import to
    the correct file.
    
    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    7dcfb12 View commit details
    Browse the repository at this point in the history
  24. Make requests_fetcher import vendoring compatible

    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    30ab838 View commit details
    Browse the repository at this point in the history
  25. metadata: Make isort happy and bundle imports

    Signed-off-by: Jussi Kukkonen <[email protected]>
    Jussi Kukkonen committed Mar 19, 2021
    Configuration menu
    Copy the full SHA
    ab56344 View commit details
    Browse the repository at this point in the history