Skip to content

Updated setup.py with OCP being available on PyPi now #1085

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

Merged
merged 26 commits into from
May 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d3c1a5c
Updated setup.py with OCP being available on PyPi now
jmwright May 19, 2022
f925063
Integrated suggestions and added back version number.
jmwright May 19, 2022
29268a7
Black formatting and added black/click to dev dependencies
jmwright May 19, 2022
dad25a1
Trying to get ReadTheDocs to ignore setup.py
jmwright May 19, 2022
fa5ec03
Trying to get ReadTheDocs to stop including setup.py dependencies
jmwright May 19, 2022
0796bb2
Commented out editable option as it seemed to be causing conda to att…
jmwright May 19, 2022
c9da2c2
Trying to enforce versions to get setup.py and conda to play well tog…
jmwright May 19, 2022
fac311b
Fixing merge conflict
jmwright May 19, 2022
f36e871
Merge branch 'master' of github.com:CadQuery/cadquery into setup
jmwright May 19, 2022
b7d069c
Trying to enforce a pip version
jmwright May 19, 2022
b769a63
Took version pin back off of pip
jmwright May 19, 2022
3c9fe3a
Trying the editable install with no-deps to try to decouple things
jmwright May 20, 2022
1de937c
Still trying to decouple things by not installing deps in conda env
jmwright May 20, 2022
433d5bf
Passing no-deps option to pip in a different way
jmwright May 20, 2022
e3a19c4
Trying to use the RTD env varaible to limit the dependencies
jmwright May 20, 2022
44413e5
Trying to protect against the env variable not being present
jmwright May 20, 2022
ddceab1
Black formatting and AppVeyor handling
jmwright May 20, 2022
58b2810
Added scm version tracking
jmwright May 20, 2022
d09334c
Trying to fix package errors in CI with another selective require
jmwright May 20, 2022
7197eea
Ignoring SCM version reqs for Azure
jmwright May 20, 2022
dafd8e7
Trying to find an environment variable that is available
jmwright May 20, 2022
e23d8a9
Printing os.environ to see what is available in Pipelines
jmwright May 20, 2022
1472063
Trying yet another environment variable for Azure
jmwright May 21, 2022
7164898
Streamlining the code a little bit
jmwright May 21, 2022
162e3c5
Trying without the version number in setup.py
jmwright May 22, 2022
7cff170
Removed hard-coded version number in __init__.py
jmwright May 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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