GithubHelp home page GithubHelp logo

How to use with tox about pip-accel HOT 7 CLOSED

graingert avatar graingert commented on August 31, 2024
How to use with tox

from pip-accel.

Comments (7)

xolox avatar xolox commented on August 31, 2024

It would help your cause (resolving this issue) if you provided more information:

  • I don't know what "the movement" is, nor do I know whether this is relevant to the topic at hand;
  • You're talking about two different virtual environments being involved, which sounds kind of fragile (although I assume you have your reasons);
  • I'm familiar with tox as a user but I haven't seen it from the inside and I kind of don't like how it has its own way of setting up "the test environment", so indeed it could turn out to be tricky to solve this, but really it all depends on where and how and why tox is run.

pip-accel aims to be a drop in replacement to pip but it does have different semantics which sometimes makes the "drop in" part problematic :-). Also it requires both the Python pip package and the pip command to be installed (the second part is an implementation detail which I might try to solve).

Long story short: In order to help you with this issue I need a lot more information. If possible, something I can run myself to avoid remote debugging using GitHub messages as a proxy ;-).

from pip-accel.

graingert avatar graingert commented on August 31, 2024

Fixed up some of the Typos.

The trouble I'm having is installing pip-accel so that Tox's "install_command" can run it.

here's an example tox.ini

# content of: tox.ini , put in same dir as setup.py
[tox]
install_command = pip-accel install --pre {opts} {packages}
envlist = py26,py27
[testenv]
deps=
    pip-accel     # not installed before install_command is run (to install pip-accel)
    pytest        # install pytest in the venvs
commands=py.test  # or 'nosetests' or ...

from pip-accel.

xolox avatar xolox commented on August 31, 2024

Ah, s/movement/moment/. That makes more sense, thank you :-). I think I found something that works, although it's a bit of a (creative) hack.

First create the shell script ~/bin/pip-accel-for-tox with the following contents (don't forget to make the file executable):

#!/bin/bash

BIN_DIR="$(echo $PATH | tr : '\n' | head -n1)"
export VIRTUAL_ENV="$(dirname "$BIN_DIR")"
if [ ! -x "$VIRTUAL_ENV/bin/pip-accel" ]; then
  "$VIRTUAL_ENV/bin/pip" install pip-accel
fi
"$VIRTUAL_ENV/bin/pip-accel" install --pre "$@"

Then add the following install_command definition to your tox.ini:

install_command = pip-accel-for-tox {opts} {packages}

Tox will print a warning because the install command is located outside the test environment, but it will still execute the install command and this seems to work fine...

Does this help?

from pip-accel.

graingert avatar graingert commented on August 31, 2024

You can whitelist that command. This looks very useful.

I'll raise a PR with that bash script in the docs that fixes this issue.
On 8 Jul 2014 20:51, "Peter Odding" [email protected] wrote:

Ah, s/movement/moment/. That makes more sense, thank you :-). I think I
found something that works, although it's a bit of a (creative) hack.

First create the shell script ~/bin/pip-accel-for-tox with the following
contents (don't forget to make the file executable):

#!/bin/bash
BIN_DIR="$(echo $PATH | tr : '\n' | head -n1)"export VIRTUAL_ENV="$(dirname "$BIN_DIR")"if [ ! -x "$VIRTUAL_ENV/bin/pip-accel" ]; then
"$VIRTUAL_ENV/bin/pip" install pip-accelfi"$VIRTUAL_ENV/bin/pip-accel" install --pre "$@"

Then add the following install_command definition to your tox.ini:

install_command = pip-accel-for-tox {opts} {packages}

Tox will print a warning because the install command is located outside
the test environment, but it will still execute the install command and
this seems to work fine...

Does this help?

Reply to this email directly or view it on GitHub
#30 (comment).

from pip-accel.

xolox avatar xolox commented on August 31, 2024

I'm closing this issue now because there's nothing more for me to do here. I did add a link to this issue in the readme (which is also the homepage on GitHub and PyPI) so that other users can more easily find how to do this.

from pip-accel.

bh avatar bh commented on August 31, 2024

I got the same issue a half year ago.
I fixed it with setting the VIRTUAL_ENV env variable in tox.ini:

[tox]
skipsdist = True
envlist = py34
toxworkdir = {toxinidir}/.tox

[testenv]
# on jenkins we always recreate the whole
# workspace, so tox will be implicitly recreated
recreate = False
whitelist_externals = make
setenv =
    VIRTUAL_ENV={toxworkdir}/{envname}
    DJANGO_CONFIGURATION=Jenkins

# run the commands in a Makefile target to exit if one command failes
# https://bitbucket.org/hpk42/tox/issue/124/ignore-command-exit-codes
commands = make ci_run_tests

from pip-accel.

hashar avatar hashar commented on August 31, 2024

tox 1.8+ should now export VIRTUAL_ENV. At least according to https://bitbucket.org/hpk42/tox/issues/152

from pip-accel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.