Skip to content
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

MyPy in CI [WIP] #378

Merged
merged 22 commits into from
Jun 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .coverage

This file was deleted.

7 changes: 7 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[run]
branch = True

[report]
exclude_lines =
# Ignore stub body
\.\.\.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ matrix:
os: linux
script:
- black . --diff --check
- mypy cadquery

before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
Expand All @@ -54,7 +55,8 @@ before_install:
- conda config --set always_yes yes --set changeps1 no;
- conda env create -f environment.yml
- source ~/miniconda/bin/activate cadquery
- conda install -c conda-forge -c defaults -c cadquery python=$PYTHON_VERSION
- conda install -c conda-forge -c defaults -c cadquery python=$PYTHON_VERSION mypy
- pip install git+https://github.com/CadQuery/OCP-stubs.git

install:
- python setup.py install
Expand Down
10 changes: 2 additions & 8 deletions cadquery/occ_impl/exporters.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
import os
import sys

if sys.version_info.major == 2:
import cStringIO as StringIO
else:
import io as StringIO
import io as StringIO

from .shapes import Shape, Compound, TOLERANCE
from .geom import BoundBox
Expand All @@ -20,10 +17,7 @@
from OCP.HLRAlgo import HLRAlgo_Projector
from OCP.GCPnts import GCPnts_QuasiUniformDeflection

try:
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
import xml.etree.cElementTree as ET

DISCRETIZATION_TOLERANCE = 1e-3
DEFAULT_DIR = gp_Dir(-1.75, 1.1, 5)
Expand Down
Loading