Skip to content

Commit 87d5f5b

Browse files
authored
update project files (#5457)
* update pre-commit hook * upgrade pip with venv * update description and version * show url in publish environment * update versions * update versions, separate typing job * use dependabot grouped updates ignore upload/download-artifact until slsa updates * use sphinx.ext.extlinks instead of sphinx-issues * update dev dependencies * update editorconfig * update gitignore * update .readthedocs.yaml * license is txt, readme is md * update pyproject.toml add typed classifier add pyright config simplify urls * tox builds docs in place * update min test py version * add tox env to update all dev dependencies * update issue and pr templates * rename security docs page to not conflict with org policy file * simplify matrix
1 parent d5e321b commit 87d5f5b

35 files changed

+377
-317
lines changed

.devcontainer/on-create-command.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#!/bin/bash
22
set -e
3-
4-
python3 -m venv .venv
3+
python3 -m venv --upgrade-deps .venv
54
. .venv/bin/activate
6-
pip install -U pip
75
pip install -r requirements/dev.txt
86
pip install -e .
97
pre-commit install --install-hooks

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ end_of_line = lf
99
charset = utf-8
1010
max_line_length = 88
1111

12-
[*.{yml,yaml,json,js,css,html}]
12+
[*.{css,html,js,json,jsx,scss,ts,tsx,yaml,yml}]
1313
indent_size = 2

.github/ISSUE_TEMPLATE/bug-report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ about: Report a bug in Flask (not other projects which depend on Flask)
55

66
<!--
77
This issue tracker is a tool to address bugs in Flask itself. Please use
8-
Pallets Discord or Stack Overflow for questions about your own code.
8+
GitHub Discussions or the Pallets Discord for questions about your own code.
99
1010
Replace this comment with a clear outline of what the bug is.
1111
-->

.github/ISSUE_TEMPLATE/config.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Security issue
4-
url: security@palletsprojects.com
5-
about: Do not report security issues publicly. Email our security contact.
4+
url: https://github.com/pallets/flask/security/advisories/new
5+
about: Do not report security issues publicly. Create a private advisory.
66
- name: Questions
7-
url: https://stackoverflow.com/questions/tagged/flask?tab=Frequent
8-
about: Search for and ask questions about your code on Stack Overflow.
9-
- name: Questions and discussions
7+
url: https://github.com/pallets/flask/discussions/
8+
about: Ask questions about your own code on the Discussions tab.
9+
- name: Questions on
1010
url: https://discord.gg/pallets
11-
about: Discuss questions about your code on our Discord chat.
11+
about: Ask questions about your own code on our Discord chat.

.github/SECURITY.md

-19
This file was deleted.

.github/dependabot.yml

+22-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "github-actions"
4-
directory: "/"
5-
schedule:
6-
interval: "monthly"
7-
day: "monday"
8-
time: "16:00"
9-
timezone: "UTC"
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: monthly
7+
ignore:
8+
# slsa depends on upload/download v3
9+
- dependency-name: actions/upload-artifact
10+
versions: '>= 4'
11+
- dependency-name: actions/download-artifact
12+
versions: '>= 4'
13+
groups:
14+
github-actions:
15+
patterns:
16+
- '*'
17+
- package-ecosystem: pip
18+
directory: /requirements/
19+
schedule:
20+
interval: monthly
21+
groups:
22+
python-requirements:
23+
patterns:
24+
- '*'

.github/pull_request_template.md

+10-15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<!--
22
Before opening a PR, open a ticket describing the issue or feature the
3-
PR will address. Follow the steps in CONTRIBUTING.rst.
3+
PR will address. An issue is not required for fixing typos in
4+
documentation, or other simple non-code changes.
45
56
Replace this comment with a description of the change. Describe how it
67
addresses the linked ticket.
@@ -9,22 +10,16 @@ addresses the linked ticket.
910
<!--
1011
Link to relevant issues or previous PRs, one per line. Use "fixes" to
1112
automatically close an issue.
12-
-->
1313
14-
- fixes #<issue number>
14+
fixes #<issue number>
15+
-->
1516

1617
<!--
17-
Ensure each step in CONTRIBUTING.rst is complete by adding an "x" to
18-
each box below.
18+
Ensure each step in CONTRIBUTING.rst is complete, especially the following:
1919
20-
If only docs were changed, these aren't relevant and can be removed.
20+
- Add tests that demonstrate the correct behavior of the change. Tests
21+
should fail without the change.
22+
- Add or update relevant docs, in the docs folder and in code.
23+
- Add an entry in CHANGES.rst summarizing the change and linking to the issue.
24+
- Add `.. versionchanged::` entries in any relevant code docs.
2125
-->
22-
23-
Checklist:
24-
25-
- [ ] Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
26-
- [ ] Add or update relevant docs, in the docs folder and in code.
27-
- [ ] Add an entry in `CHANGES.rst` summarizing the change and linking to the issue.
28-
- [ ] Add `.. versionchanged::` entries in any relevant code docs.
29-
- [ ] Run `pre-commit` hooks and fix any issues.
30-
- [ ] Run `pytest` and `tox`, no tests failed.

.github/workflows/lock.yaml

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
name: 'Lock threads'
2-
# Lock closed issues that have not received any further activity for
3-
# two weeks. This does not close open issues, only humans may do that.
4-
# We find that it is easier to respond to new issues with fresh examples
5-
# rather than continuing discussions on old issues.
1+
name: Lock inactive closed issues
2+
# Lock closed issues that have not received any further activity for two weeks.
3+
# This does not close open issues, only humans may do that. It is easier to
4+
# respond to new issues with fresh examples rather than continuing discussions
5+
# on old issues.
6+
67
on:
78
schedule:
89
- cron: '0 0 * * *'
@@ -15,7 +16,8 @@ jobs:
1516
lock:
1617
runs-on: ubuntu-latest
1718
steps:
18-
- uses: dessant/lock-threads@7de207be1d3ce97a9abe6ff1306222982d1ca9f9
19+
- uses: dessant/lock-threads@7de207be1d3ce97a9abe6ff1306222982d1ca9f9 # v5.0.1
1920
with:
2021
issue-inactive-days: 14
2122
pr-inactive-days: 14
23+
discussion-inactive-days: 14

.github/workflows/publish.yaml

+15-11
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ jobs:
99
outputs:
1010
hash: ${{ steps.hash.outputs.hash }}
1111
steps:
12-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
13-
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c
12+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
13+
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
1414
with:
1515
python-version: '3.x'
1616
cache: pip
@@ -23,9 +23,8 @@ jobs:
2323
- name: generate hash
2424
id: hash
2525
run: cd dist && echo "hash=$(sha256sum * | base64 -w0)" >> $GITHUB_OUTPUT
26-
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
26+
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
2727
with:
28-
name: dist
2928
path: ./dist
3029
provenance:
3130
needs: [build]
@@ -34,7 +33,7 @@ jobs:
3433
id-token: write
3534
contents: write
3635
# Can't pin with hash due to how this workflow works.
37-
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.9.0
36+
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.10.0
3837
with:
3938
base64-subjects: ${{ needs.build.outputs.hash }}
4039
create-release:
@@ -45,25 +44,30 @@ jobs:
4544
permissions:
4645
contents: write
4746
steps:
48-
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
47+
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
4948
- name: create release
5049
run: >
5150
gh release create --draft --repo ${{ github.repository }}
5251
${{ github.ref_name }}
53-
*.intoto.jsonl/* dist/*
52+
*.intoto.jsonl/* artifact/*
5453
env:
5554
GH_TOKEN: ${{ github.token }}
5655
publish-pypi:
5756
needs: [provenance]
5857
# Wait for approval before attempting to upload to PyPI. This allows reviewing the
5958
# files in the draft release.
60-
environment: publish
59+
environment:
60+
name: publish
61+
url: https://pypi.org/project/Flask/${{ github.ref_name }}
6162
runs-on: ubuntu-latest
6263
permissions:
6364
id-token: write
6465
steps:
65-
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
66-
- uses: pypa/gh-action-pypi-publish@f946db0f765b9ae754e44bfd5ae5b8b91cfb37ef
66+
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
67+
- uses: pypa/gh-action-pypi-publish@68e62d4871ad9d14a9d55f114e6ac71f0b408ec0 # v1.8.14
6768
with:
6869
repository-url: https://test.pypi.org/legacy/
69-
- uses: pypa/gh-action-pypi-publish@f946db0f765b9ae754e44bfd5ae5b8b91cfb37ef
70+
packages-dir: artifact/
71+
- uses: pypa/gh-action-pypi-publish@68e62d4871ad9d14a9d55f114e6ac71f0b408ec0 # v1.8.14
72+
with:
73+
packages-dir: artifact/

.github/workflows/tests.yaml

+30-20
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,45 @@ on:
1515
- '*.rst'
1616
jobs:
1717
tests:
18-
name: ${{ matrix.name }}
19-
runs-on: ${{ matrix.os }}
18+
name: ${{ matrix.name || matrix.python }}
19+
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
2020
strategy:
2121
fail-fast: false
2222
matrix:
2323
include:
24-
- {name: Linux, python: '3.12', os: ubuntu-latest, tox: py312}
25-
- {name: Windows, python: '3.12', os: windows-latest, tox: py312}
26-
- {name: Mac, python: '3.12', os: macos-latest, tox: py312}
27-
- {name: '3.11', python: '3.11', os: ubuntu-latest, tox: py311}
28-
- {name: '3.10', python: '3.10', os: ubuntu-latest, tox: py310}
29-
- {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39}
30-
- {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38}
31-
- {name: 'PyPy', python: 'pypy-3.10', os: ubuntu-latest, tox: pypy310}
32-
- {name: 'Minimum Versions', python: '3.12', os: ubuntu-latest, tox: py312-min}
33-
- {name: 'Development Versions', python: '3.8', os: ubuntu-latest, tox: py38-dev}
34-
- {name: Typing, python: '3.12', os: ubuntu-latest, tox: typing}
24+
- {python: '3.12'}
25+
- {name: Windows, python: '3.12', os: windows-latest}
26+
- {name: Mac, python: '3.12', os: macos-latest}
27+
- {python: '3.11'}
28+
- {python: '3.10'}
29+
- {python: '3.9'}
30+
- {python: '3.8'}
31+
- {name: PyPy, python: 'pypy-3.10', tox: pypy310}
32+
- {name: Minimum Versions, python: '3.12', tox: py-min}
33+
- {name: Development Versions, python: '3.8', tox: py-dev}
3534
steps:
36-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
37-
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c
35+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
36+
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
3837
with:
3938
python-version: ${{ matrix.python }}
40-
cache: 'pip'
39+
allow-prereleases: true
40+
cache: pip
41+
cache-dependency-path: requirements*/*.txt
42+
- run: pip install tox
43+
- run: tox run -e ${{ matrix.tox || format('py{0}', matrix.python) }}
44+
typing:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
48+
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
49+
with:
50+
python-version: '3.x'
51+
cache: pip
4152
cache-dependency-path: requirements*/*.txt
4253
- name: cache mypy
43-
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2
54+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
4455
with:
4556
path: ./.mypy_cache
46-
key: mypy|${{ matrix.python }}|${{ hashFiles('pyproject.toml') }}
47-
if: matrix.tox == 'typing'
57+
key: mypy|${{ hashFiles('pyproject.toml') }}
4858
- run: pip install tox
49-
- run: tox run -e ${{ matrix.tox }}
59+
- run: tox run -e typing

.gitignore

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
.idea/
22
.vscode/
3+
.venv*/
4+
venv*/
35
__pycache__/
4-
.tox/
5-
.coverage
6-
.coverage.*
6+
dist/
7+
.coverage*
78
htmlcov/
9+
.tox/
810
docs/_build/
9-
dist/
10-
venv/

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ ci:
22
autoupdate_schedule: monthly
33
repos:
44
- repo: https://github.com/astral-sh/ruff-pre-commit
5-
rev: v0.1.13
5+
rev: v0.3.5
66
hooks:
77
- id: ruff
88
- id: ruff-format
99
- repo: https://github.com/pre-commit/pre-commit-hooks
10-
rev: v4.5.0
10+
rev: v4.6.0
1111
hooks:
1212
- id: check-merge-conflict
1313
- id: debug-statements

.readthedocs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22
build:
33
os: ubuntu-22.04
44
tools:
5-
python: "3.12"
5+
python: '3.12'
66
python:
77
install:
88
- requirements: requirements/docs.txt

LICENSE.rst renamed to LICENSE.txt

File renamed without changes.

0 commit comments

Comments
 (0)