Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Commit

Permalink
Merge pull request #248 from adam-urbanczyk/master
Browse files Browse the repository at this point in the history
Implement CI on Windows
  • Loading branch information
dcowden committed Mar 27, 2018
2 parents 146ae81 + 45b6e1a commit 66054b0
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 17 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ What is a CadQuery?
========================================

[![Travis Build Status](https://travis-ci.org/dcowden/cadquery.svg?branch=master)](https://travis-ci.org/dcowden/cadquery?branch=master)
[![Build status](https://ci.appveyor.com/api/projects/status/c7u4yjl8xxlokrw0/branch/master?svg=true)](https://ci.appveyor.com/project/jmwright/cadquery/branch/master)
[![Coverage Status](https://coveralls.io/repos/github/dcowden/cadquery/badge.svg?branch=master)](https://coveralls.io/github/dcowden/cadquery?branch=master)
[![GitHub version](https://d25lcipzij17d.cloudfront.net/badge.svg?id=gh&type=6&v=1.1.0&x2=0)](https://github.com/dcowden/cadquery/releases/tag/v1.1.0)
[![License](https://img.shields.io/badge/license-Apache2-blue.svg)](https://github.com/dcowden/cadquery/blob/master/LICENSE)
Expand Down
21 changes: 21 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
build: false
shallow_clone: true

platform:
- x64

environment:
matrix:
- PYTHON_VERSION: 3.6
MINICONDA_DIRNAME: C:\Miniconda36-x64

install:
- set "PATH=%MINICONDA_DIRNAME%;%MINICONDA_DIRNAME%\\Scripts;%PATH%"
- conda config --set always_yes yes
- conda update -q conda
- conda create --quiet --name cqtest -c freecad -c conda-forge python=%PYTHON_VERSION% freecad=0.17=py36_vc14_13 occt=7.2.0 python=3.6 pyparsing mock
- activate cqtest
- python setup.py install

test_script:
- python runtests.py
14 changes: 10 additions & 4 deletions cadquery/freecad_impl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,16 @@ def _fc_path():

# Try to guess if using Anaconda
if 'env' in sys.prefix:
_PATH = os.path.join(sys.prefix,'lib')
# return PATH if FreeCAD.[so,pyd] is present
if len(glob.glob(os.path.join(_PATH,'FreeCAD.*'))) > 0:
return _PATH
if sys.platform.startswith('linux'):
_PATH = os.path.join(sys.prefix,'lib')
# return PATH if FreeCAD.[so,pyd] is present
if len(glob.glob(os.path.join(_PATH,'FreeCAD.so'))) > 0:
return _PATH
elif sys.platform.startswith('win'):
_PATH = os.path.join(sys.prefix,'Library','bin')
# return PATH if FreeCAD.[so,pyd] is present
if len(glob.glob(os.path.join(_PATH,'FreeCAD.pyd'))) > 0:
return _PATH

if sys.platform.startswith('linux'):
# Make some dangerous assumptions...
Expand Down
8 changes: 2 additions & 6 deletions tests/TestCadQuery.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
#system modules
import math,sys,os.path,time
import math,os.path,time,tempfile

#my modules
from cadquery import *
Expand All @@ -19,11 +19,7 @@
from cadquery.freecad_impl import suppress_stdout_stderr

#where unit test output will be saved
import sys
if sys.platform.startswith("win"):
OUTDIR = "c:/temp"
else:
OUTDIR = "/tmp"
OUTDIR = tempfile.gettempdir()
SUMMARY_FILE = os.path.join(OUTDIR,"testSummary.html")

SUMMARY_TEMPLATE="""<html>
Expand Down
9 changes: 2 additions & 7 deletions tests/TestImporters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Tests file importers such as STEP
"""
#core modules
import io
import tempfile

from cadquery import *
from cadquery import exporters
Expand All @@ -11,12 +11,7 @@
from tests import BaseTest

#where unit test output will be saved
import sys
if sys.platform.startswith("win"):
OUTDIR = "c:/temp"
else:
OUTDIR = "/tmp"

OUTDIR = tempfile.gettempdir()

class TestImporters(BaseTest):
def importBox(self, importType, fileName):
Expand Down

0 comments on commit 66054b0

Please sign in to comment.