vinszent / cq-flake Goto Github PK
View Code? Open in Web Editor NEWCadQuery and CQ-editor flake, closely follows master
License: MIT License
CadQuery and CQ-editor flake, closely follows master
License: MIT License
Should really grab it out of the python argument.
It is not clear what exactly version of CadQuery is used here. Even though I understand it "closely follows master", there is no easy way to find out which version cq API is.
I assume cq 2.1+ is supported :)
Needs to use pkgs.glibc
instead.
My priorities have changed and I can no longer keep this repo up to date.
@vinszent, would you like to take over?
Making text onto no base solid segfaults. Not sure if my fault or upstream yet. There are no tests in CadQuery that cover this behaviour.
Currently pinned, that's probably over a year old now, should update it sometime.
When I try to run this flake I get an error:
λ nix run github:marcus7070/cq-flake
error: attribute 'defaultApp.x86_64-linux' should have type 'derivation'
I'm using the current nixpkgs master branch.
Should probably do that.
I'm a bit unsure where the root cause for this is between NixOS, this repo, and cadquery itself, but since the viewport in cq-editor is not working anymore. On STDERR I can see this:
libGL error: MESA-LOADER: failed to open radeonsi: /nix/store/naxlf484ka6r8r5qck91yv184wy5xwd5-libdrm-2.4.108/lib/libdrm_nouveau.so.2: undefined symbol: drmCloseBufferHandle (search paths /run/opengl-driver/lib/dri, suffix _dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open swrast: /nix/store/naxlf484ka6r8r5qck91yv184wy5xwd5-libdrm-2.4.108/lib/libdrm_nouveau.so.2: undefined symbol: drmCloseBufferHandle (search paths /run/opengl-driver/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast
Namespace(filename=None)
libGL error: MESA-LOADER: failed to open radeonsi: /nix/store/naxlf484ka6r8r5qck91yv184wy5xwd5-libdrm-2.4.108/lib/libdrm_nouveau.so.2: undefined symbol: drmCloseBufferHandle (search paths /run/opengl-driver/lib/dri, suffix _dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open swrast: /nix/store/naxlf484ka6r8r5qck91yv184wy5xwd5-libdrm-2.4.108/lib/libdrm_nouveau.so.2: undefined symbol: drmCloseBufferHandle (search paths /run/opengl-driver/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast
The GUI Log viewer has this to say:
[2021-12-20 12:16:52.560540] ERROR: CQ-Editor: Uncaught exception occurred
Traceback (most recent call last):
File "/nix/store/klm4whckx030dmavqqijwkz42hf11wdr-cq-editor-local/lib/python3.8/site-packages/cq_editor/widgets/occt_widget.py", line 131, in paintEvent
self._initialize()
File "/nix/store/klm4whckx030dmavqqijwkz42hf11wdr-cq-editor-local/lib/python3.8/site-packages/cq_editor/widgets/occt_widget.py", line 153, in _initialize
self.view.SetWindow(wins.get(platform,self._get_window_linux)(self.winId()))
OCP.Aspect.Aspect_GraphicDeviceDefinitionError: OpenGl_Window::CreateWindow: glXCreateContext failed.
[2021-12-20 12:16:52.567216] ERROR: CQ-Editor: Uncaught exception occurred
Traceback (most recent call last):
File "/nix/store/klm4whckx030dmavqqijwkz42hf11wdr-cq-editor-local/lib/python3.8/site-packages/cq_editor/widgets/occt_widget.py", line 131, in paintEvent
self._initialize()
File "/nix/store/klm4whckx030dmavqqijwkz42hf11wdr-cq-editor-local/lib/python3.8/site-packages/cq_editor/widgets/occt_widget.py", line 153, in _initialize
self.view.SetWindow(wins.get(platform,self._get_window_linux)(self.winId()))
OCP.Aspect.Aspect_GraphicDeviceDefinitionError: OpenGl_Window::CreateWindow: glXCreateContext failed.
[2021-12-20 12:16:52.587332] ERROR: CQ-Editor: Uncaught exception occurred
Traceback (most recent call last):
File "/nix/store/klm4whckx030dmavqqijwkz42hf11wdr-cq-editor-local/lib/python3.8/site-packages/cq_editor/widgets/occt_widget.py", line 131, in paintEvent
self._initialize()
File "/nix/store/klm4whckx030dmavqqijwkz42hf11wdr-cq-editor-local/lib/python3.8/site-packages/cq_editor/widgets/occt_widget.py", line 153, in _initialize
self.view.SetWindow(wins.get(platform,self._get_window_linux)(self.winId()))
OCP.Aspect.Aspect_GraphicDeviceDefinitionError: OpenGl_Window::CreateWindow: glXCreateContext failed.
[2021-12-20 12:16:52.594079] ERROR: CQ-Editor: Uncaught exception occurred
Traceback (most recent call last):
File "/nix/store/klm4whckx030dmavqqijwkz42hf11wdr-cq-editor-local/lib/python3.8/site-packages/cq_editor/widgets/occt_widget.py", line 131, in paintEvent
self._initialize()
File "/nix/store/klm4whckx030dmavqqijwkz42hf11wdr-cq-editor-local/lib/python3.8/site-packages/cq_editor/widgets/occt_widget.py", line 153, in _initialize
self.view.SetWindow(wins.get(platform,self._get_window_linux)(self.winId()))
OCP.Aspect.Aspect_GraphicDeviceDefinitionError: OpenGl_Window::CreateWindow: glXCreateContext failed.
[2021-12-20 12:16:52.594796] ERROR: CQ-Editor: Uncaught exception occurred
Traceback (most recent call last):
File "/nix/store/klm4whckx030dmavqqijwkz42hf11wdr-cq-editor-local/lib/python3.8/site-packages/cq_editor/widgets/occt_widget.py", line 131, in paintEvent
self._initialize()
File "/nix/store/klm4whckx030dmavqqijwkz42hf11wdr-cq-editor-local/lib/python3.8/site-packages/cq_editor/widgets/occt_widget.py", line 153, in _initialize
self.view.SetWindow(wins.get(platform,self._get_window_linux)(self.winId()))
OCP.Aspect.Aspect_GraphicDeviceDefinitionError: OpenGl_Window::CreateWindow: glXCreateContext failed.
I've tried removing all cadquery/ocp/occt derivations and rebuilding from scratch, but that didn't make a difference. I recently upgraded to NixOS 21.11, but even when I boot the older 21.05 system configuration it fails in the same way.
Is there something I can do to help diagnose this further?
I could use a nix develop
environment for both cadquery and cq-editor. Should split cadquery off into it's own flake, with it's own default package and develop environment.
Perhaps with a dirty environment provided by nix develop
cq-flake, I could get cq-editor's pytestqt working under nixos?
That's just an intermediate step in generating OCP.
exception: No module named 'sphinx_autodoc_typehints'
It keeps getting rebuilt every time I update cadquery-src.
python3.8-cadquery-local-dev> Running Sphinx v3.2.1
python3.8-cadquery-local-dev> building [mo]: targets for 0 po files that are out of date
python3.8-cadquery-local-dev> building [html]: targets for 20 source files that are out of date
python3.8-cadquery-local-dev> updating environment: [new config] 20 added, 0 changed, 0 removed
python3.8-cadquery-local-dev> Warning: Desired error not necessarily achieved due to precision loss.int
python3.8-cadquery-local-dev> Current function value: 0.000000
python3.8-cadquery-local-dev> Iterations: 29
python3.8-cadquery-local-dev> Function evaluations: 89
python3.8-cadquery-local-dev> Gradient evaluations: 77
python3.8-cadquery-local-dev> /build/source/cadquery/utils.py:34: FutureWarning: toString will be removed in the next release.
python3.8-cadquery-local-dev> warn(f"{f.__name__} will be removed in the next release.", FutureWarning)
python3.8-cadquery-local-dev> /build/source/cadquery/utils.py:34: FutureWarning: exportShape will be removed in the next release.
python3.8-cadquery-local-dev> warn(f"{f.__name__} will be removed in the next release.", FutureWarning)
python3.8-cadquery-local-dev> Exception occurred:
python3.8-cadquery-local-dev> File "/build/source/cadquery/occ_impl/exporters/__init__.py", line 142, in tessellate
python3.8-cadquery-local-dev> return shape.tessellate(tolerance, angularTolerance)
python3.8-cadquery-local-dev> AttributeError: 'Assembly' object has no attribute 'tessellate'
Need to update sphinxcadquery, but even still that's not the issue.
They're excessive from a packaging perspective, and can always be run from a develop env if you need to run them.
MWE:
width = 10
inner_diam = 10
outer_diam = 100
part = (
cq.Workplane("YZ", origin=(-width / 2, 0, 0))
.circle(inner_diam / 2)
.circle(outer_diam / 2)
.extrude(width)
)
Spin it a bit with the mouse and this pops up in the log:
[2021-05-08 01:07:44.826334] ERROR: CQ-Editor: Uncaught exception occurred
Traceback (most recent call last):
File "/nix/store/8v18gdz65092h6rzq7ry96l4ziy6lasi-cq-editor-local/lib/python3.8/site-packages/cq_editor/widgets/occt_widget.py", line 109, in mouseReleaseEvent
self.context.MoveTo(x,y,self.view,True)
OCP.Standard.Standard_ProgramError: *** ERROR: ASSERT in file '/build/occt-V7_5_1-94c0055/src/SelectMgr/SelectMgr_Frustum.lxx':
Error! Failed to project box (aBoxProjMax >= aBoxProjMin)
This does not occur in a VM with a canonical Conda install.
Still to do:
Currently segfaults with the testEdgeWrapperRadius
test from cadquery master.
I let a link to a local direction get merged from dev branch into main. Didn't notice because the local link was available to me during all tests. A silly mistake that would be caught if I had CI on a clean machine.
Build123d describes itself as "an evolution of CadQuery", relies on the same hellish-to-package cadquery-ocp library, and seems to have some community overlap.
Think the way I handle python in flake.nix
is wrong, it doesn't create a derivation when it should.
Hello,
Is there any reason this isn't upstreamed to nixpkgs?
I have tried using this with the latest nixpkgs version, but it required quite some tweaking. I might be doing a PR once I get rid of some of the bugs :)
I did some minor patching, but am unable to build it by updating nixpkgs.
diff --git a/expressions/cq-editor.nix b/expressions/cq-editor.nix
index c47745c..5171f8a 100644
--- a/expressions/cq-editor.nix
+++ b/expressions/cq-editor.nix
@@ -16,7 +16,7 @@ mkDerivationWith python3Packages.buildPythonApplication {
propagatedBuildInputs = with python3Packages; [
cadquery
- Logbook
+ logbook
nlopt
pyqt5
pyparsing
diff --git a/expressions/py-overrides.nix b/expressions/py-overrides.nix
index 6cee176..51a2014 100644
--- a/expressions/py-overrides.nix
+++ b/expressions/py-overrides.nix
@@ -88,7 +88,7 @@
spyder = (super.spyder.overrideAttrs (oldAttrs: {
propagatedBuildInputs = with self; oldAttrs.propagatedBuildInputs ++ [
- cookiecutter Rtree qstylizer jellyfish
+ cookiecutter rtree qstylizer jellyfish
];
}));
diff --git a/expressions/sphinx-autodoc-typehints.nix b/expressions/sphinx-autodoc-typehints.nix
index a4cf773..7dfc065 100644
--- a/expressions/sphinx-autodoc-typehints.nix
+++ b/expressions/sphinx-autodoc-typehints.nix
@@ -18,7 +18,7 @@ buildPythonPackage rec {
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
- owner = "agronholm";
+ owner = "tox-dev";
repo = "sphinx-autodoc-typehints";
rev = version;
sha256 = "sha256-hM4YIWsfEESaKaXg6Ds+XDUIz3Bi64RoMfBfnuBPdrM=";
diff --git a/flake.lock b/flake.lock
index 70a7359..42762be 100644
--- a/flake.lock
+++ b/flake.lock
@@ -68,11 +68,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1673134516,
- "narHash": "sha256-mAZQKqkNQbBmJnmUU0blOfkKlgMSSVyPHdeWeuKad8U=",
+ "lastModified": 1692084312,
+ "narHash": "sha256-Za++qKVK6ovjNL9poQZtLKRM/re663pxzbJ+9M4Pgwg=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "f6f44561884c3470e2b783683d5dbac42dfc833b",
+ "rev": "8353344d3236d3fda429bb471c1ee008857d3b7c",
"type": "github"
},
"original": {
I'm certain I could do this without rebuilding and re-running all the tests.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.