-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into nspcdef
- Loading branch information
Showing
1,345 changed files
with
104,221 additions
and
16,855 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: Comment with mypy_primer diff | ||
|
||
on: | ||
workflow_run: | ||
workflows: | ||
- Run mypy_primer | ||
types: | ||
- completed | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
comment: | ||
name: Comment PR from mypy_primer | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download diffs | ||
uses: actions/github-script@v3 | ||
with: | ||
script: | | ||
const fs = require('fs'); | ||
const artifacts = await github.actions.listWorkflowRunArtifacts({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: ${{ github.event.workflow_run.id }}, | ||
}); | ||
const [matchArtifact] = artifacts.data.artifacts.filter((artifact) => | ||
artifact.name == "mypy_primer_diffs"); | ||
const download = await github.actions.downloadArtifact({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
artifact_id: matchArtifact.id, | ||
archive_format: "zip", | ||
}); | ||
fs.writeFileSync("diff.zip", Buffer.from(download.data)); | ||
- run: unzip diff.zip | ||
|
||
# Based on https://github.com/kanga333/comment-hider | ||
- name: Hide old comments | ||
uses: actions/github-script@v3 | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
script: | | ||
const fs = require('fs') | ||
const response = await github.issues.listComments({ | ||
issue_number: fs.readFileSync("pr_number.txt", { encoding: "utf8" }), | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
}) | ||
const botCommentIds = response.data | ||
.filter(comment => comment.user.login === 'github-actions[bot]') | ||
.map(comment => comment.node_id) | ||
for (const id of botCommentIds) { | ||
const resp = await github.graphql(` | ||
mutation { | ||
minimizeComment(input: {classifier: OUTDATED, subjectId: "${id}"}) { | ||
minimizedComment { | ||
isMinimized | ||
} | ||
} | ||
} | ||
`) | ||
if (resp.errors) { | ||
throw new Error(resp.errors) | ||
} | ||
} | ||
- name: Post comment | ||
uses: actions/github-script@v3 | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
script: | | ||
const fs = require('fs') | ||
// Keep in sync with shards produced by mypy_primer workflow | ||
const data = ( | ||
['diff_0.txt', 'diff_1.txt', 'diff_2.txt'] | ||
.map(fileName => fs.readFileSync(fileName, { encoding: 'utf8' })) | ||
.join('') | ||
.substr(0, 30000) // About 300 lines | ||
) | ||
console.log("Diff from mypy_primer:") | ||
console.log(data) | ||
if (data.trim()) { | ||
const body = 'Diff from [mypy_primer](https://github.com/hauntsaninja/mypy_primer), showing the effect of this PR on open source code:\n```diff\n' + data + '```' | ||
await github.issues.createComment({ | ||
issue_number: fs.readFileSync("pr_number.txt", { encoding: "utf8" }), | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Test stubgenc on pybind11-mypy-demo | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
tags: ['*'] | ||
pull_request: | ||
paths: | ||
- 'misc/test-stubgenc.sh' | ||
- 'mypy/stubgenc.py' | ||
- 'mypy/stubdoc.py' | ||
- 'test-data/stubgen/**' | ||
|
||
jobs: | ||
stubgenc: | ||
# Check stub file generation for a small pybind11 project | ||
# (full text match is required to pass) | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup 🐍 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Test stubgenc | ||
run: misc/test-stubgenc.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.