#11 Modify the sh files to work with the python environment
Opened 3 years ago by josseline. Modified 3 years ago

Once the issues #1 and #7 are resolved, we should modify the current sh files, so that when running the .py files, they use the python interpreter located in the environment and not the global interpreter.

Run the files with the global interpreter would cause errors if the dependencies are not available globally, so the goal of solving this issue is to avoid these problems.

The solution that I thought might work is to change the way the .py files run, they are currently run as follows:
For example in get-weekly-user-stats.sh

until ./weekly-user-activity.py org.fedoraproject.prod.irc.karma; do sleep 5; done

change it to:

until python weekly-user-activity.py org.fedoraproject.prod.irc.karma; do sleep 5; done

In this way, the interpreter that will be used is within the environment, which must previously be activated. If this issue is ok for you @mattdm @bt0dotninja I would like to work on it. :smile:


That seems like a fine solution.

Of course, note that the whole loop there is simply part of a horrible hack -- the weekly-user-activity.py script often gets errors and times out, so I made it give an error code if that happens and have it start again until it finally finishes. Ideally that would be unnecessary.

Yes

That seems like a fine solution.

Of course, note that the whole loop there is simply part of a horrible hack -- the weekly-user-activity.py script often gets errors and times out, so I made it give an error code if that happens and have it start again until it finally finishes. Ideally that would be unnecessary.

Yes you are right, but I think that is the first solution for anyone that wants to contribute can run the project :smile: but yes maybe is no the best approach

Your approach seems fine with me. Better than env in the #! lines.

I just just wanted to make the note that there is a lot of horrible stuff here that I did previously. :smile:

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #18 Merged 3 years ago
  • #17 Closed 3 years ago