Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v6
- uses: actions/setup-python@v7
with:
python-version: "3.x"
- uses: j178/prek-action@v1
9 changes: 4 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["pypy3.11", "3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["pypy3.12", "pypy3.11", "3.11", "3.12", "3.13", "3.14"]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
Expand All @@ -34,7 +34,7 @@ jobs:
requirements.txt

- name: Set up node
uses: actions/setup-node@v6
uses: actions/setup-node@v7
with:
node-version: 16
cache: 'npm'
Expand All @@ -43,7 +43,6 @@ jobs:
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U wheel
python -m pip install -Ur requirements.txt --prefer-binary
npm install svgexport

Expand Down
2 changes: 1 addition & 1 deletion all.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ <h2 id="thanks">Thanks</h2>
</div>
</div>
<footer>
<p>Last updated <span ng-bind="last_update"></span>. (Updated hourly.)</p>
<p>Last updated <span ng-bind="last_update"></span>. (Updated daily.)</p>
<a class="github-fork-ribbon" href="https://github.com/hugovk/drop-python" target="_blank" data-ribbon="Fork me on GitHub" title="Fork me on GitHub">Fork me on GitHub</a>
</footer>
</div>
Expand Down
8 changes: 4 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ wget https://endoflife.date/api/python.json -O python-eol.json
export OPENSSL_CONF=/dev/null

# Generate the files
python3 generate.py --version 2.{0,1,2,3,4,5,6,7} 3.{0,1,2,3,4,5,6,7,8,9,10}
python3 generate.py --version 2.{0,1,2,3,4,5,6,7} 3.{0,1,2,3,4,5,6,7,8,9,10,11}

# Create index.html files from the template
python3 template.py --version 2.{0,1,2,3,4,5,6,7} 3.{0,1,2,3,4,5,6,7,8,9,10}
python3 template.py --version 2.{0,1,2,3,4,5,6,7} 3.{0,1,2,3,4,5,6,7,8,9,10,11}

# Make output directory, don't fail if it exists
mkdir -p build

# Copy to output directory
cp -R {2.{0,1,2,3,4,5,6,7},3.{0,1,2,3,4,5,6,7,8,9,10},all.html,index.html,results.json,style.css,wheel.css} build
cp -R {2.{0,1,2,3,4,5,6,7},3.{0,1,2,3,4,5,6,7,8,9,10,11},all.html,index.html,results.json,style.css,wheel.css} build

# Remove templated index.html files
rm {2.{0,1,2,3,4,5,6,7},3.{0,1,2,3,4,5,6,7,8,9,10}}/index.html
rm {2.{0,1,2,3,4,5,6,7},3.{0,1,2,3,4,5,6,7,8,9,10,11}}/index.html
18 changes: 9 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ <h1 id="drop">Drop Python</h1>
<h2 id="2.7"><a href="2.7">Python 2.7</a></h2>
<object data="2.7/wheel.svg" type="image/svg+xml" width="380" height="380" class="d-block mx-auto"></object>
</div>
<div class="col-sm-6">
<h2 id="3.6"><a href="3.6">Python 3.6</a></h2>
<object data="3.6/wheel.svg" type="image/svg+xml" width="380" height="380" class="d-block mx-auto"></object>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<h2 id="3.7"><a href="3.7">Python 3.7</a></h2>
<object data="3.7/wheel.svg" type="image/svg+xml" width="380" height="380" class="d-block mx-auto"></object>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<h2 id="3.8"><a href="3.8">Python 3.8</a></h2>
<object data="3.8/wheel.svg" type="image/svg+xml" width="380" height="380" class="d-block mx-auto"></object>
</div>
<div class="col-sm-6">
<h2 id="3.9"><a href="3.9">Python 3.9</a></h2>
<object data="3.9/wheel.svg" type="image/svg+xml" width="380" height="380" class="d-block mx-auto"></object>
</div>
</div>
<div class="row">
<div class="col-sm-6">
Expand All @@ -62,13 +62,13 @@ <h2 id="thanks">Thanks</h2>

</div>
<div class="col-sm-6">
<h2 id="3.9"><a href="3.9">Python 3.9</a></h2>
<object data="3.9/wheel.svg" type="image/svg+xml" width="380" height="380" class="d-block mx-auto"></object>
<h2 id="3.10"><a href="3.10">Python 3.10</a></h2>
<object data="3.10/wheel.svg" type="image/svg+xml" width="380" height="380" class="d-block mx-auto"></object>
</div>

</div>
<footer>
<p>Last updated <span ng-bind="last_update"></span>. (Updated hourly.)</p>
<p>Last updated <span ng-bind="last_update"></span>. (Updated daily.)</p>
<a class="github-fork-ribbon" href="https://github.com/hugovk/drop-python" target="_blank" data-ribbon="Fork me on GitHub" title="Fork me on GitHub">Fork me on GitHub</a>
</footer>
</div>
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.black]
target_version = [ "py310" ]
target_version = [ "py311" ]

[tool.ruff]
fix = true
Expand Down
7 changes: 6 additions & 1 deletion template.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@
<li><a href="https://github.com/jugmac00/python-version-cheat-sheet#python-311"><code>tomllib</code> in the stdlib, exception groups and except*</a></li>
<li><a href="https://docs.python.org/3/whatsnew/$template_next_version.html">And more!</a></li>
"""}, # noqa: E501
"3.11": {"reasons": """
<li><a href="https://nedbatchelder.com/text/which-py.html">10–60% faster than 3.10, tomllib</a></li>
<li><a href="https://github.com/jugmac00/python-version-cheat-sheet#python-312">Python version cheat sheet</a></li>
<li><a href="https://docs.python.org/3/whatsnew/$template_next_version.html">What's new in Python $template_next_version</a></li>
"""}, # noqa: E501
}

REASONS = """
Expand Down Expand Up @@ -146,7 +151,7 @@ def main() -> None:
# Read it
src = Template(infile.read())

now = dt.datetime.utcnow()
now = dt.datetime.now(dt.UTC).replace(tzinfo=None)
for version in args.version:
# Document data
print(version)
Expand Down
2 changes: 1 addition & 1 deletion template/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ <h2 id="thanks">Thanks</h2>
</div>
</div>
<footer>
<p>Last updated <span ng-bind="last_update"></span>. (Updated hourly.)</p>
<p>Last updated <span ng-bind="last_update"></span>. (Updated daily.)</p>
<a class="github-fork-ribbon" href="https://github.com/hugovk/drop-python" target="_blank" data-ribbon="Fork me on GitHub" title="Fork me on GitHub">Fork me on GitHub</a>
</footer>
</div>
Expand Down
3 changes: 1 addition & 2 deletions utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import datetime as dt
import json
import os
from zoneinfo import ZoneInfo

import requests_cache
from packaging import specifiers
Expand Down Expand Up @@ -219,7 +218,7 @@ def remove_irrelevant_packages(packages, limit):


def save_to_file(packages, file_name):
now = dt.datetime.utcnow().replace(tzinfo=ZoneInfo("UTC"))
now = dt.datetime.now(dt.UTC)
with open(file_name, "w") as f:
f.write(
json.dumps(
Expand Down
Loading