Skip to content

Commit

Permalink
Merge pull request #1085 from CadQuery/setup
Browse files Browse the repository at this point in the history
Updated setup.py with OCP being available on PyPi now
  • Loading branch information
jmwright authored May 23, 2022
2 parents cee66ff + 7cff170 commit 893c799
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 9 deletions.
10 changes: 8 additions & 2 deletions cadquery/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
from importlib.metadata import version, PackageNotFoundError

try:
__version__ = version("cadquery")
except PackageNotFoundError:
# package is not installed
__version__ = "2.2-dev"

# these items point to the OCC implementation
from .occ_impl.geom import Plane, BoundBox, Vector, Matrix, Location
from .occ_impl.shapes import (
Expand Down Expand Up @@ -69,5 +77,3 @@
"plugins",
"Sketch",
]

__version__ = "2.1"
3 changes: 2 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ channels:
- conda-forge
- defaults
dependencies:
- python>=3.6
- python>=3.8
- ipython
- ocp=7.5.3
- vtk=9.0.1
Expand All @@ -26,6 +26,7 @@ dependencies:
- casadi
- pip
- pip:
- "--install-option=\"--no-deps\""
- "--editable=."
- sphinxcadquery
- multimethod
35 changes: 29 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,46 @@
import os
from setuptools import setup, find_packages

reqs = []
setup_reqs = []

# if we are building in travis, use the build number as the sub-minor version
version = "2.1"
if "TRAVIS_TAG" in os.environ.keys():
version = os.environ["TRAVIS_TAG"]
# ReadTheDocs, AppVeyor and Azure builds will break when trying to instal pip deps in a conda env
is_rtd = "READTHEDOCS" in os.environ
is_appveyor = "APPVEYOR" in os.environ
is_azure = "CONDA_PY" in os.environ

# Only include the installation dependencies if we are not running on RTD or AppVeyor
if not is_rtd and not is_appveyor and not is_azure:
reqs = [
"cadquery-ocp",
"ezdxf",
"multimethod",
"nlopt",
"nptyping>=2",
"typish",
"casadi",
"path",
]

setup_reqs = ["setuptools_scm"]

setup(
name="cadquery",
version=version,
url="https://github.com/dcowden/cadquery",
use_scm_version=True,
url="https://github.com/CadQuery/cadquery",
license="Apache Public License 2.0",
author="David Cowden",
author_email="[email protected]",
description="CadQuery is a parametric scripting language for creating and traversing CAD models",
long_description=open("README.md").read(),
packages=find_packages(exclude=("tests",)),
python_requires=">=3.8,<3.11",
setup_requires=setup_reqs,
install_requires=reqs,
extras_require={
"dev": ["docutils", "ipython", "pytest", "black==19.10b0", "click==8.0.4",],
"ipython": ["ipython",],
},
include_package_data=True,
zip_safe=False,
platforms="any",
Expand Down

0 comments on commit 893c799

Please sign in to comment.