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
Knotinfo db interface looks for the wrong python module #31921
Comments
comment:2
Attach branch with patch currently tested in sage-on-gentoo. That allows documentation to be built, I am currently running doctests. The next test would be to make sure it behaves properly with the knotinfo package installed. New commits:
|
Branch: u/fbissey/knotinfo_feature |
Author: François Bissey |
Commit: |
comment:3
This is not the right fix. The database is provided by a Python package so it should be looked up via import machinery. Just change: - PythonModule.__init__(self, 'sage.knots.knotinfo', spkg='database_knotinfo',)
+ PythonModule.__init__(self, 'database_knotinfo', spkg='database_knotinfo') and set |
comment:4
Replying to @mkoeppe:
I understand, the wrong python module was looked up. Of course you cannot know that without installing the package or reading the ticket very, very, carefully. I will put up a corrected branch later today. |
comment:5
Replying to @mkoeppe:
Python detail, do you need to import |
comment:6
yes, it needs to be imported |
comment:7
Hum, I have to package this to make sure I understand, but it looks to me that the current location of |
comment:8
OK, the |
comment:9
Replying to @mkoeppe:
Under |
comment:11
Replying to @kiwifb:
There are more files, so that should be a separate folder. Sorry for causing this trouble. I already had I can do the tests but maybe not today! |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:13
I am now understanding my confusion in full. All the other databases test for I'll add that since it is a user location, it doesn't really belongs to |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:15
Need to rewrite the description but it should be a testable state now. |
This comment has been minimized.
This comment has been minimized.
comment:18
The patch looks good to me! Another question: It seems that we have a new feature within our doctests, right now, which produces the following failure (independent on this branch): sage -t --random-seed=0 src/sage/databases/knotinfo_db.py
[90 tests, 0.06 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------
Total time for all tests: 0.2 seconds
cpu time: 0.0 seconds
cumulative wall time: 0.1 seconds
================================================================================================================================== test session starts ===================================================================================================================================
platform linux -- Python 3.9.2, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /home/sebastian/devel/sage/src, configfile: tox.ini
collected 0 items / 1 error
========================================================================================================================================= ERRORS =========================================================================================================================================
_____________________________________________________________________________________________________________________ ERROR collecting sage/databases/knotinfo_db.py _____________________________________________________________________________________________________________________
src/sage/databases/knotinfo_db.py:330: in <module>
class KnotInfoDataBase(SageObject, UniqueRepresentation):
sage/misc/nested_class.pyx:318: in sage.misc.nested_class.NestedClassMetaclass.__init__ (build/cythonized/sage/misc/nested_class.c:2327)
???
E KeyError: 'knotinfo_db'
================================================================================================================================ short test summary info =================================================================================================================================
ERROR src/sage/databases/knotinfo_db.py - KeyError: 'knotinfo_db'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
==================================================================================================================================== 1 error in 0.73s ==================================================================================================================================== What is the reason for this? How can I fix it? Any hints are welcome! |
Reviewer: Sebastian Oehms |
comment:19
I also see this error after installing |
comment:20
This defect is not specific to |
Changed branch from u/fbissey/knotinfo_feature to |
comment:23
There is another piece of code that should be adapted to the change of file-cache location. I've opened ticket #32099 for that! |
Changed commit from |
Ticket #30352 included a new optional database and its interface in sage. As all new optional package of this kind, whether to use it or not is detected at runtime by the feature framework.
In #30352 presence was implemented by looking if the sage interface python module is installed. Which is always true since this interface is shipped in the standard sagelib. Instead it should have searched for the module installed by the
database_knotinfo
package itself.Furthermore, it sets user writable cache under
SAGE_SHARE
which is a system location for any system wide installation of sage.The problem is not clearly visible in vanilla sage as there are no direct consequence for a private user installation. But for system installation or distro installation which are sandboxed, there are consequences as sage will try to create files in system location.
See cschwan/sage-on-gentoo#639 for example.
CC: @soehms @tscrim @antonio-rojas
Component: packages: optional
Author: François Bissey
Branch:
9907095
Reviewer: Sebastian Oehms
Issue created by migration from https://trac.sagemath.org/ticket/31921
The text was updated successfully, but these errors were encountered: