Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f51f29a
34185: initial version
soehms Jul 15, 2022
3071dbc
34185: correction according to review
soehms Jul 18, 2022
faacd11
Merge branch 'u/soehms/hide_features_34185' of trac.sagemath.org:sage…
soehms Jul 24, 2022
b4b562c
34185: take care of joined features
soehms Jul 25, 2022
ddd7ada
Merge branch 'u/soehms/hide_features_34185' of trac.sagemath.org:sage…
soehms Aug 3, 2022
70abb3f
Merge branch 'u/soehms/hide_features_34185' of trac.sagemath.org:sage…
soehms Aug 4, 2022
442fca6
Merge branch 'join_feature_texfile_with_pdflatex_34282' into hide_fea…
soehms Aug 5, 2022
f39836a
Merge branch 'circular_import_matrix_space_34283' into hide_features_…
soehms Aug 5, 2022
0ec6d46
Merge branch 'u/soehms/hide_features_34185' of trac.sagemath.org:sage…
soehms Aug 7, 2022
f463ac7
Merge branch 'join_feature_texfile_with_pdflatex_34282' into hide_fea…
soehms Aug 9, 2022
ebbd4a4
Merge branch 'circular_import_matrix_space_34283' into hide_features_…
soehms Aug 9, 2022
6912c1c
34185: fix doctest failure + pep8 fixes
soehms Aug 9, 2022
2e11970
Merge branch 'u/soehms/hide_features_34185' of trac.sagemath.org:sage…
soehms Sep 3, 2022
d676f79
Merge branch 'u/soehms/join_feature_texfile_with_pdflatex_34282' of t…
soehms Sep 6, 2022
187bdcf
34185: fix typos
soehms Sep 6, 2022
2a582f4
Merge branch 'u/soehms/hide_features_34185' of trac.sagemath.org:sage…
soehms Sep 30, 2022
f69396c
Merge branch 'u/soehms/hide_features_34185' of https://github.com/sag…
soehms May 22, 2023
b695c04
34185: fix RST issues
soehms May 22, 2023
c3da4d8
34185 / 35668: fixes according to review
soehms May 25, 2023
6dff841
Merge branch 'sagemath:develop' into hide_features_34185
soehms May 25, 2023
72d9da7
Merge branch 'develop' into hide_features_34185
soehms May 30, 2023
7d58d67
Merge branch 'develop' into hide_features_34185
soehms Jun 11, 2023
560228c
Merge branch 'sagemath:develop' into hide_features_34185
soehms Jun 11, 2023
d0ccd37
Merge branch 'hide_features_34185' of github.com:soehms/sage into hid…
soehms Jun 19, 2023
97eaac9
35668: pycodestyle fix
soehms Jun 19, 2023
3103888
Merge branch 'hide_features_34185' into feature_standard_optional_static
mkoeppe Jun 23, 2023
1fcdde3
sage.features: Declare type='standard' explicitly, check against SPKG…
mkoeppe Jun 23, 2023
fd8a32d
Terminology change
mkoeppe Jun 24, 2023
ad202ba
Add 'type=standard' in more places
mkoeppe Jun 24, 2023
62ad2a3
Add 'type=standard' in more places that use pplpy
mkoeppe Jun 25, 2023
98a8664
src/sage/features/cddlib.py: Add type='standard'
mkoeppe Jun 25, 2023
4eddb7c
src/sage/misc/package.py: Do not fail if SAGE_PKGS is not set
mkoeppe Jun 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
34185: correction according to review
  • Loading branch information
soehms committed Jul 18, 2022
commit 3071dbc20e76459a23282001311b6fee3cd897c3
12 changes: 2 additions & 10 deletions src/sage/features/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,17 +243,9 @@ def _spkg_type(self):
The type as a string in ``('base', 'standard', 'optional', 'experimental')``.
If no SPKG corresponds to this feature ``None`` is returned.
"""
from sage.misc.package import _spkg_type
return _spkg_type(self.name)
spkg_type = None
from sage.env import SAGE_PKGS
try:
f = open(os.path.join(SAGE_PKGS, self.name, "type"))
except IOError:
# Probably an empty directory => ignore
return None

with f:
spkg_type = f.read().strip()
return spkg_type

def resolution(self):
r"""
Expand Down
41 changes: 34 additions & 7 deletions src/sage/misc/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,38 @@ def pip_remote_version(pkg, pypi_url=DEFAULT_PYPI, ignore_URLError=False):
stable_releases = [v for v in info['releases'] if 'a' not in v and 'b' not in v]
return max(stable_releases)

def _spkg_type(name):
r"""
Return the type of the Sage package with the given name.

INPUT:

- ``name`` -- string giving the subdirectory name of the package under
``SAGE_PKGS``

EXAMPLES::

sage: from sage.misc.package import _spkg_type
sage: _spkg_type('pip')
'standard'

OUTPUT:

The type as a string in ``('base', 'standard', 'optional', 'experimental')``.
If no ``SPKG`` exists with the given name ``None`` is returned.
"""
spkg_type = None
from sage.env import SAGE_PKGS
try:
f = open(os.path.join(SAGE_PKGS, name, "type"))
except IOError:
# Probably an empty directory => ignore
return None

with f:
spkg_type = f.read().strip()
return spkg_type


def pip_installed_packages(normalization=None):
r"""
Expand Down Expand Up @@ -311,15 +343,10 @@ def list_packages(*pkg_types: str, pkg_sources: List[str] = ['normal', 'pip', 's

for p in lp:

try:
f = open(os.path.join(SAGE_PKGS, p, "type"))
except IOError:
# Probably an empty directory => ignore
typ = _spkg_type(p)
if not typ:
continue

with f:
typ = f.read().strip()

if os.path.isfile(os.path.join(SAGE_PKGS, p, "requirements.txt")):
src = 'pip'
elif os.path.isfile(os.path.join(SAGE_PKGS, p, "checksums.ini")):
Expand Down