From dbd92e58c91ec9d4447749c6c9b4212b96a84e44 Mon Sep 17 00:00:00 2001 From: C4dmium <41113988+MarinMikael@users.noreply.github.com> Date: Thu, 1 Aug 2019 22:25:01 +0900 Subject: Update utils.py --- gerber/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gerber/utils.py b/gerber/utils.py index 817a36e..3d39df9 100644 --- a/gerber/utils.py +++ b/gerber/utils.py @@ -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 -- cgit From c08457f7addf2001f07fac5d30091b33b3ddcb0c Mon Sep 17 00:00:00 2001 From: C4dmium <41113988+MarinMikael@users.noreply.github.com> Date: Thu, 1 Aug 2019 22:26:06 +0900 Subject: Update excellon_statements.py --- gerber/excellon_statements.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gerber/excellon_statements.py b/gerber/excellon_statements.py index bcf35e4..2c50ef9 100644 --- a/gerber/excellon_statements.py +++ b/gerber/excellon_statements.py @@ -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 -- cgit From 2cfe65700066030578f7fbc4f90176a0fb26a688 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sun, 24 Nov 2019 17:07:48 -0500 Subject: Add support for latest Python releases --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7525487..4906456 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,13 @@ -dist: precise +dist: xenial language: python python: - "2.7" - "3.3" - "3.4" - "3.5" + - "3.6" + - "3.7" + - "3.8" # command to install dependencies install: -- cgit From c87bad8dedc0ea2a52171840d24451e2117c8325 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sun, 24 Nov 2019 17:10:43 -0500 Subject: Drop end of life Python 3.3 --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4906456..725a0b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ dist: xenial language: python python: - "2.7" - - "3.3" - "3.4" - "3.5" - "3.6" -- cgit From e5094c04a785e10aefc306d86755fcc57f39fc34 Mon Sep 17 00:00:00 2001 From: Paulo Henrique Silva Date: Mon, 25 Nov 2019 15:34:10 -0300 Subject: Rename requirements for docs and dev and upgrade nose and coverage packages --- README.md | 4 ++-- doc-requirements.txt | 4 ---- requirements-dev.txt | 5 +++++ requirements-docs.txt | 6 ++++++ requirements.txt | 2 +- test-requirements.txt | 4 ---- 6 files changed, 14 insertions(+), 11 deletions(-) delete mode 100644 doc-requirements.txt create mode 100644 requirements-dev.txt create mode 100644 requirements-docs.txt delete mode 100644 test-requirements.txt diff --git a/README.md b/README.md index f741f80..42c90f4 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/doc-requirements.txt b/doc-requirements.txt deleted file mode 100644 index a163c9b..0000000 --- a/doc-requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Doc requirements -Sphinx==1.2.3 -numpydoc==0.5 - diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..c1e695d --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,5 @@ +# install base requirements +-r requirements.txt + +coverage==4.5.4 +nose==1.3.7 diff --git a/requirements-docs.txt b/requirements-docs.txt new file mode 100644 index 0000000..a2cc5a1 --- /dev/null +++ b/requirements-docs.txt @@ -0,0 +1,6 @@ +# install base requirements +-r requirements.txt + +# documentation generation support +Sphinx==1.2.3 +numpydoc==0.5 diff --git a/requirements.txt b/requirements.txt index a7f5f01..1f769f2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -## The following requirements were added by pip --freeze: +# cairo rendering support cairocffi==0.6 diff --git a/test-requirements.txt b/test-requirements.txt deleted file mode 100644 index 826da33..0000000 --- a/test-requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Test requirements -cairocffi==0.6 -coverage==3.7.1 -nose==1.3.4 -- cgit From 2b6ea5ead81ac069452d73e00f3b19d4325611d0 Mon Sep 17 00:00:00 2001 From: Paulo Henrique Silva Date: Mon, 25 Nov 2019 15:34:37 -0300 Subject: Upgrade for new requirements-dev.txt --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7525487..d4c40c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,7 @@ python: # command to install dependencies install: - - "pip install -r requirements.txt" - - "pip install -r test-requirements.txt" + - "pip install -r requirements-dev.txt" - "pip install coveralls" # command to run tests -- cgit From 5afe26d124d2ff1266586e4edea36877d67eb576 Mon Sep 17 00:00:00 2001 From: Paulo Henrique Silva Date: Mon, 25 Nov 2019 15:56:42 -0300 Subject: Create pythonapp.yml --- .github/workflows/pythonapp.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/pythonapp.yml diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml new file mode 100644 index 0000000..fe097ab --- /dev/null +++ b/.github/workflows/pythonapp.yml @@ -0,0 +1,22 @@ +name: pcb-tools + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - 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 -- cgit From 5d05e7db8ee6d55e90bccad2efecfd7eb7f145fa Mon Sep 17 00:00:00 2001 From: Paulo Henrique Silva Date: Mon, 25 Nov 2019 16:10:33 -0300 Subject: Update and rename pythonapp.yml to pcb-tools.yml --- .github/workflows/pcb-tools.yml | 26 ++++++++++++++++++++++++++ .github/workflows/pythonapp.yml | 22 ---------------------- 2 files changed, 26 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/pcb-tools.yml delete mode 100644 .github/workflows/pythonapp.yml diff --git a/.github/workflows/pcb-tools.yml b/.github/workflows/pcb-tools.yml new file mode 100644 index 0000000..d125a46 --- /dev/null +++ b/.github/workflows/pcb-tools.yml @@ -0,0 +1,26 @@ +name: pcb-tools + +on: [push, pull_request] + +jobs: + build: + strategy: + matrix: + python: [3.7] + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: ${matrix.python} + - 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 diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml deleted file mode 100644 index fe097ab..0000000 --- a/.github/workflows/pythonapp.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: pcb-tools - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - name: Set up Python 3.7 - uses: actions/setup-python@v1 - with: - python-version: 3.7 - - 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 -- cgit From 3602ce4d684b7ddfd2f8c825c72414cdbbd20775 Mon Sep 17 00:00:00 2001 From: Paulo Henrique Silva Date: Mon, 25 Nov 2019 16:16:35 -0300 Subject: Update pcb-tools.yml --- .github/workflows/pcb-tools.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pcb-tools.yml b/.github/workflows/pcb-tools.yml index d125a46..8f52f00 100644 --- a/.github/workflows/pcb-tools.yml +++ b/.github/workflows/pcb-tools.yml @@ -6,7 +6,7 @@ jobs: build: strategy: matrix: - python: [3.7] + python-version: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8] runs-on: ubuntu-latest @@ -15,7 +15,7 @@ jobs: - name: Set up Python 3.7 uses: actions/setup-python@v1 with: - python-version: ${matrix.python} + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip -- cgit From 79428db321ff0b78edd183dd8586580b4e93f58f Mon Sep 17 00:00:00 2001 From: Paulo Henrique Silva Date: Mon, 25 Nov 2019 16:19:10 -0300 Subject: Update pcb-tools.yml --- .github/workflows/pcb-tools.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pcb-tools.yml b/.github/workflows/pcb-tools.yml index 8f52f00..6164c4a 100644 --- a/.github/workflows/pcb-tools.yml +++ b/.github/workflows/pcb-tools.yml @@ -1,18 +1,18 @@ name: pcb-tools -on: [push, pull_request] +on: [push] jobs: - build: + test: strategy: matrix: - python-version: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8] + 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 3.7 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} -- cgit From db54393f4e01a037c8a9611680267facc2347e98 Mon Sep 17 00:00:00 2001 From: Paulo Henrique Silva Date: Mon, 25 Nov 2019 16:31:41 -0300 Subject: Remove travis, coverage still missing on gh actions --- .travis.yml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1226075..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -dist: xenial -language: python -python: - - "2.7" - - "3.4" - - "3.5" - - "3.6" - - "3.7" - - "3.8" - -# command to install dependencies -install: - - "pip install -r requirements-dev.txt" - - "pip install coveralls" - -# command to run tests -script: - - make test-coverage - -# Coveralls -after_success: - - coveralls -- cgit From d54bdf37699aad423d5e572f6ff351b5840b29fd Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2019 21:09:59 +0000 Subject: Bump numpydoc from 0.5 to 0.9.1 Bumps [numpydoc](https://github.com/numpy/numpydoc) from 0.5 to 0.9.1. - [Release notes](https://github.com/numpy/numpydoc/releases) - [Commits](https://github.com/numpy/numpydoc/compare/v0.5...v0.9.1) Signed-off-by: dependabot-preview[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index a2cc5a1..27b3ae8 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -3,4 +3,4 @@ # documentation generation support Sphinx==1.2.3 -numpydoc==0.5 +numpydoc==0.9.1 -- cgit From e952aedbc3b71b45c15383c89c1f1f31cbb99178 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2019 21:10:40 +0000 Subject: Bump sphinx from 1.2.3 to 2.2.1 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 1.2.3 to 2.2.1. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v1.2.3...v2.2.1) Signed-off-by: dependabot-preview[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index a2cc5a1..25c8c2c 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -2,5 +2,5 @@ -r requirements.txt # documentation generation support -Sphinx==1.2.3 +Sphinx==2.2.1 numpydoc==0.5 -- cgit From cee1fcff3ac8c15e8888dd0d4738c3c7f1db196d Mon Sep 17 00:00:00 2001 From: Paulo Henrique Silva Date: Mon, 25 Nov 2019 23:40:59 -0300 Subject: Run workflow checks on PRs --- .github/workflows/pcb-tools.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pcb-tools.yml b/.github/workflows/pcb-tools.yml index 6164c4a..85038a7 100644 --- a/.github/workflows/pcb-tools.yml +++ b/.github/workflows/pcb-tools.yml @@ -1,6 +1,6 @@ name: pcb-tools -on: [push] +on: [push, pull_request] jobs: test: -- cgit