Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsonschema 2.5.0 not installable on Python 3 #228

Closed
wichert opened this issue Jun 5, 2015 · 23 comments
Closed

jsonschema 2.5.0 not installable on Python 3 #228

wichert opened this issue Jun 5, 2015 · 23 comments

Comments

@wichert
Copy link

wichert commented Jun 5, 2015

You use a universal wheel for jsonschema, which means the dependencies are forced to be identical on Python 2 and 3. This breaks the handling of functools32, which is only required (and installable) on Python 2. That results in this error:

$ bin/pip install --upgrade jsonschema
Collecting jsonschema
  Downloading jsonschema-2.5.0-py2.py3-none-any.whl
Collecting functools32 (from jsonschema)
  Downloading functools32-3.2.3-1.tar.gz
    Complete output from command python setup.py egg_info:
    This backport is for Python 2.7 only.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/p_/p3cbpfr96sb7h5gpq6vfvwcc0000gn/T/pip-build-d1dmcog1/functools32
@SylvainCorlay
Copy link

Yes, apparently the pypi release is broken. The egg.info includes a requires.txt file that lists functools32, which is Python 2.7 only.

@wichert
Copy link
Author

wichert commented Jun 5, 2015

It's specifically only the wheel which is broken. The source releases are fine.

@SylvainCorlay
Copy link

I think that it depends on how you install it. Running setup.py should work indeed.

@asottile
Copy link
Contributor

asottile commented Jun 5, 2015

This is also broken in py26 (I imagine broken in any version that is not 2.7). The wheel is not universal and probably shouldn't be marked as such. Installing from sdist works fine.

@Julian
Copy link
Member

Julian commented Jun 5, 2015

Thanks for the report, sorry that things are broken -- I'm trying to get some tests around this so that I can fix it and push a bugfix. (https://github.com/Julian/jsonschema/tree/install-checks has the idea, I'm just gonna use travis to make sure that what a release generates is installable).

I'll update as soon as I figure things out.

@asottile
Copy link
Contributor

asottile commented Jun 5, 2015

@Julian I believe simply deleting the .whl from pypi will solve this in the short term (forcing installation from sdist)

@mriedem
Copy link

mriedem commented Jun 5, 2015

Confirmed in openstack py34 jobs today:

https://jenkins03.openstack.org/job/gate-nova-python34/82/console

@Julian
Copy link
Member

Julian commented Jun 5, 2015

Good point -- removed the wheel, does that help all here for the immediate term?

@SylvainCorlay
Copy link

@Julian it seems to work. Thanks.

@takluyver
Copy link

We have several dependencies for IPython which are only relevant on one platform or Python version. You can see here how we're specifying them in a way that's compatible with wheels. We actually specify those dependencies twice; once in the new format for building wheels and pip >= 6, and one for people installing from source with pip < 6. The same technique should work for jsonschema's dependencies.

@mdomke
Copy link

mdomke commented Jun 6, 2015

I think that removing the wheel from pypi doesn't do the trick. At least not when you're using pip version 7, which creates wheels from the source packages before installing them. So you currently can do a pip install jsonschema in Python 3 with pip version 6.1.1, which will fail however with pip version 7.0.3.

@isaacm
Copy link

isaacm commented Jun 6, 2015

Using pip --no-binary option until a fix is finalized.

@wichert
Copy link
Author

wichert commented Jun 8, 2015

@mdomke Removing the wheel is fine. When pip creates a wheel from the source it will figure out the right dependencies for your system and put those in your wheel.

@wichert
Copy link
Author

wichert commented Jun 8, 2015

Reverting 537f878 should be enough to fix this.

@mdomke
Copy link

mdomke commented Jun 8, 2015

@wichert I meant removing the wheel from PyPI doesn't do the trick. Anyhow, specifying the requirements in the way I proposed it in my pull-request should solve the problem.

@rbtcollins
Copy link
Contributor

Pull #231 will fix this.

@rbtcollins
Copy link
Contributor

Or #230 which I just saw. That has some extra glue in it to handle old setuptools locally, but personally I'd go with a more pithy approach.

@Julian
Copy link
Member

Julian commented Jun 8, 2015

OK, released 2.5.1, can y'all confirm that things look OK, installation on Py3 works at least now, which I've checked myself.

openstack-gerrit pushed a commit to openstack/requirements that referenced this issue Jun 8, 2015
It was released with bad requirements. See
python-jsonschema/jsonschema#228

Change-Id: I4928c89b9f770017063a69ce262e8cdc3a4a03df
openstack-gerrit pushed a commit to openstack/openstack that referenced this issue Jun 8, 2015
Project: openstack/requirements  16352257719851516170b9ea77cac870cd02e254

Exclude jsonschema 2.5.0.

It was released with bad requirements. See
python-jsonschema/jsonschema#228

Change-Id: I4928c89b9f770017063a69ce262e8cdc3a4a03df
openstack-gerrit pushed a commit to openstack/openstack that referenced this issue Jun 8, 2015
Project: openstack/requirements  16352257719851516170b9ea77cac870cd02e254

Exclude jsonschema 2.5.0.

It was released with bad requirements. See
python-jsonschema/jsonschema#228

Change-Id: I4928c89b9f770017063a69ce262e8cdc3a4a03df
@rbtcollins
Copy link
Contributor

All good on 2.7 and 3.4:

(This shows the changes from yesterday to today in our transitive requirements)
$ git diff
diff --git a/upper-constraints.txt b/upper-constraints.txt
index bbeb749..cb8d378 100644
--- a/upper-constraints.txt
+++ b/upper-constraints.txt
@@ -107,6 +107,7 @@ feedparser===5.2.0
fixtures===1.2.0
flake8===2.4.1
funcparserlib===0.3.6
+functools32===3.2.3.post1;python_version=='2.7'
futures===3.0.2
gabbi===0.99.2
glance-store===0.6.0
@@ -126,7 +127,7 @@ jsonpatch===1.11
jsonpath-rw===1.4.0
jsonpointer===1.9
jsonrpclib===0.1.3
-jsonschema===2.4.0
+jsonschema===2.5.1
kafka-python===0.9.3
kazoo===2.0
kerberos===1.1.1;python_version=='2.7'
@@ -205,7 +206,7 @@ pycadf===1.0.0
pycparser===2.13
pycrypto===2.6.1
pyflakes===0.8.1
-pyghmi===0.7.1
+pyghmi===0.8.0
pylint===1.4.1
pymemcache===1.2.9
pymongo===3.0.2

@mdomke
Copy link

mdomke commented Jun 8, 2015

I tested the installation on Python 3.4 and Python 2.7 with pip 6.1.1 and pip 7.0.3. Everything works fine from my perspective. I also tried older setuptools versions, but it didn't make a difference…

@Julian
Copy link
Member

Julian commented Jun 8, 2015

Awesome, thanks all around, feel free to follow up if there's anything else here.

@Julian Julian closed this as completed Jun 8, 2015
@Julian
Copy link
Member

Julian commented Jun 9, 2015

I've put an attempt at catching this in 96c5f47 in case anyone is interested.

It fails on 2.5.0 and passes now, so I think, hacky as it is, that it'll do.

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

No branches or pull requests

10 participants