Skip to content

Commit

Permalink
Merge pull request kliment#1465 from DivingDuck/PythonSupport3.12_3.13
Browse files Browse the repository at this point in the history
 * Add support for Python version 3.12 and 3.13
 * Drop support for macOS 12
 * Fix syntax warnings
 * Fix macOS translation folder
 * Add a section on README for Translating Pronterface
 * Add README file to distributed binaries
 * Update translation files
 * Add translation files to macOS distributed binaries
  • Loading branch information
rockstorm101 authored Feb 20, 2025
2 parents 1af6ad9 + 191ba73 commit 9ff2df6
Show file tree
Hide file tree
Showing 20 changed files with 3,769 additions and 3,529 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, windows-2022, macos-12]
os: [ubuntu-22.04, windows-2022, macos-13]

steps:
- uses: actions/checkout@v4
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/buildpackage-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ jobs:

strategy:
matrix:
os: [macos-12]
os: [macos-13,macos-14]
architecture: [x64]
python-version: ['3.10']
python-version: ['3.11','3.13']
exclude:
- os: macos-13
python-version: '3.13'
- os: macos-14
python-version: '3.11'

steps:
- name: Checkout
Expand Down Expand Up @@ -53,6 +58,11 @@ jobs:
cd dist
zip -r -X Pronterface-app.zip Pronterface.app
- name: Copy translation files
run: |
cp -r locale dist
cp README.md dist/
- name: Configuration for releases
if: ${{ github.event_name == 'release' }}
run: |
Expand All @@ -72,7 +82,10 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ${{ env.EXE_NAME }}
path: dist/Pronterface-app.zip
path: |
dist/Pronterface-app.zip
dist/README.md
dist/locale
upload_release_assets:
needs: [build]
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/buildpackage-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ jobs:
os: [windows-latest]
# supported architecture: [x64, x86]
architecture: [x86, x64]
# supported versions: ['3.8', '3.9', '3.10', '3.11']
# for x86 only Python 3.9 to 3.11 is supported
python-version: ['3.10']
# supported versions: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
# for x86 only Python 3.9 to 3.13 is supported
# Python 3.13t is not supported
python-version: ['3.8', '3.13']

steps:
- name: Checkout
Expand Down Expand Up @@ -64,6 +65,7 @@ jobs:
- name: Copy translation files
run: |
cp -r locale dist
cp README.md dist/
- name: Configuration for releases
if: ${{ github.event_name == 'release' }}
Expand All @@ -87,6 +89,7 @@ jobs:
path: |
dist/Pronterface.exe
dist/Pronsole.exe
dist/README.md
dist/locale
upload_release_assets:
Expand Down
40 changes: 40 additions & 0 deletions CleanCacheFiles.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
echo off
rem **************************************************************
rem *** This batch file will clean up all __pycache__ folders, ***
rem *** *.pyd files and left over gcoder_line files from ***
rem *** previous builds. For Windows only. ***
rem *** ***
rem *** This is helpful when you switch between Python ***
rem *** versions or you have problems with incompatible ***
rem *** library files. ***
rem *** ***
rem *** Don't forget to delete the virtual environment v3 ***
rem *** if you switch between Python versions. ***
rem *** ***
rem *** Author: DivingDuck, 2024-11-16, Status: working ***
rem **************************************************************

echo *** Clean pip cache ***
if exist v3 (
call v3\Scripts\activate
echo *** Activate virtual environment v3 ***
)

pip cache purge

echo *** Clean all __pycache__ folders ***

for /d /r . %%d in (__pycache__) do @if exist "%%d" echo "%%d" && rd /s/q "%%d"

if exist v3 (
call v3\Scripts\deactivate
echo *** Deactivate virtual environment v3 ***
)

echo *** clean gcoder_line files ***
if exist printrun\gcoder_line.c del printrun\gcoder_line.c && echo *** delete printrun\gcoder_line.c deleted ***
if exist printrun\gcoder_line.cp???-win_amd??.pyd del printrun\gcoder_line.cp???-win_amd??.pyd && echo *** printrun\gcoder_line.cp???-win_amd??.pyd deleted ***
if exist printrun\gcoder_line.cp???-win??.pyd del printrun\gcoder_line.cp???-win??.pyd && echo *** printrun\gcoder_line.cp???-win??.pyd deleted ***
if exist printrun\gcoder_line.cp??-win_amd??.pyd del printrun\gcoder_line.cp??-win_amd??.pyd && echo *** printrun\gcoder_line.cp??-win_amd??.pyd deleted ***
if exist printrun\gcoder_line.cp??-win??.pyd del printrun\gcoder_line.cp??-win??.pyd && echo *** printrun\gcoder_line.cp??-win??.pyd deleted ***
pause
82 changes: 80 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The contents of this document are organized in the following sections:
+ [Linux packages from official repositories](#linux-packages-from-official-repositories)
+ [Printrun package from PyPI](#printrun-package-from-pypi)
* [Running From Source](#running-from-source)
* [Translating Pronterface](#translating-pronterface)
- [Using Printrun](#using-printrun)
* [Using Pronterface](#using-pronterface)
* [Using Pronsole](#using-pronsole)
Expand Down Expand Up @@ -58,7 +59,15 @@ available at: https://github.com/kliment/Printrun/releases/latest

#### Important: Allow the application to run on macOS

macOS will block Printrun from running because it is not from a verified developer. [Please read this wiki article](https://github.com/kliment/Printrun/wiki/macOS-Apple-could-not-verify) to learn how to allow the application to start. You only need to do this once for each new version.
macOS will block Printrun from running because it is not from a verified developer.
[Please read this wiki article](https://github.com/kliment/Printrun/wiki/macOS-Apple-could-not-verify)
to learn how to allow the application to start. You only need to do this once for each new version.

#### Important: Allow the application to run on Windows

Windows will block Printrun from running because it is not from a verified developer.
[Please read this wiki FAQ article](https://github.com/kliment/Printrun/wiki/FAQ#malware-virus-or-trojan-detection-defender-smartscreen-and-firewall-warnings)
to learn how to allow the application to start. You only need to do this once for each new version.

### Linux packages from official repositories

Expand Down Expand Up @@ -195,7 +204,9 @@ With your virtual environment still active, invoke the app you need like:

### Windows

First download and install [GIT for Windows](https://git-scm.com/downloads), [Python 3.10](https://www.python.org/downloads/) and a [C-compiler environment](https://wiki.python.org/moin/WindowsCompilers/).
For running or compiling Pronterface from source we need first download and install [GIT for Windows](https://git-scm.com/downloads), [Python 3.13](https://www.python.org/downloads/) and a [C-compiler environment](https://wiki.python.org/moin/WindowsCompilers/). We use Visual Studio 2022 with workloads for Python and C++ installed.
Please consult `release_windows.bat` in case you want to use other Python versions. Currently supported are all versions from 3.8 to 3.13 except the free-threaded versions of 3.12 and 3.13. The default version is actual set to 3.13.

For the next steps we need a CMD window or a PowerShell window. You can use Windows Terminal for this as well.
Create and navigate to a directory of your choice where you want to download the source files of this repository and follow the next steps:

Expand Down Expand Up @@ -223,6 +234,73 @@ You need to adjust the path to your location of pronsole.exe.

Run 'release_windows.bat' when ever you make changes or updates. With each new run it will compile the binaries and update all involved libraries in the virtual environment if needed. Delete the virtual environment if you have problems with it.

## Translating Pronterface

Pronterface supports the localization of the GUI in your language. We would be more
than happy if users support us with updated translation files in all different
languages. Actually we have translation files for AR, DE, FR, HY, IT and NL available,
but only the translation DE is complete. Generate a new issue in our repository and
ask us if you need an additional translation file that is not available jet.

The easiest way updating our translation files is to use a free version of the tool
Poedit (https://poedit.net/). The software is available for Linux, macOS and Windows.

A set of existing translation files is already included in the distributed pre-compiled
binaries for Windows and macOS. You need only to open the pronterface.po of the
corresponding language folder and save the file. This will generate the needed
pronterface.mo for a working translation.

### How to update a translation

The best way is to clone first our repository and then work on the translation file
local. Send us a pull request when you have finished your work. Doing the translation
in steps is also OK, please mention it in the PR. We will then wait with releasing
your update up to the point you tell us you have finished your work.

The translation is organized in the folder `\locale` and includes sub folders for each
supported language. The structure is mandatory and should not be changed. The file
`pronterface.po` contains all translatable strings and is the file to be edited for a
translation. The file `pronterface.mo` is the translation file from `pronterface.po`
file in binary format and is needed on that place for a functional translation in
Pronterface. It will be automatically generated if you use Poedit. Please do not send
this file as it is operating system dependent and should be generated on the OS used.
The file `pronterface.pot` is the master translation file and should not be modified.
We do update the translation files when ever this is needed, mostly due to source code
changes where translation is also involved or when we receive an updated translation.


Structure:
```
.\locale
\de
\LC_MESSAGES
pronterface.po
pronterface.mo
\it
\LC_MESSAGES
pronterface.po
pronterface.mo
...
pronterface.pot
```
Pronterface search for installed translation files on `/usr/share` for Linux. For
Windows and macOS it will find the folder `.\locale` on the same location where
the binaries are installed (where you will find them when you download the distributed
binaries).

Copy the updated folder `.\locale` over the same folder of your Pronterface
installation after you update a translation and then restart Ponterface.
The file pronterface.po is not needed for a functional translation but helpful,
if you want to work on your translation.

### Providing a new or updated translation

Please use always the latest version of files in our repository before providing
a new or updated translation. Open an issue and ask for help if you need further
support - we are glad to help.

Open an issue and attach the updated translation file `pronterface.po` or better,
make a pull request.

# USING PRINTRUN

Expand Down
Loading

0 comments on commit 9ff2df6

Please sign in to comment.