Skip to content

Commit

Permalink
get "pip_install_wheel" from whey_conda
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Jul 2, 2021
1 parent 4d1a220 commit 0677bb8
Show file tree
Hide file tree
Showing 17 changed files with 8,036 additions and 790 deletions.
37 changes: 1 addition & 36 deletions repo_helper/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
from packaging.version import Version
from shippinglabel.requirements import ComparableRequirement, combine_requirements, read_requirements
from whey.builder import SDistBuilder, WheelBuilder
from whey_conda import pip_install_wheel

# this package
from repo_helper import __version__
Expand Down Expand Up @@ -503,39 +504,3 @@ def build_sdist(sdist_directory, config_settings=None):

def get_requires_for_build_sdist(config_settings=None):
return []


def pip_install_wheel(wheel_file: PathLike, target_dir: PathLike, verbose: bool = False):
command = [
"pip",
"install",
os.fspath(wheel_file),
"--target",
os.fspath(target_dir),
"--no-deps",
"--no-compile",
"--no-warn-script-location",
"--no-warn-conflicts",
"--disable-pip-version-check",
]

process = Popen(command, stdout=PIPE)
(output, err) = process.communicate()
exit_code = process.wait()

if verbose:
click.echo((output or b'').decode("UTF-8"))
click.echo((err or b'').decode("UTF-8"), err=True)

if exit_code != 0:
err = err or b''

message = dedent(
f"""\
Command '{' '.join(command)}' returned non-zero exit code {exit_code}:
{indent(err.decode("UTF-8"), ' ')}
"""
)

raise abort(message.rstrip() + '\n')
19 changes: 9 additions & 10 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
apeye>=0.4.0
apeye>=1.0.0
attrs>=20.2.0
click==7.1.2
configconfig>=0.5.0
consolekit>=1.0.0
consolekit>=1.2.0
dict2css>=0.2.0
dom-toml>=0.2.2
domdf-python-tools>=2.7.0
dom-toml>=0.5.0
domdf-python-tools>=2.8.0
dulwich>=0.19.16
email-validator==1.1.2
first>=2.0.2
idna==2.10
isort>=5.0.0
jinja2<3.0.0,>=2.11.2
mkrecipe>=0.1.2
natsort>=7.1.0
jinja2>=2.11.2
mkrecipe>=0.3.0
natsort>=7.0.1
packaging>=20.4
ruamel-yaml>=0.17.4
shippinglabel>=0.8.2
southwark>=0.7.1
tabulate>=0.8.8
typing-extensions>=3.7.4.3
typing-extensions>=3.7.4.1
whey>=0.0.14
whey-conda>=0.1.2
yapf-isort>=0.5.2
Loading

0 comments on commit 0677bb8

Please sign in to comment.