Skip to content

Commit 18f0da9

Browse files
committed
Merge branch 'main' of github.com:HTTPArchive/almanac.httparchive.org into production
2 parents b3214d9 + 63114ef commit 18f0da9

15 files changed

Lines changed: 93 additions & 90 deletions

.github/workflows/code-static-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ jobs:
3333
steps:
3434
- name: Checkout repository
3535
uses: actions/checkout@v4
36-
- name: Set up Python 3.8
36+
- name: Set up Python 3.12
3737
if: ${{ matrix.language == 'python' }}
3838
uses: actions/setup-python@v5.1.1
3939
with:
40-
python-version: '3.8'
40+
python-version: '3.12'
4141
- name: Install dependencies
4242
if: ${{ matrix.language == 'python' }}
4343
run: |

.github/workflows/lintsql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
with:
1919
# Full git history is needed to get a proper list of changed files within `super-linter`
2020
fetch-depth: 0
21-
- name: Set up Python 3.8
21+
- name: Set up Python 3.12
2222
uses: actions/setup-python@v5.1.1
2323
with:
24-
python-version: '3.8'
24+
python-version: '3.12'
2525
- name: Lint SQL code
2626
if: |
2727
github.event_name == 'workflow_dispatch' ||

.github/workflows/predeploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ jobs:
3636
uses: actions/setup-node@v4
3737
with:
3838
node-version: '20'
39-
- name: Set up Python 3.8
39+
- name: Set up Python 3.12
4040
uses: actions/setup-python@v5.1.1
4141
with:
42-
python-version: '3.8'
42+
python-version: '3.12'
4343
- name: Install Asian Fonts
4444
if: ${{ github.event.inputs.ebooks == 'true' }}
4545
run: |

.github/workflows/test_website.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ jobs:
2929
uses: actions/setup-node@v4
3030
with:
3131
node-version: '20'
32-
- name: Set up Python 3.8
32+
- name: Set up Python 3.12
3333
uses: actions/setup-python@v5.1.1
3434
with:
35-
python-version: '3.8'
35+
python-version: '3.12'
3636
- name: Run the website
3737
run: ./src/tools/scripts/run_and_test_website.sh
3838
- name: Remove node modules to avoid linting errors

src/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
ARG PYVER=3.8
1+
ARG PYVER=3.12
22
FROM python:${PYVER} as base
33

44
# Enable unbuffered STDOUT logging
55
ENV PYTHONUNBUFFERED=1
66

7-
ARG NODEVER=16.x
7+
ARG NODEVER=20.x
88
RUN curl -sL https://deb.nodesource.com/setup_${NODEVER} | bash -
99

1010
RUN apt update && apt install -y nodejs && rm -rf /var/lib/apt/lists/* \

src/README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Developing the Web Almanac
22

3-
The Web Almanac can be developed on macOS, Windows or Linux. It requires Node v16, Python v3.8 and pip to be installed. You can use Docker to avoid manually configuring the development environment.
3+
The Web Almanac can be developed on macOS, Windows or Linux. It requires Node v20, Python v3.12 and pip to be installed. You can use Docker to avoid manually configuring the development environment.
44
It can be quickly deployed as a development container in GitHub Codespaces to develop in cloud:
55
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/HTTPArchive/almanac.httparchive.org?quickstart=1)
66

@@ -14,7 +14,7 @@ An `.editorconfig` file exists for those using [EditorConfig](https://editorconf
1414

1515
Make sure you run the following commands from within the `src` directory by executing `cd src` first.
1616

17-
Make sure Python (3.8 or above), pip and NodeJS (v20 or above) are installed on your machine.
17+
Make sure Python (3.12 or above), pip and NodeJS (v20 or above) are installed on your machine.
1818

1919
1. If you don't have virtualenv, install it using pip.
2020

@@ -31,7 +31,7 @@ py -m pip install --user virtualenv
3131
2. Create an isolated Python environment, and install dependencies:
3232

3333
```
34-
virtualenv --python python3.8 .venv
34+
virtualenv --python python3.12 .venv
3535
source .venv/bin/activate
3636
```
3737

@@ -49,7 +49,7 @@ npm install
4949
npm run start
5050
```
5151

52-
4. In your web browser, enter the following address: http://127.0.0.1:8080
52+
4. In your web browser, enter the following address: <http://127.0.0.1:8080>
5353

5454
To stop the server run the following:
5555

@@ -164,9 +164,9 @@ Generating for chapter: pwa for year 2021
164164

165165
Authors can delete images and rerun if they want to, to regenerate images.
166166

167-
Images will automatically be compressed by our Calibre GitHub Action when uploaded to GitHub, but you can get a lot more compression (about 44% more!) by running them through https://tinypng.com instead (at which point the Calibre Action will usually not find any further compression gains). It's quite simple to drag them up, and download them, so would encourage analysts/authors to take this step.
167+
Images will automatically be compressed by our Calibre GitHub Action when uploaded to GitHub, but you can get a lot more compression (about 44% more!) by running them through <https://tinypng.com> instead (at which point the Calibre Action will usually not find any further compression gains). It's quite simple to drag them up, and download them, so would encourage analysts/authors to take this step.
168168

169-
Running them through https://tinypng.com also has the added advantage of the compression being repeatable each time. So if you are not sure which images you have changed, you can delete them all, regenerate them all, run them through TinyPNG, and then a `git diff` will only show differences on the images that have changed. This will not be the case if you use the Calibre GitHub Action and it will look like all images have changed.
169+
Running them through <https://tinypng.com> also has the added advantage of the compression being repeatable each time. So if you are not sure which images you have changed, you can delete them all, regenerate them all, run them through TinyPNG, and then a `git diff` will only show differences on the images that have changed. This will not be the case if you use the Calibre GitHub Action and it will look like all images have changed.
170170

171171
## Linting files
172172

@@ -214,6 +214,7 @@ All Finished 📜 🎉!
214214
```
215215

216216
This states that:
217+
217218
- On line 25, in position 26 you are using lowercase for keywords (e.g. `as` instead of `AS`) so failed rule L010.
218219
- Similarly on line 26, position 37.
219220
- And finally on line 34, position 63 you have an unnecessary comma (e.g. `SELECT a,b, FROM table`) and so failed rule L038. Remove the extra comma.
@@ -244,7 +245,6 @@ Are you sure you wish to attempt to fix these? [Y/n]
244245

245246
If you lint again you should see most of the errors are fixed. Note that not all errors can be autofixed and some will require manual intervention but autofixing is useful for the simple errors. So while it's generally OK to run the `fix` command, do run the `lint` command when all clean to make sure the `fix` command didn't miss any issues.
246247

247-
248248
## Generating Ebooks
249249

250250
For generating PDFs of the ebook, you need to install Prince. Follow the instructions on [the Prince Website](https://www.princexml.com/) and pdftk.
@@ -318,7 +318,7 @@ prince "http://127.0.0.1:8080/en/2019/ebook?cover&spine=25&pageWidth=148&pageHei
318318

319319
Note, similar to above, this will create one extra page at the begining which will need to be removed with a PDF editor to start with a clean page for printing. Please remove this before checking in versions into git.
320320

321-
With the print-ready eBook and Cover you can send them to a printer. I used https://www.digitalprintingireland.ie/ before and they were excellent and charge about €35 for a full-colour A5 ebook. Most of the settings above are for them, so tweak them based on your own printer's requirements.
321+
With the print-ready eBook and Cover you can send them to a printer. I used <https://www.digitalprintingireland.ie/> before and they were excellent and charge about €35 for a full-colour A5 ebook. Most of the settings above are for them, so tweak them based on your own printer's requirements.
322322

323323
## Deploying changes
324324

@@ -360,13 +360,14 @@ npm run stage -- -s 20211111t105151
360360

361361
To deploy the site to production run the following:
362362

363-
_Make sure you have updated the timestamps and generated the ebooks PDFs first in the main branch, by running the "Predeploy script" GitHub Action_
363+
*Make sure you have updated the timestamps and generated the ebooks PDFs first in the main branch, by running the "Predeploy script" GitHub Action*
364364

365365
```
366366
npm run deploy
367367
```
368368

369369
The deploy script will do the following:
370+
370371
- Ask you to confirm you've run the pre-deploy script via GitHub Actions
371372
- Switch to the production branch
372373
- Merge changes from main
@@ -399,7 +400,7 @@ docker image build -t webalmanac .
399400
docker container run --rm -it -v "$PWD":/app -p 8080:8080 webalmanac
400401
```
401402

402-
3. Open http://localhost:8080 in your web browser to access the site. You can kill the server when it is no longer needed using `Ctrl+C`.
403+
3. Open <http://localhost:8080> in your web browser to access the site. You can kill the server when it is no longer needed using `Ctrl+C`.
403404

404405
4. Make changes in the code using any text editor and run tests (need to build the image again if any Python or Node dependencies are changed):
405406

@@ -420,7 +421,7 @@ root@[CID]:/app# exit
420421
6. To customize the image use `PYVER`, `NODEVER`, and `SKIPGC` build arguments to control which versions of Python and Node are used and whether Google Cloud SDK is installed.
421422

422423
```
423-
docker image build --build-arg PYVER=3.8 --build-arg NODEVER=14.x --build-arg SKIPGC=false -t webalmanac:custom .
424+
docker image build --build-arg PYVER=3.12 --build-arg NODEVER=20.x --build-arg SKIPGC=false -t webalmanac:custom .
424425
```
425426

426427
7. If you want to run the GitHub Super-Linter without `npm` being installed you need to call the command directly as given in `package.json`.

src/app.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
runtime: python38
1+
runtime: python312
22
entrypoint: gunicorn -b :$PORT main:app
33
default_expiration: 3h
44

src/config/last_updated.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
},
3232
"/static/js/almanac.js": {
3333
"date_published": "2021-02-24T00:00:00.000Z",
34-
"date_modified": "2024-02-23T00:00:00.000Z",
35-
"hash": "096e38f74c72532860651812978526c5"
34+
"date_modified": "2024-08-29T00:00:00.000Z",
35+
"hash": "97142d86390e2f961ce47183b6d3c9cb"
3636
},
3737
"/static/js/send-web-vitals.js": {
3838
"date_published": "2021-02-24T00:00:00.000Z",

0 commit comments

Comments
 (0)