Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#17268 closed defect (fixed)

Fix removal of old versions in setuptools

Reported by: jdemeyer Owned by:
Priority: blocker Milestone: sage-6.4
Component: build Keywords: setuptools, sagenb
Cc: Merged in:
Authors: Jeroen Demeyer Reviewers: Volker Braun
Report Upstream: N/A Work issues:
Branch: db9fe89 (Commits, GitHub, GitLab) Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by jdemeyer)

The setuptools patch build/pkgs/setuptools/patches/easy_install_lock.patch from #13201 breaks the removal of old versions of packages.

This has the following effect in Sage: the wrong version of sagenb is used. Even after an explicit ./sage -f sagenb installing sagenb-0.11.0, Sage still thinks I want to use an older version.

Looking at local/lib/python2.7/site-packages/easy-install.pth shows

[...]
./Flask_OpenID-1.2.4-py2.7.egg
./sagenb-0.10.7.2-py2.7.egg
./zope.interface-4.0.5-py2.7-linux-x86_64.egg
./sagenb-0.10.8.2-py2.7.egg
./sagenb-0.11.0-py2.7.egg
./itsdangerous-0.23-py2.7.egg
[...]

This leads to the following doctest failure:

$ ./sage -tp --long --sagenb
too many failed tests, not using stored timings
Running doctests with ID 2014-10-31-14-01-49-cac56b83.
Doctesting the Sage notebook.
Sorting sources by runtime so that slower doctests are run first....
Doctesting 51 files using 4 threads.
sage -t --long local/lib/python2.7/site-packages/sagenb-0.10.7.2-py2.7.egg/sagenb/misc/sphinxify.py
**********************************************************************
File "local/lib/python2.7/site-packages/sagenb-0.10.7.2-py2.7.egg/sagenb/misc/sphinxify.py", line 69, in sagenb.misc.sphinxify.sphinxify
Failed example:
    sphinxify('A test')
Expected:
    '\n<div class="docstring">\n    \n  <p>A test</p>\n\n\n</div>'
Got:
    '<div class="docstring">\n    \n  <p>A test</p>\n\n\n</div>'
**********************************************************************
File "local/lib/python2.7/site-packages/sagenb-0.10.7.2-py2.7.egg/sagenb/misc/sphinxify.py", line 71, in sagenb.misc.sphinxify.sphinxify
Failed example:
    sphinxify('**Testing**\n`monospace`')
Expected:
    '\n<div class="docstring"...<strong>Testing</strong>\n<span class="math"...</p>\n\n\n</div>'
Got:
    '<div class="docstring">\n    \n  <p><strong>Testing</strong>\n<span class="math">monospace</span></p>\n\n\n</div>'
**********************************************************************
File "local/lib/python2.7/site-packages/sagenb-0.10.7.2-py2.7.egg/sagenb/misc/sphinxify.py", line 73, in sagenb.misc.sphinxify.sphinxify
Failed example:
    sphinxify('`x=y`')
Expected:
    '\n<div class="docstring">\n    \n  <p><span class="math">x=y</span></p>\n\n\n</div>'
Got:
    '<div class="docstring">\n    \n  <p><span class="math">x=y</span></p>\n\n\n</div>'
**********************************************************************

Change History (15)

comment:1 Changed 8 years ago by jdemeyer

  • Description modified (diff)
  • Summary changed from Doctest failures in sagenb to Wrong version of sagenb imported

comment:2 Changed 8 years ago by jdemeyer

  • Component changed from notebook to build
  • Description modified (diff)
  • Keywords setuptools sagenb added

comment:3 Changed 8 years ago by jdemeyer

  • Description modified (diff)
  • Summary changed from Wrong version of sagenb imported to Fix removal of old versions in setuptools

comment:4 follow-up: Changed 8 years ago by vbraun

maybe the best solution is to switch everything to pip and get rid of easy_install ...

comment:5 Changed 8 years ago by jdemeyer

I have a simple patch ready which simply locks easy_install.pth all the time.

comment:6 Changed 8 years ago by jdemeyer

  • Branch set to u/jdemeyer/ticket/17268
  • Created changed from 10/31/14 13:07:32 to 10/31/14 13:07:32
  • Modified changed from 10/31/14 14:09:31 to 10/31/14 14:09:31

comment:7 Changed 8 years ago by jdemeyer

  • Authors set to Jeroen Demeyer
  • Commit set to fc331e7aff0d697102cec3bcc4226a68af7fdd87
  • Status changed from new to needs_review

New commits:

fc331e7Fix removal of old versions in setuptools

comment:8 Changed 8 years ago by git

  • Commit changed from fc331e7aff0d697102cec3bcc4226a68af7fdd87 to db9fe89fdb525a48c9d2472f7dc648f6b3b632a1

Branch pushed to git repo; I updated commit sha1. New commits:

db9fe89Manually remove "Only in" line

comment:9 in reply to: ↑ 4 Changed 8 years ago by jdemeyer

Replying to vbraun:

maybe the best solution is to switch everything to pip and get rid of easy_install ...

Does pip not have such a race condition?

comment:10 Changed 8 years ago by vbraun

  • Reviewers set to Volker Braun
  • Status changed from needs_review to positive_review

Afaik if you are doing it right (not using editable mode)...

comment:11 Changed 8 years ago by vbraun

  • Branch changed from u/jdemeyer/ticket/17268 to db9fe89fdb525a48c9d2472f7dc648f6b3b632a1
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:12 Changed 7 years ago by gagern

  • Commit db9fe89fdb525a48c9d2472f7dc648f6b3b632a1 deleted

Hmm… I'm seeing the same error messages from sphinxify, even without the --sagenb flag, and even after manually removing ./sagenb-0.10.8.2-py2.7.egg from my easy-install.pth. Is this some kind of legacy from this bug here, or is this a separate bug in its own right?

comment:13 Changed 7 years ago by jdemeyer

Obvious question: did you run make?

comment:14 Changed 7 years ago by jdemeyer

...or are you working on an old branch which doesn't have this patch?

comment:15 Changed 7 years ago by gagern

TL;DR: Found my mistake.

OK, I am on 6.5.beta2 which contains this since it got merged for 6.4.rc1. I guess my main problem was the following: I encountered the problem on a feature branch, then checked whether I could reproduce on develop. To do that, I copied the command line as printed by the test suite runner, The one to execute the test from one single file:

sage -t --warn-long 22.0 local/lib/python2.7/site-packages/sagenb-0.10.8.2-py2.7.egg/sagenb/misc/sphinxify.py

I copied that line without really reading it, so I didn't realize that it was referring to the file in the version-specific sagenb directory. Then I started searching for it, found this one here, removed the old sagenb from my pth file, but the executed that same command line.

I guess I had somehow assumed that the error message was due to a bug in the code, and that bug in the code had been fixed by now. The fact that the doctest itself might have been updated didn't occur to me.

Sorry for the noise.

Note: See TracTickets for help on using tickets.