Skip to content

Commit

Permalink
Update auto-detect the minimum python version needed for vendored pac…
Browse files Browse the repository at this point in the history
…kages.
  • Loading branch information
jaraco committed Jul 3, 2024
1 parent 51615db commit b4b6bf7
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions tools/vendored.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import functools
import sys
import subprocess

from jaraco.packaging import metadata
import jaraco.packaging.metadata
from path import Path


Expand Down Expand Up @@ -41,11 +42,20 @@ def update_pkg_resources():
install_deps(deps, vendor)


@functools.cache
def metadata():
return jaraco.packaging.metadata.load('.')


def load_deps():
"""
Read the dependencies from `.`.
"""
return metadata.load('.').get_all('Requires-Dist')
return metadata().get_all('Requires-Dist')


def min_python():
return metadata()['Requires-Python'].removeprefix('>=').strip()


def install_deps(deps, vendor):
Expand All @@ -65,7 +75,7 @@ def install_deps(deps, vendor):
'--target',
str(vendor),
'--python-version',
'3.8',
min_python(),
'--only-binary',
':all:',
] + list(deps)
Expand Down

0 comments on commit b4b6bf7

Please sign in to comment.