#4206 Allow run pagure module from source.
Closed by pingou. Opened by ark74.
ark74/pagure stream_server  into  master

Download 4206.patch

Just like hookrunner this requires to add some tweaks in order to allow run pagures module from source/git clone.

@ark74 Why not just install pagure using the setup.py in the venv? Then these hacks aren't needed...

I often make these kinds of changes in the code to get it running or using things like PYTHONPATH=., but I'm not fan of adding this to the code itself, it's really a dev hack and highly specific on how you set-up your dev environment.

I'm more tempted to go through and rip these comments out of the code in places where they already are, so that people don't think it's an okay way to do this...

First of all I'm just learning so the chances for me to be wrong are awfully high.

But also take into account that debian based distros doesn't have the same up-to-date build process for python modules, so I relay on venv and hacks like these in order to run pagure, there are some pieces of code that are expected to be at some place by default even though you have declared before where they should run.

About the complete comment, I agree is not very appealing but I'm copying to keep what was already on other places.
Feel free to turn it down.

@ark74, Debian does ship Python 3, though they split out the virtualenv creation module into python3-venv. If you install that module, then you can follow the recommended venv setup process.

I'm more tempted to go through and rip these comments out of the code in places where they already are, so that people don't think it's an okay way to do this...

We mostly have this in the tests where they are quite convenient, outside of this I see 3 comments with this, in places where I think it makes sense.

@ngompa Ok, I'll try.
Thanks

Alright, I'm inclined to close this PR

@ark74 did you manage to get pagure to behave as you wanted to?

Even when I install using setup.py, there are some files that need this pointers in order to run correctly on my ubuntu based environment.
Adding this allowed the file to run correctly.

Feel free to close.

I use some of these tricks when working on a local dev instance of pagure (most often I play with PYTHONPATH though), but I'm inclined to not put them in the code itself.

For this reason, I'm going to close this PR. I'm glad you could make pagure behave as desired, if you see a place in the doc where we could document this, let's add it!

:thumbsup:

Pull-Request has been closed by pingou

Metadata