Skip to content

Commit da3a9f0

Browse files
authored
update project files (#1968)
2 parents e491223 + 0ee5eb4 commit da3a9f0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+431
-492
lines changed

.devcontainer/devcontainer.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "pallets/jinja",
3+
"image": "mcr.microsoft.com/devcontainers/python:3",
4+
"customizations": {
5+
"vscode": {
6+
"settings": {
7+
"python.defaultInterpreterPath": "${workspaceFolder}/.venv",
8+
"python.terminal.activateEnvInCurrentTerminal": true,
9+
"python.terminal.launchArgs": [
10+
"-X",
11+
"dev"
12+
]
13+
}
14+
}
15+
},
16+
"onCreateCommand": ".devcontainer/on-create-command.sh"
17+
}

.devcontainer/on-create-command.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
set -e
3+
python3 -m venv --upgrade-deps .venv
4+
. .venv/bin/activate
5+
pip install -r requirements/dev.txt
6+
pip install -e .
7+
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

.flake8

-28
This file was deleted.

.github/ISSUE_TEMPLATE/bug-report.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ about: Report a bug in Jinja (not other projects which depend on Jinja)
44
---
55

66
<!--
7-
This issue tracker is a tool to address bugs in Jinja itself. Please
8-
use Pallets Discord or Stack Overflow for questions about your own code.
7+
This issue tracker is a tool to address bugs in Jinja itself. Please use
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

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

.github/ISSUE_TEMPLATE/feature-request.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ about: Suggest a new feature for Jinja
55

66
<!--
77
Replace this comment with a description of what the feature should do.
8-
Include details such as links relevant specs or previous discussions.
8+
Include details such as links to relevant specs or previous discussions.
99
-->
1010

1111
<!--
1212
Replace this comment with an example of the problem which this feature
13-
would resolve. Is this problem solvable without changes to Jinja,
14-
such as by subclassing or using an extension?
13+
would resolve. Is this problem solvable without changes to Jinja, such
14+
as by subclassing or using an extension?
1515
-->

.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

+15-16
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
<!--
2-
Before opening a PR, open a ticket describing the issue or feature the PR will address. Follow the steps in CONTRIBUTING.rst.
2+
Before opening a PR, open a ticket describing the issue or feature the
3+
PR will address. An issue is not required for fixing typos in
4+
documentation, or other simple non-code changes.
35
4-
Replace this comment with a description of the change. Describe how it addresses the linked ticket.
6+
Replace this comment with a description of the change. Describe how it
7+
addresses the linked ticket.
58
-->
69

710
<!--
8-
Link to relevant issues or previous PRs, one per line. Use "fixes" to automatically close an issue.
9-
-->
11+
Link to relevant issues or previous PRs, one per line. Use "fixes" to
12+
automatically close an issue.
1013
11-
- fixes #<issue number>
14+
fixes #<issue number>
15+
-->
1216

1317
<!--
14-
Ensure each step in CONTRIBUTING.rst is complete by adding an "x" to each box below.
18+
Ensure each step in CONTRIBUTING.rst is complete, especially the following:
1519
16-
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.
1725
-->
18-
19-
Checklist:
20-
21-
- [ ] Add tests that demonstrate the correct behavior of the change. Tests 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.
25-
- [ ] Run `pre-commit` hooks and fix any issues.
26-
- [ ] Run `pytest` and `tox`, no tests failed.

.github/workflows/lock.yaml

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
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.
66

77
on:
88
schedule:
99
- cron: '0 0 * * *'
10-
1110
permissions:
1211
issues: write
1312
pull-requests: write
14-
1513
concurrency:
1614
group: lock
17-
1815
jobs:
1916
lock:
2017
runs-on: ubuntu-latest
2118
steps:
22-
- uses: dessant/lock-threads@c1b35aecc5cdb1a34539d14196df55838bb2f836
19+
- uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5.0.1
2320
with:
2421
issue-inactive-days: 14
2522
pr-inactive-days: 14
23+
discussion-inactive-days: 14

.github/workflows/publish.yaml

+19-13
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ jobs:
99
outputs:
1010
hash: ${{ steps.hash.outputs.hash }}
1111
steps:
12-
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
13-
- uses: actions/setup-python@5ccb29d8773c3f3f653e1705f474dfaa8a06a912
12+
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
13+
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
1414
with:
1515
python-version: '3.x'
16-
cache: 'pip'
17-
cache-dependency-path: 'requirements/*.txt'
16+
cache: pip
17+
cache-dependency-path: requirements*/*.txt
1818
- run: pip install -r requirements/build.txt
1919
# Use the commit date instead of the current date during the build.
2020
- run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV
@@ -23,28 +23,28 @@ jobs:
2323
- name: generate hash
2424
id: hash
2525
run: cd dist && echo "hash=$(sha256sum * | base64 -w0)" >> $GITHUB_OUTPUT
26-
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
26+
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
2727
with:
2828
path: ./dist
2929
provenance:
30-
needs: ['build']
30+
needs: [build]
3131
permissions:
3232
actions: read
3333
id-token: write
3434
contents: write
3535
# Can't pin with hash due to how this workflow works.
36-
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.4.0
36+
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.10.0
3737
with:
3838
base64-subjects: ${{ needs.build.outputs.hash }}
3939
create-release:
4040
# Upload the sdist, wheels, and provenance to a GitHub release. They remain
4141
# available as build artifacts for a while as well.
42-
needs: ['provenance']
42+
needs: [provenance]
4343
runs-on: ubuntu-latest
4444
permissions:
4545
contents: write
4646
steps:
47-
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
47+
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
4848
- name: create release
4949
run: >
5050
gh release create --draft --repo ${{ github.repository }}
@@ -53,15 +53,21 @@ jobs:
5353
env:
5454
GH_TOKEN: ${{ github.token }}
5555
publish-pypi:
56-
needs: ['provenance']
56+
needs: [provenance]
5757
# Wait for approval before attempting to upload to PyPI. This allows reviewing the
5858
# files in the draft release.
59-
environment: 'publish'
59+
environment:
60+
name: publish
61+
url: https://pypi.org/project/Jinja2/${{ github.ref_name }}
6062
runs-on: ubuntu-latest
6163
permissions:
6264
id-token: write
6365
steps:
64-
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
65-
- uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf
66+
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
67+
- uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # v1.8.14
68+
with:
69+
repository-url: https://test.pypi.org/legacy/
70+
packages-dir: artifact/
71+
- uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # v1.8.14
6672
with:
6773
packages-dir: artifact/

.github/workflows/tests.yaml

+30-28
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,50 @@ on:
99
- '*.md'
1010
- '*.rst'
1111
pull_request:
12-
branches:
13-
- main
14-
- '*.x'
1512
paths-ignore:
1613
- 'docs/**'
1714
- '*.md'
1815
- '*.rst'
1916
jobs:
2017
tests:
21-
name: ${{ matrix.name }}
22-
runs-on: ${{ matrix.os }}
18+
name: ${{ matrix.name || matrix.python }}
19+
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
2320
strategy:
2421
fail-fast: false
2522
matrix:
2623
include:
27-
- {name: Linux, python: '3.11', os: ubuntu-latest, tox: py311}
28-
- {name: Windows, python: '3.11', os: windows-latest, tox: py311}
29-
- {name: Mac, python: '3.11', os: macos-latest, tox: py311}
30-
- {name: '3.12-dev', python: '3.12-dev', os: ubuntu-latest, tox: py312}
31-
- {name: '3.10', python: '3.10', os: ubuntu-latest, tox: py310}
32-
- {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39}
33-
- {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38}
34-
- {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37}
35-
- {name: 'PyPy', python: 'pypy-3.10', os: ubuntu-latest, tox: pypy310}
36-
- {name: Typing, python: '3.11', 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+
- {python: '3.7'}
32+
- {name: PyPy, python: 'pypy-3.10', tox: pypy310}
3733
steps:
38-
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
39-
- uses: actions/setup-python@5ccb29d8773c3f3f653e1705f474dfaa8a06a912
34+
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
35+
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
4036
with:
4137
python-version: ${{ matrix.python }}
42-
cache: 'pip'
43-
cache-dependency-path: 'requirements/*.txt'
44-
- name: update pip
45-
run: |
46-
pip install -U wheel
47-
pip install -U setuptools
48-
python -m pip install -U pip
38+
allow-prereleases: true
39+
cache: pip
40+
cache-dependency-path: requirements*/*.txt
41+
- run: pip install tox
42+
- run: tox run -e ${{ matrix.tox || format('py{0}', matrix.python) }}
43+
typing:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
47+
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
48+
with:
49+
python-version: '3.x'
50+
cache: pip
51+
cache-dependency-path: requirements*/*.txt
4952
- name: cache mypy
50-
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12
53+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
5154
with:
5255
path: ./.mypy_cache
53-
key: mypy|${{ matrix.python }}|${{ hashFiles('setup.cfg') }}
54-
if: matrix.tox == 'typing'
56+
key: mypy|${{ hashFiles('pyproject.toml') }}
5557
- run: pip install tox
56-
- run: tox run -e ${{ matrix.tox }}
58+
- run: tox run -e typing

.gitignore

+8-19
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
1-
*.so
2-
docs/_build/
3-
*.pyc
4-
*.pyo
5-
*.egg-info/
6-
*.egg
7-
build/
1+
.idea/
2+
.vscode/
3+
.venv*/
4+
venv*/
5+
__pycache__/
86
dist/
9-
.DS_Store
7+
.coverage*
8+
htmlcov/
109
.tox/
11-
.cache/
12-
.idea/
13-
env/
14-
venv/
15-
venv-*/
16-
.coverage
17-
.coverage.*
18-
htmlcov
19-
.pytest_cache/
20-
/.vscode/
21-
.mypy_cache
10+
docs/_build/

0 commit comments

Comments
 (0)