tbnobody / OpenDTU

Software for ESP32 to talk to Hoymiles/TSUN/Solenso Inverters
GNU General Public License v2.0
1.69k stars 471 forks source link

platformio esp32 build fails due to import pkg_resources in auto_firmware_version.py #2059

Closed b0661 closed 2 weeks ago

b0661 commented 2 weeks ago

What happened?

platformio generic_esp32 build failed:

Executing task: platformio run --environment generic_esp32 

Processing generic_esp32 (board: esp32dev; framework: arduino; platform: espressif32@6.7.0)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
ModuleNotFoundError: No module named 'pkg_resources':
  File "/home/bobby/.platformio/penv/lib/python3.12/site-packages/platformio/builder/main.py", line 167:
    env.SConscript(env.GetExtraScripts("pre"), exports="env")
  File "/home/bobby/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Script/SConscript.py", line 612:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/bobby/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Script/SConscript.py", line 279:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/bobby/projects/OpenDTU/pio-scripts/auto_firmware_version.py", line 6:
    import pkg_resources
============================================================================================= [FAILED] Took 0.62 seconds =============================================================================================

Environment    Status    Duration
-------------  --------  ------------
generic_esp32  FAILED    00:00:00.620
======================================================================================== 1 failed, 0 succeeded in 00:00:00.620 ========================================================================================

To Reproduce Bug

Linux bobby-desktop 6.8.0-35-generic #35-Ubuntu SMP PREEMPT_DYNAMIC Mon May 20 15:51:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Visual Studio Code Version: 1.90.0 Commit: 89de5a8d4d6205e5b11647eb6a74844ca23d2573 Date: 2024-06-04T19:43:07.605Z Electron: 29.4.0 ElectronBuildId: 9593362 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Linux x64 6.8.0-35-generic snap

PlatformIO IDE v3.3.3

platformio run --environment generic_esp32 

pkg_resources seems to be deprecated. See these issues:

This is the solution chosen in the Espressif IDE

Expected Behavior

Build to work in platformio.

Install Method

Self-Compiled

What git-hash/version of OpenDTU?

c144b6830632426db8718e5a19b7bc2611602321

Relevant log/trace output

No response

Anything else?

No response

Please confirm the following

b0661 commented 2 weeks ago

Already addresses by PR #2052