26 Commits

Author SHA1 Message Date
jdegenstein
d67472fb3c Update setup.py 2025-02-20 15:48:25 -06:00
jdegenstein
10cd914498 Update pyinstaller_pip.spec -> fix missing js file from build123d 2025-02-20 15:47:30 -06:00
jdegenstein
6d0ae2564c setup.py -> pin scipy==1.15.1 2025-02-18 09:34:15 -06:00
jdegenstein
3bbe2ea762 Update pyinstaller_pip.spec -> py311 to py312 2025-02-18 09:03:14 -06:00
jdegenstein
5a5f96d3e9 Update environment.yml 2025-02-18 08:48:31 -06:00
jdegenstein
7161462aa5 Update cqgui_env.yml 2025-02-18 08:48:21 -06:00
jdegenstein
41ee6be4e5 pyinstaller-builds-actions-PIP-TAR.yml -> add some missing deps 2025-02-18 08:47:42 -06:00
jdegenstein
9e027d908e Update pyinstaller-builds-actions-PIP-TAR.yml 2025-01-30 21:40:47 -06:00
jdegenstein
58cefa05b0 pyinstaller-builds-actions-PIP-TAR.yml -> ssl investigation for arm64 mac 2025-01-30 21:24:27 -06:00
jdegenstein
c592c9cccf Update pyinstaller_pip.spec 2025-01-30 21:20:27 -06:00
jdegenstein
f9e32b156a updates to work on python 3.13 2025-01-29 16:03:21 -06:00
jdegenstein
70b823ae5d cq_utils.py -> comment out nonexistent reload(cq.occ_impl.exporters.utils) 2025-01-12 15:36:25 -06:00
jdegenstein
0569294a2b setup.py -> numpy>=2,<3 and python 3.10 through 3.12 2024-12-01 13:54:01 -06:00
jdegenstein
0e6b47e21e pyinstaller-builds-actions-PIP-TAR.yml -> re-enable macos/windows builds after fixing linux build 2024-09-18 20:45:07 -05:00
jdegenstein
01ce43e1be pyinstaller-builds-actions-PIP-TAR.yml -> set LD_LIBRARY_PATH 2024-09-18 14:59:00 -05:00
jdegenstein
0499f2dc69 Update pyinstaller-builds-actions-PIP-TAR.yml 2024-09-18 11:00:27 -05:00
jdegenstein
5225408777 Update pyinstaller-builds-actions-PIP-TAR.yml 2024-09-18 10:59:29 -05:00
jdegenstein
8748b35e9f Update pyinstaller-builds-actions-PIP-TAR.yml 2024-09-18 10:52:27 -05:00
jdegenstein
7a279ad9a7 Update pyinstaller-builds-actions-PIP-TAR.yml 2024-09-18 09:36:44 -05:00
jdegenstein
cf3df6e95a pyinstaller-builds-actions-PIP-TAR.yml -> add linux libssl3-dev install via apt and temporarily disable other builds 2024-09-18 09:32:10 -05:00
jdegenstein
7015e70f4a pyinstaller-builds-actions-PIP-TAR.yml -> add mac-specific shell script 2024-09-17 14:59:07 -05:00
jdegenstein
f21b680ced Create CQ-editor-mac.sh 2024-09-17 14:57:46 -05:00
jdegenstein
9579757c98 debugger.py -> abspath to absolute 2024-08-22 12:34:28 -05:00
jdegenstein
5d8f651f97 widgets/editor.py -> abspath to absolute 2024-08-22 12:34:12 -05:00
jdegenstein
7f01d73f54 editor.py -> abspath to absolute 2024-08-22 12:33:40 -05:00
jdegenstein
d657da605a setup.py -> add numpy dep below v2 2024-08-22 12:27:06 -05:00
10 changed files with 155 additions and 137 deletions

View File

@@ -9,127 +9,135 @@ on:
required: true required: true
default: 'dir' default: 'dir'
jobs: jobs:
# build-linux-x86_64: build-linux-x86_64:
# runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
# steps: steps:
# - uses: actions/checkout@v4 - uses: actions/checkout@v4
# - uses: mamba-org/setup-micromamba@v1 - uses: mamba-org/setup-micromamba@v1
# with: with:
# environment-name: test environment-name: test
# environment-file: environment.yml environment-file: environment.yml
# init-shell: >- init-shell: >-
# bash bash
# - name: pip install cadquery CQ-editor ... etc # create-args: >-
# shell: bash --login {0} - name: pip install cadquery CQ-editor ... etc
# run: | shell: bash --login {0}
# sudo apt install -y libblas-dev libblas3 libblas64-3 libblas64-dev run: |
# sudo apt install -y libxkbcommon0 libxkbcommon-x11-0 libxcb-xinerama0 sudo apt install -y libblas-dev libblas3 libblas64-3 libblas64-dev
# sudo apt install -y qtbase5-dev qt5-qmake sudo apt install -y libxkbcommon0 libxkbcommon-x11-0 libxcb-xinerama0
# micromamba info sudo apt install -y qtbase5-dev qt5-qmake
# pip install pyopengl micromamba info
# pip install git+https://github.com/jdegenstein/jmwright-CQ-Editor pip install pyopengl
# pip install -vvv --pre git+https://github.com/cadquery/cadquery casadi pip install git+https://github.com/jdegenstein/jmwright-CQ-Editor
# pip install pyinstaller>=5.6 pip install -vvv --pre git+https://github.com/cadquery/cadquery casadi typish "multimethod>=1.11,<2.0" "nlopt>=2.9.0,<3.0" typish
# pip install path pip install pyinstaller>=5.6
# pip install jupyter-rfb pip install path
# pip install git+https://github.com/gumyr/cq_warehouse.git#egg=cq_warehouse pip install jupyter-rfb
# pip install git+https://github.com/gumyr/bd_warehouse pip install git+https://github.com/gumyr/cq_warehouse.git#egg=cq_warehouse
# pip install git+https://github.com/meadiode/cq_gears.git@main pip install git+https://github.com/gumyr/bd_warehouse
# pip install -e "git+https://github.com/CadQuery/cadquery-plugins.git#egg=cq_cache&subdirectory=plugins/cq_cache" pip install git+https://github.com/meadiode/cq_gears.git@main
# pip install git+https://github.com/gumyr/build123d pip install -e "git+https://github.com/CadQuery/cadquery-plugins.git#egg=cq_cache&subdirectory=plugins/cq_cache"
# pip install git+https://github.com/JustinSDK/cqMore pip install git+https://github.com/gumyr/build123d
# pip list pip install git+https://github.com/JustinSDK/cqMore
# - name: Run build pip list
# shell: bash --login {0} - name: Run build
# run: | shell: bash --login {0}
# micromamba activate test run: |
# micromamba info micromamba activate test
# pyinstaller pyinstaller_pip.spec ${{ github.event.inputs.type }} micromamba info
# cp /home/runner/work/jmwright-CQ-Editor/jmwright-CQ-Editor/pyinstaller/CQ-editor.sh /home/runner/work/jmwright-CQ-Editor/jmwright-CQ-Editor/dist/ echo $LD_LIBRARY_PATH
# - uses: actions/upload-artifact@v4 export LD_LIBRARY_PATH=/home/runner/micromamba/envs/test/lib
# with: echo $LD_LIBRARY_PATH
# name: CQ-editor-Linux-x86_64 pyinstaller --log-level=DEBUG pyinstaller_pip.spec ${{ github.event.inputs.type }}
# path: dist cp /home/runner/work/jmwright-CQ-Editor/jmwright-CQ-Editor/pyinstaller/CQ-editor.sh /home/runner/work/jmwright-CQ-Editor/jmwright-CQ-Editor/dist/
# build-macos-x86_64: - uses: actions/upload-artifact@v4
# runs-on: macos-13 with:
# steps: name: CQ-editor-Linux-x86_64
# - uses: actions/checkout@v4 path: dist
# - uses: mamba-org/setup-micromamba@v1 build-macos-x86_64:
# with: runs-on: macos-13
# environment-name: test steps:
# environment-file: environment.yml - uses: actions/checkout@v4
# init-shell: >- - uses: mamba-org/setup-micromamba@v1
# bash with:
# - name: pip install cadquery CQ-editor ... etc environment-name: test
# shell: bash --login {0} environment-file: environment.yml
# run: | init-shell: >-
# micromamba info bash
# pip install git+https://github.com/jdegenstein/jmwright-CQ-Editor - name: pip install cadquery CQ-editor ... etc
# pip install --pre git+https://github.com/cadquery/cadquery casadi shell: bash --login {0}
# pip install pyinstaller>=5.6 run: |
# pip install path micromamba info
# pip uninstall -y PyQt5 pip install git+https://github.com/jdegenstein/jmwright-CQ-Editor
# pip install PyQt5==5.15.7 pip install -vvv --pre git+https://github.com/cadquery/cadquery casadi typish "multimethod>=1.11,<2.0" "nlopt>=2.9.0,<3.0" typish
# pip install PyQtWebEngine==5.15.6 pip install pyinstaller>=5.6
# pip install git+https://github.com/gumyr/cq_warehouse.git#egg=cq_warehouse pip install path
# pip install git+https://github.com/gumyr/bd_warehouse pip uninstall -y PyQt5
# pip install git+https://github.com/meadiode/cq_gears.git@main pip install PyQt5==5.15.7
# pip install -e "git+https://github.com/CadQuery/cadquery-plugins.git#egg=cq_cache&subdirectory=plugins/cq_cache" pip install PyQtWebEngine==5.15.6
# pip install git+https://github.com/gumyr/build123d pip install git+https://github.com/gumyr/cq_warehouse.git#egg=cq_warehouse
# pip install git+https://github.com/JustinSDK/cqMore pip install git+https://github.com/gumyr/bd_warehouse
# pip list pip install git+https://github.com/meadiode/cq_gears.git@main
# - name: Run build pip install -e "git+https://github.com/CadQuery/cadquery-plugins.git#egg=cq_cache&subdirectory=plugins/cq_cache"
# shell: bash --login {0} pip install git+https://github.com/gumyr/build123d
# run: | pip install git+https://github.com/JustinSDK/cqMore
# micromamba activate test pip list
# micromamba info - name: Run build
# pyinstaller pyinstaller_pip.spec ${{ github.event.inputs.type }} shell: bash --login {0}
# cp /Users/runner/work/jmwright-CQ-Editor/jmwright-CQ-Editor/pyinstaller/CQ-editor.sh /Users/runner/work/jmwright-CQ-Editor/jmwright-CQ-Editor/dist/ run: |
# - uses: actions/upload-artifact@v4 micromamba activate test
# with: micromamba info
# name: CQ-editor-MacOS-x86_64 pyinstaller pyinstaller_pip.spec ${{ github.event.inputs.type }}
# path: dist cp /Users/runner/work/jmwright-CQ-Editor/jmwright-CQ-Editor/pyinstaller/CQ-editor-mac.sh /Users/runner/work/jmwright-CQ-Editor/jmwright-CQ-Editor/dist/CQ-editor.sh
# build-macos-arm64: - uses: actions/upload-artifact@v4
# runs-on: macos-14 with:
# steps: name: CQ-editor-MacOS-x86_64
# - uses: actions/checkout@v4 path: dist
# - uses: mamba-org/setup-micromamba@v1 build-macos-arm64:
# with: runs-on: macos-14
# environment-name: test steps:
# environment-file: environment.yml - uses: actions/checkout@v4
# init-shell: >- - uses: mamba-org/setup-micromamba@v1
# bash with:
# - name: pip install cadquery CQ-editor ... etc environment-name: test
# shell: bash --login {0} environment-file: environment.yml
# run: | init-shell: >-
# micromamba info bash
# pip install git+https://github.com/jdegenstein/jmwright-CQ-Editor - name: pip install cadquery CQ-editor ... etc
# pip install https://github.com/CadQuery/ocp-build-system/releases/download/7.7.2.0/cadquery_ocp-7.7.2-cp311-cp311-macosx_11_0_arm64.whl shell: bash --login {0}
# pip install https://github.com/jdegenstein/nlopt-python/releases/download/2.7.1.3/nlopt-2.7.1-cp311-cp311-macosx_11_0_arm64.whl run: |
# pip install --pre git+https://github.com/cadquery/cadquery casadi micromamba info
# pip install pyinstaller>=5.6 brew update
# pip install path brew upgrade
# pip uninstall -y PyQt5 brew install openssl
# pip install PyQt5==5.15.10 pip install git+https://github.com/jdegenstein/jmwright-CQ-Editor
# pip install PyQtWebEngine==5.15.6 pip install -vvv --pre git+https://github.com/cadquery/cadquery casadi typish "multimethod>=1.11,<2.0" "nlopt>=2.9.0,<3.0" typish
# pip install git+https://github.com/gumyr/cq_warehouse.git#egg=cq_warehouse pip install pyinstaller>=5.6
# pip install git+https://github.com/gumyr/bd_warehouse pip install path
# pip install git+https://github.com/meadiode/cq_gears.git@main pip uninstall -y PyQt5
# pip install -e "git+https://github.com/CadQuery/cadquery-plugins.git#egg=cq_cache&subdirectory=plugins/cq_cache" pip install PyQt5==5.15.10
# pip install git+https://github.com/gumyr/build123d pip install PyQtWebEngine==5.15.6
# pip install git+https://github.com/JustinSDK/cqMore pip install git+https://github.com/gumyr/cq_warehouse.git#egg=cq_warehouse
# pip list pip install git+https://github.com/gumyr/bd_warehouse
# - name: Run build pip install git+https://github.com/meadiode/cq_gears.git@main
# shell: bash --login {0} pip install -e "git+https://github.com/CadQuery/cadquery-plugins.git#egg=cq_cache&subdirectory=plugins/cq_cache"
# run: | pip install git+https://github.com/gumyr/build123d
# micromamba activate test pip install git+https://github.com/JustinSDK/cqMore
# micromamba info pip list
# pyinstaller pyinstaller_pip.spec ${{ github.event.inputs.type }} - name: Run build
# cp /Users/runner/work/jmwright-CQ-Editor/jmwright-CQ-Editor/pyinstaller/CQ-editor.sh /Users/runner/work/jmwright-CQ-Editor/jmwright-CQ-Editor/dist/ shell: bash --login {0}
# - uses: actions/upload-artifact@v4 run: |
# with: micromamba activate test
# name: CQ-editor-MacOS-arm64 micromamba info
# path: dist echo $LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/home/runner/micromamba/envs/test/lib
echo $LD_LIBRARY_PATH
pyinstaller pyinstaller_pip.spec ${{ github.event.inputs.type }}
cp /Users/runner/work/jmwright-CQ-Editor/jmwright-CQ-Editor/pyinstaller/CQ-editor-mac.sh /Users/runner/work/jmwright-CQ-Editor/jmwright-CQ-Editor/dist/CQ-editor.sh
- uses: actions/upload-artifact@v4
with:
name: CQ-editor-MacOS-arm64
path: dist
build-windows: build-windows:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
@@ -144,9 +152,8 @@ jobs:
shell: bash --login {0} shell: bash --login {0}
run: | run: |
micromamba info micromamba info
choco install upx
pip install git+https://github.com/jdegenstein/jmwright-CQ-Editor pip install git+https://github.com/jdegenstein/jmwright-CQ-Editor
pip install --pre git+https://github.com/cadquery/cadquery casadi pip install -vvv --pre git+https://github.com/cadquery/cadquery casadi typish "multimethod>=1.11,<2.0" "nlopt>=2.9.0,<3.0" typish
pip install pyinstaller>=5.6 pip install pyinstaller>=5.6
pip install path pip install path
pip install git+https://github.com/gumyr/cq_warehouse.git#egg=cq_warehouse pip install git+https://github.com/gumyr/cq_warehouse.git#egg=cq_warehouse

View File

@@ -2,7 +2,7 @@ import cadquery as cq
from cadquery.occ_impl.assembly import toCAF from cadquery.occ_impl.assembly import toCAF
from typing import List, Union from typing import List, Union
from imp import reload from importlib import reload
from types import SimpleNamespace from types import SimpleNamespace
from OCP.XCAFPrs import XCAFPrs_AISObject from OCP.XCAFPrs import XCAFPrs_AISObject
@@ -31,7 +31,7 @@ def find_cq_objects(results: dict):
def to_compound( def to_compound(
obj: Union[cq.Workplane, List[cq.Workplane], cq.Shape, List[cq.Shape], cq.Sketch] obj: Union[cq.Workplane, List[cq.Workplane], cq.Shape, List[cq.Shape], cq.Sketch],
): ):
vals = [] vals = []
@@ -213,7 +213,7 @@ def reload_cq():
reload(cq.sketch) reload(cq.sketch)
reload(cq.occ_impl.exporters.svg) reload(cq.occ_impl.exporters.svg)
reload(cq.cq) reload(cq.cq)
reload(cq.occ_impl.exporters.utils) # reload(cq.occ_impl.exporters.utils)
reload(cq.occ_impl.exporters.dxf) reload(cq.occ_impl.exporters.dxf)
reload(cq.occ_impl.exporters.amf) reload(cq.occ_impl.exporters.amf)
reload(cq.occ_impl.exporters.json) reload(cq.occ_impl.exporters.json)

View File

@@ -148,7 +148,7 @@ class Editor(CodeEditor,ComponentMixin):
if not self.confirm_discard(): return if not self.confirm_discard(): return
curr_dir = Path(self.filename).abspath().dirname() curr_dir = Path(self.filename).absolute().dirname()
fname = get_open_filename(self.EXTENSIONS, curr_dir) fname = get_open_filename(self.EXTENSIONS, curr_dir)
if fname != '': if fname != '':
self.load_from_file(fname) self.load_from_file(fname)

View File

@@ -186,7 +186,7 @@ class Debugger(QObject, ComponentMixin):
def _exec(self, code, locals_dict, globals_dict): def _exec(self, code, locals_dict, globals_dict):
with ExitStack() as stack: with ExitStack() as stack:
fname = self.parent().components["editor"].filename fname = self.parent().components["editor"].filename
p = Path(fname if fname else "").abspath().dirname() p = Path(fname if fname else "").absolute().dirname()
if self.preferences["Add script dir to path"] and p.exists(): if self.preferences["Add script dir to path"] and p.exists():
sys.path.insert(0, p) sys.path.insert(0, p)

View File

@@ -147,7 +147,7 @@ class Editor(CodeEditor,ComponentMixin):
if not self.confirm_discard(): return if not self.confirm_discard(): return
curr_dir = Path(self.filename).abspath().dirname() curr_dir = Path(self.filename).absolute().dirname()
fname = get_open_filename(self.EXTENSIONS, curr_dir) fname = get_open_filename(self.EXTENSIONS, curr_dir)
if fname != '': if fname != '':
self.load_from_file(fname) self.load_from_file(fname)

View File

@@ -5,7 +5,7 @@ channels:
dependencies: dependencies:
- pyqt=5 - pyqt=5
- pyqtgraph - pyqtgraph
- python=3.11 - python=3.12
- spyder=5 - spyder=5
- path - path
- logbook - logbook

View File

@@ -3,4 +3,4 @@ channels:
- conda-forge - conda-forge
- defaults - defaults
dependencies: dependencies:
- python=3.11 - python=3.12

View File

@@ -0,0 +1,4 @@
#!/bin/sh
export QT_MAC_WANTS_LAYER=1
chmod u+x ./CQ-editor/CQ-editor
QT_QPA_PLATFORM=cocoa PYOPENGL_PLATFORM=x11 ./CQ-editor/CQ-editor

View File

@@ -10,17 +10,18 @@ spyder_data = Path(site.getsitepackages()[-1]) / 'spyder'
parso_grammar = (Path(site.getsitepackages()[-1]) / 'parso/python').glob('grammar*') parso_grammar = (Path(site.getsitepackages()[-1]) / 'parso/python').glob('grammar*')
cqw_path = Path(site.getsitepackages()[-1]) / 'cq_warehouse' cqw_path = Path(site.getsitepackages()[-1]) / 'cq_warehouse'
bdw_path = Path(site.getsitepackages()[-1]) / 'bd_warehouse' bdw_path = Path(site.getsitepackages()[-1]) / 'bd_warehouse'
b123d_path = Path(site.getsitepackages()[-1]) / 'build123d'
cq_path = Path(site.getsitepackages()[-1]) / 'cadquery' cq_path = Path(site.getsitepackages()[-1]) / 'cadquery'
if sys.platform == 'linux': if sys.platform == 'linux':
occt_dir = os.path.join(Path(sys.prefix), 'share', 'opencascade') occt_dir = os.path.join(Path(sys.prefix), 'share', 'opencascade')
ocp_path = [(os.path.join(HOMEPATH, 'OCP.cpython-311-x86_64-linux-gnu.so'), '.')] ocp_path = [(os.path.join(HOMEPATH, 'OCP', 'OCP.cpython-312-x86_64-linux-gnu.so'), '.')]
elif sys.platform == 'darwin': elif sys.platform == 'darwin':
occt_dir = os.path.join(Path(sys.prefix), 'share', 'opencascade') occt_dir = os.path.join(Path(sys.prefix), 'share', 'opencascade')
ocp_path = [(os.path.join(HOMEPATH, 'OCP.cpython-311-darwin.so'), '.')] ocp_path = [(os.path.join(HOMEPATH, 'OCP', 'OCP.cpython-312-darwin.so'), '.')]
elif sys.platform == 'win32': elif sys.platform == 'win32':
occt_dir = os.path.join(Path(sys.prefix), 'Library', 'share', 'opencascade') occt_dir = os.path.join(Path(sys.prefix), 'Library', 'share', 'opencascade')
ocp_path = [(os.path.join(HOMEPATH, 'OCP.cp311-win_amd64.pyd'), '.')] ocp_path = [(os.path.join(HOMEPATH, 'OCP', 'OCP.cp312-win_amd64.pyd'), '.')]
datas1, binaries1, hiddenimports1 = collect_all('debugpy') datas1, binaries1, hiddenimports1 = collect_all('debugpy')
hiddenimports2 = collect_submodules('xmlrpc') hiddenimports2 = collect_submodules('xmlrpc')
@@ -31,6 +32,7 @@ a = Analysis(['run.py'],
datas=[(spyder_data, 'spyder'), datas=[(spyder_data, 'spyder'),
(cqw_path, 'cq_warehouse'), (cqw_path, 'cq_warehouse'),
(bdw_path, 'bd_warehouse'), (bdw_path, 'bd_warehouse'),
(b123d_path, 'build123d'),
(cq_path, 'cadquery')] + (cq_path, 'cadquery')] +
[(p, 'parso/python') for p in parso_grammar] + datas1, [(p, 'parso/python') for p in parso_grammar] + datas1,
hiddenimports=['ipykernel.datapub', 'debugpy', 'vtkmodules', 'vtkmodules.all', hiddenimports=['ipykernel.datapub', 'debugpy', 'vtkmodules', 'vtkmodules.all',

View File

@@ -3,19 +3,22 @@ import os.path
from setuptools import setup, find_packages from setuptools import setup, find_packages
def read(rel_path): def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__)) here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, rel_path), 'r') as fp: with codecs.open(os.path.join(here, rel_path), "r") as fp:
return fp.read() return fp.read()
def get_version(rel_path): def get_version(rel_path):
for line in read(rel_path).splitlines(): for line in read(rel_path).splitlines():
if line.startswith('__version__'): if line.startswith("__version__"):
delim = '"' if '"' in line else "'" delim = '"' if '"' in line else "'"
return line.split(delim)[1] return line.split(delim)[1]
else: else:
raise RuntimeError("Unable to find version string.") raise RuntimeError("Unable to find version string.")
setup( setup(
name="CQ-editor", name="CQ-editor",
version=get_version("cq_editor/_version.py"), version=get_version("cq_editor/_version.py"),
@@ -26,7 +29,7 @@ setup(
"CQ-editor = cq_editor.__main__:main", "CQ-editor = cq_editor.__main__:main",
] ]
}, },
python_requires=">=3.8,<3.12", python_requires=">=3.10,<3.14",
install_requires=[ install_requires=[
"logbook>=1", "logbook>=1",
"ipython", "ipython",
@@ -35,5 +38,7 @@ setup(
"requests>=2,<3", "requests>=2,<3",
"spyder>=5,<6", "spyder>=5,<6",
"pyqtgraph", "pyqtgraph",
"numpy >= 2, <3",
"scipy==1.14.1", # workaround for renamed stuff in scipy optimize
], ],
) )