mirror of
https://github.com/pmeier/light-the-torch.git
synced 2024-09-08 23:29:28 +03:00
fix incorrect patched distributions template (#75)
* fix incorrect patched distributions template * remove multiline once again * remove comments
This commit is contained in:
@@ -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 %}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -13,3 +13,4 @@ check-wheel-contents
|
||||
# misc
|
||||
requests
|
||||
beautifulsoup4
|
||||
jinja2
|
||||
|
||||
@@ -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__":
|
||||
|
||||
Reference in New Issue
Block a user