diff --git a/cadquery/__init__.py b/cadquery/__init__.py index 4645a3d88..42b888b36 100644 --- a/cadquery/__init__.py +++ b/cadquery/__init__.py @@ -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 ( @@ -69,5 +77,3 @@ "plugins", "Sketch", ] - -__version__ = "2.1" diff --git a/environment.yml b/environment.yml index 756bc0007..be553b535 100644 --- a/environment.yml +++ b/environment.yml @@ -4,7 +4,7 @@ channels: - conda-forge - defaults dependencies: - - python>=3.6 + - python>=3.8 - ipython - ocp=7.5.3 - vtk=9.0.1 @@ -26,6 +26,7 @@ dependencies: - casadi - pip - pip: + - "--install-option=\"--no-deps\"" - "--editable=." - sphinxcadquery - multimethod diff --git a/setup.py b/setup.py index c341c5aa9..2da6c19d1 100644 --- a/setup.py +++ b/setup.py @@ -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="dave.cowden@gmail.com", 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",