Customise the virtualenv `activate` script

Ben Finney ben+python at benfinney.id.au
Fri Jun 16 01:53:31 EDT 2017


Cameron Simpson <cs at zip.com.au> writes:

> I must admit my initial preference would be the differently named
> wrapper. Surely users of the codebase will be invoking stuff via
> something opaque which sources the requisite things?

That “something opaque” is the ‘$VENV/bin/activate’ script; many people
who join the team will already know that, and I'm trying to make use of
that existing convention.

> Actually, on trying to write something simple and flexible, since once
> made the venv is basicly state WRT the activate script, I'm leaning
> towards hacking the activate script, probably by keeping a distinct
> file off the the side and modifying activate to source it.

Yeah, I'd much prefer to be told there's a hook to use, so that someone
who creates a standard Python virtualenv the conventional way will not
need to then hack that virtualenv.

-- 
 \       “I distrust those people who know so well what God wants them |
  `\    to do to their fellows, because it always coincides with their |
_o__)                      own desires.” —Susan Brownell Anthony, 1896 |
Ben Finney




More information about the Python-list mailing list