Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring in missing python (system dependency) #1639

Merged
merged 2 commits into from
Mar 28, 2024
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
9 changes: 9 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ jobs:
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Use python specified in the '.python-version' file
uses: actions/setup-python@v5
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[nightly branch]')) }}
- name: Install node dependencies
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[nightly branch]')) }}
uses: nick-fields/retry@v3
Expand Down Expand Up @@ -177,6 +180,8 @@ jobs:
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Use python specified in the '.python-version' file
uses: actions/setup-python@v5
- name: Install node dependencies
uses: nick-fields/retry@v3
with:
Expand Down Expand Up @@ -256,6 +261,8 @@ jobs:
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Use python specified in the '.python-version' file
uses: actions/setup-python@v5
- name: Install node dependencies
uses: nick-fields/retry@v3
with:
Expand Down Expand Up @@ -356,6 +363,8 @@ jobs:
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Use python specified in the '.python-version' file
uses: actions/setup-python@v5
#TODO - Remove this once https://github.com/electron-userland/electron-builder/issues/6933#issuecomment-1213438889 is resolved
- name: Tweak pnpm.cjs
run: |
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11.8
11 changes: 7 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- [How can I contribute?](#how-can-i-contribute)
- [Setting up your development machine](#setting-up-your-development-machine)
- [Install system-level dependencies](#install-system-level-dependencies)
- [Node.js, pnpm](#nodejs-pnpm)
- [Node.js, pnpm, python](#nodejs-pnpm-python)
- [Git](#git)
- [On Debian/Ubuntu](#on-debianubuntu)
- [On Fedora](#on-fedora)
Expand Down Expand Up @@ -52,7 +52,7 @@ If so, engage in the already existing discussion.

_Note:_ This list can likely get outdated. If so, please refer to the specific version of the [electronuserland builder](https://hub.docker.com/r/electronuserland/builder) that we use in our [Dockerfile](./Dockerfile).

#### Node.js, pnpm
#### Node.js, pnpm, python

Please make sure you are conforming to the `engines` requirements used by the developers/contributors as specified in the [`package.json`](./package.json#engines) and [`recipes/package.json`](./recipes/package.json#engine) files.

Expand All @@ -63,11 +63,14 @@ Currently, these are the combinations of system dependencies that work for MacOS
$ jq --null-input '[inputs.engines] | add' < ./package.json < ./recipes/package.json
{
"node": "20.11.1",
"pnpm": "8.15.5"
"pnpm": "8.15.5",
"python": "3.11.8"
}
```

_Note:_ You can choose any version manager to manage multiple versions of `node` and `pnpm`. For eg, [nvm](https://github.com/nvm-sh/nvm) or [asdf](https://github.com/asdf-vm/asdf).
Python is only/mainly required to compile any dependencies for which the binary is not found, and we have to resort to compiling from source (for eg sqlite3)

_Note:_ You can choose any version manager to manage multiple versions of `node` and `pnpm`. For eg, [nvm](https://github.com/nvm-sh/nvm) or [mise](https://github.com/jdx/mise).

#### Git

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ARG PREVAL_BUILD_INFO_PLACEHOLDERS=true

# Note: 'fpm' is needed for building on ARM machines
RUN apt-get update -y \
&& apt-get install --no-install-recommends -y rpm ruby gem \
&& apt-get install --no-install-recommends -y python3 rpm ruby gem \
&& gem install dotenv -v 2.8.1 --no-ri --no-rdoc --no-document \
&& gem install fpm --no-ri --no-rdoc --no-document

Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
"private": true,
"engines": {
"node": "20.11.1",
"pnpm": "8.15.5"
"pnpm": "8.15.5",
"python": "3.11.8"
},
"engine-strict": true,
"volta": {
"node": "20.11.1",
"pnpm": "8.15.5"
"pnpm": "8.15.5",
"python": "3.11.8"
},
"packageManager": "pnpm@8.15.5",
"scripts": {
Expand Down Expand Up @@ -127,7 +129,7 @@
"route-parser": "0.0.5",
"sanitize-filename": "1.6.3",
"semver": "7.6.0",
"sqlite3": "5.1.6",
"sqlite3": "5.1.7",
"tar": "6.2.0",
"tslib": "2.6.2",
"useragent-generator": "1.1.1-amkt-22079-finish.0",
Expand All @@ -141,6 +143,7 @@
"@electron/notarize": "1.2.3",
"@formatjs/cli": "6.2.7",
"@jest/types": "29.6.3",
"@mapbox/node-pre-gyp": "1.0.11",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sqlite3 module has moved away from using node-pre-gyp and is using prebuild-install instead (cf TryGhost/node-sqlite3#1735), so I do not think this dependency is needed nowadays.

"@types/auto-launch": "5.0.5",
"@types/color": "3.0.6",
"@types/fs-extra": "11.0.4",
Expand Down
Loading