Switch to python 3.9.13 and switch how python is installed in Windows

This commit is contained in:
Micah Lee 2022-06-19 18:11:50 -04:00
parent 609cf488eb
commit e8b388995b
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
3 changed files with 27 additions and 49 deletions

View File

@ -17,10 +17,10 @@ workflows:
requires: requires:
- test-cli - test-cli
# - test-gui # - test-gui
- build-macos: # - build-macos:
requires: # requires:
- test-cli # - test-cli
# - test-gui # # - test-gui
jobs: jobs:
test-cli: test-cli:
@ -90,9 +90,11 @@ jobs:
- checkout - checkout
- run: - run:
name: Install Python 3.9.12 name: Install Python 3.9.13 (64-bit)
command: | command: |
choco install python3 --version=3.9.12 cd ~\Downloads
Invoke-WebRequest -Uri https://www.python.org/ftp/python/3.9.13/python-3.9.13-amd64.exe -OutFile python-3.9.13-amd64.exe
.\python-3.9.13-amd64.exe /quiet PrependPath=1
- run: - run:
name: Install poetry name: Install poetry
@ -194,13 +196,15 @@ jobs:
- checkout - checkout
- run: - run:
name: Install Python 3.9.12 (32-bit) name: Install Python 3.9.13 (32-bit)
command: | command: |
choco install python3 --params "/InstallDir32:C:\Python-32bit" --version=3.9.12 cd ~\Downloads
Invoke-WebRequest -Uri https://www.python.org/ftp/python/3.9.13/python-3.9.13.exe -OutFile python-3.9.13.exe
.\python-3.9.13.exe /quiet PrependPath=1
- run: - run:
name: Install poetry (32-bit) name: Install poetry
command: C:\Python-32bit\Scripts\pip install poetry command: (Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python -
- restore_cache: - restore_cache:
key: build-win32-desktop-poetry-deps-{{ checksum "~/project/desktop/poetry.lock" }}-{{ .Environment.CACHE_VERSION }} key: build-win32-desktop-poetry-deps-{{ checksum "~/project/desktop/poetry.lock" }}-{{ .Environment.CACHE_VERSION }}
@ -208,7 +212,7 @@ jobs:
name: Install poetry dependencies name: Install poetry dependencies
command: | command: |
cd ~\project\desktop cd ~\project\desktop
C:\Python-32bit\Scripts\poetry install poetry install
- save_cache: - save_cache:
key: build-win32-desktop-poetry-deps-{{ checksum "~/project/desktop/poetry.lock" }}-{{ .Environment.CACHE_VERSION }} key: build-win32-desktop-poetry-deps-{{ checksum "~/project/desktop/poetry.lock" }}-{{ .Environment.CACHE_VERSION }}
paths: paths:
@ -220,7 +224,7 @@ jobs:
name: Get tor binaries from Tor Browser (32-bit) name: Get tor binaries from Tor Browser (32-bit)
command: | command: |
cd desktop cd desktop
C:\Python-32bit\Scripts\poetry run python .\scripts\get-tor.py win32 poetry run python .\scripts\get-tor.py win32
- save_cache: - save_cache:
key: get-tor-win32-{{ checksum "desktop/scripts/get-tor.py" }}-{{ .Environment.CACHE_VERSION }} key: get-tor-win32-{{ checksum "desktop/scripts/get-tor.py" }}-{{ .Environment.CACHE_VERSION }}
paths: paths:
@ -288,8 +292,8 @@ jobs:
name: Build OnionShare name: Build OnionShare
command: | command: |
cd ~\project\desktop cd ~\project\desktop
C:\Python-32bit\Scripts\poetry run python .\setup-freeze.py build poetry run python .\setup-freeze.py build
C:\Python-32bit\Scripts\poetry run python .\scripts\build-windows.py cleanup-build poetry run python .\scripts\build-windows.py cleanup-build
- run: - run:
name: Compress name: Compress
@ -314,9 +318,9 @@ jobs:
brew install go brew install go
- run: - run:
name: Install Python 3.9.12 name: Install Python 3.9.13
command: | command: |
wget https://www.python.org/ftp/python/3.9.12/python-3.9.12-macosx10.9.pkg -O ~/Downloads/python.pkg wget https://www.python.org/ftp/python/3.9.13/python-3.9.13-macosx10.9.pkg -O ~/Downloads/python.pkg
sudo installer -pkg ~/Downloads/python.pkg -target / sudo installer -pkg ~/Downloads/python.pkg -target /
- run: - run:

View File

@ -16,12 +16,6 @@ Before making a release, you must update the version in these places:
If you update `flask-socketio`, ensure that you also update the [socket.io.min.js](https://github.com/micahflee/onionshare/blob/develop/cli/onionshare_cli/resources/static/js/socket.io.min.js) file to a version that is [supported](https://flask-socketio.readthedocs.io/en/latest/#version-compatibility) by the updated version of `flask-socketio`. If you update `flask-socketio`, ensure that you also update the [socket.io.min.js](https://github.com/micahflee/onionshare/blob/develop/cli/onionshare_cli/resources/static/js/socket.io.min.js) file to a version that is [supported](https://flask-socketio.readthedocs.io/en/latest/#version-compatibility) by the updated version of `flask-socketio`.
Use tor binaries from the latest Tor Browser:
- [ ] `desktop/scripts/get-tor-linux.py`
- [ ] `desktop/scripts/get-tor-osx.py`
- [ ] `desktop/scripts/get-tor-windows.py`
Update the documentation: Update the documentation:
- [ ] Update all of the documentation in `docs` to cover new features, including taking new screenshots if necessary - [ ] Update all of the documentation in `docs` to cover new features, including taking new screenshots if necessary
@ -100,27 +94,18 @@ snapcraft upload --release=stable onionshare_${VERSION}_amd64.snap
## Windows ## Windows
Set up the development environment described in desktop `README.md`. Set up the packaging environment:
- To get `signtool.exe`, install the [Windows SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/) and add `C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64` to your path. - Install the [Windows SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/) and add `C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64` to your path (to get `signtool.exe`).
- Go to https://dotnet.microsoft.com/download/dotnet-framework and download and install .NET Framework 3.5 SP1 Runtime. I downloaded `dotnetfx35.exe`. - Go to https://dotnet.microsoft.com/download/dotnet-framework and download and install .NET Framework 3.5 SP1 Runtime. I downloaded `dotnetfx35.exe`.
- Go to https://wixtoolset.org/releases/ and download and install WiX toolset. I downloaded `wix311.exe`. Add `C:\Program Files (x86)\WiX Toolset v3.11\bin` to the path. - Go to https://wixtoolset.org/releases/ and download and install WiX toolset. I downloaded `wix311.exe`. Add `C:\Program Files (x86)\WiX Toolset v3.11\bin` to the path.
Build the Windows binaries, delete extra files, codesign, and create an MSI package: CircleCI will build the binaries. Find the CircleCI jobs `build-win32` and `build-win64`, switch to the artifacts tab, and download:
CircleCI will build the binary and delete extra files, basically running these:
```
poetry run python .\setup-freeze.py build
poetry run python .\scripts\build-windows.py cleanup-build
```
Find the CircleCI jobs `build-win32` and `build-win64`, switch to the artifacts tab, and download:
- `onionshare-win32.zip` - `onionshare-win32.zip`
- `onionshare-win64.zip` - `onionshare-win64.zip`
Extract these files, then run: Extract these files, change to the `desktop` folder, and run:
``` ```
poetry run python .\scripts\build-windows.py codesign [onionshare_win32_path] [onionshare_win64_path] poetry run python .\scripts\build-windows.py codesign [onionshare_win32_path] [onionshare_win64_path]
@ -134,22 +119,11 @@ This will create:
## macOS ## macOS
Set up the development environment described in `README.md`. CircleCI will build the binaries. Find the CircleCI job `build-macos`, switch to the artifacts tab, and download:
Then build an executable, make it a macOS app bundle, and package it in a dmg.
CircleCI will build the binary and delete extra files, basically running these:
```sh
poetry run python ./setup-freeze.py bdist_mac
poetry run python ./scripts/build-macos.py cleanup-build
```
Find the CircleCI job `build-macos`, switch to the artifacts tab, and download:
- `onionshare-macos.zip` - `onionshare-macos.zip`
Extract this file, then run: Extract these files, change to the `desktop` folder, and run:
```sh ```sh
poetry run python ./scripts/build-macos.py codesign [app_path] poetry run python ./scripts/build-macos.py codesign [app_path]

View File

@ -9,7 +9,7 @@ git clone https://github.com/onionshare/onionshare.git
cd onionshare/desktop cd onionshare/desktop
``` ```
Make sure you have Python 3 installed. If you're using Windows or macOS, install version 3.9.12 [from python.org](https://www.python.org/downloads/release/python-3912/). For Windows, make sure to check the box to add python to the path on the first page of the installer. Make sure you have Python 3 installed. If you're using Windows or macOS, install version 3.9.13 [from python.org](https://www.python.org/downloads/release/python-3913/). For Windows, make sure to check the box to add python to the path on the first page of the installer.
Make sure you have [poetry](https://python-poetry.org/) installed: Make sure you have [poetry](https://python-poetry.org/) installed: