Skip to content

Conversation

@prayanshchh
Copy link

@prayanshchh prayanshchh commented Sep 20, 2025

sets up a proper pip package, a .whl build for openpilot to use out of the box. includes .h and .py from the board dir, includes .py files from python dir.

issue: #2239

here all the files included in the build

 base  prayansh-chhablani   proper_pip_package  unzip -l dist/pandacan-0.0.10-py3-none-any.whl 
Archive:  dist/pandacan-0.0.10-py3-none-any.whl
  Length      Date    Time    Name
---------  ---------- -----   ----
      679  2025-09-20 18:24   panda/__init__.py
        0  2025-09-23 05:27   panda/py.typed
      739  2025-09-23 07:41   panda/setup.py
        0  2025-09-15 15:25   panda/board/__init__.py
      741  2025-09-15 15:25   panda/board/bootstub_declarations.h
      763  2025-09-15 15:25   panda/board/can.h
     4167  2025-09-15 15:25   panda/board/can_comms.h
      402  2025-09-15 15:25   panda/board/comms_definitions.h
      790  2025-09-15 15:25   panda/board/config.h
      362  2025-09-15 15:25   panda/board/crc.h
      359  2025-09-15 15:25   panda/board/critical.h
      607  2025-09-15 15:25   panda/board/critical_declarations.h
     1639  2025-09-15 15:25   panda/board/early_init.h
      551  2025-09-15 15:25   panda/board/fake_stm.h
      665  2025-09-15 15:25   panda/board/faults.h
     1347  2025-09-15 15:25   panda/board/faults_declarations.h
      698  2025-09-15 15:25   panda/board/flash.py
     3478  2025-09-15 15:25   panda/board/flasher.h
     2201  2025-09-15 15:25   panda/board/health.h
     1733  2025-09-15 15:25   panda/board/libc.h
    10811  2025-09-15 15:25   panda/board/main_comms.h
      627  2025-09-15 15:25   panda/board/main_declarations.h
      341  2025-09-15 15:25   panda/board/main_definitions.h
     1528  2025-09-15 15:25   panda/board/power_saving.h
      328  2025-09-15 15:25   panda/board/power_saving_declarations.h
      608  2025-09-15 15:25   panda/board/provision.h
      737  2025-09-15 15:25   panda/board/recover.py
     1365  2025-09-15 15:25   panda/board/utils.h
     1953  2025-09-15 15:25   panda/board/boards/board_declarations.h
     4876  2025-09-15 15:25   panda/board/boards/cuatro.h
     3888  2025-09-15 15:25   panda/board/boards/red.h
     5098  2025-09-15 15:25   panda/board/boards/tres.h
      486  2025-09-15 15:25   panda/board/boards/unused_funcs.h
     2343  2025-09-15 15:25   panda/board/drivers/bootkick.h
      111  2025-09-15 15:25   panda/board/drivers/bootkick_declarations.h
     7767  2025-09-15 15:25   panda/board/drivers/can_common.h
     2286  2025-09-15 15:25   panda/board/drivers/can_common_declarations.h
     2066  2025-09-15 15:25   panda/board/drivers/clock_source.h
      220  2025-09-15 15:25   panda/board/drivers/clock_source_declarations.h
     4920  2025-09-15 15:25   panda/board/drivers/fake_siren.h
     1346  2025-09-15 15:25   panda/board/drivers/fan.h
      321  2025-09-15 15:25   panda/board/drivers/fan_declarations.h
    11068  2025-09-15 15:25   panda/board/drivers/fdcan.h
      478  2025-09-15 15:25   panda/board/drivers/fdcan_declarations.h
     2632  2025-09-15 15:25   panda/board/drivers/gpio.h
     4201  2025-09-15 15:25   panda/board/drivers/harness.h
      862  2025-09-15 15:25   panda/board/drivers/harness_declarations.h
     2394  2025-09-15 15:25   panda/board/drivers/interrupts.h
      956  2025-09-15 15:25   panda/board/drivers/interrupts_declarations.h
     1024  2025-09-15 15:25   panda/board/drivers/led.h
     1729  2025-09-15 15:25   panda/board/drivers/pwm.h
     2569  2025-09-15 15:25   panda/board/drivers/registers.h
      953  2025-09-15 15:25   panda/board/drivers/registers_declarations.h
      540  2025-09-15 15:25   panda/board/drivers/simple_watchdog.h
      239  2025-09-15 15:25   panda/board/drivers/simple_watchdog_declarations.h
     7230  2025-09-15 15:25   panda/board/drivers/spi.h
     1040  2025-09-15 15:25   panda/board/drivers/spi_declarations.h
     1045  2025-09-15 15:25   panda/board/drivers/timers.h
     3603  2025-09-15 15:25   panda/board/drivers/uart.h
     1305  2025-09-15 15:25   panda/board/drivers/uart_declarations.h
    29385  2025-09-15 15:25   panda/board/drivers/usb.h
     3807  2025-09-15 15:25   panda/board/drivers/usb_declarations.h
     5037  2025-09-15 15:25   panda/board/jungle/__init__.py
      734  2025-09-15 15:25   panda/board/jungle/flash.py
      597  2025-09-15 15:25   panda/board/jungle/jungle_health.h
     9064  2025-09-15 15:25   panda/board/jungle/main_comms.h
     1010  2025-09-15 15:25   panda/board/jungle/recover.py
     2174  2025-09-15 15:25   panda/board/jungle/boards/board_declarations.h
     9696  2025-09-15 15:25   panda/board/jungle/boards/board_v2.h
      854  2025-09-15 15:25   panda/board/jungle/scripts/can_health.py
     1041  2025-09-15 15:25   panda/board/jungle/scripts/can_printer.py
      986  2025-09-15 15:25   panda/board/jungle/scripts/debug_console.py
     2140  2025-09-15 15:25   panda/board/jungle/scripts/echo_loopback_test.py
      193  2025-09-15 15:25   panda/board/jungle/scripts/get_version.py
      358  2025-09-15 15:25   panda/board/jungle/scripts/health_test.py
     4436  2025-09-15 15:25   panda/board/jungle/scripts/loopback_test.py
      493  2025-09-15 15:25   panda/board/jungle/scripts/spam_can.py
      376  2025-09-15 15:25   panda/board/jungle/scripts/start.py
      215  2025-09-15 15:25   panda/board/jungle/stm32h7/board.h
    18628  2025-09-23 07:42   panda/board/obj/bootstub.panda_h7.bin
    13964  2025-09-23 07:42   panda/board/obj/bootstub.panda_jungle_h7.bin
     1730  2025-09-23 07:42   panda/board/obj/cert.h
       89  2025-09-23 07:42   panda/board/obj/gitversion.h
    72008  2025-09-23 07:42   panda/board/obj/panda_h7.bin.signed
    66468  2025-09-23 07:42   panda/board/obj/panda_jungle_h7.bin.signed
   150680  2025-09-23 07:42   panda/board/obj/panda_h7/bootstub.elf
    71872  2025-09-23 07:42   panda/board/obj/panda_h7/main.bin
   378708  2025-09-23 07:42   panda/board/obj/panda_h7/main.elf
   123936  2025-09-23 07:42   panda/board/obj/panda_jungle_h7/bootstub.elf
    66332  2025-09-23 07:42   panda/board/obj/panda_jungle_h7/main.bin
   346524  2025-09-23 07:42   panda/board/obj/panda_jungle_h7/main.elf
     1755  2025-09-15 15:25   panda/board/stm32h7/board.h
     5261  2025-09-15 15:25   panda/board/stm32h7/clock.h
     9258  2025-09-15 15:25   panda/board/stm32h7/interrupt_handlers.h
     2517  2025-09-15 15:25   panda/board/stm32h7/lladc.h
      891  2025-09-15 15:25   panda/board/stm32h7/lladc_declarations.h
      684  2025-09-15 15:25   panda/board/stm32h7/llfan.h
     7654  2025-09-15 15:25   panda/board/stm32h7/llfdcan.h
     2436  2025-09-15 15:25   panda/board/stm32h7/llfdcan_declarations.h
      770  2025-09-15 15:25   panda/board/stm32h7/llflash.h
     4158  2025-09-15 15:25   panda/board/stm32h7/lli2c.h
     3338  2025-09-15 15:25   panda/board/stm32h7/llspi.h
     3035  2025-09-15 15:25   panda/board/stm32h7/lluart.h
     2918  2025-09-15 15:25   panda/board/stm32h7/llusb.h
      752  2025-09-15 15:25   panda/board/stm32h7/llusb_declarations.h
     4260  2025-09-15 15:25   panda/board/stm32h7/peripherals.h
     9757  2025-09-15 15:25   panda/board/stm32h7/sound.h
     2896  2025-09-15 15:25   panda/board/stm32h7/stm32h7_config.h
     9482  2025-09-15 15:25   panda/board/stm32h7/inc/cmsis_compiler.h
    62551  2025-09-15 15:25   panda/board/stm32h7/inc/cmsis_gcc.h
     1677  2025-09-15 15:25   panda/board/stm32h7/inc/cmsis_version.h
   151761  2025-09-15 15:25   panda/board/stm32h7/inc/core_cm7.h
    11644  2025-09-15 15:25   panda/board/stm32h7/inc/mpu_armv7.h
  1957600  2025-09-15 15:25   panda/board/stm32h7/inc/stm32h725xx.h
  1957600  2025-09-15 15:25   panda/board/stm32h7/inc/stm32h735xx.h
     8946  2025-09-15 15:25   panda/board/stm32h7/inc/stm32h7xx.h
     8298  2025-09-15 15:25   panda/board/stm32h7/inc/stm32h7xx_hal_def.h
    23585  2025-09-15 15:25   panda/board/stm32h7/inc/stm32h7xx_hal_gpio_ex.h
     2524  2025-09-15 15:25   panda/board/stm32h7/inc/system_stm32h7xx.h
    26139  2025-09-15 15:25   panda/python/__init__.py
     1367  2025-09-15 15:25   panda/python/base.py
     1116  2025-09-15 15:25   panda/python/constants.py
     3868  2025-09-15 15:25   panda/python/dfu.py
      762  2025-09-15 15:25   panda/python/serial.py
     3956  2025-09-15 15:25   panda/python/socketpanda.py
    14190  2025-09-15 15:25   panda/python/spi.py
     3737  2025-09-15 15:25   panda/python/usb.py
      276  2025-09-15 15:25   panda/python/utils.py
     1059  2025-09-23 07:42   pandacan-0.0.10.dist-info/licenses/LICENSE
     5370  2025-09-23 07:42   pandacan-0.0.10.dist-info/METADATA
       91  2025-09-23 07:42   pandacan-0.0.10.dist-info/WHEEL
        6  2025-09-23 07:42   pandacan-0.0.10.dist-info/top_level.txt
    11711  2025-09-23 07:42   pandacan-0.0.10.dist-info/RECORD
---------                     -------
  5835006                     133 files
               
 [~/panda]
 base  prayansh-chhablani   proper_pip_package  

@prayanshchh
Copy link
Author

prayanshchh commented Sep 20, 2025

not ready for review

@adeebshihadeh adeebshihadeh marked this pull request as draft September 20, 2025 16:02
@adeebshihadeh
Copy link
Contributor

Converting to draft until it's ready for review

@prayanshchh prayanshchh marked this pull request as ready for review September 21, 2025 07:26
@prayanshchh
Copy link
Author

ready now, openpilot pr: commaai/openpilot#36185

MANIFEST.in Outdated
Comment on lines 1 to 2
include SConstruct
include SConscript
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't think we need these two?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't, removing

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this? we should only add top level files/dirs if absolutely needed

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

py.typed is required by [PEP 561] without it, type checkers like mypy treat everything as Any.

pyproject.toml Outdated

[build-system]
requires = ["setuptools>=61", "wheel"]
requires = ["setuptools>=61", "wheel", "pycryptodome >= 3.9.8", "scons", "opendbc @ git+https://github.com/commaai/opendbc.git@master#egg=opendbc",]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no way to use the dependencies declared above?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried, based on my reading [project].dependencies includes deps that are required after the build whereas [build-system].requires includes deps required before the build, and as per my knowledge there is no place where we can mention deps that are common to both of these environments...these are treated as two completely different enviroments.

pyproject.toml Outdated
[tool.hatch.build.targets.wheel]
packages = ["src/panda"]
include = [ "include/**"
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleanup the formatting

[tool.hatch.build.targets.wheel.shared-data]
"include" = "include"

[tool.setuptools.package-data]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this redundant with MANIFEST.in?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

from setuptools.command.build import build as _build

class build(_build):
def run(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong indentation

setup.py Outdated
class build(_build):
def run(self):
env = os.environ.copy()
env['FINAL_PROVISIONING'] = '1'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not be set

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, removed

@prayanshchh
Copy link
Author

@adeebshihadeh any comments?

@prayanshchh
Copy link
Author

@adeebshihadeh pinging again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants