Commit Graph

48 Commits

Author SHA1 Message Date
Adeeb Shihadeh
fc469e5f80 Revert "Remove setproctitle (#32716)" (#33195)
* Revert "Remove `setproctitle` (#32716)"

This reverts commit 9020d1931f4cd72f8162e4402278bdf76e3746f2.

* uv lock

* old name
old-commit-hash: 29b58d4f2f
2024-08-05 16:42:22 -07:00
Adeeb Shihadeh
9cfdd6200d Remove setproctitle (#32716)
* Custom setproctitle (#32667)

* add custom setproctitle

* add test

* Update poetry.lock

* fix lint

* support only Linux

* test only Linux

* final lint

* Update test_setproctitle.py

* Update setproctitle.py

* convert to threadnames

* delete proctitles

* Check str len and use PR_GET_NAME

* fix poetry.lock

* lint fix

* Update common/threadname.py

---------

Co-authored-by: reddyn12 <nikhilr.ssm@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* revert that for now

* use last 15

* fix

* use name

* update those

* and modeld

* rm

---------

Co-authored-by: schlimeszn <138847413+schlimeszn@users.noreply.github.com>
Co-authored-by: reddyn12 <nikhilr.ssm@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 83ac80c6c8
2024-06-11 21:57:32 -07:00
Adeeb Shihadeh
e920e57530 Revert "Custom setproctitle (#32667)"
This reverts commit 1f45e163559baa2a6127d5a5e8deb7067e32f813.

old-commit-hash: 5b51f03967
2024-06-10 19:55:41 -07:00
schlimeszn
afea57ae2a Custom setproctitle (#32667)
* add custom setproctitle

* add test

* Update poetry.lock

* fix lint

* support only Linux

* test only Linux

* final lint

* Update test_setproctitle.py

* Update setproctitle.py

* convert to threadnames

* delete proctitles

* Check str len and use PR_GET_NAME

* fix poetry.lock

* lint fix

* Update common/threadname.py

---------

Co-authored-by: reddyn12 <nikhilr.ssm@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 3365ed5eff
2024-06-10 18:59:01 -07:00
Adeeb Shihadeh
92ad30cbd6 Replace markdown-it-py with small function in common/ (#32664)
* Replace markdown-it-py with small function in common/

* simple test

* unused

* lock

* linting fixes
old-commit-hash: 5265d13fe0
2024-06-08 15:39:26 -07:00
cl0cks4fe
639a634f7c Unittest to pytest (#32366)
* add pytest-asyncio

* switch common

* switch selfdrive

* switch system

* switch tools

* small fixes

* fix setUp and valgrind pytest

* switch to setup

* fix random

* switch mock

* switch test_lateral_limits

* revert test_ui

* fix poetry.lock

* add unittest to banned-api

* add inline ignores to remaining unittest imports

* revert test_models

* revert check_can_parser_performance

* one more skip

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: dd9d5d4528
2024-05-17 11:01:44 -07:00
Adeeb Shihadeh
12d2d861f2 Revert "Switch from json11 to nlohmann/json (#31093)"
This reverts commit 8fa1e8aa53defca264272a66531d639b3d569418.

old-commit-hash: 88757c12b3
2024-01-22 22:41:59 -08:00
mtribiere
cb3a834067 Switch from json11 to nlohmann/json (#31093)
* Initial commit

* fix release/file_common

* Update common/swaglog.cc

* Swtiched serialize cc

* move to lfs

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: ee036482b8
2024-01-22 22:35:47 -08:00
Adeeb Shihadeh
5e9dc2c415 cleanup tests that are now useless (#31098)
* disable that onoe

* e2e tests catch this

* rm more useless checks
old-commit-hash: 78e20cff39
2024-01-21 14:49:57 -08:00
Adeeb Shihadeh
63b374bd89 Cython KF1D to Python (#30773)
* Cython KF1D to Python

* cleanup

* set x

* less nesting

* fix release

* Revert "fix release"

This reverts commit 97e5d0f80405660efb861c7b9df7fbfd5dda5dd9.
old-commit-hash: 1421551297
2023-12-16 23:45:28 -08:00
Adeeb Shihadeh
0bbffc86c0 common/file_helpers: remove xx stuff (#30772)
* remove xx stuff

* cleanup
old-commit-hash: 1346704426
2023-12-16 22:19:50 -08:00
Dean Lee
1d7d7b89b2 common/params: support nonblocking write (#29808)
* Safe and efficient asynchronous writing parameters

* call putNonBlocking in locationd

* remove space

* ->AsyncWriter

* remove semicolon

* use member function

* asyc write multiple times

* add test case for AsyncWriter

* merge master

* add missing include

* public

* cleanup

* create once

* cleanup

* update that

* explicit waiting

* improve test case

* pass prefix to asywriter

* move to params

* assert(queue.empty())

* add comment

* add todo

* test_power_monitoring: remove patch

* rm laikad.py

* fix import

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 3c4c4d1f7f
2023-12-13 20:36:01 -08:00
Dean Lee
9351c70889 test_util.cc: do not compare file contents in REQUIRE (#29861)
old-commit-hash: 95ae87659d
2023-09-09 08:47:52 -07:00
Adeeb Shihadeh
268337f32b fix RateKeeper test
old-commit-hash: f197decbc9
2023-09-07 16:47:33 -07:00
Justin Newberry
c7029ea15a System: cleanup paths to use a common class (#29816)
* use OP prefix for logmessage

* cleanup paths too

* cleanup the paths too

* add hw.py to release

* fix those issues

* fix unittests

* fix unittests

* fix unittests

* do swaglog_ipc properly across all the files

* fix that

* fix swaglog in c++

* review suggestions
old-commit-hash: bfe990b112
2023-09-07 11:32:47 -07:00
Adeeb Shihadeh
0010c9a986 Revert "params: safe and efficient async writing parameters (#25912)"
This reverts commit 780669c33fea1b2a14a0bd6e2eac82c9b8893aa5.

old-commit-hash: ec479322d3
2023-09-06 13:44:20 -07:00
Dean Lee
08e70aecb2 params: safe and efficient async writing parameters (#25912)
* Safe and efficient asynchronous writing parameters

* call putNonBlocking in locationd

* remove space

* ->AsyncWriter

* remove semicolon

* use member function

* asyc write multiple times

* add test case for AsyncWriter

* merge master

* add missing include

* public

* cleanup

* create once

* cleanup

* update that

* explicit waiting

* improve test case

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 0d797f4e8b
2023-09-06 08:50:28 -07:00
Adeeb Shihadeh
53e0f5eb49 pytest: use a clean environment for all tests (#29788)
* pytest: use a clean environment for all tests

* rm that

* fix pj

* put build back

* fix params

* fix that

* handle no key

* that was removed

---------

Co-authored-by: Justin Newberry <justin@comma.ai>
old-commit-hash: 7b6afbc162
2023-09-05 18:52:40 -07:00
Dean Lee
00f900e8c4 common/tests: combine multiple test binaries into one (#29623)
old-commit-hash: 2709cd6538
2023-08-25 10:35:39 -07:00
Dean Lee
0984736972 cpplint: add filter build/include_subdir (#29585)
old-commit-hash: 21da5a216f
2023-08-24 15:42:17 +01:00
Dean Lee
97631ec362 common: C++ RateKeeper (#29374)
* c++ RateKeeper

* add to files_common

* use util::random_int

* improve monotor_time

* remove ~ratekeeper
old-commit-hash: 3eef63af9b
2023-08-20 21:27:02 -07:00
Adeeb Shihadeh
16ec56398c add openpilot prefix to imports (#29498)
* add openpilot prefix to imports

* more

* more

* fix docs

* fix linter

* bump submodules

* fix patched tests

* update dynamic imports

* debug

* Revert "debug"

This reverts commit db5e13b9911cc74438bee123bc3430da6c31b24b.

* fix pm test
old-commit-hash: a9626f95b6
2023-08-20 20:49:55 -07:00
Dean Lee
3ff040d52c params: cleanup old params that aren't defined (#28017)
* delete files that are not defined in the keys

* assert after create file

* remove util::remove_files_in_dir

* cleanup

* fix up test

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 10a1b8b7b1
2023-05-04 11:21:41 -07:00
Dean Lee
389558776e params: remove all files if call clearAll with the ParamKeyType.ALL key. (#26000)
* remove all files in dir

* fix test case name
old-commit-hash: 8dbb25e683
2022-10-07 11:28:09 -07:00
Dean Lee
dc0ad229cd Params: add new method to get all keys (#25779)
* allKeys

* cleanup and test

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 85b433760a
2022-09-15 15:43:27 -07:00
Adeeb Shihadeh
35ff65121e pre-commit: add codespell (#25571)
old-commit-hash: 6590fb2b93
2022-08-30 11:20:55 -07:00
Adeeb Shihadeh
d9c279aea9 params: make python and c++ API match (#25573)
* params: make python and c++ API match

* few more
old-commit-hash: 90a4565eb2
2022-08-26 20:46:19 -07:00
ZwX1616
d500a25ab5 params: add put_bool_nonblocking (#25292)
* add bool flag

* cleanup

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 1f087bceb4
2022-07-28 13:17:11 -07:00
Adeeb Shihadeh
9a45a3b99b Move selfdrive/hardware/ to system/ (#24725)
* move hardware to system/

* fix mypy
old-commit-hash: 1139fe507b
2022-06-11 16:38:24 -07:00
Willem Melching
753045c73d less TICI when not needed (#24698)
* less TICI when not needed

* fix process replay

* move reading voltages into hw abstraction layer

* Update selfdrive/hardware/tici/hardware.h

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* Update selfdrive/hardware/hw.h

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* Update selfdrive/hardware/base.h

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* rename init function

* Update selfdrive/athena/athenad.py

Co-authored-by: Robbe Derks <robbe.derks@gmail.com>

* Update selfdrive/boardd/boardd.cc

* Apply suggestions from code review

* Update selfdrive/thermald/thermald.py

* update ref

* fix alert width if all cameras are bad

* add ecam to test_loggerd

* bump cereal

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Robbe Derks <robbe.derks@gmail.com>
old-commit-hash: f49a9c9fd2
2022-06-02 15:20:51 +02:00
Adeeb Shihadeh
f4675fc260 Merge common/ and selfdrive/common (#24556)
* Merge common/ and selfdrive/common

* fix that

* fix version

* fix unit tests
old-commit-hash: cb8885cffb
2022-05-18 14:11:57 -07:00
Adeeb Shihadeh
fb1c3b0d5d common: replace custom xattr implementation with os module's (#24448)
* use os module's xattr function

* fix that

* handle in helper
old-commit-hash: 81dacbedca
2022-05-15 17:13:50 -07:00
Adeeb Shihadeh
d33afc2cac remove custom markdown rendering (#24538)
* remove custom markdown rendering

* remove from release
old-commit-hash: 222c7cd60d
2022-05-14 22:18:13 -07:00
Willem Melching
6346a84060 thermald: remove panda disconnect logic (#23526)
* thermald: remove panda disconnect logic

* keep that
old-commit-hash: ed23177898
2022-01-14 14:13:18 +01:00
Ewout ter Hoeven
a962365292 Convert format strings strings to f-strings (#23241)
* Convert all text strings to f-strings

Reformats all the text from the old "%-formatted" and .format(...) format to the newer f-string format, as defined in PEP 498. This requires Python 3.6+.

Flynt 0.69 was used to reformat the strings. 120 f-strings were created in 51 files.

F-strings are in general more readable, concise and performant. See also: https://www.python.org/dev/peps/pep-0498/#rationale

* revert pyextra changes

* revert ublox.py

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 55390d273f
2021-12-16 14:58:17 +01:00
Mayfield
72c892e014 ui: render markdown in release notes (#22754)
* convert release notes from markdown to html

* fall back to previous behavior if utf8 decoding or markdown parsing throws

* make simple markdown parser to avoid needing a library

* add unit test

* move markdown parser to common. add unit test

use `markdown-it-py` instead of `markdown` dependency for test comparison since it's already in Pipfile.lock

* test (almost) all release notes and add some extra html encoding

* update lock

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 1aebe6ff6e
2021-11-04 16:12:39 +01:00
Willem Melching
6f92abc815 Less open file permissions (#21922)
* Less open file permissions

* add test back

* remove params test for permissions

* remove umask

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: dddab597bc
2021-08-28 18:25:05 -07:00
Dean Lee
29ec7b83bf params: remove persistent params (#21975)
* cleanup constructors

* remove persistent_param

* remove test_persist_params_put_and_get
old-commit-hash: 3b752a307f
2021-08-20 16:57:45 -07:00
Adeeb Shihadeh
88434dc9e4 add CLEAR_ON_IGNITION param type (#20810)
old-commit-hash: b4447993c1
2021-05-04 11:32:40 -07:00
Willem Melching
8f4a445171 add putBool/getBool wrappers to cython params class (#20611)
* add putBool/getBool wrappers to cython class

* use new API

* some more puts

* fix mockparams arguments

* add get_bool to MockParams

* typo
old-commit-hash: ae094042ad
2021-04-07 15:36:37 +02:00
Jon Ander Oribe
9f61dd6254 Simple improvements for quality gate (#2517)
* Improvements for quality gate

* Update test_xattr.py

* Update test_mpc_wobble.py

* python

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 887d67eb8d
2020-11-12 14:48:45 -08:00
Willem Melching
789d5176cb Params path only in one place (#2344)
* fix params paths

* Qcom & qcom2

* This env variable is not used anywhere

* params path in only one place

* fix other PARAMS_PATH references

* absolute path is probably better
old-commit-hash: 3dd9448981
2020-10-15 13:15:22 +02:00
Willem Melching
498ecbdf3c Params refactor, simplified (#2300)
* always c++

* Create C++ params class

* get works

* tests hang now

* passes tests

* cleanup string formatting

* handle interrupt in blocking read

* fix memory leak

* remove unused constructor

* Use delete_db_value directly

* Rename put -> write_db_value

* filename cleanup

* no semicolons in cython

* Update common/SConscript

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* add std::string version of delete_db_value

* This is handled

* cleanup encoding

* Add clear method to clear all

* add persistent params

* fix android build

* Should be called clear_all

* only import params when needed

* set params path on manager import

* recusrively create directories

* Fix function order

* cleanup mkdirp

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 2e182e5c57
2020-10-13 16:23:23 +02:00
Adeeb Shihadeh
86d9da50c5 add test for params permissions
old-commit-hash: 2ad9c50e36
2020-07-18 18:30:29 -07:00
Willem Melching
12a306021d flake8 in pre-commit(#1583)
old-commit-hash: 29aaa44740
2020-05-27 20:33:05 -07:00
Andy Haden
4abb80c9d6 Remove legacy AccessToken param
old-commit-hash: 538ca733c7
2020-03-23 00:22:41 -07:00
Greg Hogan
004c181167 uploader: do not delete files after uploading (#1253)
* cffi xattr function wrapper

* xattr wrapper error handling

* xattr tests

* use xattr for tracking files uploaded

* uploader xattr exception handling

* update uploader tests

* remove unused import

* update release build

* xattrs.py -> xattr.py
old-commit-hash: f21d0f325e
2020-03-19 18:09:26 -07:00
George Hotz
b1f13418e1 common folder
old-commit-hash: e8d888c45b
2020-01-17 10:28:44 -08:00