kopia lustrzana https://gitlab.com/gerbolyze/gerbonara
Merge branch 'master' into multilayer
commit
d5d618f058
|
@ -0,0 +1,26 @@
|
|||
name: pcb-tools
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements-dev.txt
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
pip install pytest
|
||||
pytest
|
21
.travis.yml
21
.travis.yml
|
@ -1,21 +0,0 @@
|
|||
dist: precise
|
||||
language: python
|
||||
python:
|
||||
- "2.7"
|
||||
- "3.3"
|
||||
- "3.4"
|
||||
- "3.5"
|
||||
|
||||
# command to install dependencies
|
||||
install:
|
||||
- "pip install -r requirements.txt"
|
||||
- "pip install -r test-requirements.txt"
|
||||
- "pip install coveralls"
|
||||
|
||||
# command to run tests
|
||||
script:
|
||||
- make test-coverage
|
||||
|
||||
# Coveralls
|
||||
after_success:
|
||||
- coveralls
|
|
@ -48,11 +48,11 @@ Documentation:
|
|||
Development and Testing:
|
||||
------------------------
|
||||
|
||||
Dependencies for developing and testing pcb-tools are listed in test-requirements.txt. Use of a virtual environment is strongly recommended.
|
||||
Dependencies for developing and testing pcb-tools are listed in requirements-dev.txt. Use of a virtual environment is strongly recommended.
|
||||
|
||||
$ virtualenv venv
|
||||
$ source venv/bin/activate
|
||||
(venv)$ pip install -r test-requirements.txt
|
||||
(venv)$ pip install -r requirements-dev.txt
|
||||
(venv)$ pip install -e .
|
||||
|
||||
We use nose to run pcb-tools's suite of unittests and doctests.
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
# Doc requirements
|
||||
Sphinx==1.2.3
|
||||
numpydoc==0.5
|
||||
|
|
@ -23,6 +23,7 @@ Excellon Statements
|
|||
|
||||
import re
|
||||
import uuid
|
||||
import itertools
|
||||
from .utils import (parse_gerber_value, write_gerber_value, decimal_string,
|
||||
inch, metric)
|
||||
|
||||
|
@ -151,8 +152,7 @@ class ExcellonTool(ExcellonStatement):
|
|||
tool : Tool
|
||||
An ExcellonTool representing the tool defined in `line`
|
||||
"""
|
||||
commands = re.split('([BCFHSTZ])', line)[1:]
|
||||
commands = [(command, value) for command, value in pairwise(commands)]
|
||||
commands = pairwise(re.split('([BCFHSTZ])', line)[1:])
|
||||
args = {}
|
||||
args['id'] = id
|
||||
nformat = settings.format
|
||||
|
@ -973,6 +973,7 @@ def pairwise(iterator):
|
|||
|
||||
e.g. [1, 2, 3, 4, 5, 6] ==> [(1, 2), (3, 4), (5, 6)]
|
||||
"""
|
||||
itr = iter(iterator)
|
||||
while True:
|
||||
yield tuple([next(itr) for i in range(2)])
|
||||
a, b = itertools.tee(iterator)
|
||||
itr = zip(itertools.islice(a, 0, None, 2), itertools.islice(b, 1, None, 2))
|
||||
for elem in itr:
|
||||
yield elem
|
||||
|
|
|
@ -123,6 +123,10 @@ def write_gerber_value(value, format=(2, 5), zero_suppression='trailing'):
|
|||
value : string
|
||||
The specified value as a Gerber/Excellon-formatted string.
|
||||
"""
|
||||
|
||||
if format[0] == float:
|
||||
return "%f" %value
|
||||
|
||||
# Format precision
|
||||
integer_digits, decimal_digits = format
|
||||
MAX_DIGITS = integer_digits + decimal_digits
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
# install base requirements
|
||||
-r requirements.txt
|
||||
|
||||
coverage==4.5.4
|
||||
nose==1.3.7
|
|
@ -0,0 +1,6 @@
|
|||
# install base requirements
|
||||
-r requirements.txt
|
||||
|
||||
# documentation generation support
|
||||
Sphinx==2.2.1
|
||||
numpydoc==0.9.1
|
|
@ -1,2 +1,2 @@
|
|||
## The following requirements were added by pip --freeze:
|
||||
# cairo rendering support
|
||||
cairocffi==0.6
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
# Test requirements
|
||||
cairocffi==0.6
|
||||
coverage==3.7.1
|
||||
nose==1.3.4
|
Ładowanie…
Reference in New Issue