From fdc13a39443f824ad5203b7d45fce8c27de0279c Mon Sep 17 00:00:00 2001 From: mrJean1 <22154337+mrJean1@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:14:23 -0500 Subject: [PATCH] Update make Mistake. --- make | 934 ----------------------------------------------------------- 1 file changed, 934 deletions(-) diff --git a/make b/make index 69973b2a1..8b1378917 100755 --- a/make +++ b/make @@ -1,935 +1 @@ -#!/usr/bin/env python3.13 -# -*- coding: utf-8 -*- -# Script to run some or all PyGeodesy tests, rebuild the docs, etc. - -from collections import defaultdict -from contextlib import contextmanager -from glob import iglob -import os -from subprocess import PIPE, STDOUT, Popen -from time import sleep, time -import sys - -__version__ = '24.10.20' -_PyGeodesy_ = 'PyGeodesy' - -_OO = '' if __debug__ else ' -OO' -_PD = os.getcwd().split(_PyGeodesy_)[0] -_SIsecs = 'fs', 'ps', 'ns', 'us', 'ms', 'sec' # reversed -_time0 = time() - - -def _all_locals(*files): # PYCHOK no cover - # check __all__ vs locals(). - from os.path import basename, splitext - - import pygeodesy # Python 2- only - if not pygeodesy.lazily._FOR_DOCS: - sys.exit('usage: env PYGEODESY_FOR_DOCS=1 make ...') - - for f in (files or _walker(1)): # sorted? - n = splitext(basename(f))[0] - m = getattr(pygeodesy, n) - d = dict((a, getattr(m, a)) for a in dir(m)) - for a in m.__all__: - if a not in d and not a.startswith('_'): - _printf('%s.%s %r not in %s.%s', n,'__all__', a, n,'locals') - for a, o in d.items(): - if a not in m.__all__ and getattr(o, '__module__', '') == n: - _printf('%s.%s %r not in %s.%s', n,'locals', a, n,'__all__') - - -def _cmd(cmd, *args): - if args: - cmd = cmd % args - _gc(cmd) - return os.system(cmd) - - -def _coverage_percentage(html, readme): - # check coverage percentage in README.rst - p = '' - t = '' - h = _read(html) - i = h.find(t) - if i > 0: - i += len(t) - j = h.find('%', i) - if j > i: - p = h[i:j].strip() + '%' - if not p: - sys.exit('not in %s: %r' % (html, t)) - - r = _read(readme) - t = 'https://Img.Shields.io/badge/coverage-%s25-brightgreen' % (p,) - if t not in r: - sys.exit('not in %s: %r' % (readme, t)) - - _cmd('echo coverage: %s %r in %s OK', html, p, readme) - - -def _coverage_pygeodesy(*cb_, **z_p_): # MCCABE 15 - # remove _cb_...ext tails - cb = {} - for c in cb_: - i = c.find('_cb_') - j = c.rfind('.') - if 0 < i < j < len(c): - b = c[:i] + c[j:] - if b != c: - os.system('mv testcoverage/' + c + - ' testcoverage/' + b) - cb[c] = b - # replace 'z_4569faf12939b165_' with 'pygeodesy_' - os.system('rm -f testcoverage/class_index.html' - ' testcoverage/function_index.html') -# for h in iglob('testcoverage/*index.html'): -# t = r = _read(h) -# for c, b in cb.items(): -# t = t.replace(c, b) -# _write(h, t, r) - - for h in iglob('testcoverage/*.html'): - for z_, p_ in z_p_.items(): - t = h.replace(z_, p_) - if t != h: - os.system('mv ' + h + ' ' + t) - h = t - r = t = _read(h) - t = t.replace(z_, p_) - for c, b in cb.items(): - t = t.replace(c, b) - _write(h, t, r) - break - - h = 'testcoverage/index.html' - r = t = _read(h) - i = t.find('

') - if i > 0: # buttons Classes, etc. - j = t.find('

', i) + 5 - if j > i: - t = t[:i] + t[j:] - for z_, p_ in z_p_.items(): - t = t.replace(z_, p_) - for c, b in cb.items(): - t = t.replace(c, b) - _write(h, t, r) - - # take out