Error while running python setup.py test

I was following the steps in this video, https://www.youtube.com/watch?v=S1JmgNbNeeo
And I get stuck at this step every time,

DB_NAME=":memory:" python setup.py test
FileNotFoundError: [Errno 2] No such file or directory: '/home/*****/Projects/tum2019/.venv/lib/python3.11/site-packages/trytond-7.4.0-py3.11.egg/trytond/modules/party/tryton.cfg'

In the video, there was not any step, which said pip install trytond-party, or else it would have been under the modules directory in the venv site-packages. I think that video is outdated, and the right or the current way I’m not able to find it and do the deployment properly, as the title of the video states.

What do you actually want to do?

Wanted to setup new module in tryton using docker

I do not understand what this mean?
You want to develop your own custom module? You want to activate an existing module? You want to install a module in a docker image?

extend a module, lets the party module, and deploy it using docker

What do you mean by “extend a module”?

Yes, and how to do the testing?

You just have to write the proper Dockerfile that install your custom module from the tryton/tryton image.

I get it that changing the Dockerfile, I can proceed but why does the setup.py test does not work?
See I was just trying to follow the steps in the video, executed this

DB_NAME=":memory:" python setup.py test

but getting the error, No such file or directory:

ib/python3.11/site-packages/trytond-7.4.1-py3.11.egg/trytond/modules/country/tryton.cfg'

I do not understand what this “setup.py test” has to do with installing a custom module in a docker image.

I think I’m not able to explain. I wanted to run the DB_NAME=":memory:" python setup.py test, before proceeding to follow next steps, and it is failing for me at that step. U can try replicating the steps in the video, and u should find the same error, or else I’m doing something wrong. I also know that it is not an important step, and I can deploy it nonetheless, but what then when I want to test my module also? And if the testing step has nothing to do with installing a custom module in a docker image, why was this step included in the video in the first place?

This error is typically show if there is an import error in your module. (This issue is known since long and based on Tryton not using standard mechanisms find resource files like tryton.cfg.)

I used tox, as it was written in Tryton documentation site, and I was able to run the tests like this

tox -e py311-sqlite

This worked

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.