Re: Python's import situation has driven me to the brink of imsanity

2016-02-10 Thread Mark Lawrence
On 10/02/2016 19:05, Sivan Greenberg wrote: not entirely on-topic here, but is distutils still being in active use "in the wild" ? -Sivan Given that there was distutils2 which took the same course as the Norwegian Blue, I would say no, distutils is not active. I'll happily stand corrected.

Re: Python's import situation has driven me to the brink of imsanity

2016-02-10 Thread Sivan Greenberg
not entirely on-topic here, but is distutils still being in active use "in the wild" ? -Sivan On Wed, Feb 10, 2016 at 2:31 AM, Oscar Benjamin wrote: > On 8 February 2016 at 00:38, wrote: > > Running python setup.py develop doesn't work, it gives me this error: > error: invalid command 'develo

Re: Python's import situation has driven me to the brink of imsanity

2016-02-09 Thread Oscar Benjamin
On 8 February 2016 at 00:38, wrote: > Running python setup.py develop doesn't work, it gives me this error: error: > invalid command 'develop' This is presumably because your setup.py script uses distutils rather than setuptools: distutils doesn't have the develop command. > Running pip instal

Re: Python's import situation has driven me to the brink of imsanity

2016-02-07 Thread dimva13
Running python setup.py develop doesn't work, it gives me this error: error: invalid command 'develop' Running pip install -e . does work. This is somewhat reasonable, and I think may work for my purposes, but it has the following drawbacks: - you have to create a fake package with a fake versio

Re: Python's import situation has driven me to the brink of imsanity

2016-02-07 Thread Sivan Greenberg
I if it's more than few files, I use 'develop' as Kevin noted in the note before: - http://www.ewencp.org/blog/a-brief-introduction-to-packaging-python/ Hope this helps.. -Sivan On Sun, Feb 7, 2016 at 6:09 PM, Kevin Conway wrote: > You can use 'setup.py develop' or 'pip install -e' to install

Re: Python's import situation has driven me to the brink of imsanity

2016-02-07 Thread Kevin Conway
You can use 'setup.py develop' or 'pip install -e' to install your package in editable mode. It makes it so your local code is used. Modifications are seen immediately. On Sun, Feb 7, 2016, 08:16 wrote: > I see that this would work once you've installed the package, but how do > you develop it?

Re: Python's import situation has driven me to the brink of imsanity

2016-02-07 Thread dimva13
I see that this would work once you've installed the package, but how do you develop it? Say you are working on a change that modifies both email.py and reports.py. Do you run setup.py every time you make a change in email.py? On Sunday, February 7, 2016 at 1:35:15 AM UTC-5, Kevin Conway wrote:

Re: Python's import situation has driven me to the brink of imsanity

2016-02-07 Thread Sivan Greenberg
in sake of providing another example, as I ran into the same problem and fixed it the very same way, one can also take a look at: (this is the main executable) https://github.com/sivang/navistore/blob/master/navistore/backend/nhttpserver.py Note the explicit imports in lines 19-22 to allow the exe

Re: Python's import situation has driven me to the brink of imsanity

2016-02-06 Thread Kevin Conway
> My question is: is this crazy? Please tell me there's a better way and I just wasted my time creating this package. There is a better way and you have wasted your time creating this package. I hear your problem statement as asking two questions. The first is: What is the right way to include ex

Re: Python's import situation has driven me to the brink of imsanity

2016-02-06 Thread Chris Angelico
On Sun, Feb 7, 2016 at 1:47 PM, wrote: > Imsanity allows you to make imports usable (not ideal, but at least usable) > for python projects without having to manage PYTHONPATHs or do whacky stuff > like running files with python -m or put even whackier boilerplate at the top > of every file. An

Python's import situation has driven me to the brink of imsanity

2016-02-06 Thread dimva13
No, that's not a typo, it's the name of a package I created. :) The problems I have with python's import system are detailed in the README of my package here: https://github.com/vadimg/imsanity Basically, relative imports are broken if you like running scripts as executables, so the only real s