Skip to content

Ipython > 6 is python 3 only. Update pacakges and dependencies.#8309

Closed
s-sajid-ali wants to merge 9 commits intospack:developfrom
s-sajid-ali:ipython_python_3
Closed

Ipython > 6 is python 3 only. Update pacakges and dependencies.#8309
s-sajid-ali wants to merge 9 commits intospack:developfrom
s-sajid-ali:ipython_python_3

Conversation

@s-sajid-ali
Copy link
Copy Markdown
Contributor

@s-sajid-ali s-sajid-ali commented May 29, 2018

	modified:   var/spack/repos/builtin/packages/py-ipython-genutils/package.py
	modified:   var/spack/repos/builtin/packages/py-ipython/package.py
	new file:   var/spack/repos/builtin/packages/py-testpath/package.py
	modified:   var/spack/repos/builtin/packages/py-traitlets/package.py

I don't understand why ipython doesn't work when py-setuptools is specified as a dependency. Leaving it as is until someone understands how to fix it.

One package requires master and has to be installed with -n.

	modified:   var/spack/repos/builtin/packages/py-ipython-genutils/package.py
	modified:   var/spack/repos/builtin/packages/py-ipython/package.py
	new file:   var/spack/repos/builtin/packages/py-testpath/package.py
	modified:   var/spack/repos/builtin/packages/py-traitlets/package.py
@s-sajid-ali
Copy link
Copy Markdown
Contributor Author

Also, does spack have a plan for dealing with the flit buildsystem for python packages ?
refer to 1

	modified:   var/spack/repos/builtin/packages/py-backcall/package.py
	modified:   var/spack/repos/builtin/packages/py-ipython-genutils/package.py
	modified:   var/spack/repos/builtin/packages/py-ipython/package.py
	modified:   var/spack/repos/builtin/packages/py-testpath/package.py
	modified:   var/spack/repos/builtin/packages/py-traitlets/package.py
@adamjstewart
Copy link
Copy Markdown
Member

I don't understand why ipython doesn't work when py-setuptools is specified as a dependency.

Because py-setuptools is not a dependency. Spack adds setuptools-specific flags to python setup.py install in order to handle things like eggs. If the package doesn't use setuptools, this will break.

"""Specifications for callback functions passed in to an API"""

homepage = "https://github.com/takluyver/backcall"
url = "https://files.pythonhosted.org/packages/84/71/c8ca4f5bb1e08401b916c68003acf0a0655df935d74d93bf3f3364b310e0/backcall-0.1.0.tar.gz"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s-sajid-ali
Copy link
Copy Markdown
Contributor Author

The install_requies section of the current setup.py lists setuptools as a requirement though and I did the same for the spack package.

@adamjstewart
Copy link
Copy Markdown
Member

Oh, very interesting. For some reason they use the setup function from distutils instead of from setuptools, which explains why those install flags aren't working. You could override the default install phase to not add those flags even though setuptools is a dependency.

@s-sajid-ali
Copy link
Copy Markdown
Contributor Author

s-sajid-ali commented May 30, 2018

So it looks like there's a choice for ipython. The setup.py has this comment :

# For some commands, use setuptools.  Note that we do NOT list install here!
# If you want a setuptools-enhanced install, just run 'setupegg.py install'

Should this be left here and not list setuptools as a dependency or should a variant for setuptools also be included ?

Copy link
Copy Markdown
Member

@citibeth citibeth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not merge. Add necessary elements to #7926 instead.

@citibeth
Copy link
Copy Markdown
Member

citibeth commented Jun 1, 2018

This cannot be merged because it breaks Python2. See #7926 for how to create packages that work for Python2 and Python3. HOWEVER... the core problem is that the concretizer cannot properly handle things like:

depends_on('py-backport', when='^python@:2')

@scheibelp we have had discussion about that, and the plan is to fix the concretizer. In the meantime, #7926 provides a "hack" of a +python3 variant you have to set manually, and then the concretizer is able to use that in depends_on() statements. So the above turns into:

depend_on('py-backport', when='~python3')

It has been decided that this stuff will not be merged into develop; but instead (for now), Python3 users will merge #7926. See #8018. If you wish this decision to be revisited, you need to petition core Spack maintainers such as @scheibelp. In any case... the good thing about #7926 is it doesn't break Python2; so in theory it COULD be merged.

Moving forward... I see this PR as basically as new versions of a bunch of things. Please do the following:

  1. If the new package or version requires Python3, submit a new PR based on the branch efischer/Python3Fixes and notify me (@citibeth) when opening the PR. Please do one package per PR. I will merge it into that branch, where it becomes part of Successfully Concretize Python3-Based DAGs  #7926.

  2. If the new package can also work with Python2, please separate it into its own PR and re-submit to the general develop branch.

@citibeth citibeth closed this Jun 1, 2018
@s-sajid-ali
Copy link
Copy Markdown
Contributor Author

So, I've made the default version to be 6.4.0 and this will work for python-3 only. All that needs to be done is to add an if statement to force it to pick versions lower than 6.0.0 if the python version is 2.7.x. I've updated the dependencies from their latest setup.py file and tested the install as well.

@citibeth
Copy link
Copy Markdown
Member

citibeth commented Jun 2, 2018

All that needs to be done is to add an if statement to force it to pick versions lower than 6.0.0 if the python version is 2.7.x.

@s-sajid-ali That is done with depends_on('xyz', when='^python@...') --- which is unfortunately what doesn't work with the concretizer at this point. Please do submit a PR on top of the efischer/Python3Fixes branch.

@s-sajid-ali
Copy link
Copy Markdown
Contributor Author

s-sajid-ali commented Jun 2, 2018

It looks like all the commits to develop are also included. Does that work ?

@citibeth
Copy link
Copy Markdown
Member

citibeth commented Jun 2, 2018 via email

@s-sajid-ali
Copy link
Copy Markdown
Contributor Author

@adamjstewart : would it be possible to add the py-backcall package to develop so that it's easier for people who do use it ?

@adamjstewart
Copy link
Copy Markdown
Member

You can add any package you want to develop, just submit a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants