Skip to content

Commit 2d2fbb1

Browse files
committed
Merge branch 'master' into status_bar
2 parents 7c16e99 + d746c8e commit 2d2fbb1

File tree

19 files changed

+944
-301
lines changed

19 files changed

+944
-301
lines changed

README.md

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ CadQuery GUI editor based on PyQT supports Linux, Windows and Mac.
1313

1414
## Notable features
1515

16+
* Automatic code reloading - you can use your favourite editor
1617
* OCCT based
1718
* Graphical debugger for CadQuery scripts
1819
* Step through script and watch how your model changes
@@ -23,27 +24,41 @@ CadQuery GUI editor based on PyQT supports Linux, Windows and Mac.
2324
* STL
2425
* STEP
2526

26-
## Installation (Binary Builds)
27+
## Installation - Pre-Built Packages (Recommended)
2728

28-
Stable release builds which do not require Anaconda are attached to the [latest release](https://github.com/CadQuery/CQ-editor/releases). Download the zip file for your operating system, extract it, and run the CQ-editor script for your OS (CQ-editor.cmd for Windows, CQ-editor.sh for Linux and MacOS). On Windows you should be able to simply double-click on CQ-editor.cmd. On Linux and MacOS you may need to make the script executable with `chmod +x CQ-editor.sh` and run the script from the command line. The script contains an environment variable export that may be required to get CQ-editor to launch correctly on MacOS Big Sur, so it is better to use the script than to launch CQ-editor directly.
29+
~~### Release Packages~~
2930

30-
Development builds are also available, but you must be logged in to GitHub to get access. Click on the newest build with a green checkmark [here](https://github.com/jmwright/CQ-editor/actions?query=workflow%3Abuild), wait for the _Artifacts_ section at the bottom of the page to load, and then click on the appropriate download for your operating system. Extract the archive file and run the shell (Linux/MacOS) or batch (Windows) script in the root CQ-editor directory. The CQ-editor window should launch.
31+
~~Stable release builds which do not require Anaconda are attached to the [latest release](https://github.com/CadQuery/CQ-editor/releases). Download installer for your operating system, extract it, and run the CQ-editor script for your OS (CQ-editor.cmd for Windows, CQ-editor.sh for Linux and MacOS). On Windows you should be able to simply double-click on CQ-editor.cmd. On Linux and MacOS you may need to make the script executable with `chmod +x CQ-editor.sh` and run the script from the command line. The script contains an environment variable export that may be required to get CQ-editor to launch correctly on MacOS Big Sur, so it is better to use the script than to launch CQ-editor directly.~~
3132

32-
## Installation (Anaconda)
33+
### Development Packages
3334

34-
Use conda to install:
35+
Development builds are also available, but can be unstable and should be used at your own risk. You can download the newest build [here](https://github.com/CadQuery/CQ-editor/releases/tag/nightly). Install and run the `run.sh` (Linux/MacOS) or `run.bat` (Windows) script in the root CQ-editor directory. The CQ-editor window should launch.
36+
37+
### MacOS workarounds
38+
39+
On later MacOS versions you may also need `xattr -r -d com.apple.quarantine path/to/CQ-editor-MacOS`.
40+
41+
## Installation (conda/mamba)
42+
43+
Use conda or mamba to install:
3544
```
36-
conda install -c cadquery -c conda-forge cq-editor=master
45+
mamba install -c cadquery -c conda-forge cq-editor=master
3746
```
3847
and then simply type `cq-editor` to run it. This installs the latest version built directly from the HEAD of this repository.
3948

4049
Alternatively clone this git repository and set up the following conda environment:
4150
```
42-
conda env create -f cqgui_env.yml -n cqgui
43-
conda activate cqgui
51+
mamba env create -f cqgui_env.yml -n cqgui
52+
mamba activate cqgui
4453
python run.py
4554
```
4655

56+
If you are concerned about mamba/conda modifying your shell settings, you can use [micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html):
57+
```
58+
micromamba install -n base -c cadquery cq-editor
59+
micromamba run -n base cq-editor
60+
```
61+
4762
On some linux distributions (e.g. `Ubuntu 18.04`) it might be necessary to install additonal packages:
4863
```
4964
sudo apt install libglu1-mesa libgl1-mesa-dri mesa-common-dev libglu1-mesa-dev
@@ -57,10 +72,10 @@ dnf install -y mesa-libGLU mesa-libGL mesa-libGLU-devel
5772

5873
### Showing Objects
5974

60-
By default, CQ-editor will display a 3D representation of all `Workplane` objects in a script with a default color and alpha (transparency). To have more control over what is shown, and what the color and alpha settings are, the `show_object` method can be used. `show_object` tells CQ-editor to explicity display an object, and accepts the `options` parameter. The `options` parameter is a dictionary of rendering options named `alpha` and `color`. `alpha` is scaled between 0.0 and 1.0, with 0.0 being completely opaque and 1.0 being completely transparent. The color is set using R (red), G (green) and B (blue) values, and each one is scaled from 0 to 255. Either option or both can be omitted.
75+
By default, CQ-editor will display a 3D representation of all `Workplane` objects in a script with a default color and alpha (transparency). To have more control over what is shown, and what the color and alpha settings are, the `show_object` method can be used. `show_object` tells CQ-editor to explicity display an object, and accepts the `options` parameter. The `options` parameter is a dictionary of rendering options named `alpha` and `color`. `alpha` is scaled between 0.0 and 1.0, with 0.0 being completely opaque and 1.0 being completely transparent. The color is set using R (red), G (green) and B (blue) values, and each one is scaled from 0 to 255. Either option or both can be omitted. The `name` parameter can assign a custom name which will appear in the objects pane of CQ-editor.
6176

6277
```python
63-
show_object(result, options={"alpha":0.5, "color": (64, 164, 223)})
78+
show_object(result, name="somename", options={"alpha":0.5, "color": (64, 164, 223)})
6479
```
6580

6681
Note that `show_object` works for `Shape` and `TopoDS_Shape` objects too. In order to display objects from the embedded Python console use `show`.
@@ -116,7 +131,7 @@ Any object can be exported to either STEP or STL format. The steps for doing so
116131
1. Highlight the object to be exported in the _Objects_ panel.
117132
2. Click either `Export as STL` or `Export as STEP` from the `Tools` menu, depending on which file format you want to export. Both of these options will be disabled if an object is not selected in the _Objects_ panel.
118133

119-
Clicking either _Export_ item will present a file dialog that allows the file name ad location of the export file to be set.
134+
Clicking either _Export_ item will present a file dialog that allows the file name and location of the export file to be set.
120135

121136
### Displaying All Wires for Debugging
122137

appveyor.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
shallow_clone: false
22

33
image:
4-
# - macOS-mojave
5-
# - macOS
6-
- Ubuntu
7-
- Ubuntu1804
8-
- Visual Studio 2015
4+
- Ubuntu2004
5+
- Visual Studio 2015
96

107
environment:
118
matrix:
@@ -16,23 +13,21 @@ environment:
1613

1714
install:
1815
- sh: if [[ $APPVEYOR_BUILD_WORKER_IMAGE != "macOS"* ]]; then sudo apt update; sudo apt -y --force-yes install libglu1-mesa xvfb libgl1-mesa-dri mesa-common-dev libglu1-mesa-dev; fi
19-
- sh: if [[ $APPVEYOR_BUILD_WORKER_IMAGE != "macOS"* ]]; then curl -o miniconda.sh curl -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh; fi
20-
- sh: if [[ $APPVEYOR_BUILD_WORKER_IMAGE == "macOS"* ]]; then curl -o miniconda.sh curl -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-4.7.10-MacOSX-x86_64.sh; fi
16+
- sh: if [[ $APPVEYOR_BUILD_WORKER_IMAGE != "macOS"* ]]; then curl -fsSL -o miniconda.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh; fi
17+
- sh: if [[ $APPVEYOR_BUILD_WORKER_IMAGE == "macOS"* ]]; then curl -fsSL -o miniconda.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Darwin-x86_64.sh; fi
2118
- sh: bash miniconda.sh -b -p $HOME/miniconda
2219
- sh: source $HOME/miniconda/bin/activate
23-
- cmd: appveyor DownloadFile https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe
24-
- cmd: Miniconda3-latest-Windows-x86_64.exe /S /InstallationType=JustMe /D=%MINICONDA_DIRNAME%
20+
- cmd: curl -fsSL -o miniconda.exe https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe
21+
- cmd: miniconda.exe /S /InstallationType=JustMe /D=%MINICONDA_DIRNAME%
2522
- cmd: set "PATH=%MINICONDA_DIRNAME%;%MINICONDA_DIRNAME%\\Scripts;%PATH%"
2623
- cmd: activate
27-
- conda config --set always_yes yes
28-
- conda install -c conda-forge python=3.7
29-
- conda info
30-
- conda env create --name cqgui -f cqgui_env.yml
24+
- mamba info
25+
- mamba env create --name cqgui -f cqgui_env.yml
3126
- sh: source activate cqgui
3227
- cmd: activate cqgui
33-
- conda list
34-
- pip install pytest pluggy pytest-qt
35-
- pip install pytest-mock pytest-cov pytest-repeat codecov pyvirtualdisplay==0.2.1
28+
- mamba list
29+
- mamba install -y pytest pluggy pytest-qt
30+
- mamba install -y pytest-mock pytest-cov pytest-repeat codecov pyvirtualdisplay
3631

3732
build: false
3833

azure-pipelines.yml

Lines changed: 68 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ trigger:
33
include:
44
- master
55
- refs/tags/*
6+
exclude:
7+
- refs/tags/nightly
68

79
pr:
810
- master
@@ -14,51 +16,73 @@ resources:
1416
name: CadQuery/conda-packages
1517
endpoint: CadQuery
1618

17-
jobs:
18-
- template: conda-build.yml@templates
19-
parameters:
20-
name: Linux
21-
vmImage: 'ubuntu-18.04'
22-
py_maj: 3
23-
py_min: 8
24-
conda_bld: '3.20.3'
19+
parameters:
20+
- name: minor
21+
type: object
22+
default:
23+
- 11
2524

26-
- template: conda-build.yml@templates
27-
parameters:
28-
name: macOS
29-
vmImage: 'macOS-10.15'
30-
py_maj: 3
31-
py_min: 8
32-
conda_bld: '3.20.3'
25+
stages:
26+
- stage: build_conda_package
27+
jobs:
28+
- ${{ each minor in parameters.minor }}:
29+
- template: conda-build.yml@templates
30+
parameters:
31+
name: Linux
32+
vmImage: 'ubuntu-latest'
33+
py_maj: 3
34+
py_min: ${{minor}}
35+
conda_bld: 3.21.6
3336

34-
- template: conda-build.yml@templates
35-
parameters:
36-
name: Windows
37-
vmImage: 'vs2017-win2016'
38-
py_maj: 3
39-
py_min: 8
40-
conda_bld: '3.20.3'
37+
- stage: build_installers
38+
jobs:
39+
- template: constructor-build.yml@templates
40+
parameters:
41+
name: linux
42+
vmImage: 'ubuntu-latest'
43+
- template: constructor-build.yml@templates
44+
parameters:
45+
name: win
46+
vmImage: 'windows-latest'
47+
- template: constructor-build.yml@templates
48+
parameters:
49+
name: macos
50+
vmImage: 'macOS-latest'
4151

42-
- template: conda-build.yml@templates
43-
parameters:
44-
name: Linux
45-
vmImage: 'ubuntu-18.04'
46-
py_maj: 3
47-
py_min: 9
48-
conda_bld: '3.21.4'
52+
- stage: upload_installers
53+
jobs:
54+
- job: upload_to_github
55+
condition: ne(variables['Build.Reason'], 'PullRequest')
56+
pool:
57+
vmImage: ubuntu-latest
58+
steps:
59+
- download: current
60+
artifact: installer_ubuntu-latest
61+
- download: current
62+
artifact: installer_windows-latest
63+
- download: current
64+
artifact: installer_macOS-latest
65+
- bash: cp $(Pipeline.Workspace)/installer*/*.* .
66+
- task: GitHubRelease@1
67+
inputs:
68+
gitHubConnection: github.com_oauth
69+
assets: CQ-editor-*.*
70+
action: edit
71+
tag: nightly
72+
target: d8e247d15001bf785ef7498d922b4b5aa017a9c9
73+
addChangeLog: false
74+
assetUploadMode: replace
75+
isPreRelease: true
4976

50-
- template: conda-build.yml@templates
51-
parameters:
52-
name: macOS
53-
vmImage: 'macOS-10.15'
54-
py_maj: 3
55-
py_min: 9
56-
conda_bld: '3.21.4'
57-
58-
- template: conda-build.yml@templates
59-
parameters:
60-
name: Windows
61-
vmImage: 'vs2017-win2016'
62-
py_maj: 3
63-
py_min: 9
64-
conda_bld: '3.21.4'
77+
# stage left for debugging, disabled by default
78+
- stage: verify
79+
condition: False
80+
jobs:
81+
- job: verify_linux
82+
pool:
83+
vmImage: ubuntu-latest
84+
steps:
85+
- download: current
86+
artifact: installer_ubuntu-latest
87+
- bash: cp $(Pipeline.Workspace)/installer*/*.* .
88+
- bash: sh ./CQ-editor-master-Linux-x86_64.sh -b -p dummy && cd dummy && ./run.sh

conda/construct.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CQ-editor
2+
company: Cadquery
3+
version: master
4+
icon_image: ../icons/cadquery_logo_dark.ico
5+
license_file: ../LICENSE
6+
register_python: False
7+
initialize_conda: False
8+
keep_pkgs: False
9+
10+
channels:
11+
- conda-forge
12+
- cadquery
13+
14+
specs:
15+
- cq-editor=master
16+
- cadquery=master
17+
- nomkl
18+
- mamba
19+
20+
menu_packages: []
21+
22+
extra_files:
23+
- run.sh # [unix]
24+
- run.bat # [win]

conda/meta.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,29 @@ source:
66
path: ..
77

88
build:
9-
string: {{ 'py'+environ.get('PYTHON_VERSION')}}
9+
string: {{ GIT_DESCRIBE_TAG }}_{{ GIT_BUILD_STR }}
10+
noarch: python
1011
script: python setup.py install --single-version-externally-managed --record=record.txt
1112
entry_points:
1213
- cq-editor = cq_editor.__main__:main
1314
- CQ-editor = cq_editor.__main__:main
1415
requirements:
1516
build:
16-
- python {{ environ.get('PYTHON_VERSION') }}
17+
- python >=3.8
1718
- setuptools
1819

1920
run:
20-
- python {{ environ.get('PYTHON_VERSION') }}
21+
- python >=3.8
2122
- cadquery=master
2223
- ocp
2324
- logbook
2425
- pyqt=5.*
2526
- pyqtgraph
26-
- spyder=4.*
27-
- path.py
27+
- spyder=5.*
28+
- path
2829
- logbook
2930
- requests
30-
31+
- qtconsole=5.4.1
3132
test:
3233
imports:
3334
- cq_editor

conda/run.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
start /B Scripts\conda.exe run -n base python Scripts\cq-editor-script.py

conda/run.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
exec bin/cq-editor

cq_editor/__main__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,12 @@
1313

1414
def main():
1515

16-
win = MainWindow()
17-
1816
parser = argparse.ArgumentParser(description=NAME)
1917
parser.add_argument('filename',nargs='?',default=None)
2018

2119
args = parser.parse_args(app.arguments()[1:])
22-
print(args)
23-
if args.filename:
24-
win.components['editor'].load_from_file(args.filename)
2520

21+
win = MainWindow(filename=args.filename if args.filename else None)
2622
win.show()
2723
sys.exit(app.exec_())
2824

0 commit comments

Comments
 (0)