Changeset 265049 in webkit
- Timestamp:
- Jul 29, 2020 11:43:43 AM (4 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r265040 r265049 1 2020-07-29 Jonathan Bedard <jbedard@apple.com> 2 3 [webkitcorepy] Add an auto-installer 4 https://bugs.webkit.org/show_bug.cgi?id=214606 5 6 Reviewed by Darin Adler. 7 8 Add an autoinstaller to webkitcorepy. This is eventually intended to replace the 9 autoinstaller in webkitpy. 10 11 * Scripts/libraries: Added property svn:ignore. 12 * Scripts/libraries/webkitcorepy/README.md: 13 * Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py: 14 * Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py: Added. 15 (Package): Class representing a single Python module. 16 (Package.Archive): Class representing a zip file containing a package. 17 (Package.Archive.__init__): Construct representation with a name, version and 18 downloadable link. 19 (Package.Archive.__repr__): Archives are named based on their package name 20 and version. 21 (Package.Archive.path): The location of a downloaded archive on disk. 22 (Package.Archive.download): Download archive and write contents to disk. 23 (Package.Archive.unpack): Unpack archive on disk into package. 24 (Package.__init__): Packages are constructed with a name, version and name on 25 PyPi, which is assumed to be the package name unless specified. 26 (Package.location): Location of the package on disk. 27 (Package.do_post_install): Some packages have post-install actions, execute 28 those. 29 (Package.archives): Return a list of archives which match the specified 30 package parameters. 31 (Package.is_cached): Check the AutoInstall manifest to see if a package has 32 already been installed. 33 (Package.install): If needed, find a compatible archive for the specified 34 package, download and install it. 35 (AutoInstall): Namespace for auto-install functionality. 36 (AutoInstall._request): Make a request to the package index specified. 37 (AutoInstall.enable): Enable the auto-installer. 38 (AutoInstall.disable): Disable the auto-installer. 39 (AutoInstall.set_directory): Set the directory to save auto-installed libraries to. 40 (AutoInstall.set_index): Use a different package index. 41 (AutoInstall.set_timeout): Set the default timeout. 42 (AutoInstall.register): Add a package to the list of packages to be installed 43 when encountered. 44 (AutoInstall.install): Given a package, register and install that package. 45 (AutoInstall.install_everything): Install all registered packages if they are not 46 already. 47 (AutoInstall.find_module): Check and see if a requested module has been registered, 48 if it has, install that module if needed. 49 * Scripts/libraries/webkitcorepy/webkitcorepy/cacert.pem: Added. 50 * Scripts/libraries/webkitcorepy/webkitcorepy/rootcerts.p7b: Added. 51 * Scripts/webkitpy/__init__.py: Add logger, autoinstalled requests and certifi. 52 * Scripts/webkitpy/test/main.py: 53 (Tester._run_tests): Include webkitcorepy.AutoInstall when installing everything. 54 1 55 2020-07-29 Jonathan Bedard <jbedard@apple.com> 2 56 -
trunk/Tools/Scripts/libraries/webkitcorepy/README.md
r264715 r265049 3 3 Provides a number of utilities intended to support intermediate to advanced Python programming. 4 4 5 ## Requirements 5 6 7 The mock and requests libraries. 8 6 9 ## Usage 7 10 … … 24 27 string_utils.decode(...) 25 28 ``` 29 30 Automatically install libraries on import. 31 ``` 32 from webkitcorepy import AutoInstall 33 AutoInstall.register(Package('requests', Version(2, 24))) 34 import requests 35 ``` -
trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py
r264715 r265049 21 21 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 22 23 import logging 24 import sys 25 26 log = logging.getLogger('webkitcorepy') 27 23 28 from webkitcorepy.version import Version 24 29 from webkitcorepy.string_utils import BytesIO, StringIO, UnicodeIO, unicode 25 30 26 version = Version(0, 0, 2) 31 version = Version(0, 0, 3) 32 33 from webkitcorepy.autoinstall import Package, AutoInstall 34 if sys.version_info > (3, 0): 35 AutoInstall.register(Package('mock', Version(4))) 36 else: 37 AutoInstall.register(Package('mock', Version(3, 0, 5))) 38 39 AutoInstall.register(Package('certifi', Version(2020, 6, 20))) 40 AutoInstall.register(Package('requests', Version(2, 24))) -
trunk/Tools/Scripts/webkitpy/__init__.py
r264425 r265049 18 18 libraries = os.path.join(os.path.abspath(os.path.dirname(os.path.dirname(__file__))), 'libraries') 19 19 sys.path.insert(0, os.path.join(libraries, 'webkitcorepy')) 20 21 from webkitcorepy import AutoInstall 22 AutoInstall.set_directory(os.path.join(libraries, 'autoinstalled', 'python-{}'.format(sys.version_info[0]))) -
trunk/Tools/Scripts/webkitpy/test/main.py
r264949 r265049 156 156 from webkitpy.thirdparty import autoinstall_everything 157 157 autoinstall_everything() 158 159 from webkitcorepy import AutoInstall 160 AutoInstall.install_everything() 158 161 159 162 start_time = time.time()
Note: See TracChangeset
for help on using the changeset viewer.