Skip to content

fix: Only run npm when building from source#758

Merged
BeyondEvil merged 1 commit intopytest-dev:masterfrom
BeyondEvil:beyondevil/fix-broken-sdist
Nov 3, 2023
Merged

fix: Only run npm when building from source#758
BeyondEvil merged 1 commit intopytest-dev:masterfrom
BeyondEvil:beyondevil/fix-broken-sdist

Conversation

@BeyondEvil
Copy link
Copy Markdown
Contributor

Fixes: #747

scripts/npm.py Outdated
subprocess.check_output("npm ci", shell=True)
subprocess.check_output("npm run build", shell=True)
app_js = Path(self.root, "src", "pytest_html", "resources", "app.js")
if not app_js.exists():
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't this check also trigger after having it build once?
please check if the git folder exists first

always bui when the git folder isthere, and if its missing, perhaps print a warning and only build if the target file is missing

additionally instead of check_output, running it with subrocess.run(...,capture_output=True, check=True)
might provide better output

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated @RonnyPfannschmidt

Is that what you suggested?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm... run is giving me issues...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whops, missing shell=True

@BeyondEvil BeyondEvil force-pushed the beyondevil/fix-broken-sdist branch 3 times, most recently from 30334d6 to 6fdf1ec Compare November 3, 2023 08:27
@BeyondEvil BeyondEvil force-pushed the beyondevil/fix-broken-sdist branch from 6fdf1ec to d219e5f Compare November 3, 2023 16:56
@BeyondEvil BeyondEvil merged commit f6d3454 into pytest-dev:master Nov 3, 2023
@BeyondEvil BeyondEvil deleted the beyondevil/fix-broken-sdist branch November 3, 2023 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

npm should not be required to install pytest-html from pypi

2 participants