Skip to content

Commit 893c799

Browse files
authored
Merge pull request #1085 from CadQuery/setup
Updated setup.py with OCP being available on PyPi now
2 parents cee66ff + 7cff170 commit 893c799

File tree

3 files changed

+39
-9
lines changed

3 files changed

+39
-9
lines changed

cadquery/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
from importlib.metadata import version, PackageNotFoundError
2+
3+
try:
4+
__version__ = version("cadquery")
5+
except PackageNotFoundError:
6+
# package is not installed
7+
__version__ = "2.2-dev"
8+
19
# these items point to the OCC implementation
210
from .occ_impl.geom import Plane, BoundBox, Vector, Matrix, Location
311
from .occ_impl.shapes import (
@@ -69,5 +77,3 @@
6977
"plugins",
7078
"Sketch",
7179
]
72-
73-
__version__ = "2.1"

environment.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ channels:
44
- conda-forge
55
- defaults
66
dependencies:
7-
- python>=3.6
7+
- python>=3.8
88
- ipython
99
- ocp=7.5.3
1010
- vtk=9.0.1
@@ -26,6 +26,7 @@ dependencies:
2626
- casadi
2727
- pip
2828
- pip:
29+
- "--install-option=\"--no-deps\""
2930
- "--editable=."
3031
- sphinxcadquery
3132
- multimethod

setup.py

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,46 @@
1414
import os
1515
from setuptools import setup, find_packages
1616

17+
reqs = []
18+
setup_reqs = []
1719

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

25+
# Only include the installation dependencies if we are not running on RTD or AppVeyor
26+
if not is_rtd and not is_appveyor and not is_azure:
27+
reqs = [
28+
"cadquery-ocp",
29+
"ezdxf",
30+
"multimethod",
31+
"nlopt",
32+
"nptyping>=2",
33+
"typish",
34+
"casadi",
35+
"path",
36+
]
37+
38+
setup_reqs = ["setuptools_scm"]
2339

2440
setup(
2541
name="cadquery",
26-
version=version,
27-
url="https://github.com/dcowden/cadquery",
42+
use_scm_version=True,
43+
url="https://github.com/CadQuery/cadquery",
2844
license="Apache Public License 2.0",
2945
author="David Cowden",
3046
author_email="dave.cowden@gmail.com",
3147
description="CadQuery is a parametric scripting language for creating and traversing CAD models",
3248
long_description=open("README.md").read(),
3349
packages=find_packages(exclude=("tests",)),
50+
python_requires=">=3.8,<3.11",
51+
setup_requires=setup_reqs,
52+
install_requires=reqs,
53+
extras_require={
54+
"dev": ["docutils", "ipython", "pytest", "black==19.10b0", "click==8.0.4",],
55+
"ipython": ["ipython",],
56+
},
3457
include_package_data=True,
3558
zip_safe=False,
3659
platforms="any",

0 commit comments

Comments
 (0)