From: Rob S. <rs...@MI...> - 2010-03-25 16:11:46
|
Thanks for figuring out the include thing! You should put setuptools in a try/except block. Remember, I want users to automatically pull in pysparse as a dependency, so they wouldn't have an option to stop the process between downloading and installing pysparse to edit a file. And when pip installs something from SVN instead of from PyPI, it insists on 'setup.py develop'. It's fortunate that pip can force setuptools to be imported, but we shouldn't rely on that behavior. Unrelatedly, I've just noticed a bug in the PysparseMatrix class. It has a .matvec method that doesn't meet NumPy's requirements (because it returns its result, instead of writing it into another array). Currently I work around it by using .matrix.matvec, which does the right thing, but it would be nice if this worked better. Would it make sense for me to have SVN access so I can fix minor things like this? -- Rob On Thu, Mar 25, 2010 at 10:18 AM, Dominique Orban <dom...@gm...> wrote: > On Wed, Mar 24, 2010 at 5:24 PM, Rob Speer <rs...@mi...> wrote: >>>> 2. Pysparse won't install in a virtualenv. It tries to install files >>>> in the include/ directory of your Python environment, but virtualenvs >>>> don't have their own include directory. They just symlink to the >>>> system-wide one. >>>> >>>> I don't know what the correct way to resolve this one is, because I've >>>> never had to manage additional include files in a Python package. >>> >>> Rob, >>> >>> Thanks for the feedback. #1 has been on my list for a long time but >>> never gets adressed because time is scarce. I really want to have a >>> proper setup.py for Pysparse. I'm now getting better at writing them >>> so maybe I can whip up something quick. >>> >>> Regarding #2, could you be more specific? In my experience, >>> package-specific include files always go to the include/ directory of >>> the local Python environment. However, you can normally install >>> packages "locally" (e.g., in your home directory) instead of system >>> wide, by using an option such as --prefix or --home with setup.py. I >>> might have misunderstood your question... >> >> Responding to this part now: does your local Python environment >> actually have its own include/ directory? Because my virtualenv just >> has a symbolic link to the Python global one. This means that >> installing pysparse in a virtualenv requires permission to modify the >> global Python include directory, and it does so. > > No my virtual environment doesn't have its own include dir. All it has > is a symlink to the system include dir. This looks like a defect of > virtualenv, really. > > The pysparse header files are now installed under pysparse/include in > the lib/pythonX.Y directory. So this doesn't cause permission issues > with virtual environments anymore. I also added a convenience function > for packages that rely on pysparse: > >>>> import pysparse >>>> pysparse.get_include() > > Let me know how that goes. > > -- > Dominique > |