Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHIA-597: Use poetry for package management #11057

Merged
merged 166 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
f6e6384
preliminary setup with poetry
altendky Apr 5, 2022
41b1047
Merge branch 'main' into poetry
altendky Apr 5, 2022
e1baf5c
don't worry about locking the poetry env for the exploration right now
altendky Apr 5, 2022
0e3ca4c
recover black config in pyproject.toml
altendky Apr 5, 2022
8eb66ca
install.sh for linting workflow
altendky Apr 5, 2022
1d4c1d1
pull chiavdf version from poetry in install-timelord.sh
altendky Apr 5, 2022
fb57f56
activate etc in upload and lint workflow
altendky Apr 5, 2022
c17f767
debug poetry show output on macos
altendky Apr 5, 2022
e862f9b
update to clvm-tools 0.4.4
altendky Apr 5, 2022
050cc24
Merge branch 'main' into poetry
altendky Apr 20, 2022
4591ff5
Merge branch 'main' into poetry
altendky Apr 22, 2022
7e9c103
Merge branch 'main' into poetry
altendky Apr 26, 2022
77585c5
add back setproctitle
altendky Apr 26, 2022
4e59137
Merge branch 'main' into poetry
altendky Apr 29, 2022
88b9aaa
catchup deps
altendky Apr 29, 2022
a8b7c03
lock
altendky Apr 29, 2022
701a834
Merge branch 'main' into poetry
altendky May 1, 2022
92c8204
allow 3.10
altendky May 1, 2022
98fdc43
debug
altendky May 1, 2022
70dd4c9
make Install.ps1 use poetry as well
altendky May 1, 2022
9c96bfe
-ErrorAction Ignore
altendky May 1, 2022
3adf176
more todo about python version selection
altendky May 1, 2022
a02af91
make install-timelord.sh modifications more posix compliant
altendky May 1, 2022
90faa5b
gitignore .penv* and .venv* as well
altendky May 1, 2022
608eace
remove requirements.penv.txt
altendky May 1, 2022
6273eb5
get artifact check requirements from poetry
altendky May 1, 2022
27fcd23
fix .gitignore for venv symlink
altendky May 1, 2022
398821e
separate out poetry setup
altendky May 1, 2022
021b9d0
:
altendky May 1, 2022
e6f1f6c
comment out code to be worked on
altendky May 1, 2022
9cc87cc
setup poetry for dependency check
altendky May 1, 2022
550ced0
ignore new poetry symlink
altendky May 1, 2022
b21dacc
Merge branch 'main' into poetry
altendky May 24, 2022
6368e40
Merge branch 'main' into poetry
altendky May 30, 2022
73e9ca4
Merge branch 'main' into poetry
altendky Jun 2, 2022
b27da72
chia_rs==0.1.4
altendky Jun 2, 2022
0415c4f
a few updates
altendky Jun 3, 2022
52d4d4f
Merge branch 'main' into poetry
altendky Aug 26, 2022
a3b5a53
some missed updates `:[`
altendky Aug 28, 2022
4ca9b9c
update some types libs
altendky Aug 28, 2022
fa2ae23
fix extras
altendky Aug 28, 2022
cc5f3d8
activate
altendky Aug 28, 2022
b914389
just use `python` somewhere
altendky Aug 28, 2022
15dee72
for windows
altendky Aug 28, 2022
27f7049
less symlinking for windows
altendky Aug 28, 2022
0ef5ef7
oops
altendky Aug 28, 2022
ce21e7f
s
altendky Aug 28, 2022
198acda
more
altendky Aug 28, 2022
5702852
# shellcheck disable=SC2086
altendky Aug 28, 2022
7c3a69e
activate action
altendky Aug 28, 2022
c64cdb5
more python version
altendky Aug 28, 2022
24543e8
lock up
altendky Aug 29, 2022
3fbfe4e
include ipython (for python >=3.8)
altendky Aug 29, 2022
b41b5e4
add miniupnpc extra
altendky Aug 29, 2022
8293158
add poetry-dynamic-versioning
altendky Aug 31, 2022
4ad4ab5
type it out
altendky Aug 31, 2022
91a348b
better match dev versioning
altendky Aug 31, 2022
55d98c2
Merge branch 'main' into poetry
altendky Nov 1, 2022
a2314ca
catch up and delete setup.py again
altendky Nov 1, 2022
79ef676
lock
altendky Nov 1, 2022
a93d172
add pytest-cov
altendky Nov 1, 2022
743477f
.penv/bin/poetry
altendky Nov 1, 2022
66a8652
.venv for windows activation
altendky Nov 1, 2022
852b986
update pytest-xdist
altendky Nov 1, 2022
837f84f
install upnp extra
altendky Nov 1, 2022
c384b94
upnp
altendky Nov 1, 2022
f79e64d
quote
altendky Nov 1, 2022
9456d5f
maybe update some deps
altendky Nov 1, 2022
fe11d73
Merge branch 'main' into poetry
altendky Nov 2, 2022
e51579e
mandatory and string
altendky Nov 2, 2022
59b1a4c
oops
altendky Nov 2, 2022
c12fe47
slighty tidy
altendky Nov 2, 2022
aba3fd9
debug pip list
altendky Nov 2, 2022
9e73d6a
debug
altendky Nov 2, 2022
906c6ca
pybind11 maybe instead?
altendky Nov 2, 2022
597c963
remove pip install debugging
altendky Nov 3, 2022
29c94ed
debug without upnp nor pypi.chia.net
altendky Nov 3, 2022
dfa454d
chiavdf==1.0.8
altendky Nov 3, 2022
6ae06d7
bring back upnp
altendky Nov 3, 2022
864d0fc
re-enable upnp
altendky Nov 3, 2022
dce749f
diagnostic exception reraise
altendky Nov 3, 2022
4eec388
.exe?
altendky Nov 3, 2022
c211273
diagnostics
altendky Nov 3, 2022
1efbd4f
.cmd...?
altendky Nov 3, 2022
f1f3bec
light tidy
altendky Nov 5, 2022
d192f7e
Merge branch 'main' into poetry
altendky Nov 6, 2022
0b446df
more cleanup
altendky Nov 6, 2022
b305a50
make dependency check script not cwd dependent for finding the poetry…
altendky Nov 6, 2022
28e6cae
correct sh substitution
altendky Nov 6, 2022
10b5d62
Merge branch 'main' into poetry
altendky Nov 10, 2022
7f0c8f6
Merge branch 'main' into poetry
altendky Nov 11, 2022
55ca74b
Merge branch 'main' into poetry
altendky Nov 12, 2022
986bc13
Merge branch 'main' into poetry
altendky Nov 16, 2022
602bf6c
Merge branch 'main' into poetry
altendky Nov 16, 2022
d4399fb
Merge branch 'main' into poetry
altendky Nov 19, 2022
937e868
Merge branch 'main' into poetry
altendky Dec 8, 2022
08ca8a2
Merge branch 'main' into poetry
altendky Dec 22, 2022
ffe372c
lock
altendky Dec 22, 2022
9309471
Merge branch 'main' into poetry
altendky Feb 11, 2023
8322c83
coverage 7
altendky Feb 11, 2023
795c0b1
Merge branch 'main' into poetry
altendky Feb 13, 2023
cbbb281
Merge branch 'main' into poetry
altendky Apr 19, 2023
62cdfb2
todo cleanup
altendky Apr 19, 2023
77ffd79
Merge branch 'main' into poetry
altendky Apr 19, 2023
f1d9a9d
poetry update
altendky Apr 19, 2023
fbd9e73
Merge branch 'main' into poetry
altendky Apr 20, 2023
6687135
interesting
altendky Apr 20, 2023
1f3fd36
Merge branch 'main' into poetry
altendky Oct 17, 2023
c1b3bfc
windows too
altendky Oct 17, 2023
3ffaa9f
support non-editable install via scripts again
altendky Oct 17, 2023
2059a51
oops
altendky Oct 17, 2023
e54cd51
again
altendky Oct 17, 2023
7d6e482
sheesh
altendky Oct 17, 2023
48a1232
fixup
altendky Oct 17, 2023
ab8785c
more
altendky Oct 17, 2023
9869ae1
more
altendky Oct 18, 2023
c049b07
Merge branch 'main' into poetry
altendky Oct 20, 2023
33d0e87
Merge remote-tracking branch 'origin/main' into poetry
emlowe Jun 7, 2024
e0efa2d
Update dependencies
emlowe Jun 7, 2024
7b213b5
various pre-commit linter updates
emlowe Jun 7, 2024
e1e503f
add pyupgrade to extras list
emlowe Jun 7, 2024
77cc520
use priority=supplemental instead of secondary
emlowe Jun 7, 2024
c13445e
Add in some missing deps
emlowe Jun 7, 2024
4da16cd
update setuptools and pyinstaller to match main
emlowe Jun 7, 2024
b074a40
venv->.venv
emlowe Jun 7, 2024
9f41c4c
lint fixes
emlowe Jun 7, 2024
8e4495c
update a few packages for 3.12 support
emlowe Jun 7, 2024
08e557d
get zstd from chia resource for python 3.12
emlowe Jun 7, 2024
5a4a811
Adjustments to dynamic versioning
emlowe Jun 7, 2024
6ecbbf1
experiments with versioning
emlowe Jun 7, 2024
bd219d5
test fixes
emlowe Jun 10, 2024
a4cf3c7
fixup last commit
emlowe Jun 10, 2024
c5f3c24
include upnp as extra when installing on windows
emlowe Jun 10, 2024
6131d3f
include mozilla-ca as a package for the cacert.pem file
emlowe Jun 10, 2024
7b315ca
some windows tweaks
emlowe Jun 10, 2024
c034e64
use SPECPATH as anchor path in pyinstaller.spec file
emlowe Jun 10, 2024
3bcef73
Add lxml as dev dependency
emlowe Jun 11, 2024
2f06900
Fixup typo in lxml version
emlowe Jun 11, 2024
779465d
Update some packages to resolve GH vuln reports
emlowe Jun 11, 2024
2c7485d
Update more packages to resolve GH vulns
emlowe Jun 11, 2024
906eae3
Merge remote-tracking branch 'origin/main' into poetry
emlowe Jun 11, 2024
98595ca
Ignore pylint license in depedency checker
emlowe Jun 11, 2024
78638d2
match installation of the dynamic version plugin on windows
emlowe Jun 12, 2024
2115200
Merge remote-tracking branch 'origin/main' into poetry
emlowe Jun 12, 2024
6701bab
Fix issues with setting windows environment and use pip to install pl…
emlowe Jun 12, 2024
51d6c85
properly apply non-editable option with -i
emlowe Jun 12, 2024
b158aa8
use -f with ln to remove existing file as needed
emlowe Jun 12, 2024
16ef0ae
use shell=true for subprocess to help windows run chia if it's a .cmd
emlowe Jun 13, 2024
be077a6
Update .coveragerc
altendky Jun 13, 2024
4a0cde3
use shutil.which() to find chia executable in a cross platform way
emlowe Jun 13, 2024
44d4c7b
Merge branch 'poetry' of https://github.com/Chia-Network/chia-blockch…
emlowe Jun 13, 2024
726e83c
mypy fixes
emlowe Jun 13, 2024
7bb919b
Merge remote-tracking branch 'origin/main' into poetry
emlowe Jun 20, 2024
db73f22
Address conflicts for numpy based on python version
emlowe Jun 20, 2024
d2d38b2
Merge remote-tracking branch 'origin/main' into poetry
emlowe Jun 25, 2024
9a12d4a
Update lock file
emlowe Jun 25, 2024
fdb7fe9
Remove troublesome reference to pypi source
emlowe Jun 25, 2024
2a33790
Add TODOs for manual install of poetry-dynamic-versioning plugin
emlowe Jun 25, 2024
57a304e
Use poetry dynamic versioning to figure out the version rather than s…
emlowe Jun 25, 2024
d17b97e
Update .github/workflows/reflow-version.yml
emlowe Jun 26, 2024
660851d
Update .github/workflows/test-single.yml
emlowe Jun 26, 2024
ac84e83
Update urllib3
emlowe Jun 28, 2024
db95c55
Attempts to get dynamic versioning to output something semver
emlowe Jul 9, 2024
262263c
more versioning finangling
emlowe Jul 9, 2024
975a1d2
lint pyproject.toml
emlowe Jul 9, 2024
5336efa
Update certifi
emlowe Jul 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ parallel=True
[paths]
source =
chia/
venv/**/site-packages/chia/
.venv/**/site-packages/chia/

[report]
precision = 1
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/check_wheel_availability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,15 @@ jobs:
python-version: ${{ matrix.python-version }}
force-pyenv: ${{ matrix.os.matrix == 'macos' && matrix.arch.matrix == 'intel' }}

- name: Setup Poetry
if: matrix.os.matrix != 'windows'
run: |
sh setup-poetry.sh ${{ matrix.python-version }}
- name: Setup Poetry
if: matrix.os.matrix == 'windows'
run: |
./Setup-poetry.ps1 ${{ matrix.python-version }}
- name: Check Wheel Availability
run: python build_scripts/check_dependency_artifacts.py
1 change: 1 addition & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ jobs:
- name: "Dependency Review"
uses: actions/dependency-review-action@v4
with:
allow-dependencies-licenses: pkg:pypi/pylint
deny-licenses: AGPL-1.0-only, AGPL-1.0-or-later, AGPL-1.0-or-later, AGPL-3.0-or-later, GPL-1.0-only, GPL-1.0-or-later, GPL-2.0-only, GPL-2.0-or-later, GPL-3.0-only, GPL-3.0-or-later
6 changes: 4 additions & 2 deletions .github/workflows/reflow-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ jobs:
- name: Create installer version number
id: version-number
# TODO figure out better way to handle versioning
run: |
python3 -m venv ../venv
. ../venv/bin/activate
pip install setuptools_scm
echo "chia-installer-version=$(python3 ./build_scripts/installer-version.py)" >> "$GITHUB_OUTPUT"
python -m pip install --upgrade pip
pip install poetry "poetry-dynamic-versioning[plugin]"
echo "chia-installer-version=$(poetry version -s)" >> "$GITHUB_OUTPUT"
deactivate
2 changes: 1 addition & 1 deletion .github/workflows/test-single.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ jobs:
echo '==== collecting installed tests ===='
if pytest --collect-only -qq --import-mode=append --pyargs chia._tests > installed_tests_raw
then
cat installed_tests_raw | sed -n 's;^venv/.*/\(chia/_tests/.*\);\1;p' | sort > installed_tests
cat installed_tests_raw | sed -n 's;^\.venv/.*/\(chia/_tests/.*\);\1;p' | sort > installed_tests
else
echo ' ==== installed test collection failure'
cat installed_tests_raw
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/upload-pypi-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,16 @@ jobs:

upload_source_dist:
name: Lint and Upload source distribution
runs-on: [ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
needs:
- mypy
- check
strategy:
matrix:
python-version: [3.8]
os: [ubuntu-latest]

steps:
- name: Add safe git directory
uses: chia-network/actions/git-mark-workspace-safe@main
Expand All @@ -194,6 +199,7 @@ jobs:

- name: Build source distribution
run: |
# TODO: let poetry do this?
emlowe marked this conversation as resolved.
Show resolved Hide resolved
python -m build --sdist --outdir dist .

- name: Upload artifacts
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ build_scripts/build

# pyenv
.python-version
.penv*/
.venv*/
venv*/
venv*
activate

# Editors
Expand Down
40 changes: 20 additions & 20 deletions Install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@ param(
$ErrorActionPreference = "Stop"

$extras = @()
$extras += "upnp"
if ($d)
{
$extras += "dev"
}

$pip_parameters = @()
if (-not $i)
{
$pip_parameters += "--editable"
}

if ([Environment]::Is64BitOperatingSystem -eq $false)
{
Write-Output "Chia requires a 64-bit Windows installation"
Expand Down Expand Up @@ -100,31 +95,36 @@ if ($openSSLVersion -lt 269488367)
Write-Output "Anything before 1.1.1n is vulnerable to CVE-2022-0778."
}

if ($extras.length -gt 0)
$extras_cli = @()
foreach ($extra in $extras)
{
$extras_cli = $extras -join ","
$pip_parameters += ".[$extras_cli]"
}
else
{
$pip_parameters += "."
$extras_cli += "--extras"
$extras_cli += $extra
}

py -$pythonVersion -m venv venv
./Setup-poetry.ps1 -pythonVersion "$pythonVersion"
.penv/Scripts/poetry env use $(py -"$pythonVersion" -c 'import sys; print(sys.executable)')
# TODO: Decide if this is needed or should be handled automatically in some way
.penv/Scripts/pip install "poetry-dynamic-versioning[plugin]"
.penv/Scripts/poetry install @extras_cli

venv\scripts\python -m pip install --upgrade pip setuptools wheel
venv\scripts\pip install --extra-index-url https://pypi.chia.net/simple/ miniupnpc==2.2.2
& venv\scripts\pip install @pip_parameters --extra-index-url https://pypi.chia.net/simple/
if ($i)
{
Write-Output "Running 'pip install --no-deps .' for non-editable"
.venv/Scripts/python -m pip install --no-deps .
}

if ($p)
{
$PREV_VIRTUAL_ENV = "$env:VIRTUAL_ENV"
$env:VIRTUAL_ENV = "venv"
$env:VIRTUAL_ENV = ".venv"
.\Install-plotter.ps1 bladebit
.\Install-plotter.ps1 madmax
$env:VIRTUAL_ENV = "$PREV_VIRTUAL_ENV"
}

cmd /c mklink /j venv .venv

Write-Output ""
Write-Output "Chia blockchain .\Install.ps1 complete."
Write-Output "For assistance join us on Discord in the #support chat channel:"
Expand All @@ -133,6 +133,6 @@ Write-Output ""
Write-Output "Try the Quick Start Guide to running chia-blockchain:"
Write-Output "https://github.com/Chia-Network/chia-blockchain/wiki/Quick-Start-Guide"
Write-Output ""
Write-Output "To install the GUI run '.\venv\scripts\Activate.ps1' then '.\Install-gui.ps1'."
Write-Output "To install the GUI run '.\.venv\scripts\Activate.ps1' then '.\Install-gui.ps1'."
Write-Output ""
Write-Output "Type '.\venv\Scripts\Activate.ps1' and then 'chia init' to begin."
Write-Output "Type '.\.venv\Scripts\Activate.ps1' and then 'chia init' to begin."
12 changes: 12 additions & 0 deletions Setup-poetry.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
param(
[Parameter(Mandatory, HelpMessage="Python version")]
[string]
$pythonVersion
)

$ErrorActionPreference = "Stop"

py -$pythonVersion -m venv .penv
.penv/Scripts/python -m pip install --upgrade pip setuptools wheel
# TODO: maybe make our own zipapp/shiv/pex of poetry and download that?
.penv/Scripts/python -m pip install poetry
2 changes: 1 addition & 1 deletion activated.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $command = $args[0]
$parameters = [System.Collections.ArrayList]$args
$parameters.RemoveAt(0)

& $script_directory/venv/Scripts/Activate.ps1
& $script_directory/.venv/Scripts/Activate.ps1
& $command @parameters

exit $LASTEXITCODE
2 changes: 1 addition & 1 deletion activated.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ SCRIPT_DIRECTORY=$(
pwd
)
# shellcheck disable=SC1091
. "${SCRIPT_DIRECTORY}/venv/bin/activate"
. "${SCRIPT_DIRECTORY}/.venv/bin/activate"

"$@"
47 changes: 38 additions & 9 deletions build_scripts/check_dependency_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
}


here = pathlib.Path(__file__).parent
project_root = here.parent


def excepted(path: pathlib.Path) -> bool:
# TODO: This should be implemented with a real file name parser though i'm
# uncertain at the moment what package that would be.
Expand All @@ -29,14 +33,10 @@ def main() -> int:
print(f"Working in: {directory_string}")
print()
directory_path = pathlib.Path(directory_string)
artifact_directory_path = directory_path.joinpath("artifacts")
artifact_directory_path.mkdir()

extras = ["upnp"]
package_path_string = os.fspath(pathlib.Path(__file__).parent.parent)

if len(extras) > 0:
package_and_extras = f"{package_path_string}[{','.join(extras)}]"
else:
package_and_extras = package_path_string

print("Downloading packages for Python version:")
lines = [
Expand All @@ -49,24 +49,53 @@ def main() -> int:
print(f" {line}")
print(flush=True)

requirements_path = directory_path.joinpath("exported_requirements.txt")

if sys.platform == "win32":
poetry_path = pathlib.Path(".penv/Scripts/poetry")
else:
poetry_path = pathlib.Path(".penv/bin/poetry")

poetry_path = project_root.joinpath(poetry_path)

subprocess.run(
[
os.fspath(poetry_path),
"export",
"--format",
"requirements.txt",
"--output",
os.fspath(requirements_path),
"--without-hashes",
"--no-ansi",
"--no-interaction",
*(f"--extras={extra}" for extra in extras),
],
check=True,
)

env = {key: value for key, value in os.environ.items() if key != "PIP_REQUIRE_VIRTUALENV"}

subprocess.run(
[
sys.executable,
"-m",
"pip",
"download",
"--dest",
os.fspath(directory_path),
os.fspath(artifact_directory_path),
"--extra-index",
"https://pypi.chia.net/simple/",
package_and_extras,
"--requirement",
os.fspath(requirements_path),
],
env=env,
check=True,
)

failed_artifacts = []

for artifact in directory_path.iterdir():
for artifact in artifact_directory_path.iterdir():
if artifact.suffix == ".whl":
# everything being a wheel is the target
continue
Expand Down
65 changes: 0 additions & 65 deletions build_scripts/installer-version.py

This file was deleted.

2 changes: 1 addition & 1 deletion build_scripts/pyinstaller.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ from PyInstaller.utils.hooks import collect_submodules, copy_metadata
THIS_IS_WINDOWS = platform.system().lower().startswith("win")
THIS_IS_MAC = platform.system().lower().startswith("darwin")

ROOT = pathlib.Path(importlib.import_module("chia").__file__).absolute().parent.parent
ROOT = pathlib.Path(SPECPATH).absolute().parent


keyring_imports = collect_submodules("keyring.backends")
Expand Down
11 changes: 9 additions & 2 deletions chia/_tests/core/data_layer/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import functools
import os
import pathlib
import shutil
import subprocess
from dataclasses import dataclass
from typing import IO, TYPE_CHECKING, Any, Dict, Iterator, List, Literal, Optional, Union, overload
Expand Down Expand Up @@ -137,8 +138,11 @@ def run(
if "SYSTEMROOT" in os.environ:
kwargs["env"]["SYSTEMROOT"] = os.environ["SYSTEMROOT"]

chia_executable = shutil.which("chia")
if chia_executable is None:
chia_executable = "chia"
modified_args: List[Union[str, os_PathLike_str]] = [
self.scripts_path.joinpath("chia"),
self.scripts_path.joinpath(chia_executable),
"--root-path",
self.path,
*args,
Expand All @@ -151,7 +155,10 @@ def run(
kwargs["stdout"] = stdout
kwargs["stderr"] = stderr

return subprocess.run(*final_args, **kwargs)
try:
return subprocess.run(*final_args, **kwargs)
except OSError as e:
raise Exception(f"failed to run:\n {final_args}\n {kwargs}") from e

def read_log(self) -> str:
return self.path.joinpath("log", "debug.log").read_text(encoding="utf-8")
Expand Down
2 changes: 1 addition & 1 deletion chia/_tests/util/test_installed.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ def test_chia_installed() -> None:
and testing the installed code checks for that. A next step would be to install
using the actual wheel file we are going to publish.
"""
assert "venv" in pathlib.Path(chia.__file__).parts
assert ".venv" in pathlib.Path(chia.__file__).parts
Loading
Loading