commit:     7f1a4e8159a04c79aa09028137ad609aae95d815
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 18 21:02:42 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Thu Dec 18 21:02:42 2025 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=7f1a4e81

rename snakeoil.{demandload.demand_compile_regexp -> delayed.regexp}

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 src/pkgcore/ebuild/cpv.py         | 13 ++++++-------
 src/pkgcore/ebuild/eapi.py        |  6 +++---
 src/pkgcore/ebuild/ebuild_src.py  |  8 +++-----
 src/pkgcore/ebuild/pkg_updates.py |  2 --
 4 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/src/pkgcore/ebuild/cpv.py b/src/pkgcore/ebuild/cpv.py
index 263a505d..5ab8aa62 100644
--- a/src/pkgcore/ebuild/cpv.py
+++ b/src/pkgcore/ebuild/cpv.py
@@ -3,30 +3,29 @@
 from collections import UserString
 
 from snakeoil.compatibility import cmp
-from snakeoil.demandload import demand_compile_regexp
+from snakeoil.delayed import regexp
 
 from ..package import base
 from . import atom
 from .errors import InvalidCPV
 
-demand_compile_regexp("suffix_regexp", "^(alpha|beta|rc|pre|p)(\\d*)$")
+suffix_regexp = regexp("^(alpha|beta|rc|pre|p)(\\d*)$")
 
 suffix_value = {"pre": -2, "p": 1, "alpha": -4, "beta": -3, "rc": -1}
 
 # while the package section looks fugly, there is a reason for it-
 # to prevent version chunks from showing up in the package
 
-demand_compile_regexp(
-    "isvalid_version_re",
-    r"^(?:\d+)(?:\.\d+)*[a-zA-Z]?(?:_(p(?:re)?|beta|alpha|rc)\d*)*$",
+isvalid_version_re = regexp(
+    r"^(?:\d+)(?:\.\d+)*[a-zA-Z]?(?:_(p(?:re)?|beta|alpha|rc)\d*)*$"
 )
 
 # see https://github.com/pkgcore/pkgcore/issues/453 for why this regex 
underscores
 # PMS Category names regex is directly replicated below.
-demand_compile_regexp("isvalid_cat_re", r"^(?:[A-Za-z0-9_][A-Za-z0-9+_-]*)$")
+isvalid_cat_re = regexp(r"^(?:[A-Za-z0-9_][A-Za-z0-9+_-]*)$")
 
 # empty string is fine, means a -- was encounter.
-demand_compile_regexp("_pkg_re", r"^[a-zA-Z0-9+_]+$")
+_pkg_re = regexp(r"^[a-zA-Z0-9+_]+$")
 
 
 def isvalid_pkg_name(chunks):

diff --git a/src/pkgcore/ebuild/eapi.py b/src/pkgcore/ebuild/eapi.py
index f530d29a..dfd984ae 100644
--- a/src/pkgcore/ebuild/eapi.py
+++ b/src/pkgcore/ebuild/eapi.py
@@ -9,7 +9,7 @@ from os.path import join as pjoin
 from weakref import WeakValueDictionary
 
 from snakeoil import klass
-from snakeoil.demandload import demand_compile_regexp
+from snakeoil.delayed import regexp
 from snakeoil.mappings import ImmutableDict, OrderedFrozenSet, 
inject_getitem_as_getattr
 from snakeoil.process.spawn import bash_version
 from snakeoil.sequences import unique_stable
@@ -25,8 +25,8 @@ def get_latest_PMS_eapi():
 from ..log import logger
 from . import atom, const
 
-demand_compile_regexp("_valid_EAPI_regex", r"^[A-Za-z0-9_][A-Za-z0-9+_.-]*$")
-demand_compile_regexp("_valid_use_flag", r"^[A-Za-z0-9][A-Za-z0-9+_@-]*$")
+_valid_EAPI_regex = regexp(r"^[A-Za-z0-9_][A-Za-z0-9+_.-]*$")
+_valid_use_flag = regexp(r"^[A-Za-z0-9][A-Za-z0-9+_@-]*$")
 
 eapi_optionals = ImmutableDict(
     {

diff --git a/src/pkgcore/ebuild/ebuild_src.py b/src/pkgcore/ebuild/ebuild_src.py
index bcbfd262..a0e9bc11 100644
--- a/src/pkgcore/ebuild/ebuild_src.py
+++ b/src/pkgcore/ebuild/ebuild_src.py
@@ -10,7 +10,7 @@ from itertools import chain
 from sys import intern
 
 from snakeoil import chksum, data_source, fileutils, klass
-from snakeoil.demandload import demand_compile_regexp
+from snakeoil.delayed import regexp
 from snakeoil.mappings import OrderedFrozenSet
 
 from .. import fetch
@@ -26,10 +26,8 @@ from .atom import atom
 from .eapi import get_eapi
 from .misc import sort_keywords
 
-demand_compile_regexp(
-    "_EAPI_regex", r"^EAPI=(['\"]?)(?P<EAPI>[A-Za-z0-9+_.-]*)\1[\t ]*(?:#.*)?"
-)
-demand_compile_regexp("_EAPI_str_regex", r"^EAPI=(['\"]?)(?P<EAPI>.*)\1")
+_EAPI_regex = regexp(r"^EAPI=(['\"]?)(?P<EAPI>[A-Za-z0-9+_.-]*)\1[\t 
]*(?:#.*)?")
+_EAPI_str_regex = regexp(r"^EAPI=(['\"]?)(?P<EAPI>.*)\1")
 
 
 class base(metadata.package):

diff --git a/src/pkgcore/ebuild/pkg_updates.py 
b/src/pkgcore/ebuild/pkg_updates.py
index e828fbe6..c1f64195 100644
--- a/src/pkgcore/ebuild/pkg_updates.py
+++ b/src/pkgcore/ebuild/pkg_updates.py
@@ -1,8 +1,6 @@
 from collections import defaultdict, deque
-from operator import itemgetter
 from os.path import join as pjoin
 
-from snakeoil.demandload import demand_compile_regexp
 from snakeoil.osutils import listdir_files
 from snakeoil.sequences import iflatten_instance
 

Reply via email to