How to create a production version from my local copy?


I have developed a custom payment plugin on my local on the latest indico-3.2.4 version.

I want to deploy this to our dev server to test the functionality, as postbacks from payment processor cannot be tested on my local due to firewall.

Now, I want the dev server enviroment to mimic the production version but at the same time it needs to be flexible enough so that I can make changes to the code on the dev server itself and maybe run some commands to see the change.

How do I go about this? Is there a big difference between the production and development versions? Currently I’m just getting lot of wierd errors one after the other when I’m trying to do this. I don’t have clear understanding of the difference, although I went through Production — Indico 3.2.3 documentation

Appreciate any guidace. Thanks!

For testing you do not need to change anything. If it works on the dev setup it will almost certainly work on the prod setup as well.

The only main difference between dev and prod builds is to omit --dev when running - but this makes no difference for your payment plugin since it’s just for building JS/CSS assets.

I recommend you to post the errors you get and we can help you with those, instead of asking an X/Y question :wink:

Sure, it’s just that I’m not sure I fully understand how all the different pieces in indico work togather. I suppose the production version is supposed to run on apache? And that’s different from the built in webserver used for dev? It would be helpful to have an overarching picture of indico architecture as right now it feels that I’m just trying to do reverse engineering and tyring to fit all the pieces togather without having an understanding of the underlying architecture. So I don’t know what I don’t know. Thanks!

Yes, in a production setup uWSGI runs the indico app and there’s nginx (our personal preference) or apache (works fine as well) in front of it.

But for testing purposes this does not really matter. If you want a true prod-like setup, it’s best to use e.g. a VM with a normal production setup. You can still edit code files from the installed indico package and reload uwsgi there. It’s not as pleasant as with the dev server’s autoreloader but it’ll work.

I have exported a tar.gz file of indico from my local to dev machine (production setup).

Now I get this error when I try to pip install it. The same pip install works on my local.

root@:/opt/indico# pip install indico-3.2.4.dev0.tar.gz
Processing ./indico-3.2.4.dev0.tar.gz
  Preparing metadata ( ... error
  error: subprocess-exited-with-error

  × python egg_info did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-req-build-4iwoxssc/", line 59, in <module>
        File "/tmp/pip-req-build-4iwoxssc/", line 22, in get_requirements
          return read_requirements_file(os.path.join(os.path.dirname(__file__), fname))
        File "/tmp/pip-req-build-4iwoxssc/", line 17, in read_requirements_file
          with open(fname) as f:
      FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-4iwoxssc/requirements.txt'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

You cannot use sdists or other .tar.gz archives for this. Please build a Python wheel as recommended in the docs: Building — Indico 3.2.3 documentation