Skip to content

Commit 7669410

Browse files
authored
Merge branch 'kliment:master' into upd_translation
2 parents 67f5bc4 + 6b56bf8 commit 7669410

11 files changed

+166
-260
lines changed

.github/workflows/build-wheels.yml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Build Python sdist and wheels
2+
3+
on:
4+
pull_request:
5+
push:
6+
release:
7+
types:
8+
- published
9+
10+
jobs:
11+
build_wheels:
12+
name: Build wheels on ${{ matrix.os }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-22.04, windows-2022, macos-12]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up QEMU
22+
if: runner.os == 'Linux'
23+
uses: docker/setup-qemu-action@v3
24+
with:
25+
platforms: all
26+
27+
- name: Build ${{ matrix.os }} wheels
28+
uses: pypa/[email protected]
29+
env:
30+
# we only support what's supported by wxPython, therefore we skip:
31+
# * PyPy Python implementation
32+
# * Python 3.6 and 3.7 versions
33+
# * musl C implementation
34+
CIBW_SKIP: "pp* cp36* cp37* *-musllinux*"
35+
# produce ARM wheels on Linux in addition to 32 and 64 bit
36+
CIBW_ARCHS_LINUX: auto aarch64
37+
# produce wheels for macOS to support both Intel and Apple silicon
38+
CIBW_ARCHS_MACOS: x86_64 universal2 arm64
39+
40+
- name: Upload ${{ matrix.os }} wheels
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
44+
path: ./wheelhouse/*.whl
45+
46+
build_sdist:
47+
name: Build source distribution
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v4
51+
52+
- name: Build sdist
53+
run: pipx run build --sdist
54+
55+
- name: Upload sdist
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: cibw-sdist
59+
path: dist/*.tar.gz
60+
61+
upload_pypi:
62+
needs: [build_wheels, build_sdist]
63+
runs-on: ubuntu-latest
64+
environment: pypi
65+
permissions:
66+
id-token: write
67+
if: github.event_name == 'release' && github.event.action == 'published'
68+
steps:
69+
- uses: actions/download-artifact@v4
70+
with:
71+
# unpack all CIBW artifacts into dist/
72+
pattern: cibw-*
73+
path: dist
74+
merge-multiple: true
75+
76+
- uses: pypa/gh-action-pypi-publish@release/v1
77+
with:
78+
# by default, the contents of the `dist/` directory are uploaded
79+
password: ${{ secrets.PYPI_API_KEY }}

.github/workflows/buildpackage-mac.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
os: [macos-11, macos-12]
16+
os: [macos-12]
1717
architecture: [x64]
1818
python-version: ['3.10']
1919

@@ -33,11 +33,11 @@ jobs:
3333
python setup.py build_ext --inplace
3434
- name: Make pyinstaller spec
3535
run: |
36-
pyi-makespec --hidden-import="pkg_resources.py2_warn" -F --add-data images/\*:images --add-data \*.png:. --add-data \*.ico:. -w -i P-face.icns pronterface.py
36+
pyi-makespec --hidden-import="pkg_resources.py2_warn" -F --add-data images/\*:images --add-data \*.png:. --add-data \*.ico:. --name Pronterface -w -i P-face.icns pronterface.py
3737
# Edit spec file
3838
export git_hash=$(git rev-parse --short "$GITHUB_SHA")
39-
sed -i '' '$ s/.$//' pronterface.spec
40-
cat >> pronterface.spec <<EOL
39+
sed -i '' '$ s/.$//' Pronterface.spec
40+
cat >> Pronterface.spec <<EOL
4141
info_plist={
4242
'CFBundleShortVersionString': '$git_hash',
4343
'NSPrincipalClass': 'NSApplication',
@@ -48,10 +48,10 @@ jobs:
4848
EOL
4949
- name: Make pyinstaller build
5050
run: |
51-
pyinstaller --clean pronterface.spec -y
51+
pyinstaller --clean Pronterface.spec -y
5252
# Zip app manually to avoid losing execute permissions for binary file in app
5353
cd dist
54-
zip -r -X pronterface-app.zip pronterface.app
54+
zip -r -X Pronterface-app.zip Pronterface.app
5555
5656
- name: Configuration for releases
5757
if: ${{ github.event_name == 'release' }}
@@ -72,4 +72,4 @@ jobs:
7272
uses: actions/upload-artifact@v4
7373
with:
7474
name: ${{ env.EXE_NAME }}_${{ matrix.os }}_${{ matrix.architecture }}_py${{ matrix.python-version }}
75-
path: dist/pronterface-app.zip
75+
path: dist/Pronterface-app.zip

.github/workflows/pypi-mac.yml

-45
This file was deleted.

.github/workflows/pypi-manylinux.yml

-39
This file was deleted.

.github/workflows/pypi-sdist.yml

-37
This file was deleted.

.github/workflows/pypi-win.yml

-45
This file was deleted.

README.md

+6-25
Original file line numberDiff line numberDiff line change
@@ -163,17 +163,15 @@ $ source venv/bin/activate # activate the virtual environment
163163
> **Note for Ubuntu/Debian**: You might need to install `python3-venv` first.
164164
165165
> **Note for Ubuntu/Debian**: If you get `python: command not found` use
166-
> `python3` instead of just `python` on all commands below.
166+
> `python3 -m venv venv` instead.
167167
168168

169-
#### 4. Install dependencies
169+
#### 4. Install Printrun
170170

171-
Dependencies for running Printrun are laid out in the [`requirements.txt`][5]
172-
file. Once activated your virtual environment, install required dependencies
173-
with:
171+
Once activated your virtual environment, install Printrun' source code with:
174172

175173
```
176-
(venv) $ python -m pip install -r requirements.txt # install the rest of dependencies
174+
(venv) $ python -m pip install .
177175
```
178176

179177
> **Note for Linux users**: wxPython4 doesn't have Linux wheels available from
@@ -186,32 +184,15 @@ with:
186184
> (venv) $ python -m pip install https://extras.wxpython.org/wxPython4/extras/linux/gtk3/fedora-27/wxPython-4.0.1-cp36-cp36m-linux_x86_64.whl # replace the link with yours
187185
> ```
188186
189-
[5]: requirements.txt
190187
[6]: https://extras.wxpython.org/wxPython4/extras/linux/gtk3
191188
192189
193-
#### 5. (Optional) Cython-based G-Code parser
194-
195-
Printrun default G-Code parser is quite memory hungry, but we also provide a
196-
much lighter one which just needs an extra build-time dependency (Cython). The
197-
warning message `WARNING:root:Memory-efficient GCoder implementation
198-
unavailable: No module named gcoder_line` means that this optimized G-Code
199-
parser hasn't been compiled. To get rid of it and benefit from the better
200-
implementation, install Cython and build the extension with the following
201-
commands:
202-
203-
```console
204-
(venv) $ python -m pip install Cython
205-
(venv) $ python setup.py build_ext --inplace
206-
```
207-
208-
209-
#### 6. Run Printrun
190+
#### 5. Run Printrun
210191
211192
With your virtual environment still active, invoke the app you need like:
212193
213194
```shell
214-
(venv) $ python pronterface.py # or `pronsole.py` or `plater.py`
195+
(venv) $ pronterface.py # or `pronsole.py` or `plater.py`
215196
```
216197
217198

printrun/pronsole.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ def recvcb_actions(self, l):
13171317
command = command.split(":")
13181318
if len(command) == 2 and command[0] == "action":
13191319
command = command[1]
1320-
if command == "pause":
1320+
if command in ["pause", "cancel"]:
13211321
self.do_pause(None)
13221322
sys.stdout.write(self.promptf())
13231323
sys.stdout.flush()

printrun/pronterface.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2055,7 +2055,7 @@ def recvcb_actions(self, l):
20552055
if len(command) == 2 and command[0] == "action":
20562056
command = command[1]
20572057
self.log(_("Received command %s") % command)
2058-
if command == "pause":
2058+
if command in ["pause", "cancel"]:
20592059
if not self.paused:
20602060
wx.CallAfter(self.pause)
20612061
return True

0 commit comments

Comments
 (0)