Automate: No module named 'pytest'

Hello everyone,

I am starting my first attempt at Speckle Automate for the Hackathon and I have run into early trouble creating an initial function to then develop my code within.

I followed the guide Creating Functions Guide with the Python template. The only changes I made to the template were a couple of spelling updates in main.py (just to test making an initial commit through Codespace) and I created an initial v0.1 release so that it appears in the Speckle Functions and I can assign to a test model.

Any time I trigger (on bot the test model and others) it I get the error below referring to the speckle_automate library and no pytest module. As this is outside of the code repo I assume it’s not a problem I can solve in the repo itself? I haven’t worked with containerization before. Any help appreciated.

Thanks,
Thomas

[prepare] 2024/06/07 15:39:56 Entrypoint initialization[22a3f82886-4bbdec246a-1b705e] Traceback (most recent call last):[22a3f82886-4bbdec246a-1b705e] File “/home/speckle/main.py”, line 7, in [22a3f82886-4bbdec246a-1b705e] from speckle_automate import ([22a3f82886-4bbdec246a-1b705e] File “/usr/local/lib/python3.11/site-packages/speckle_automate/init.py”, line 2, in [22a3f82886-4bbdec246a-1b705e] from speckle_automate import fixtures[22a3f82886-4bbdec246a-1b705e] File “/usr/local/lib/python3.11/site-packages/speckle_automate/fixtures.py”, line 5, in [22a3f82886-4bbdec246a-1b705e] import pytest[22a3f82886-4bbdec246a-1b705e] ModuleNotFoundError: No module named ‘pytest’

1 Like

Hey @thomascorrie,

This looks weird, im investigating. Stay tuned for an update soon.

Gergő

@thomascorrie problem found and fixed.

You need to:

  1. update the specklepy dependency in your function. Change the version in the pyproject.toml to specklepy = "^2.19.5"
  2. run poetry lock in your repo
  3. commit and push your changes
  4. make a new release of your function on github and wait for the release action to publish the new release
  5. update your automation to use the new release of the function, the automation page should already show the function being outdated

for the last step see the gif below

9 Likes

Thank you, that worked!

2 Likes