Commit Graph

7 Commits

Author SHA1 Message Date
Wyatt Hepler
01a85d6b0e Python: Generate BUILD.gn files for Python packages
- Generate BUILD.gn files with pw_python_packages using
  pw_build.generate_python_package_gn.
- Add the new pw_python_package targets to the default build.
- Remove the unncecessary "python_packages" group.
- Fix some Windows path issues in Python tests.

Change-Id: I50c9b1f650652554f0836cbdc1781a00ec7e8e56
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22203
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
2020-10-22 21:12:11 +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
Paul Mathieu
787ce97a03 pw_trace_tokenized: add tickrate to python script
Testing done:
- tested with data obtained on my own target

Change-Id: I16c11a632917d4758b5df97c120171af88af85f1
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/20283
Commit-Queue: Paul Mathieu <paulmathieu@google.com>
Reviewed-by: Rob Oliver <rgoliver@google.com>
2020-10-20 20:07:51 +00:00
Wyatt Hepler
d9a1b82b37 pw_tokenizer: Make LoadTokenDatabases public
Change-Id: I3c4e9e316c92fe8abb90e21abb48566406d79c64
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/16860
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Joe Ethier <jethier@google.com>
2020-08-26 20:58:36 +00:00
Paul Mathieu
0b374c2f2a pw_trace_tokenized: move py code to a library
Change-Id: Id01d5213b913eae23f06de09180a93d7c32b22c4
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/15941
Commit-Queue: Paul Mathieu <paulmathieu@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2020-08-14 08:34:29 +00:00
Robert Oliver
9da6af8952 pw_trace: Initial tokenized trace python tool
Generates json trace files viewable using chrome://tracing from binary
trace files.

Example usage:
python pw_trace_tokenized/py/trace_tokenized.py -i trace.bin -o trace.json
./out/host_clang_debug/obj/pw_trace_tokenized/bin/trace_tokenized_example_basic

Change-Id: Ia660ee339ebfd26d67377d12618fb9e588865fc8
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/15200
Commit-Queue: Rob Oliver <rgoliver@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-07-31 21:18:03 +00:00