sagemath/sage

sage-env, sage.env: Remove unused environment and Python variables SAGE_ETC, SAGE_INC

Closed this issue · 17 comments

These variables are unused (and do not have a legitimate use any more).

If there are user packages around that use it... they will need repackaging as pip-installable packages anyway.

CC: @jhpalmieri @kiwifb @kliem @dimpase

Component: build: configure

Author: Matthias Koeppe

Branch/Commit: 6012b45

Reviewer: François Bissey, John Palmieri

Issue created by migration from https://trac.sagemath.org/ticket/32045

comment:1

I don't know how to deprecate global variables, so help is welcome.

kliem commented
comment:2

Basically lazy_import would work. However, it isn't allowed in there. So we basically need to copy it to create a small deprecated_string_class. All the special methods need to be copied, which is annoying but trivial.

What do you think about this solution?

comment:3

Probably not worth doing this. Let's just document it as deprecated.

comment:4

I thought I was (ab)using SAGE_ETC but it looks like it do go when I abandoned sage-env in sage-on-gentoo.

kliem commented
comment:5

Do you think people will catch on? Then again, they will catch on, once it's gone and then they can look up the release notes. So maybe just document it.

comment:6

I don't really think anyone will notice

fbissey@tarazed ~/sandbox/git-personal/sage $ grep -rI SAGE_ETC src/
src/bin/sage-env:    export SAGE_ETC="$SAGE_LOCAL/etc"
src/sage/env.py:SAGE_ETC = var("SAGE_ETC", join(SAGE_LOCAL, "etc"))
fbissey@tarazed ~/sandbox/git-personal/sage $ grep -rI SAGE_INC src/
src/sage/env.py:SAGE_INC = var("SAGE_INC", join(SAGE_LOCAL, "include"))

OK, there is one thing that need attention

build/pkgs/notebook/spkg-install.in:ETC_JUPYTER="$SAGE_ETC"/jupyter

But SAGE_INC can disappear now and no-one will miss it.

comment:7

I originally just meant that we should deprecate the Python variables in sage.env.
Things in build that use environment variables set by sage-env are unaffected by that.

But we could, of course, also just remove the environment variables, too. Any user package that uses them should certainly be updated anyway to become properly pip-installable.

Description changed:

--- 
+++ 
@@ -1 +1,5 @@
-These variables are unused (and do not have a legitimate use any more), but there might be user packages around that use it.
+These variables are unused (and do not have a legitimate use any more).
+
+If there are user packages around that use it... they will need repackaging as pip-installable packages anyway.
+
+

New commits:

e91e2d9build/pkgs/notebook/spkg-install.in: Use $SAGE_INST_LOCAL/etc/jupyter
6012b45src/bin/sage-env, src/sage/env.py: Remove SAGE_ETC, SAGE_INC

Author: Matthias Koeppe

Commit: 6012b45

comment:11

This looks okay to me. @kiwifb, how about you?

comment:12

Replying to @jhpalmieri:

This looks okay to me. @kiwifb, how about you?

Yes, it looks perfectly fine to me. We are cutting dead branches really.

Reviewer: François Bissey, John Palmieri

comment:14

Thanks!