CadQuery / cadquery

A python parametric CAD scripting framework based on OCCT
https://cadquery.readthedocs.io
Other
3.26k stars 295 forks source link

Introduce pinning CadQuery to a specific commit in the docs #358

Open marcus7070 opened 4 years ago

marcus7070 commented 4 years ago

When I use CadQuery for a specific project I always start by creating an environment where CadQuery and CQ-editor are pinned to specific commits (and sometimes a commit is from my fork instead of the official). There are a few reasons why I do this, and I believe it's a good practise that the docs should be encouraging (perhaps at the bottom of the installation page, under a heading like "pinned install").

The main reason I want this in the docs, aside from making other user's projects better, is because it might help out when we are considering changes that would break backwards compatibility. I'm not saying it would remove the need for backwards compatibility, but having a solution like this in the docs might reduce the need for long term deprecation warnings and help us trim the codebase down a bit. Examples:

Unfortunately I use NixOS and I'm not sure how to pin CadQuery using the standard Conda installation. I suspect this will work, but I'm not aware if there are any CadQuery/CQ-editor specific details. If I get some spare time I'll make a VM, figure it out, write the method into the docs and make a PR myself (but I don't have much spare time at the moment).

adam-urbanczyk commented 4 years ago

This can be done with pip: https://pip.pypa.io/en/latest/reference/pip_install/#git . Is this what you are after (NB: pip can be mixed with conda)?

marcus7070 commented 4 years ago

Yeah, that's the idea. Suggest an environment.yml file for each project/model they produce, with something like:

dependencies:
  - pip:
    - git+https://github.com/cadquery/cadquery.git@9c69cb3b797469055730845b60136ce6813f02fc#egg=cadquery
    - git+https://github.com/cadquery/CQ-editor.git@23fc503d962518564a62b5cf7a0ea5edb62ce87d#egg=cq_editor