-
-
Notifications
You must be signed in to change notification settings - Fork 652
Open
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues for a bug report that matches the one I want to file, without success.
Problem Description
According to #35820 (comment) this is needed to eliminate the use of sage.misc.packages
from the doctester.
Proposed Solution
Here are the lists we should work through:
A. Optional
-
- biopython
-
- cunningham_tables
-
- cylp
-
- database_kohel
-
- database_mutation_class
-
- database_odlyzko_zeta
-
- database_stein_watkins
-
- database_symbolic_data
-
- fricas, Feature for fricas #33575
-
- frobby
-
- glucose,
sage.features.sat
#38239
- glucose,
-
- kissat,
sage.features.sat
#38239
- kissat,
-
- p_group_cohomology
-
- pari_elldata
-
- pari_galpol
-
- pari_seadata
-
- pycosat,
sage.features.sat
#38239
- pycosat,
-
- pycryptosat,
sage.features.sat
#38239
- pycryptosat,
-
- pyscipopt
-
- snappy
-
- topcom,
sage.features.topcom
#37858
- topcom,
B. Experimental
-
- gap3
-
- lie
-
- qepcad
-
- symengine_py
C. Standard
These standard packages still have optional
tags which should be removed changed to # needs
tags (– mkoeppe):
-
- beautifulsoup4
-
- rpy2, Activate/fix rpy2 tests #35396 changes
# optional
to# needs
- rpy2, Activate/fix rpy2 tests #35396 changes
Alternatives Considered
The purpose of this issue is to track the progress on this task (similar to a Trac Meta-Ticket).
Related PR and issues
- Meta-ticket: Create upstream repositories, pip-installable packages for database packages #30914
- Replace
have_program
usage by Features #32957 - Doctester: Issue a warning when unknown
# optional
/# needs
tags are used #38217 - sage.databases: Use sage.feature to define database file system location #30819
Additional Information
The above list of packages has been detected by the following script:
from sage.misc.package import list_packages
from sage.features.all import all_features
from sage.env import SAGE_SRC
from os import environ, chdir, path
from subprocess import check_output, CalledProcessError
import re
pwd = environ['PWD']
spkgs = list_packages(local=True)
sl = set([k for k, v in spkgs.items() if v.type == 'standard'])
ol = set([k for k, v in spkgs.items() if v.type == 'optional'])
el = set([k for k, v in spkgs.items() if v.type == 'experimental'])
af_list = list(all_features())
af_spkg = set([f.spkg for f in af_list if f.spkg is not None])
af_name = set([f.name for f in af_list])
af = af_spkg.union(af_name)
af.add('gap_packages') # manually added since no individual instance of GapPackage is in the af_list
sl_minus_af = sl.difference(af)
ol_minus_af = ol.difference(af)
el_minus_af = el.difference(af)
sage_src = path.join(SAGE_SRC, 'sage')
chdir(sage_src)
def test_doctest_tag(spkg_name):
cmd = 'git grep \\#[\\ ]*optional.*%s | grep -v "doctest/" | grep -v "tests/cmdline"' % spkg_name
try:
res = check_output(cmd, shell=True).decode()
if re.match(r'^[^\n]*#[\s]+optional[^\n]*[\s]%s[\s,\n]' % spkg_name, res) is None:
return False
return True
except CalledProcessError:
pass
return False
missing_standard_features = sorted([f for f in sl_minus_af if test_doctest_tag(f)])
missing_optional_features = sorted([f for f in ol_minus_af if test_doctest_tag(f)])
missing_experimental_features = sorted([f for f in el_minus_af if test_doctest_tag(f)])
chdir(pwd)
print('missing_standard_features', missing_standard_features)
print('missing_optional_features', missing_optional_features)
print('missing_experimental_features', missing_experimental_features)