Overhaul/Clean up/Refactor SConstruct/SConscript #93
Replies: 8 comments 43 replies
-
I think what these tools will all struggle with is some of the SCons magic. This includes both implicit import of various SCons classes like You can always add a vote for SCons/scons#3210. |
Beta Was this translation helpful? Give feedback.
-
Bike-shedding time: What's your opinion of single vs. double quotes in Python code (for my purposes here, in the various SCons related files)? My personal opinion is a pretty strong preference for double quotes as the default, and my plan in this pull request is to eventually change all the single quotes to double quotes (except where single quotes have to be used because of a double quote inside the string). Although I'm not advocating to apply Black to our code base, I agree with their justification for preferring double quotes whenever possible:
|
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
Python testing ... as this is a discussion about a
It's fully compatible with |
Beta Was this translation helpful? Give feedback.
-
Packaging ... another comment I have is about packaging. There currently are msi, macOS, conda and ubuntu packages (I may be missing a few). The first can be handled via Tangent: Assuming that local installations are possible (I have not checked), a [Edit: just noticed that interface-specific-installers are already mentioned at the top] |
Beta Was this translation helpful? Give feedback.
-
The first pull request targeting this discussion is Cantera/cantera#1012 and is ready for review 🎉 |
Beta Was this translation helpful? Give feedback.
-
As another comment that may fit in this context: how hard would it be to split |
Beta Was this translation helpful? Give feedback.
-
I read today about Ralf Gommers' efforts to transition SciPy to the Meson build system. His motivations are varied, but the main one was that distutils is deprecated in Python 3.10 and will be removed in 3.12, some 2 years from now, and NumPy (and hence SciPy) depend heavily on distutils. Setuptools is planning to include distutils with a cleaner API, but they haven't done so yet. I wonder if something like this makes sense for Cantera too. We currently don't use distutils to drive the compiling like NumPy does, so we don't have to worry about the impending removal of distutils. There's also always the danger of missing corner cases that are fixed in the SCons build system, especially for platforms we don't test that often. Meson does seem very fast though, and as the basis of this discussion is the cruft in our SCons system, I thought it'd be worth considering a change of build system. More information: https://labs.quansight.org/blog/2021/07/moving-scipy-to-meson/ scipy/scipy#13615 |
Beta Was this translation helpful? Give feedback.
-
The SCons build scripts are currently quite an octopus. Although they aren't very fragile, in the sense that they tend to work on every platform we need them to, it's a little hard to know where to change/add options as needed. I think there's room to do a few things:
pathlib.Path
, type hinting, etc. See also Make python3 default for build script #18The overall goal is to accomplish this simplification without changing or dropping support for any of the current platforms/compilers we support.
I think doing this would have a few benefits. First, it will make it easier to onboard new folks who need to modify the build script. Second, it will make it easier to add new features, such as interface-specific installers (which will, in turn, make it easier to do things like have a Wheel package to install with pip). Third, it will simplify the code by using modern Python features. And fourth, it will allow developers to use modern Python tooling, such as static type checkers (which are built in to editors like VS Code).
This is a longer term project, I think. Since it's not high-priority I don't imagine being able to devote lots of dedicated time (depending on how much procrastinating I'm doing with grading). I'm opening this as an Idea to see if other people have feedback about whether this is worth it, and if so, other places where simplification can happen!
Beta Was this translation helpful? Give feedback.
All reactions