[WIP] Preliminary PythonPackage class#2709
[WIP] Preliminary PythonPackage class#2709adamjstewart wants to merge 12 commits intospack:developfrom
Conversation
|
This might sound like a dumb question, but... do all packages that use the Python build system extend Python? For example, I believe the Spack package superclass should be based on the build system used, let's not get that confused with the contents of the package. If somebody wants to use Python setuptools to build a C++ package, they can go right ahead... For that reason, I think that |
|
So in extends('python')But in some packages, I needed to add something like: extends('python', ignore=r'bin/.*')This is causing the documentation tests to fail with a |
|
Would you like to try #2281 in this PR as well; or do you think that's best left for another day? |
|
|
||
| extends('python') | ||
|
|
||
| depends_on('py-setuptools', type='build') |
There was a problem hiding this comment.
Why does this depend on py-setuptools? Should that be an autodependency like with CMakePackage? Or am I missing a distinction between setuptools and distutils?
There was a problem hiding this comment.
I think setuptools is like a successor to distutils. The setup.py tries to import setuptools. If it is not available, we can't build it. This is the case for the majority of Python packages. I thought about adding it to PythonPackage anyway, but a lot of packages don't need it, including py-setuptools, for which we don't want a circular dependency.
|
BTW... looking forward to this one! |
Well, all packages that need to run
|
Perhaps. I think this PR is going to need a lot of testing. And like your By the way, In combination with the |
|
I'll make a similar PR for the R-build system after #2475 is merged. R seems even simpler. |
|
Ok, I have almost all of the packages that call The first type is like lib = os.path.join(spec['libspatialindex'].prefix, 'lib')
os.environ['SPATIALINDEX_LIBRARY'] = os.path.join(lib, 'libspatialindex.%s' % dso_suffix)
os.environ['SPATIALINDEX_C_LIBRARY'] = os.path.join(lib, 'libspatialindex_c.%s' % dso_suffix)
setup_py('install', '--prefix=%s' % prefix)Is this what A second type is where there are more phases than normal, like in self.setup_py('clean', '--all')
self.setup_py('build_ext', include_flags, library_flags)
self.setup_py('install', '--prefix={0}'.format(prefix))
self.setup_py('bdist', include_flags, library_flags)Right now, the best idea I have is to create |
|
@adamjstewart @tgamblin I think the problem you are seeing here is due to the script we run. We should change: coverage run bin/spack test "$@"
coverage combineto coverage run bin/spack test "$@" && coverage combineI'll check if I am right and and submit a PR right away in case. |
| # if pkg.extendees: | ||
| # directive = 'extends' | ||
| # msg = 'Packages can extend at most one other package.' | ||
| # raise DirectiveError(directive, msg) |
There was a problem hiding this comment.
Is this safe to get rid of?
Especially if the package resides on PyPI... which provides "DOAP" records giving a lot of useful info. |
|
Oh boy, I think every file in this PR has a conflict now. This will be fun to rebase. |
|
@tgamblin I had never heard of that. I'll have to try it out. While I have your mastery of git on the table, have you ever seen a message like this? It's been happening to me very frequently lately. I don't have any webhooks or protected branches on my fork. |
|
I think I can resolve those conflicts. Give me an hour, I'll put up a new version of this branch that will go down more easily. |
|
@citibeth No worries, I'm already working on rebasing. Hopefully |
|
@adamjstewart did you rebase and then push? That typically requires a force-push because rebase has rewritten commits, changing the history. If that is your problem, my advice would be to always work on branches, even within your fork, so that you only ever have to pull from upstream develop. e.g.: git remote add upstream <main spack repo>
git checkout -b feature
# work work work
git push origin feature
# do PR
# PR is merged
git checkout develop
git pull upstream develop
# now you're synced and feature is merged
git branch -D feature |
|
It looks like you're on a branch in your fork even here, though, so I dunno why you're getting that. Hm. |
|
OK, if you like. My observation was that getting rid of "nolink" is
largely automated with `sed`. I'd be happy to revert that change on the
Python files, apply your branch, and then re-apply the nolink change. That
would probably be easier than going through a manual or semi-manual process
on your change.s
…On Sun, Jan 8, 2017 at 12:17 PM, Adam J. Stewart ***@***.***> wrote:
@citibeth <https://github.com/citibeth> No worries, I'm already working
on rebasing. Hopefully git rerere will make things quicker.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2709 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AB1cdyZxMo6zcbjNbJDZx3-oVDdfXeRFks5rQRougaJpZM4LYqZE>
.
|
|
@citibeth If that's all you have to do then that is probably easier. I tried rebasing but messed some files up, so I'll let you handle the rebase. |
|
@tgamblin I don't think I rebased. My develop should be in sync with your develop. |
|
Replaced by #2778, which is (mostly) a re-based version of this PR. |
|
@adamjstewart: if you create a new fork and force push it there I could take a look... |
|
@tgamblin All of a sudden the problem disappeared. I wonder if my |
Decided to see how hard it would be to create a
PythonPackageclass. Not too bad so far. Definitely needs a lot more testing and documentation before it's ready to merge, but I think it's a good start.