Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated stuff related to Cython #27041

Closed
jdemeyer opened this issue Jan 11, 2019 · 17 comments
Closed

Remove deprecated stuff related to Cython #27041

jdemeyer opened this issue Jan 11, 2019 · 17 comments

Comments

@jdemeyer
Copy link

Remove deprecations from #22698, #22805, #23855, #24105.

Deprecate the script src/bin/sage-cython.

Component: cython

Author: Jeroen Demeyer

Branch/Commit: 108a42e

Reviewer: Erik Bray

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

@jdemeyer jdemeyer added this to the sage-8.6 milestone Jan 11, 2019
@jdemeyer

This comment has been minimized.

@jdemeyer

This comment has been minimized.

@jdemeyer jdemeyer changed the title Remove deprecated code in sage.misc.cython Remove deprecated stuff related to Cython Jan 11, 2019
@jdemeyer

This comment has been minimized.

@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link
Author

@jdemeyer
Copy link
Author

Commit: 108a42e

@jdemeyer
Copy link
Author

New commits:

108a42eRemove deprecated stuff related to Cython

@videlec
Copy link
Contributor

videlec commented Jan 11, 2019

comment:7

(For the record: the 4 tickets have been closed for Sage 8.1 released in July 2017)

@jdemeyer
Copy link
Author

comment:9

Replying to @videlec:

(For the record: the 4 tickets have been closed for Sage 8.1 released in July 2017)

Not quite. #24105 is from Sage 8.2

@videlec
Copy link
Contributor

videlec commented Jan 15, 2019

comment:10

Replying to @jdemeyer:

Replying to @videlec:

(For the record: the 4 tickets have been closed for Sage 8.1 released in July 2017)

Not quite. #24105 is from Sage 8.2

Which is bad as it was released 05/06/18... One year deprecation implies 5 more months.

@jdemeyer
Copy link
Author

comment:11

Replying to @videlec:

Which is bad as it was released 05/06/18... One year deprecation implies 5 more months.

No, we are both wrong :-)

#22805 is from Sage 8.0

#22698, #23855, #24105 are from Sage 8.1

So this should be fine.

@embray
Copy link
Contributor

embray commented Jan 15, 2019

comment:12

Maybe not for this ticket, but there's a patch in Debian related to this that I think would be worth incorporating into Sage somehow:

Description: Additional changes to work with the Debian package of singular
 We search for a specific SOVERSION of libsingular-Singular, to allow us to
 runtime-Depend on libsingular4 and not libsingular4-dev.
Author: Tobias Hansen <[email protected]>
Author: Ximin Luo <[email protected]>
Forwarded: not-needed
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/sage/src/sage/interfaces/singular.py
+++ b/sage/src/sage/interfaces/singular.py
@@ -2264,7 +2264,7 @@
     node_names.clear()

     import os
-    singular_docdir = os.environ['SINGULARPATH']+"/../info/"
+    singular_docdir = "/usr/share/doc/singular/"

     new_node = re.compile(r"File: singular\.hlp,  Node: ([^,]*),.*")
     new_lookup = re.compile(r"\* ([^:]*):*([^.]*)\..*")
--- a/sage/src/sage/misc/cython.py
+++ b/sage/src/sage/misc/cython.py
@@ -323,6 +323,11 @@
     args = ['-w','-O2'] + args
     libdirs = cblas_library_dirs

+    # Add Singular directories to includes
+    if "singular" in s or "pynac" in s:
+        import pkgconfig
+        inc.extend(sorted(set(pkgconfig.parse("Singular")["include_dirs"])))
+
     # Add cysignals directory to includes
     for path in sys.path:
         cysignals_path = os.path.join(path, "cysignals")
--- a/sage/src/sage/env.py
+++ b/sage/src/sage/env.py
@@ -187,7 +187,7 @@
     else:
         extension = "so"
     # library name changed from libsingular to libSingular btw 3.x and 4.x
-    SINGULAR_SO = SAGE_LOCAL+"/lib/libSingular."+extension
+    SINGULAR_SO = "/usr/lib/%s/libsingular-Singular-4.1.1.so" % sysconfig.get_config_var('MULTIARCH')

 _add_variable_or_fallback('SINGULAR_SO', SINGULAR_SO)

--- a/sage/src/sage/misc/compat.py
+++ b/sage/src/sage/misc/compat.py
@@ -87,7 +87,7 @@
     EXAMPLES::

         sage: from sage.misc.compat import find_library
-        sage: find_library('Singular')
+        sage: find_library('singular-Singular')
         '...Singular...'

     """

I think that this demonstrates that there needs to be a better way to customize where sage looks for bits of Singular (the library, as well as its docs and include files).

@embray
Copy link
Contributor

embray commented Jan 15, 2019

comment:13

Hooray for getting rid of cruft.

@embray
Copy link
Contributor

embray commented Jan 15, 2019

Reviewer: Erik Bray

@vbraun
Copy link
Member

vbraun commented Jan 25, 2019

comment:14
sage -t --long src/sage/tests/cmdline.py
**********************************************************************
File "src/sage/tests/cmdline.py", line 412, in sage.tests.cmdline.test_executable
Failed example:
    print(err)
Expected:
    Traceback (most recent call last):
    ...
    RuntimeError: refusing to run doctests...
Got:
    sys:1: RuntimeWarning: not adding directory '' to sys.path since everybody can write to it.
    Untrusted users could put files in this directory which might then be imported by your Python code. As a general precaution from similar exploits, you should not execute Python code from this directory
    Traceback (most recent call last):
      File "/mnt/disk/home/release/Sage/src/bin/sage-runtests", line 163, in <module>
        err = DC.run()
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/control.py", line 1200, in run
        self.test_safe_directory()
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/control.py", line 643, in test_safe_directory
        .format(os.getcwd()))
    RuntimeError: refusing to run doctests from the current directory '/mnt/disk/home/release/.sage/temp/volker/30915/dir_Gy_O0N/test' since untrusted users could put files in this directory, making it unsafe to run Sage code from
    <BLANKLINE>
**********************************************************************
File "src/sage/tests/cmdline.py", line 417, in sage.tests.cmdline.test_executable
Failed example:
    print(err)
Expected:
    Traceback (most recent call last):
    ...
    RuntimeError: refusing to run doctests...
Got:
    sys:1: RuntimeWarning: not adding directory '' to sys.path since everybody can write to it.
    Untrusted users could put files in this directory which might then be imported by your Python code. As a general precaution from similar exploits, you should not execute Python code from this directory
    Traceback (most recent call last):
      File "/mnt/disk/home/release/Sage/src/bin/sage-runtests", line 163, in <module>
        err = DC.run()
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/control.py", line 1200, in run
        self.test_safe_directory()
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/control.py", line 643, in test_safe_directory
        .format(os.getcwd()))
    RuntimeError: refusing to run doctests from the current directory '/mnt/disk/home/release/.sage/temp/volker/30915/dir_Gy_O0N/test' since untrusted users could put files in this directory, making it unsafe to run Sage code from
    <BLANKLINE>
**********************************************************************
1 item had failures:
   2 of 251 in sage.tests.cmdline.test_executable
    [250 tests, 2 failures, 41.71 s]
----------------------------------------------------------------------
sage -t --long src/sage/tests/cmdline.py  # 2 doctests failed
----------------------------------------------------------------------
Total time for all tests: 41.8 seconds

@jdemeyer
Copy link
Author

comment:15

That error doesn't seem related to this ticket at all.

@vbraun
Copy link
Member

vbraun commented Jan 27, 2019

Changed branch from u/jdemeyer/remove_deprecated_code_in_sage_misc_cython to 108a42e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants