Show More
@@ -661,52 +661,22 b' def has_pygments():' | |||||
661 | return False |
|
661 | return False | |
662 |
|
662 | |||
663 |
|
663 | |||
664 | @check("pygments25", "Pygments version >= 2.5") |
|
664 | def getpygmentsversion(): | |
665 | def pygments25(): |
|
|||
666 | try: |
|
|||
667 | import pygments |
|
|||
668 |
|
||||
669 | v = pygments.__version__ |
|
|||
670 | except ImportError: |
|
|||
671 | return False |
|
|||
672 |
|
||||
673 | parts = v.split(".") |
|
|||
674 | major = int(parts[0]) |
|
|||
675 | minor = int(parts[1]) |
|
|||
676 |
|
||||
677 | return (major, minor) >= (2, 5) |
|
|||
678 |
|
||||
679 |
|
||||
680 | @check("pygments211", "Pygments version >= 2.11") |
|
|||
681 | def pygments211(): |
|
|||
682 | try: |
|
665 | try: | |
683 | import pygments |
|
666 | import pygments | |
684 |
|
667 | |||
685 | v = pygments.__version__ |
|
668 | v = pygments.__version__ | |
|
669 | ||||
|
670 | parts = v.split(".") | |||
|
671 | return (int(parts[0]), int(parts[1])) | |||
686 | except ImportError: |
|
672 | except ImportError: | |
687 |
return |
|
673 | return (0, 0) | |
688 |
|
||||
689 | parts = v.split(".") |
|
|||
690 | major = int(parts[0]) |
|
|||
691 | minor = int(parts[1]) |
|
|||
692 |
|
||||
693 | return (major, minor) >= (2, 11) |
|
|||
694 |
|
674 | |||
695 |
|
675 | |||
696 |
@check("pygments |
|
676 | @checkvers("pygments", "Pygments version >= %s", (2.5, 2.11, 2.14)) | |
697 |
def pygments |
|
677 | def has_pygments_range(v): | |
698 | try: |
|
678 | major, minor = v.split('.')[0:2] | |
699 | import pygments |
|
679 | return getpygmentsversion() >= (int(major), int(minor)) | |
700 |
|
||||
701 | v = pygments.__version__ |
|
|||
702 | except ImportError: |
|
|||
703 | return False |
|
|||
704 |
|
||||
705 | parts = v.split(".") |
|
|||
706 | major = int(parts[0]) |
|
|||
707 | minor = int(parts[1]) |
|
|||
708 |
|
||||
709 | return (major, minor) >= (2, 14) |
|
|||
710 |
|
680 | |||
711 |
|
681 | |||
712 | @check("outer-repo", "outer repo") |
|
682 | @check("outer-repo", "outer repo") |
General Comments 0
You need to be logged in to leave comments.
Login now