From d3c1a5cce94f241711bf3ea84938ae1d51194f0d Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Thu, 19 May 2022 10:18:57 -0400 Subject: [PATCH 01/25] Updated setup.py with OCP being available on PyPi now --- setup.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index c341c5aa9..0b1380726 100644 --- a/setup.py +++ b/setup.py @@ -14,13 +14,6 @@ import os from setuptools import setup, find_packages - -# 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"] - - setup( name="cadquery", version=version, @@ -31,6 +24,17 @@ description="CadQuery is a parametric scripting language for creating and traversing CAD models", long_description=open("README.md").read(), packages=find_packages(exclude=("tests",)), + install_requires=["cadquery-ocp", "ezdxf", "multimethod", "nlopt", "nptyping", "typish", "casadi", "path"], + extras_require = { + "dev": [ + "docutils", + "ipython", + "pytest", + ], + "ipython": [ + "ipython", + ] + }, include_package_data=True, zip_safe=False, platforms="any", From f92506313708e012372bac5d552b3d53f55abaf7 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Thu, 19 May 2022 11:36:12 -0400 Subject: [PATCH 02/25] Integrated suggestions and added back version number. --- setup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 0b1380726..23cc635b0 100644 --- a/setup.py +++ b/setup.py @@ -14,17 +14,20 @@ import os from setuptools import setup, find_packages +version = "2.1" + setup( name="cadquery", version=version, - url="https://github.com/dcowden/cadquery", + 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",)), - install_requires=["cadquery-ocp", "ezdxf", "multimethod", "nlopt", "nptyping", "typish", "casadi", "path"], + python_requires=">=3.8,<3.11", + install_requires=["cadquery-ocp", "ezdxf", "multimethod", "nlopt", "nptyping>=2", "typish", "casadi", "path"], extras_require = { "dev": [ "docutils", From 29268a74f553f80eac10e96a79790dfcef0183f9 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Thu, 19 May 2022 11:44:36 -0400 Subject: [PATCH 03/25] Black formatting and added black/click to dev dependencies --- setup.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/setup.py b/setup.py index 23cc635b0..4c0b5cdfd 100644 --- a/setup.py +++ b/setup.py @@ -27,16 +27,19 @@ long_description=open("README.md").read(), packages=find_packages(exclude=("tests",)), python_requires=">=3.8,<3.11", - install_requires=["cadquery-ocp", "ezdxf", "multimethod", "nlopt", "nptyping>=2", "typish", "casadi", "path"], - extras_require = { - "dev": [ - "docutils", - "ipython", - "pytest", - ], - "ipython": [ - "ipython", - ] + install_requires=[ + "cadquery-ocp", + "ezdxf", + "multimethod", + "nlopt", + "nptyping>=2", + "typish", + "casadi", + "path", + ], + extras_require={ + "dev": ["docutils", "ipython", "pytest", "black==19.10b0", "click==8.0.4",], + "ipython": ["ipython",], }, include_package_data=True, zip_safe=False, From dad25a1d60e647442880ec23713f3bb92fe56442 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Thu, 19 May 2022 12:18:52 -0400 Subject: [PATCH 04/25] Trying to get ReadTheDocs to ignore setup.py --- .readthedocs.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 89047f788..3db9880db 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,3 +1,5 @@ version: 2 +python: + setup_py_install: false conda: environment: environment.yml From fa5ec0379d57f8c694fc3c2255904272c57fd713 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Thu, 19 May 2022 12:45:49 -0400 Subject: [PATCH 05/25] Trying to get ReadTheDocs to stop including setup.py dependencies --- .readthedocs.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 3db9880db..313e76782 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,5 +1,7 @@ version: 2 -python: - setup_py_install: false + conda: environment: environment.yml + +python: + version: 3.8 From 0796bb27f33448b3fd9ac097ff22de23c7338252 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Thu, 19 May 2022 14:11:00 -0400 Subject: [PATCH 06/25] Commented out editable option as it seemed to be causing conda to attempt to install cadquery-ocp --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 7e1cb5f1c..eb042c20b 100644 --- a/environment.yml +++ b/environment.yml @@ -25,6 +25,6 @@ dependencies: - path - pip - pip: - - "--editable=." - sphinxcadquery - multimethod + # - "--editable=." From c9da2c2775dc78850e5c77851340a1001ce0968f Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Thu, 19 May 2022 14:48:37 -0400 Subject: [PATCH 07/25] Trying to enforce versions to get setup.py and conda to play well together --- .readthedocs.yaml | 4 ---- environment.yml | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 313e76782..89047f788 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,7 +1,3 @@ version: 2 - conda: environment: environment.yml - -python: - version: 3.8 diff --git a/environment.yml b/environment.yml index eb042c20b..636500898 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 @@ -23,8 +23,8 @@ dependencies: - nptyping>=2.0.0 - nlopt - path - - pip + - pip>=22 - pip: + - "--editable=." - sphinxcadquery - multimethod - # - "--editable=." From fac311b971659d826d3f69ab40e0ae65c4f606c2 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Thu, 19 May 2022 14:52:49 -0400 Subject: [PATCH 08/25] Fixing merge conflict --- environment.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 636500898..f1b0f435d 100644 --- a/environment.yml +++ b/environment.yml @@ -23,7 +23,8 @@ dependencies: - nptyping>=2.0.0 - nlopt - path - - pip>=22 + - casadi + - pip - pip: - "--editable=." - sphinxcadquery From b7d069cf6639264474f75d7d4d546ec2f2bfb193 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Thu, 19 May 2022 15:47:00 -0400 Subject: [PATCH 09/25] Trying to enforce a pip version --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index f1b0f435d..b09cf4872 100644 --- a/environment.yml +++ b/environment.yml @@ -24,7 +24,7 @@ dependencies: - nlopt - path - casadi - - pip + - pip>=22 - pip: - "--editable=." - sphinxcadquery From b769a6398c984c938fd609a2e9825aed693942a2 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Thu, 19 May 2022 16:44:18 -0400 Subject: [PATCH 10/25] Took version pin back off of pip --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index b09cf4872..f1b0f435d 100644 --- a/environment.yml +++ b/environment.yml @@ -24,7 +24,7 @@ dependencies: - nlopt - path - casadi - - pip>=22 + - pip - pip: - "--editable=." - sphinxcadquery From 3c9fe3af256568c5c397bc449e1c6a5a581be8d8 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 20 May 2022 09:28:19 -0400 Subject: [PATCH 11/25] Trying the editable install with no-deps to try to decouple things --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index f1b0f435d..f6ab3043a 100644 --- a/environment.yml +++ b/environment.yml @@ -26,6 +26,6 @@ dependencies: - casadi - pip - pip: - - "--editable=." + - "--no-deps --editable=." - sphinxcadquery - multimethod From 1de937c749fabb97dce104ce29bddd7d96be5c5f Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 20 May 2022 09:54:48 -0400 Subject: [PATCH 12/25] Still trying to decouple things by not installing deps in conda env --- environment.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index f6ab3043a..71f23c8ed 100644 --- a/environment.yml +++ b/environment.yml @@ -26,6 +26,7 @@ dependencies: - casadi - pip - pip: - - "--no-deps --editable=." + - "--no-deps" + - "--editable=." - sphinxcadquery - multimethod From 433d5bf44c92fbc69367b1f71d00e1433e6c3a29 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 20 May 2022 10:21:08 -0400 Subject: [PATCH 13/25] Passing no-deps option to pip in a different way --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 71f23c8ed..be553b535 100644 --- a/environment.yml +++ b/environment.yml @@ -26,7 +26,7 @@ dependencies: - casadi - pip - pip: - - "--no-deps" + - "--install-option=\"--no-deps\"" - "--editable=." - sphinxcadquery - multimethod From e3a19c41731cf2ac9181987ea587df56df294530 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 20 May 2022 11:04:12 -0400 Subject: [PATCH 14/25] Trying to use the RTD env varaible to limit the dependencies --- setup.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/setup.py b/setup.py index 4c0b5cdfd..c46059ef7 100644 --- a/setup.py +++ b/setup.py @@ -16,6 +16,22 @@ version = "2.1" +is_rtd = os.environ['READTHEDOCS'] +print(is_rtd) +if is_rtd: + reqs = [] +else: + reqs = [ + "cadquery-ocp", + "ezdxf", + "multimethod", + "nlopt", + "nptyping>=2", + "typish", + "casadi", + "path", + ] + setup( name="cadquery", version=version, @@ -27,16 +43,7 @@ long_description=open("README.md").read(), packages=find_packages(exclude=("tests",)), python_requires=">=3.8,<3.11", - install_requires=[ - "cadquery-ocp", - "ezdxf", - "multimethod", - "nlopt", - "nptyping>=2", - "typish", - "casadi", - "path", - ], + install_requires=reqs, extras_require={ "dev": ["docutils", "ipython", "pytest", "black==19.10b0", "click==8.0.4",], "ipython": ["ipython",], From 44413e5a6d83d46bc4e315eb10a8847a161a8d0c Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 20 May 2022 11:38:14 -0400 Subject: [PATCH 15/25] Trying to protect against the env variable not being present --- setup.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index c46059ef7..6a7faf3d9 100644 --- a/setup.py +++ b/setup.py @@ -16,11 +16,14 @@ version = "2.1" -is_rtd = os.environ['READTHEDOCS'] +reqs = [] + +is_rtd = False +if "READTHEDOCS" in os.environ: + is_rtd = os.environ['READTHEDOCS'] + print(is_rtd) -if is_rtd: - reqs = [] -else: +if not is_rtd: reqs = [ "cadquery-ocp", "ezdxf", From ddceab10251a679afa6f5cecb8f312216cb7b739 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 20 May 2022 14:05:03 -0400 Subject: [PATCH 16/25] Black formatting and AppVeyor handling --- setup.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 6a7faf3d9..6a62be9ce 100644 --- a/setup.py +++ b/setup.py @@ -18,12 +18,16 @@ reqs = [] +# ReadTheDocs and AppVeyor will break if we do not handle the separately is_rtd = False +is_appveyor = False if "READTHEDOCS" in os.environ: - is_rtd = os.environ['READTHEDOCS'] + is_rtd = os.environ["READTHEDOCS"] +if "APPVEYOR" in os.environ: + is_appveyor = os.environ["APPVEYOR"] -print(is_rtd) -if not is_rtd: +# Only include the installation dependencies if we are not running on RTD or AppVeyor +if not is_rtd and not is_appveyor: reqs = [ "cadquery-ocp", "ezdxf", From 58b28105a97fdd118dc19336054a367c75542e3b Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 20 May 2022 15:20:06 -0400 Subject: [PATCH 17/25] Added scm version tracking --- cadquery/__init__.py | 8 ++++++++ setup.py | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cadquery/__init__.py b/cadquery/__init__.py index 4645a3d88..37dbdce6b 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 + pass + # these items point to the OCC implementation from .occ_impl.geom import Plane, BoundBox, Vector, Matrix, Location from .occ_impl.shapes import ( diff --git a/setup.py b/setup.py index 6a62be9ce..cd59eea2d 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,8 @@ setup( name="cadquery", - version=version, + # version=version, + use_scm_version=True, url="https://github.com/CadQuery/cadquery", license="Apache Public License 2.0", author="David Cowden", @@ -50,6 +51,7 @@ long_description=open("README.md").read(), packages=find_packages(exclude=("tests",)), python_requires=">=3.8,<3.11", + setup_requires=["setuptools_scm"], install_requires=reqs, extras_require={ "dev": ["docutils", "ipython", "pytest", "black==19.10b0", "click==8.0.4",], From d09334c66d28bb2947c8344f6198891c104cf277 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 20 May 2022 15:57:10 -0400 Subject: [PATCH 18/25] Trying to fix package errors in CI with another selective require --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index cd59eea2d..56ce2cf2d 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,7 @@ version = "2.1" reqs = [] +setup_reqs = [] # ReadTheDocs and AppVeyor will break if we do not handle the separately is_rtd = False @@ -39,6 +40,8 @@ "path", ] + setup_reqs = ["setuptools_scm"] + setup( name="cadquery", # version=version, @@ -51,7 +54,7 @@ long_description=open("README.md").read(), packages=find_packages(exclude=("tests",)), python_requires=">=3.8,<3.11", - setup_requires=["setuptools_scm"], + setup_requires=setup_reqs, install_requires=reqs, extras_require={ "dev": ["docutils", "ipython", "pytest", "black==19.10b0", "click==8.0.4",], From 7197eeaf614cd3ef452ec8857a9623b7ebe43eac Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 20 May 2022 16:31:50 -0400 Subject: [PATCH 19/25] Ignoring SCM version reqs for Azure --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 56ce2cf2d..7f48cda54 100644 --- a/setup.py +++ b/setup.py @@ -22,13 +22,16 @@ # ReadTheDocs and AppVeyor will break if we do not handle the separately is_rtd = False is_appveyor = False +is_azure = False if "READTHEDOCS" in os.environ: is_rtd = os.environ["READTHEDOCS"] if "APPVEYOR" in os.environ: is_appveyor = os.environ["APPVEYOR"] +if "TF_BUILD" in os.environ: + is_azure = os.environ["TF_BUILD"] # Only include the installation dependencies if we are not running on RTD or AppVeyor -if not is_rtd and not is_appveyor: +if not is_rtd and not is_appveyor and not is_azure: reqs = [ "cadquery-ocp", "ezdxf", From dafd8e7e2f9d0820944e7c56785a70965f343f04 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 20 May 2022 16:57:42 -0400 Subject: [PATCH 20/25] Trying to find an environment variable that is available --- setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 7f48cda54..a2d25e8d0 100644 --- a/setup.py +++ b/setup.py @@ -27,8 +27,10 @@ is_rtd = os.environ["READTHEDOCS"] if "APPVEYOR" in os.environ: is_appveyor = os.environ["APPVEYOR"] -if "TF_BUILD" in os.environ: - is_azure = os.environ["TF_BUILD"] +if "System.TeamProjectId" in os.environ: + is_azure = True +print("System.TeamProjectId" in os.environ) +print("TF_BUILD" 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: From e23d8a9d3efc169af1b09abd3c4ce4b696f9dbce Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 20 May 2022 19:51:43 -0400 Subject: [PATCH 21/25] Printing os.environ to see what is available in Pipelines --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index a2d25e8d0..43c448ca9 100644 --- a/setup.py +++ b/setup.py @@ -29,8 +29,7 @@ is_appveyor = os.environ["APPVEYOR"] if "System.TeamProjectId" in os.environ: is_azure = True -print("System.TeamProjectId" in os.environ) -print("TF_BUILD" in os.environ) +print(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: From 147206394769e6baad0a6c529509c841bcf3afaa Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 20 May 2022 20:35:51 -0400 Subject: [PATCH 22/25] Trying yet another environment variable for Azure --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 43c448ca9..58f0c5bca 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ is_rtd = os.environ["READTHEDOCS"] if "APPVEYOR" in os.environ: is_appveyor = os.environ["APPVEYOR"] -if "System.TeamProjectId" in os.environ: +if "CONDA_PY" in os.environ: is_azure = True print(os.environ) From 7164898aa0aa07b254ba0948aeb2bb01c6cb9ae1 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 20 May 2022 21:40:52 -0400 Subject: [PATCH 23/25] Streamlining the code a little bit --- setup.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/setup.py b/setup.py index 58f0c5bca..0445b466c 100644 --- a/setup.py +++ b/setup.py @@ -19,17 +19,10 @@ reqs = [] setup_reqs = [] -# ReadTheDocs and AppVeyor will break if we do not handle the separately -is_rtd = False -is_appveyor = False -is_azure = False -if "READTHEDOCS" in os.environ: - is_rtd = os.environ["READTHEDOCS"] -if "APPVEYOR" in os.environ: - is_appveyor = os.environ["APPVEYOR"] -if "CONDA_PY" in os.environ: - is_azure = True -print(os.environ) +# 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: From 162e3c5cc13b9e2518882c7d6bede37b53e589bf Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Sun, 22 May 2022 13:34:00 -0400 Subject: [PATCH 24/25] Trying without the version number in setup.py --- cadquery/__init__.py | 2 +- setup.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/cadquery/__init__.py b/cadquery/__init__.py index 37dbdce6b..4c411bd28 100644 --- a/cadquery/__init__.py +++ b/cadquery/__init__.py @@ -1,7 +1,7 @@ from importlib.metadata import version, PackageNotFoundError try: - version__ = version("cadquery") + __version__ = version("cadquery") except PackageNotFoundError: # package is not installed pass diff --git a/setup.py b/setup.py index 0445b466c..2da6c19d1 100644 --- a/setup.py +++ b/setup.py @@ -14,8 +14,6 @@ import os from setuptools import setup, find_packages -version = "2.1" - reqs = [] setup_reqs = [] @@ -41,7 +39,6 @@ setup( name="cadquery", - # version=version, use_scm_version=True, url="https://github.com/CadQuery/cadquery", license="Apache Public License 2.0", From 7cff17077349ecba86203969a8cbc35e07023236 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Mon, 23 May 2022 09:36:01 -0400 Subject: [PATCH 25/25] Removed hard-coded version number in __init__.py --- cadquery/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cadquery/__init__.py b/cadquery/__init__.py index 4c411bd28..42b888b36 100644 --- a/cadquery/__init__.py +++ b/cadquery/__init__.py @@ -4,7 +4,7 @@ __version__ = version("cadquery") except PackageNotFoundError: # package is not installed - pass + __version__ = "2.2-dev" # these items point to the OCC implementation from .occ_impl.geom import Plane, BoundBox, Vector, Matrix, Location @@ -77,5 +77,3 @@ "plugins", "Sketch", ] - -__version__ = "2.1"