Opened 7 years ago

Last modified 18 months ago

#13190 needs_info enhancement

make sage use setuptools instead of distutils

Reported by: ohanar Owned by: GeorgSWeber
Priority: major Milestone: sage-7.2
Component: build Keywords:
Cc: kini, jdemeyer, robertwb, kcrisman, mhansen Merged in:
Authors: R. Andrew Ohana Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

Currently the sage library uses distutils. Switching to setuptools will give us the setup.py develop command, which bypasses the need to rebuild the sage library when modifying python files.

Attachments (3)

trac13190_root.patch (1.1 KB) - added by ohanar 7 years ago.
apply to root repo
trac13190_scripts.patch (2.6 KB) - added by ohanar 7 years ago.
apply to scripts repo
trac13190_library.patch (22.6 KB) - added by ohanar 7 years ago.
apply to sage library

Download all attachments as: .zip

Change History (32)

comment:1 Changed 7 years ago by ohanar

  • Cc kini jdemeyer robertwb kcrisman added
  • Dependencies set to #13031
  • Status changed from new to needs_review

comment:2 Changed 7 years ago by ohanar

  • Cc mhansen added

comment:3 follow-up: Changed 7 years ago by mhansen

I would imagine that you get problems similar to #12659 . Have you tried this out?

comment:4 in reply to: ↑ 3 Changed 7 years ago by ohanar

Replying to mhansen:

I would imagine that you get problems similar to #12659 . Have you tried this out?

Do you mean the sdist issues? No, I have not tried them yet, but I wouldn't doubt that there may be issues with them. Also, as noted in deps, there is an issue with parallel instances of setuptools, so either deps has to be hacked to force sage into the serial build, or we depend on #12994 (my vote is the later, since it is cleaner).

comment:5 Changed 7 years ago by ohanar

I've decided to make #12994 a dependency -- makes it much easier to add setuptool packages to the build system.

comment:6 Changed 7 years ago by ohanar

  • Dependencies changed from #13031 to #12994, #13031

comment:7 Changed 7 years ago by ohanar

  • Dependencies changed from #12994, #13031 to #12994, #13031, #13197

There are some issues with using relative paths with setuptools (which we want for relocation purposes). #13197 fixes these issues.

comment:8 Changed 7 years ago by ohanar

  • Dependencies changed from #12994, #13031, #13197 to #11874, #12994, #13031, #13197

comment:9 follow-up: Changed 7 years ago by jdemeyer

I am a bit lost on the inter-relations between the tickets #12994, #13190, #13201, #13197 (and perhaps #12659). Could you please clarify the dependencies?

Also, I personally think it would be better to split this in two tickets:

  1. Use setuptools
  2. Use setup.py develop
Last edited 7 years ago by jdemeyer (previous) (diff)

comment:10 in reply to: ↑ 9 Changed 7 years ago by ohanar

Replying to jdemeyer:

I am a bit lost on the inter-relations between the tickets #12994, #13190, #13201, #13197 (and perhaps #12659). Could you please clarify the dependencies?

Also, I personally think it would be better to split this in two tickets:

  1. Use setuptools

This should only require #13031.

  1. Use setup.py develop

This is more or less #12659 after switching to setuptools, and is where the other dependencies creep up (they aren't strictly necessary, but the alternative is to hack around setuptools, which is less preferable than patching it IMO).

I'll rework the patch to only do A once we have a 5.4 beta (mainly because #13031 more or less needs to be rebased with every development release).

Changed 7 years ago by ohanar

apply to root repo

Changed 7 years ago by ohanar

apply to scripts repo

comment:11 Changed 7 years ago by ohanar

  • Dependencies changed from #11874, #12994, #13031, #13197 to #11874, #12994, #13031

ok, rebased and only does the switch to setuptools (doesn't switch to setup.py develop anymore). Dependencies are now accurate.

Changed 7 years ago by ohanar

apply to sage library

comment:12 Changed 6 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:13 Changed 6 years ago by roed

  • Status changed from needs_review to needs_info

Are we trying to make this happen before the git transition or afterward?

comment:14 Changed 6 years ago by ohanar

Certainly after, although I'm not currently convinced that we should proceed in this direction.

comment:15 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:16 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:17 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:18 Changed 4 years ago by embray

Any thoughts on this? It hasn't been touched in quite some time despite there being (a likely outdated by now) patch. I can take this issue over and see it to completion if desired.

comment:19 follow-up: Changed 4 years ago by jdemeyer

There is at least one problem: setuptools does not support setup(data_files=...), see setuptools #130. It's a good reason to avoid setuptools.

I'm not sure that we need data_files for the Sage library though. Maybe we could use package_data instead. But then that is something which should be investigated.

comment:20 Changed 4 years ago by jdemeyer

  • Dependencies #11874, #12994, #13031 deleted

comment:21 Changed 4 years ago by embray

I don't know what files need to be installed with the sage package. For the majority of Python-based projects package_data is preferred, but of course Sage is 'special'.

Let me look into what files are installed with the sage package, and I can worry about the details.

comment:22 Changed 4 years ago by jdemeyer

Hang on, I'm looking at it.

comment:23 Changed 4 years ago by jdemeyer

  • Dependencies set to #20108
  • Milestone changed from sage-6.4 to sage-7.2

I created a new ticket for using package_data.

comment:24 in reply to: ↑ 19 Changed 18 months ago by jdemeyer

Replying to jdemeyer:

There is at least one problem: setuptools does not support setup(data_files=...), see setuptools #130. It's a good reason to avoid setuptools.

I recently learned about the (almost undocumented) setuptools options --old-and-unmanageable. It forces a non-egg build which is exactly what we want. So that would make this ticket possible again.

comment:25 Changed 18 months ago by jdemeyer

  • Dependencies #20108 deleted

comment:26 Changed 18 months ago by jdemeyer

Also, it seems that Sage is no longer using either data_files or package_data. So that discussion has also disappeared.

comment:27 follow-ups: Changed 18 months ago by embray

I forget, what is the difference between --old-and-unmanageable and --single-version-externally-managed, where I thought the latter should be sufficient...

Also I do want to use package_data for Sage (see e.g. #21732) but I don't see what the problem is.

comment:28 in reply to: ↑ 27 Changed 18 months ago by jdemeyer

Replying to embray:

Also I do want to use package_data for Sage (see e.g. #21732) but I don't see what the problem is.

There is no problem with package_data if you want to use it in the way that it was intended to be used (which may not align with actual use cases).

There is a problem with data_files: setuptools still doesn't really support that. One of the reasons that this ticket stalled was because Sage was using data_files at the time to install Cython-related files. You suggested that it would be easy to use package_data instead (#20108). That didn't actually work, but now we are using custom code (neither data_files not package_data, see #21600) to install those files.

Last edited 18 months ago by jdemeyer (previous) (diff)

comment:29 in reply to: ↑ 27 Changed 18 months ago by jdemeyer

Replying to embray:

I forget, what is the difference between --old-and-unmanageable and --single-version-externally-managed

Mainly that the latter requires a --record argument also.

Note: See TracTickets for help on using tickets.