-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restructure the Project to Follow Best Python Packaging Practices #23
Conversation
fixes "libGL.so.1: cannot open shared object file"
I installed with
I messed around with this for a bit and I think I have it working now. I changed pyproject.toml [tool.hatch.build.targets.wheel]
-packages = ["src/cq_cli/cqcodecs"]
+packages = ["src/cq_cli"] and now things show up correctly in site-packages/. After that, imports had to be changed from |
Thanks for fixing that @justbuchanan I fixed the PyInstaller spec file and added a few more dependencies to make sure that CadQuery doesn't end up broken when doing a pip install from git. I created a clean environment and installed via
It had an added advantage that it picked up the recent CadQuery change that suppresses the verbose STEP export info from OCCT. Have you noticed any other issues, or are we ready to merge this? |
Looks good! One minor suggestion - you probably don't need to add the extra dependencies in pyproject.toml (commit e19e7c2). Pip will already get those for you automatically. In general, you should only list direct dependencies and let pip figure out transitive dependencies. It looks like |
After I switched to the git install with pip the dependencies weren't getting installed, so I added those. I'll try a fresh install without them again, but will put them back if I have the same problem. The problem should go away with release packages of CadQuery. |
Yeah, the CadQuery dependency installation does not work properly when installing from git for some reason. It could have something to do with this repo using pyproject.toml and CadQuery still using setup.py. $ pip install git+https://github.com/CadQuery/cq-cli.git@restructure
Collecting git+https://github.com/CadQuery/cq-cli.git@restructure
Cloning https://github.com/CadQuery/cq-cli.git (to revision restructure) to /tmp/pip-req-build-ovpfld5a
Running command git clone --filter=blob:none --quiet https://github.com/CadQuery/cq-cli.git /tmp/pip-req-build-ovpfld5a
Running command git checkout -b restructure --track origin/restructure
Switched to a new branch 'restructure'
Branch 'restructure' set up to track remote branch 'restructure' from 'origin'.
Resolved https://github.com/CadQuery/cq-cli.git to commit addae4923ee9a22b4a3a734aa68ea7c38c88ebad
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting cadquery@ git+https://github.com/CadQuery/cadquery.git (from cq_cli==2.3.0)
Cloning https://github.com/CadQuery/cadquery.git to /tmp/pip-install-9cnbtl8b/cadquery_caae7abfc3df4fbd9f59c040ea2e11ed
Running command git clone --filter=blob:none --quiet https://github.com/CadQuery/cadquery.git /tmp/pip-install-9cnbtl8b/cadquery_caae7abfc3df4fbd9f59c040ea2e11ed
Resolved https://github.com/CadQuery/cadquery.git to commit cce60ce97f583730fdfa4844f262d6168b8b63b1
Preparing metadata (setup.py) ... done
Building wheels for collected packages: cq_cli, cadquery
Building wheel for cq_cli (pyproject.toml) ... done
Created wheel for cq_cli: filename=cq_cli-2.3.0-py3-none-any.whl size=22123 sha256=2ad317fc5d158daafe8dc354aab5881863af35302a2a3d52f3ad20b89f2ca311
Stored in directory: /tmp/pip-ephem-wheel-cache-1n09w88u/wheels/fe/a8/a6/b8966239398b2c47e87f2d32b7f848d6df165d981aab1b188c
Building wheel for cadquery (setup.py) ... done
Created wheel for cadquery: filename=cadquery-2.4.0.dev0-py3-none-any.whl size=150362 sha256=adef4cd7dc85e94a98d2792d63e2de4985ace5af11c600199ea0e62fdea05387
Stored in directory: /tmp/pip-ephem-wheel-cache-1n09w88u/wheels/f6/bd/11/9f4461324b9afde1e7af02edd50dd6c7ce6613e86665b55920
Successfully built cq_cli cadquery
Installing collected packages: cadquery, cq_cli
Successfully installed cadquery-2.4.0.dev0 cq_cli-2.3.0
$ cq-cli -h
Traceback (most recent call last):
File "/home/jwright/mambaforge/envs/cq-cli/bin/cq-cli", line 5, in <module>
from cq_cli.main import main
File "/home/jwright/mambaforge/envs/cq-cli/lib/python3.10/site-packages/cq_cli/main.py", line 15, in <module>
import cadquery as cq
File "/home/jwright/mambaforge/envs/cq-cli/lib/python3.10/site-packages/cadquery/__init__.py", line 10, in <module>
from .occ_impl.geom import Plane, BoundBox, Vector, Matrix, Location
File "/home/jwright/mambaforge/envs/cq-cli/lib/python3.10/site-packages/cadquery/occ_impl/geom.py", line 5, in <module>
from OCP.gp import (
ModuleNotFoundError: No module named 'OCP' |
Merging - Thanks for all your work on this @justbuchanan |
Great, thanks for getting this merged in! |
This project was originally structured with just PyInstaller in mind, but now that it can be installed via pip, the repo needs to be restructured.