| | |
| | | # |
| | | |
| | | # |
| | | # Print requirements for a package (first argument). |
| | | # Evaluated and normalized. |
| | | # If the package specified is - evaluate and normalize stdin. |
| | | # Usage: |
| | | # python-requires PACKAGE [EXTRA] |
| | | # |
| | | # Print requirements for PACKAGE. Evaluated and normalized. |
| | | # If PACKAGE is - evaluate and normalize stdin. |
| | | # With optional EXTRA argument passed print requirements for such extra only. |
| | | # |
| | | |
| | |
| | | except ImportError: |
| | | from importlib_metadata import requires |
| | | from packaging.requirements import Requirement |
| | | import subprocess |
| | | except: |
| | | exit() |
| | | |
| | |
| | | m = r.marker |
| | | if (not m and not e) or m and ((not e and m.evaluate(noe)) or (e and not m.evaluate(noe) and m.evaluate(e))): |
| | | print(re.sub(r"[-_.]+", "-", r.name).lower()) |
| | | for extra in r.extras: |
| | | subprocess.run([sys.argv[0], r.name, extra]) |
| | | except: |
| | | pass |