fix incorrect patched distributions template (#75)

* fix incorrect patched distributions template

* remove multiline once again

* remove comments
This commit is contained in:
Philip Meier
2022-05-13 09:15:56 +02:00
committed by GitHub
parent 100f977910
commit 1346b9a7f9
4 changed files with 28 additions and 7 deletions

View File

@@ -8,7 +8,7 @@ the wheels hosted by PyTorch. Please replace it with
```py
PYTORCH_DISTRIBUTIONS = {
{%- for dist in env.PYTORCH_DISTRIBUTIONS %}
{%- for dist in env.PYTORCH_DISTRIBUTIONS.split(",") %}
"{{ dist }}",
{%- endfor %}
}

View File

@@ -26,16 +26,37 @@ jobs:
- name: Check available PyTorch distributions
id: pytorch-dists
run: |
PYTORCH_DISTS=$(python scripts/check_available_pytorch_dists.py)
PYTORCH_DISTS=`python scripts/check_available_pytorch_dists.py`
echo "::set-output name=pytorch-dists::${PYTORCH_DISTS}"
if [[ -n "${PYTORCH_DISTS}" ]]; then { echo "${PYTORCH_DISTS}"; exit 1; }; fi
- name: Check template
if: failure() && github.event_name != 'schedule'
shell: python
env:
PYTORCH_DISTRIBUTIONS: ${{ steps.pytorch-dists.outputs.pytorch-dists }}
run: |
import os
import pathlib
import jinja2
path = pathlib.Path.cwd() / ".github"
loader = jinja2.FileSystemLoader(searchpath=path)
env = jinja2.Environment(loader=loader)
template = env.get_template("incorrect_pytorch_dists_issue_template.md")
print(
template.render(
env={"PYTORCH_DISTRIBUTIONS": os.environ["PYTORCH_DISTRIBUTIONS"]},
)
)
- uses: JasonEtco/create-an-issue@v2.6.0
if: failure() && github.event_name == 'schedule'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYTORCH_DISTRIBUTIONS:
${{ toJSON(steps.pytorch-dists.outputs.pytorch-dists) }}
PYTORCH_DISTRIBUTIONS: ${{ steps.pytorch-dists.outputs.pytorch-dists }}
with:
filename: .github/incorrect_pytorch_dists_issue_template.md
update_existing: true
update_existing: false

View File

@@ -13,3 +13,4 @@ check-wheel-contents
# misc
requests
beautifulsoup4
jinja2

View File

@@ -1,7 +1,6 @@
#!/usr/bin/env python
import itertools
import json
import requests
from bs4 import BeautifulSoup
@@ -48,7 +47,7 @@ def main():
extra = PATCHED_PYTORCH_DISTS - available
if missing or extra:
print(json.dumps(sorted(available)))
print(",".join(sorted(available)))
if __name__ == "__main__":