[TIP] Why does tox use "pip install --pre" by default?

holger krekel holger at merlinux.eu
Mon Sep 29 11:32:49 PDT 2014


On Mon, Sep 29, 2014 at 11:05 -0600, Carl Meyer wrote:
> On 09/29/2014 05:41 AM, Ned Batchelder wrote:
> > On 9/29/14 3:32 AM, holger krekel wrote:
> >> Even today i sometimes i forget to tell people to use "pip install --pre"
> >> instead of just "pip install" to test out release files of mine.
> 
> They shouldn't need --pre at all if they are specifying precisely which
> pre-release version they want to test, which I would consider preferable
> anyway.

Yes.

> >  And I
> >> guarantee that changing tox' current default for "install_command" will
> >> break things for some people.  Question is only how many and if the
> >> consistency with pip is worth it in the long run.
> > I agree this is the right approach: first decide how it should behave,
> > then assess what might break.
> 
> It seems to me that (apart from backwards-compatibility concerns) it
> would be better for tox to follow pip's default behavior by default. I
> think it's fairly clear that a new tox user, absent specific information
> from tox's docs, would assume that specifying a dependency on "coverage"
> in their tox.ini will install the same version of coverage that is
> installed by "pip install coverage".

"consistency with pip" is a valid point in principle.

However, does anybody argue that "pip install --pre" was itself a good idea? 

Are there many examples (besides Ned's) of people relying and using 
that feature?

I doubt it because:

- you can't really depend on "--pre" because "easy_install" does not
  support it and it's still producing some 20-25% of install actions
  (https://caremad.io/blog/a-look-at-pypi-downloads/ )

- it is too coarse grained: it will drag in non-stable versions from
  the full dependency closure you are installing, not just one.  So it's
  usually better to have and maintain a "requirements.txt" with good 
  version specifiers if you want stability and "referential integrity" 
  between your tests and deployments.

> I am not in a good position to evaluate the likely back-compat effects,
> since I don't ever use tox in a way that relies on --pre (if I want to
> test against a pre-release version of a dependency, I specify the
> precise pre-release I want to test against).

I don't know how many people would really be hit by tox changing its
defaults.  For sure, if a tox.ini specifies "easy_install" you could not
run "tox --pre" but when "pip" is used you would need to use "--pre" in
certain situations.  Currently, there is no need to talk about this as
the default works the same way for both installers.

> I suppose it would be possible (though probably ugly) to implement this
> change with a deprecation-warning cycle.

If i'd go for it i'd suggest to directly change it in tox-1.9, adding a 
"--pre" switch and a new default "install_command=pip install {opts}
{packages}" where the "tox --pre" switch changes the contents of
"{opts}".  And i'd ask the people here on the ML pushing for the change
to submit a PR :)

cheers,
holger

> Carl
> 
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
> 



More information about the testing-in-python mailing list