On 2015-06-19 17:32, Christopher Allan Webber wrote:
Amirouche Boubekki writes:

Héllo,


If I'm not mistaken this patch relies only on the presence of
requirements.txt. This is not a required file in python packaging.
otherwise said, we miss a lot using this method. I think the best way to
do that would be to:

- download the package and extract it
- create an environment (#)
- create a virtual env with access to system site package of the
environment (#)
- enter the venv and install the package
- use `pip freeze -l` to retrieve the full set of dependencies

Using pip freeze is an interesting idea.

Setting up a virtualenv... that's interesting. Would it be written to a
temporary directory?

My bad, it's probably not a good idea to have that without containers, as it execute some code that we don't know what it does - the setup.py. The best way to go is to parse the setup.py *and* requirements.txt.

I attached a script that does what I described without the `guix environment`.

Using `guix environment` might be a good idea to prepapre a recipe without polluting its own profile.

HTH.
if [ $1 ]
then
    wget -q $1 -O - | tar xz > .pypi-guess-deps.log 2>&1
    virtualenv .venv >> .pypi-guess-deps.log 2>&1
    source .venv/bin/activate >> .pypi-guess-deps.log 2>&1
    cd * && python setup.py install >> .pypi-guess-deps.log 2>&1
    pip freeze -l
else
   echo "Usage: pypi-guess-deps.sh PACKAGE-URL

log is written to `pypi-guess-deps.log`
"
fi

Reply via email to