Skip to content

Add missing Features for optional and experimental SPKGs #35856

@soehms

Description

@soehms

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
    • frobby
    • p_group_cohomology
    • pari_elldata
    • pari_galpol
    • pari_seadata
    • pyscipopt
    • snappy

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

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

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions