Opened 2 years ago

Last modified 2 years ago

#21508 new task

Clean up src/setup.py to bring it to standard distutils behavior

Reported by: mkoeppe Owned by:
Priority: major Milestone: sage-7.5
Component: build Keywords:
Cc: jdemeyer, vbraun, embray, leif, fbissey, was, mmezzarobba Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #21480, #21604, #21600 Stopgaps:

Description (last modified by mkoeppe)

All building (including cythonizing) should done within the call to setup, not before it.

Sub-tasks:

  • #21480: Make sagelib setup.py self-contained and independent of SAGE_ROOT
  • #21613: Make setup.py not depend on make
  • #21604: Cleaning up stale installed files in setup()
    • See also #21654: Disentangle cleaning of stale installed files in build directory and in install directory
  • #21600: Use custom build_ext to compile Cython code

In particular,

  • src/setup.py --help should return immediately.
  • src/setup.py clean should not build anything but just clean (and everything that is now done by make clean in the src directory should be done by it)

Also the following should be done:

  • #21516: Fix sagelib sdist (src/setup.py sdist)
  • #21535: Make src/setup.py respect --build-base and --inplace, independent of SAGE_CYTHONIZED
  • #21573: Make sure src/setup.py respects --install-base and --root

Also see:

  • #20108: Use package_data instead of data_files in setup.py
  • #21516: Fix sagelib sdist (src/setup.py sdist)
  • #21682: Add a separate "cythonize" command to setup.py
  • #12659: build the sage library in place
  • #13190: make sage use setuptools instead of distutils

Change History (25)

comment:1 Changed 2 years ago by jdemeyer

  • Dependencies set to #20596

comment:2 Changed 2 years ago by jdemeyer

  • Type changed from defect to task

comment:3 Changed 2 years ago by mkoeppe

  • Description modified (diff)

comment:4 Changed 2 years ago by mkoeppe

  • Summary changed from Clean up src/setup.py to Clean up src/setup.py, fix 'setup.py sdist'

comment:5 Changed 2 years ago by mkoeppe

  • Cc leif fbissey added
  • Description modified (diff)

comment:6 Changed 2 years ago by mkoeppe

  • Description modified (diff)
  • Summary changed from Clean up src/setup.py, fix 'setup.py sdist' to Clean up src/setup.py to bring it to standard distutils behavior

comment:7 Changed 2 years ago by mkoeppe

  • Cc was mmezzarobba added
  • Description modified (diff)

comment:8 Changed 2 years ago by embray

and everything that is now done by make clean should be done by it

By which you mean the makefile in src/ right?

comment:9 Changed 2 years ago by mkoeppe

  • Description modified (diff)

Yes -- I've clarified it in the description.

comment:10 Changed 2 years ago by jdemeyer

  • Dependencies changed from #20596 to #21600
  • Description modified (diff)

comment:11 Changed 2 years ago by jdemeyer

  • Dependencies changed from #21600 to #21604, #21600

comment:12 Changed 2 years ago by jdemeyer

  • Dependencies changed from #21604, #21600 to #21480, #21604, #21600
  • Description modified (diff)

comment:13 Changed 2 years ago by embray

Definitely keep in touch with me as a point of contact on any work you do on this--I know distutils + setuptools from top to bottom.

comment:14 Changed 2 years ago by embray

  • Description modified (diff)

comment:15 Changed 2 years ago by mkoeppe

Let me just say that I consider #21613 not an important step towards this task ("... standard distutils behavior"). The present task ticket (#21508) is concerned with getting the behavior of setup.py standard (how does it respond to standard commands and options), not necessarily its implementation. The fact that setup.py with #21480 invokes make is an implementation detail, which is not very relevant for the goal of #21507.

comment:16 follow-up: Changed 2 years ago by embray

Except it is pretty non-standard for it to have non-trivial side-effects (e.g. running a subprocess that generates files) unconditionally. Behavior-wise that should only happen when it's actually important for that to happen, such as during the build command.

comment:17 in reply to: ↑ 16 Changed 2 years ago by mkoeppe

Replying to embray:

Except it is pretty non-standard for it to have non-trivial side-effects (e.g. running a subprocess that generates files) unconditionally. Behavior-wise that should only happen when it's actually important for that to happen, such as during the build command.

I agree that it should happen during the build command.

comment:18 follow-up: Changed 2 years ago by embray

I will work on #21613, and you'll see it's not that big a deal.

comment:19 in reply to: ↑ 18 Changed 2 years ago by jdemeyer

Replying to embray:

I will work on #21613, and you'll see it's not that big a deal.

Beware of conflicts with other tickets, in particular #21600 and its dependencies.

comment:20 Changed 2 years ago by embray

Yep. I don't think there will be significant conflicts, but I can make those tickets dependencies of #21613 and ensure any work I do there integrates well with the others before suggesting it to be merged.

comment:21 Changed 2 years ago by mkoeppe

  • Description modified (diff)

comment:22 Changed 2 years ago by mkoeppe

  • Description modified (diff)

comment:23 Changed 2 years ago by embray

  • Description modified (diff)

comment:24 Changed 2 years ago by mkoeppe

  • Description modified (diff)

comment:25 Changed 2 years ago by mkoeppe

  • Description modified (diff)
Note: See TracTickets for help on using tickets.