[issue30842] pyenv activate for bash and tcsh

2017-07-03 Thread Arnon Sela

New submission from Arnon Sela:

Remove hard coded path in activate family of virtualenv scripts.

Currently, VIRTUAL_ENV is set hard coded.  Event after --relocatable

Instead, change to have is defined dynamically:

E.g. bash:

called=$_
[[ $called != $0 ]] && fullpath="${BASH_SOURCE[@]}" || fullpath=$0
fullpath=$(readlink -f $fullpath)
VIRTUAL_ENV=$(dirname $(dirname $fullpath))

E.g. tcsh:

set sourced=($_)
if ("$sourced" != "") then
set fullpath="$sourced[2]"
endif
if ("$0" != "tcsh") then
set fullpath="$0"
endif
set fullpath=`readlink -f $fullpath`
set binpath=`dirname $fullpath`
setenv VIRTUAL_ENV `dirname $binpath`

--
messages: 297611
nosy: PyAcrisel
priority: normal
severity: normal
status: open
title: pyenv activate for bash and tcsh
type: enhancement
versions: Python 3.5

___
Python tracker 
<http://bugs.python.org/issue30842>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30842] pyenv activate for bash and tcsh

2017-07-14 Thread Arnon Sela

Arnon Sela added the comment:

Additional information:

This suggestion will make pyenv much better. 

To emphasize the need, there are many places that due to security you cannot 
build virtualenv.  Rather you have to push a virtualenv with your python code. 
Often enough, you also don't have control on where the code will be stationed 
on the installation server.  Hence the mobility of virtualenv is important for 
Python code to be migratable.  Many times I find myself and other edit activate 
shell scripts correcting their path to a relative one.

In fact, virtualenv has --relocatable flag but it doesn't do anything to the 
batch and shell activate files.  Python programs in Scripts, however, are 
already built with a relative path.  There is no reason not to do that to the 
shell and batch programs.

The only thing is that there will need to be more particular shell activate 
scripts (tcsh, ksh, csh, etc) as they may have different characteristics for 
relativity.

Progress is not defined by how things are, but how they can be.

--
versions: +Python 3.7 -Python 3.5

___
Python tracker 
<http://bugs.python.org/issue30842>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30842] pyenv activate for bash and tcsh

2017-07-14 Thread Arnon Sela

Arnon Sela added the comment:

Thank you so much for considering this.

Both windows and linux based systems provides mechanisms to be dynamic and
relative to the path.

I wish there would be a way to add such behavior to Python development
manifesto and to check in pypi that packages are aligned

*Arnon Sela*
214-205-2151 <%2B1-214-205-2151>
ar...@acrisel.com
www.acrisel.com

IT Solutions and Ab Initio Experts
--
Notice: from Acrisel: If received in error, please destroy and notify
sender, and make no further use, disclosure, or distribution. This email
(including attachments) may contain information subject to confidentiality
obligations, and sender does not waive confidentiality or privilege.

On Fri, Jul 14, 2017 at 6:14 PM, Vinay Sajip  wrote:

>
> Vinay Sajip added the comment:
>
> This seems reasonable, but scripts written to venvs by e.g. pip hard-code
> the path to the venv, and this is a stumbling block to relocatability.
> There is no reason to use the activate scripts except under interactive use
> - a script installed in a venv should be directly runnable from its bin
> directory, but that currently won't work if the venv is moved to a new
> location.
>
> Outside of Python I maintain the distlib library which pip uses under the
> covers to write installed scripts, and I will try to consider a solution
> which solves the wider problem.
>
> --
>
> ___
> Python tracker 
> <http://bugs.python.org/issue30842>
> ___
>

--

___
Python tracker 
<http://bugs.python.org/issue30842>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30842] pyenv activate for bash and tcsh

2017-07-29 Thread Arnon Sela

Arnon Sela added the comment:

readlink -f can be replaced by the following sequence:

pushd $fullpath
fullpath=$(pwd -P)
popd

Please note that:

[[ $called != $0 ]] && fullpath="${BASH_SOURCE[@]}" || fullpath=$0

Should be replaced with:

[[ $called != $0 ]] && fullpath="${BASH_SOURCE[0]}" || fullpath=$0

0 instead of @ - that was a misspelling.

--

___
Python tracker 
<http://bugs.python.org/issue30842>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30842] pyenv activate for bash and tcsh

2017-07-30 Thread Arnon Sela

Arnon Sela added the comment:

The procedure:

pushd $fullpath
fullpath=$(pwd -P)
popd

Can be made sh (and other shells) friendly by:

here=$PWD # or $(pwd)
cd $fullpath
fullpath=$(pwd -P)
cd $here

More to write, but should work, right?

--

___
Python tracker 
<http://bugs.python.org/issue30842>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20353] Hanging bug with multiprocessing + sqlite3 + tkinter (OS X 10.9 only)

2015-04-04 Thread Arnon Sela

Arnon Sela added the comment:

I ran into similar issue on OSX.  Multiprocessing system where processes issue 
sqlite3.connect().  Periodically it hangs.  
System is using Python 3.4.3 and sqlite3; it doesn't use tkinter 

Noticed the following:
1. This doesn't happen on Ubuntu
2. It happens even if URL is invalid - which means that it happens before 
referring to URL as DB.

Workaround didn't solve the problem. But it seems to reduce the frequency.  And 
unfortunately, the system is too large and complex for it to be sent.

I tried to set my environment to debug, but with no luck yet :)

Thanks,

--
nosy: +PyAcrisel

___
Python tracker 
<http://bugs.python.org/issue20353>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com