aboutsummaryrefslogtreecommitdiff
path: root/pw_package
AgeCommit message (Collapse)Author
2021-09-24pw_package/software_update: Add presubmit stepYecheng Zhao
Fix build error and add presubmit check for pw_software_update. protobuf is added to pw_package for this purpose. Bug: 456 Change-Id: I8efe570ad0887299a2ac9dfb71c34c0382419121 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/61794 Commit-Queue: Yecheng Zhao <zyecheng@google.com> Reviewed-by: Rob Mohr <mohrr@google.com>
2021-08-24pw_presubmit: Add cfg+toml to sources build checkAnthony DiGirolamo
Add missing setup.cfg and pyproject.toml files to pw_python_package. No-Docs-Update-Reason: BUILD.gn fix Change-Id: Ice610d8cb061193582e39ec38d584b047c0cee65 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/57866 Commit-Queue: Anthony DiGirolamo <tonymd@google.com> Reviewed-by: Wyatt Hepler <hepler@google.com>
2021-08-24pw_package: Add "micro-ecc"Ali Zhang
No-Docs-Update-Reason: this is self documenting by `pw package list`. Change-Id: I5face84e1c94a73ce1a7e3d7dda110b36203174e Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/54708 Commit-Queue: Ali Zhang <alizhang@google.com> Reviewed-by: Rob Mohr <mohrr@google.com>
2021-08-19python: setup.py -> setup.cfgAnthony DiGirolamo
Move all Python package definitions into setup.cfg files. A stub setup.py file remains to support `pip install --editable` it only runs `setuptools.setup()`. The package definition is pulled from the setup.cfg. Each pyproject.toml file is required to specify the build system for the given python package. In Pigweed's case so far it always specifies Setuptools. See this page for details: https://setuptools.readthedocs.io/en/latest/build_meta.html?highlight=pyproject.toml#how-to-use-it Change-Id: Ieb52ffc46b34ff1693cbfe9b95996cf9add644d1 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/54560 Pigweed-Auto-Submit: Anthony DiGirolamo <tonymd@google.com> Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com> Reviewed-by: Wyatt Hepler <hepler@google.com>
2021-07-19pw_build: Prepare for Pylint updateWyatt Hepler
- Fix various style issues raised by Pylint 2.9.3. - Disable consider-using-with checks because they're overly broad. Change-Id: I7d0c205bbff972718aa5d52238ef34e5f4fd0930 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/52860 Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com> Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com> Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
2021-06-23pw_package: Add support for downloading CRLSetYecheng Zhao
Add support in pw_package for downloading CRLSet. The CRLSet will be used by the pw_tls_client module for certificate revocation checks. Bug: 396 Change-Id: I36399334c76a00756ecce826e4fedaac7f45bcb1 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/48460 Commit-Queue: Yecheng Zhao <zyecheng@google.com> Reviewed-by: Ali Zhang <alizhang@google.com>
2021-06-16pw_package: Simplify chromium verifier downloadYecheng Zhao
Porting unittest requires to pull in much more source files. Listing each file individually makes the list too long. As a trade-off, we'll checkout some entire subfolders instead of picking individual ones in them. Although a number of more files are downloaded, the sparse checkout list is much shorter. Accordingly, we'll not generate a sources.gni for gn build. The list of sources will be added in third_party/chromium_verifier BUILD.gn. Bug: 394 Change-Id: Id15b40cf933af6f6b5da1cc595c79f2650fbb01c Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/49303 Reviewed-by: Rob Mohr <mohrr@google.com> Commit-Queue: Yecheng Zhao <zyecheng@google.com>
2021-06-09pw_package: Add chromium verifierYecheng Zhao
Add support for downloading chromium verifier source code in "pw package". It will be used for certificate verification for boringsssl. Chromium verifier is only a small part of the chromium source. To avoid downloading the entire gigantic repo, sparse-checkout is used. The The CL adds support in git_repo.py for sparse checkout and uses it to selectively checkout sources related to chromium verifier. Bug: 394 Change-Id: I7c6695df54727fe204274467956f22cd238033b9 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/48220 Reviewed-by: Rob Mohr <mohrr@google.com> Reviewed-by: Ali Zhang <alizhang@google.com> Commit-Queue: Yecheng Zhao <zyecheng@google.com>
2021-05-24stm32cube: Add generic build scriptVarun Sharma
This adds a generic stm32cube build script. The pw_package creates a text file listing all of the relavent files in the repos. The python script then reads the text file and lists the needed source files and headers. The python script also inserts a `pw_stm32cube_Init()` into the startup scripts and converts .icf -> .ld linker scripts. Although the API's are not guaranteed to be compatible across families, many of the common API's (like GPIO) are identical. This CL adds a common header, so that integrations targeting multiple families can be built. I have tested this integration on F2, F4, and L5 boards. Change-Id: Ibc79cf7d5cf76b220bb193849863abc16f413967 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/42924 Commit-Queue: Varun Sharma <vars@google.com> Reviewed-by: Armando Montanez <amontanez@google.com> Reviewed-by: Ali Zhang <alizhang@google.com>
2021-05-12pw_package: Add boringssl to "pw package"Yecheng Zhao
Add support for downloading boringssl to "pw package". Since we plan to use chromium certificate verifier with BoringSSL, which lives in chrome source, the package will also download necessary source files from chrome. But this will be done in a separate CL. Change-Id: I3bccbfc87ef56d97e9ed97f1120dc23ca46ed7a2 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/44620 Commit-Queue: Yecheng Zhao <zyecheng@google.com> Reviewed-by: Ali Zhang <alizhang@google.com>
2021-05-12pw_package: Add mbedtls to pw packageYecheng Zhao
Add support for downloading mbedtls library in `pw package`. Upstream doesn't provide a gn build script. It will need to be added in //third_party/mbedtls. To avoid breaking the build, the install locks on a commit and we'll manually bump it. Change-Id: I0cd16e352aead5c90340be582bf54de357c99252 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/44280 Reviewed-by: Ali Zhang <alizhang@google.com> Reviewed-by: Varun Sharma <vars@google.com> Commit-Queue: Yecheng Zhao <zyecheng@google.com>
2021-05-12pw_docs: Fixup minor typos, add clarificationsShiva Rajagopal
* pw_preprocessor: Fix a typo in the example code * Correct a few spelling/grammar mistakes * Clarify intent in a couple spots Signed-off-by: Shiva Rajagopal <shivarajagopal@google.com> Change-Id: I3aebc82d219848e884408658eb8e48f3f8fe651d Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/44681 Reviewed-by: Armando Montanez <amontanez@google.com>
2021-04-29pw_package: Add stm32cube packageVarun Sharma
This downloads the correct repos for every stm32 family from ST's github. Each family will need its own build files and integrations because the headers and API's change slightly between product families. Most code (UART, USART, etc.) can be shared between families with the only difference being the header included. Change-Id: I7f8be09671e65b85aa34e31ea74240f9bddf1fab Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/42731 Commit-Queue: Varun Sharma <vars@google.com> Reviewed-by: Rob Mohr <mohrr@google.com> Reviewed-by: Ali Zhang <alizhang@google.com>
2021-03-08pw_arduino_build: Add missing commaWyatt Hepler
Also add a missing py.typed file in pw_package. Change-Id: Iec601a2074afd20b61c704e05ac172fbaf9e525b Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/36180 Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com> Reviewed-by: Rob Mohr <mohrr@google.com> Reviewed-by: Keir Mierle <keir@google.com> Commit-Queue: Wyatt Hepler <hepler@google.com>
2021-02-25pw_package: Add missing python depArmando Montanez
Adds missing python dep to pw_package's python target. Change-Id: Ia93d6ad0e2e233702e5ced62a68fdfff3d48a048 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/33960 Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com> Reviewed-by: Anthony DiGirolamo <tonymd@google.com> Reviewed-by: Rob Mohr <mohrr@google.com> Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2021-02-01pw_package: Update nanopb to 0.4.4Rob Mohr
Also switch to mirror on pigweed.googlesource.com (mirrored through github.googlesource.com). Now checking if URLs are equivalent given that many Googlers have insteadOf lines in their Git configs. Change-Id: Ib776523eed44a0154d76550a9ccfe35396e434b2 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/31360 Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com> Reviewed-by: Wyatt Hepler <hepler@google.com> Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
2021-01-25pw_package: Use CIPD packages for arduino coresAnthony DiGirolamo
Use "pigweed_internal/third_party/teensy/${platform}" CIPD packages if they are readable by the user. TEST: pw presubmit --step gn_teensy_build Change-Id: I73b9fb31e314c71c8cea357e29f7b9e788b6f894 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/30480 Commit-Queue: Anthony DiGirolamo <tonymd@google.com> Reviewed-by: Rob Mohr <mohrr@google.com>
2021-01-22pw_package: Arduino core installers and teensy presubmitAnthony DiGirolamo
Summary of Changes ================== 1. Rename arduino build args to support cores in any location and have consistent naming. 2. Update docs to reflect above. 3. `pw package install teensy` working with nice status message on how to use ge pw_arduino_build_* args. 4. Added gn_teensy_build presubmit test step, not run by default. `pw presubmit --step gn_teensy_build` 5. Added missing system_rpc_server impl for //targets/arduino. This is just a copy of the stm32f429i one. Build arg Change Examples ========================= OLD: dir_pw_third_party_arduino = "//third_party/arduino" arduino_core_name = "teensy" arduino_package_name = "teensy/avr" arduino_board = "teensy41" arduino_menu_options = ["menu.usb.serial", "menu.opt.o2std"] NEW: pw_arduino_build_CORE_PATH = "/mnt/pigweed/pigweed/.environment/packages" pw_arduino_build_CORE_NAME = "teensy" pw_arduino_build_PACKAGE_NAME = "teensy/avr" pw_arduino_build_BOARD = "teensy41" pw_arduino_build_MENU_OPTIONS = ["menu.usb.serial", "menu.opt.o2std"] All BUILD.gn checks for enabled arduino builds changed too: OLD: if (dir_pw_third_party_arduino != "") {} NEW: if (pw_arduino_build_CORE_PATH != "") {} All gn target deps on arduino core sources changed. OLD: "$dir_pw_third_party_arduino:arduino_core_sources", NEW: "$dir_pw_third_party/arduino:arduino_core_sources", Teensy package post install & status message ============================================ $ pw package status teensy 20210114 11:58:18 INF teensy is installed. 20210114 11:58:18 INF teensy currently installed in: /mnt/pigweed/pigweed/.environment/packages/teensy 20210114 11:58:18 INF Enable by running "gn args out" and adding these lines: pw_arduino_build_CORE_PATH = "/mnt/pigweed/pigweed/.environment/packages" pw_arduino_build_CORE_NAME = "teensy" pw_arduino_build_PACKAGE_NAME = "teensy/avr" pw_arduino_build_BOARD = "BOARD_NAME" 20210114 11:58:18 INF Where BOARD_NAME is any supported board. 20210114 11:58:18 INF List available boards by running: arduino_builder --arduino-package-path /mnt/pigweed/pigweed/.environment/packages/teensy --arduino-package-name teensy/avr list-boards Requires: pigweed:29490 Change-Id: Ifd0bd214777392a29af3ab24711edf2f2c1086f3 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/26240 Commit-Queue: Anthony DiGirolamo <tonymd@google.com> Reviewed-by: Keir Mierle <keir@google.com> Reviewed-by: Rob Mohr <mohrr@google.com>
2020-12-16pw_presubmit: Initialize packagesRob Mohr
The presubmit pre-push hook runs pigweed_presubmit.py directly instead of running 'pw presubmit'. This means it doesn't initialize all the commands configured for 'pw', like 'package', which loads pigweed_presubmit.py, which really only makes sure packages are registered with package_manager.py and then defers to it. Since running pigweed_presubmit.py directly bypasses this step when it attempts to install packages it doesn't find any. This makes sure that any use of pigweed_presubmit.py also loads pigweed_packages.py, so packages can be found. Also changing these packages to not register themselves on import. When adding a package it now needs to be imported and added to pigweed_packages.initialize(). Change-Id: I1e89f2a6e5cf0ab508d35becbcd4cedc8be5261e Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/27821 Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com> Reviewed-by: Wyatt Hepler <hepler@google.com> Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
2020-12-04pw_build: Support specifying mypy/pylint configWyatt Hepler
- Add pylintrc and mypy_ini options to the pw_python_package template. These can be used to specify configuration files to use for Pylint and Mypy. - Run pylint and mypy from the setup directory. This allows tools to find per-package configuration files (if they aren't specified by the pylintrc or mypy_ini arguments). - Fix some incorrect import ordering that Pylint detects now that it runs from package directories. PEP8 states imports should be grouped by standard library, third party, and local package imports. Change-Id: I8017341178ac5920d623ebbed4535432d69527c3 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/26700 Reviewed-by: Keir Mierle <keir@google.com> Reviewed-by: Alexei Frolov <frolv@google.com>
2020-11-25pw_package: Add info on enabling packagesRob Mohr
Add info() method to packages that returns a string describing how to enable the given package. Use that method at various points in the CLI (examples below). $ pw --no-banner package install nanopb 20201125 08:33:47 INF Installing nanopb... 20201125 08:33:47 INF Installing nanopb...done. 20201125 08:33:47 INF Enable with `gn gen out --args='dir_pw_third_party_nanopb="/usr/local/google/home/mohrr/pigweed/pigweed/.environment/packages/nanopb"'` $ pw --no-banner package status nanopb 20201125 08:33:52 INF nanopb is installed. 20201125 08:33:52 INF Enable with `gn gen out --args='dir_pw_third_party_nanopb="/usr/local/google/home/mohrr/pigweed/pigweed/.environment/packages/nanopb"'` $ pw --no-banner package list 20201125 08:33:55 INF Installed packages: 20201125 08:33:55 INF nanopb 20201125 08:33:55 INF Enable with `gn gen out --args='dir_pw_third_party_nanopb="/usr/local/google/home/mohrr/pigweed/pigweed/.environment/packages/nanopb"'` 20201125 08:33:55 INF 20201125 08:33:55 INF Available packages: 20201125 08:33:55 INF Change-Id: Ia3bd47250f353ea37156846ecda8fbcc7aecb0a3 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/26140 Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com> Reviewed-by: Anthony DiGirolamo <tonymd@google.com> Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
2020-10-27pw_presubmit: Add nanopb presubmit checksRob Mohr
Change-Id: Ib72e4b31402bd754fb09d95740ebbcf87d99a554 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22226 Reviewed-by: Wyatt Hepler <hepler@google.com> Commit-Queue: Rob Mohr <mohrr@google.com>
2020-10-23Python: Add remaining packages to the buildWyatt Hepler
- Restructure pw_bloat and pw_docgen as Python packages and add them to the build. - Add pw_package and target-specific packages to the build. Change-Id: I62e857d5c8b069e1923f68fe5f82ef49aa88a326 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22302 Commit-Queue: Wyatt Hepler <hepler@google.com> Reviewed-by: Alexei Frolov <frolv@google.com>
2020-10-22pw_package: Initial commitRob Mohr
Add pw_package module. This manages dependencies that aren't pulled in through env setup. For now only nanopb is available through pw_package. Change-Id: Ib8a20102baf27d5964bb275088c265f9334b6ff3 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22020 Reviewed-by: Anthony DiGirolamo <tonymd@google.com> Reviewed-by: Keir Mierle <keir@google.com> Commit-Queue: Rob Mohr <mohrr@google.com>