forked from pallets/flask
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'pallets:main' into master
- Loading branch information
Showing
130 changed files
with
2,389 additions
and
3,015 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "pallets/flask", | ||
"image": "mcr.microsoft.com/devcontainers/python:3", | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"python.defaultInterpreterPath": "${workspaceFolder}/.venv", | ||
"python.terminal.activateEnvInCurrentTerminal": true, | ||
"python.terminal.launchArgs": [ | ||
"-X", | ||
"dev" | ||
] | ||
} | ||
} | ||
}, | ||
"onCreateCommand": ".devcontainer/on-create-command.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
python3 -m venv .venv | ||
. .venv/bin/activate | ||
pip install -U pip setuptools wheel | ||
pip install -r requirements/dev.txt | ||
pip install -e . | ||
pre-commit install --install-hooks |
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,25 @@ | ||
[flake8] | ||
extend-select = | ||
# bugbear | ||
B | ||
# bugbear opinions | ||
B9 | ||
# implicit str concat | ||
ISC | ||
extend-ignore = | ||
# slice notation whitespace, invalid | ||
E203 | ||
# line length, handled by bugbear B950 | ||
E501 | ||
# bare except, handled by bugbear B001 | ||
E722 | ||
# zip with strict=, requires python >= 3.10 | ||
B905 | ||
# string formatting opinion, B028 renamed to B907 | ||
B028 | ||
B907 | ||
# up to 88 allowed by bugbear B950 | ||
max-line-length = 80 | ||
per-file-ignores = | ||
# __init__ exports names | ||
src/flask/__init__.py: F401 |
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 |
---|---|---|
@@ -1,18 +1,25 @@ | ||
# This does not automatically close "stale" issues. Instead, it locks closed issues after 2 weeks of no activity. | ||
# If there's a new issue related to an old one, we've found it's much easier to work on as a new issue. | ||
|
||
name: 'Lock threads' | ||
# Lock closed issues that have not received any further activity for | ||
# two weeks. This does not close open issues, only humans may do that. | ||
# We find that it is easier to respond to new issues with fresh examples | ||
# rather than continuing discussions on old issues. | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
permissions: | ||
issues: write | ||
pull-requests: write | ||
|
||
concurrency: | ||
group: lock | ||
|
||
jobs: | ||
lock: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: dessant/lock-threads@v3 | ||
- uses: dessant/lock-threads@c1b35aecc5cdb1a34539d14196df55838bb2f836 | ||
with: | ||
github-token: ${{ github.token }} | ||
issue-inactive-days: 14 | ||
pr-inactive-days: 14 |
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,72 @@ | ||
name: Publish | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
hash: ${{ steps.hash.outputs.hash }} | ||
steps: | ||
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab | ||
- uses: actions/setup-python@57ded4d7d5e986d7296eab16560982c6dd7c923b | ||
with: | ||
python-version: '3.x' | ||
cache: 'pip' | ||
cache-dependency-path: 'requirements/*.txt' | ||
- run: pip install -r requirements/build.txt | ||
# Use the commit date instead of the current date during the build. | ||
- run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV | ||
- run: python -m build | ||
# Generate hashes used for provenance. | ||
- name: generate hash | ||
id: hash | ||
run: cd dist && echo "hash=$(sha256sum * | base64 -w0)" >> $GITHUB_OUTPUT | ||
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce | ||
with: | ||
path: ./dist | ||
provenance: | ||
needs: ['build'] | ||
permissions: | ||
actions: read | ||
id-token: write | ||
contents: write | ||
# Can't pin with hash due to how this workflow works. | ||
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.5.0 | ||
with: | ||
base64-subjects: ${{ needs.build.outputs.hash }} | ||
create-release: | ||
# Upload the sdist, wheels, and provenance to a GitHub release. They remain | ||
# available as build artifacts for a while as well. | ||
needs: ['provenance'] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a | ||
- name: create release | ||
run: > | ||
gh release create --draft --repo ${{ github.repository }} | ||
${{ github.ref_name }} | ||
*.intoto.jsonl/* artifact/* | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
publish-pypi: | ||
needs: ['provenance'] | ||
# Wait for approval before attempting to upload to PyPI. This allows reviewing the | ||
# files in the draft release. | ||
environment: 'publish' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a | ||
# Try uploading to Test PyPI first, in case something fails. | ||
- uses: pypa/gh-action-pypi-publish@0bf742be3ebe032c25dd15117957dc15d0cfc38d | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
packages-dir: artifact/ | ||
- uses: pypa/gh-action-pypi-publish@0bf742be3ebe032c25dd15117957dc15d0cfc38d | ||
with: | ||
packages-dir: artifact/ |
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.