How to generate a final version of my module for install on production

Hello right now to deploy my changes in my server for testing purpose I just copy my working folder there (in server), then I execute ’python sertup.py install and it works fine.

But for production environment this is the only approach available? Or there is a way to generate compiled version on install, because right now the sources are keeping into modules folder after run setup.py

With the setuptools, you can create an archive with python setup.py sdist or a wheel with python setup.py wheel.

I tested the first and it created a new folder on my root path, without setup.py or other source

my_module.egg-info

image

This is the folder that I need to move on my server to install it?, and how I could doing this if setup.py is not included

No this is preparation files. You should have the archive under dist folder.
This archive can be installed using pip.

Tryton modules are Python packages so if you want anyone to use your package you can publish it to pypi.Here is a guide which explain most of the concepts:

If you go this way, you should consider adding the module on the Third Party Modules category

After python setup.py sdist was generated my_module.tar.gz, how can I use pip with it?

I had reading something about it, but for this case our module is tiny and do only one specific simple task, maybe when it grows a little and have some utility for other users

It works right now, I didn’t kno that I can execute tar.gz directly with pip install …

Thanks

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