Opened 4 years ago

Closed 4 years ago

#15944 closed defect (fixed)

Update ooniprobe pypi requirements

Reported by: anadahz Owned by: hellais
Priority: Immediate Milestone:
Component: Archived/Ooni Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

By default pip grabs the latest Twisted version (15.x) which is not currently supported by ooniprobe. The requirements.txt file for the pypi version of ooniprobe should be updated.

Is there any automated way to update ooniprobe pypi?

Child Tickets

Change History (4)

comment:1 Changed 4 years ago by sprucemoose

I'm not sure how patch-worthy this is because I'm rather a noob but I've downloaded and successfully built ooniprobe on linux mint. However, not successfully at first. Running sudo pip install ooniprobe failed on some library issue. I saw that it does in fact download Twisted 15.x and, looking at the io, it only grabs Twisted>=12.0.0 out of the requirements.txt file instead of the actual entry, Twisted>=12.0.0,<=14.0.0. I believe this may be a problem and did the simple fix of taking out the >=12.0.0 although probably something like <=15.0.0 is better. After doing that I ran sudo pip install ooniprobe --upgrade (not that that is related to the fix) and saw that it worked and that it is pulling Twisted<=14.0.0. If this error is not upgrade-worthy (not really an error), you should also consider updating the readme to say that you might need to do sudo pip install ooniprobe --upgrade. As for the automated way, beats me right now :p

comment:2 Changed 4 years ago by patcon

A couple thoughts, as someone who's only just arrived and tried out the Vagrant environment for ooni-probe:

  1. My understanding is that using virtualenv is a good practice even when requirements are simple and seemingly isolated in a VM, as even python-pip has dependencies that should be isolated from the application. This is explained here:

https://hynek.me/articles/virtualenv-lives/

  1. Also, I'm not a python dev, but coming from using bundler and some other dependency resolution tools, it might make sense to include a lockfile generated with pip freeze > requirements.lock in a virtualenv. This ensures we can version-control known-good sets of python packages, constraining as desired with some "looseness" in requirements.txt, and locking to exact specifics in requirements.lock. Then, you can install via pip install -r requirements.lock for travis tests and user installs, and you know things will be smooth. When you want to upgrade, you just do a pip install -r requirements.txt in a fresh virtualenv, which gets any updates within the constraints, and then re-freeze into requirements.lock.

There's been some new stuff in python-land with wheel since I was last working with python apps, so maybe my suggestion is stale. But looking at how we're installing with unpinned packages, it seems maybe this would be helpful to make builds more deterministic and repeatable?

(This is all operating under the assumption that ooni-probe is intended to be more like an "app" package, and not a library package that other things will depend on.)

Anyhow, wooo ooni-probe! Glad I heard about this project

comment:3 Changed 4 years ago by anadahz

A workaround until the ooniprobe pypi package gets updated:

pip uninstall Twisted
pip install 'Twisted<=14.0.0'

comment:4 Changed 4 years ago by hellais

Resolution: fixed
Severity: Normal
Status: newclosed

This is no longer an issue since we support all versions of Twisted.

Note: See TracTickets for help on using tickets.