Commit Graph

9 Commits

Author SHA1 Message Date
Rob Mohr
29288f4f12 pw_arduino_build, stm32f429i: Require pyserial 3.5
Force pyserial version 3.5+ because 3.4 and earlier versions fail on
Big Sur with Python 3.8.

pyserial bug: https://github.com/pyserial/pyserial/issues/509
Bug tracking Python 3.9 support in LUCI/CIPD: crbug.com/1176014

Change-Id: I87a057e668394329655a8e75e1e17c98182f3a14
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/32126
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Mark Rawling <mwr@google.com>
Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
2021-02-10 04:18:32 +00:00
Wyatt Hepler
438caa0ddb pw_build: Make GN Python installation more robust
- Since protobuf Python packages are generated and installed from the
  build directory now, add dependencies on package installs in the
  build. This ensures packages are properly installed before tests or
  linting.
- Instantiate all Python actions in the default toolchain. This prevents
  duplicate instantiations of Python actions for each toolchain, which
  causes flakiness as packages are reinstalled for each toolchain.
- Add python_deps to pw_python_action that Python actions can depend on
  Python package installations.
- Add various missing dependencies between Python packages.

Change-Id: I4ec34f06c04014b3552cc1b60aa506ac9a89b329
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/30000
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
2021-01-22 04:42:12 +00:00
Wyatt Hepler
3b4047da68 Python: Add py.typed files per PEP 561
- PEP 561 (https://www.python.org/dev/peps/pep-0561/) specifies that
  packages that wish to support type checking must provide a py.typed
  marker file. Add py.typed to all packages.
- Add missing __init__.py files to pw_cli and pw_hdlc_lite.

Change-Id: I32d652222e9909a5ac4a5612c2dd1683b18b2d36
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22200
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-10-22 19:24:02 +00:00
Wyatt Hepler
d7dc6550c9 pw_build: pw_python_package and mypy fixes
- Use the target-relative path for pylint's stamp so it is unique when
  there are multiple files with the same basename (e.g. __init__.py).
- Serialize pip install commands since in-parallel --editable installs
  do not work correctly.
- Run mypy over the entire package directory rather than individual
  files.
- Fix various mypy issues so that mypy passes without
  --ignore-missing-imports.

Change-Id: I8129144d7c963616e5b836dd2f082c41f1dc1416
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22201
Reviewed-by: Alexei Frolov <frolv@google.com>
2020-10-22 18:28:07 +00:00
Wyatt Hepler
01197109b2 pw_presubmit: Don't use setup.py test
Previously, Python tests were executed using setup.py test. There are a
few issues with this. First, with the current setup, tests are executed
twice for some reason. Occasionally other odd errors occur. Also,
setuptools has deprecated the test command for setup.py and states that
it will be removed in a future version.

This change discovers tests by finding the package directories of
affected files and searching for tests with customizable patterns
('*_test.py' by default). This approach is simpler, faster, and no
longer relies on setuptools or unittest.

Since setup.py test is no longer used, this change removes test suite
discovery from Pigweed's setup.py files.

Change-Id: I3de6c5d05ea5e38eea27b0e3aca956fe468035be
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12662
Reviewed-by: Rob Mohr <mohrr@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-06-22 20:16:43 +00:00
Armando Montanez
8c235cec60
stm32f429i-disc1: Add unit test server
Adds a build argument to the stm32f429i-disc1 target that enables
running tests via the pw_test_server.

Change-Id: I76c98fa25d27c771251e41de8631f156572f7731
2019-12-13 11:33:17 -08:00
Armando Montanez
8f1139f5d7 stm32f429i-disc1: Automatic board detection
Introduce automatic STM32F429I-DISC1 board detection on linux, and
integrate it with the test target runer so the com port doesn't need to
be specified.

Change-Id: I2d8aa67bd03501934e9f2404f8afcef75e7d6aca
2019-12-06 23:22:18 +00:00
Wyatt Hepler
becb431e5f Apply pw format to the repository
Change-Id: I3c8e4f956dfe6c9e81d3069f72c30c5950852074
2019-12-05 09:31:11 -08:00
Armando Montanez
2fe3b8de67 Add serial test runner for stm32f429i-disc1
Adds a script that flashes and runs a test on the stm32f429i-disc1
development board. Requires openocd and pyserial.

Example output:
~/pigweed/pigweed$ stm32f429i_disc1_unit_test_runner out/stm32f429i-disc1/obj/pw_unit_test/framework_test.elf --openocd-config targets/stm32f429i-disc1/openocd_stm32f4xx.cfg --port /dev/ttyACM0
TEST - 2019-11-25 13:50:43 - INFO - Launching test binary out/stm32f429i-disc1/obj/pw_unit_test/framework_test.elf
TEST - 2019-11-25 13:50:43 - INFO - Flashing firmware to device...
TEST - 2019-11-25 13:50:44 - INFO - Successfully flashed firmware to device!
TEST - 2019-11-25 13:50:44 - INFO - Test passed!

Change-Id: I111387bd967700e3eab6764a14b1890caedeb68d
2019-11-26 00:48:20 +00:00