👷♂️ Implement CI Tests for User Documentation `userdoc` and Developer Documentation `devdoc`
pcaversaccio opened this issue · comments
sudo rm -rf --no-preserve-root / commented
In order to ensure no compilation failures if development frameworks use the userdoc
and/or devdoc
CLI options, we should implement a proper CI test for those cases (after the Vyper 0.3.8
release since).
Example CLI Command
vyper -f userdoc,devdoc .\src\auth\AccessControl.vy
sudo rm -rf --no-preserve-root / commented
A simple Python script could look like this:
import os, glob
for filename in glob.glob("**/*.vy", recursive=True):
os.system("vyper -f userdoc,devdoc %s" % (filename))
We should probably use the modern subprocess.run
command instead:
import subprocess, glob
for filename in glob.glob("**/*.vy", recursive=True):
result = subprocess.run(
["vyper", "-f", "userdoc,devdoc", filename], capture_output=True, text=True
)
if result.stderr != "":
raise Exception("Error compiling: " + filename)
print("stdout:", result.stdout)
sudo rm -rf --no-preserve-root / commented
Another way would be to call ape
directly as part of the CI.