Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #74683
| From | Ned Batchelder <ned@nedbatchelder.com> |
|---|---|
| Subject | Re: Multiple python versions, one dev environment??? |
| Date | 2014-07-17 15:41 -0400 |
| References | <20140717173231.7cfefae5@xs4all.nl> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.11957.1405626121.18130.python-list@python.org> (permalink) |
On 7/17/14 11:32 AM, Joep van Delft wrote: > Hello! > > The condensed version of the question would probably be: How does one > deal with multiple interpreters and one package where you want to try > some changes? > > The background: > I made a trivial change to some package (docutils) to scratch a > personal itch, and I want to offer this back to the community > (whether it will be accepted or not). Because of this, I ran into > some issues. > > Some facts: > 1. Python3 is my main interpreter. > 2. The tests of docutils only run under python2. > 3. I desire not to touch my distribution's version of > site-packagesX-Y. > 4. I prefer to have one and only one development directory of > my target package. > > My confusions: > 1. Is it possible to have one source control managed directory of > some package, which is used by two versions of python? > 2. I assume that the *.pyc-files generated while using some python > source are version dependent. What is the recommended way to have > 'em both installed? > 3. The way I have stumped a wall over here, is the puzzle of how to > make python2 have a different $PYTHONPATH as python3. I hope to > hear how this strategy is silly :) > 4. I have contemplated the way of linking the source files from my > development directory into user specified site-packages > directories. Problem 3. still is valid. > 5. Should venv and friends/foes com into play? If so: How? > > Appreciate any light shed on these issues. Virtualenv is definitely the right way to isolate different Python environments from each other. Each one has its own PYTHONPATH, so each project of yours can have different packages installed. For testing one project on multiple versions of Python, use tox. Its entire reason for being is to test Python code against multiple environments, generally for different Python versions, but possibly for other reasons, like different versions of dependencies. Tox will manage the virtualenvs for you, it makes multi-version testing very simple. > > Thanks! > > > Joep > > > -- Ned Batchelder, http://nedbatchelder.com
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Multiple python versions, one dev environment??? Joep van Delft <joepvandelft@xs4all.nl> - 2014-07-17 17:32 +0200
Re: Multiple python versions, one dev environment??? Javier <nospam@nospam.com> - 2014-07-17 16:05 +0000
Re: Multiple python versions, one dev environment??? Joep van Delft <joepvandelft@xs4all.nl> - 2014-07-17 21:52 +0200
Re: Multiple python versions, one dev environment??? Javier <nospam@nospam.com> - 2014-07-17 21:52 +0000
Re: Multiple python versions, one dev environment??? Akira <4kir4.1i@gmail.com> - 2014-07-17 16:29 +0000
Re: Multiple python versions, one dev environment??? Ned Batchelder <ned@nedbatchelder.com> - 2014-07-17 15:41 -0400
Re: Multiple python versions, one dev environment??? Joep van Delft <joepvandelft@xs4all.nl> - 2014-07-17 21:54 +0200
Re: Multiple python versions, one dev environment??? Roy Smith <roy@panix.com> - 2014-07-17 19:44 -0400
Re: Multiple python versions, one dev environment??? alex23 <wuwei23@gmail.com> - 2014-07-18 11:15 +1000
Re: Multiple python versions, one dev environment??? Roy Smith <roy@panix.com> - 2014-07-17 21:29 -0400
Re: Multiple python versions, one dev environment??? Chris Angelico <rosuav@gmail.com> - 2014-07-18 12:42 +1000
csiph-web