-
Notifications
You must be signed in to change notification settings - Fork 20
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
[WIP] Upgrade for python 3 #7
Open
willprice
wants to merge
94
commits into
drepetto:master
Choose a base branch
from
willprice:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
94 commits
Select commit
Hold shift + click to select a range
b8ff8fb
Remove DS_Store
willprice 2c017fd
Run 2to3 and manually fix @apply decorators
willprice ef83357
Ignore pytest cache dir
willprice fa9490e
Add requirements.txt
willprice e0c8f8d
Fix chiplotele.tools.io.export errors
willprice 6e9de3c
Fix relativise type check
willprice a4d4f02
Fix virtual_serial_port maxint -> maxsize
willprice fc6af5a
Fix LayerVisitor tests
willprice 732735c
Update division methods of CoordinateArray to Python 3
willprice 0c0527f
Fix broken pens_updown_to_papr method (fix by @victoradan)
willprice b2ebfe6
Pasteurize lib to attempt to make py2/3 compatible
willprice b73931a
Add circleci config, makefile and tox support
willprice 9c81d2e
Add build status badge to README
willprice 67e3325
Fix chiplotle config file coding line
willprice a86feee
Fix cirleci config
willprice c1f5493
Add docs and pypi badge
willprice f5f3dbb
Ditch requirements-dev.txt keep everything in requirements.txt
willprice 3789e7e
Use RTD docs theme, extract version to __version__.py, fix docs Makef…
willprice 0f7662b
Add joe generated gitignore file
willprice b63d355
Fix venv creation bug in circleci config for py27
willprice c68d502
Reorder doc index and rename Chiplotle API page to API
willprice d7107d3
Fix circleci bug: parsing python version with multiple digits
willprice 35d7235
Fix failing python 2 tests due to unicode literals
willprice 1a75f93
Fix inflate_hpgl_string tests
willprice 1fb63aa
Fix hpgl parsing python 2 test failures
willprice 25e71db
Fix more test failures due to unicode literals and pytest.raises
willprice a7fa64e
Fix remaining broken python 2 tests relying on str instance checks
willprice 9e8d89e
Fix last instance of isinstance check that uses str
willprice 54561b1
Run black formatter on lib
willprice 90baf11
Import __version__.* constants into __init__
willprice e8ff1a1
Run black on setup.py
willprice 612bc97
Add classifiers and break up keywords in setup.py
willprice 385f745
Attempt to fix RTD build by copying chiplotle config
willprice 5153776
Add coverage
willprice 28e75d5
Add code coverage status badge to README.md
willprice 306ea01
Include README.md in MANIFEST, update INSTALL file suffix to rst
willprice e2e8871
Remove unused test script
willprice 89927de
Move chiplotle package dir to subfolder, add coverage support
willprice 475a193
Move docs up to root dir
willprice 4133c2b
Attempt to fix circleci failure due to no being able to import chiplotle
willprice 279d757
Fix print syntax in dynamically python code in strings
willprice 9e4aea7
Print __version__ imported from __init__ not chiplotle.core.cfg.cfg
willprice c01fc1b
Specify serial commands as byte strings in what_plotter_in_port.py
willprice f09e60b
Add future dependency to setup.py
willprice eb69e7c
Bump pyserial version dep to >=3.0
willprice 99bd178
Fix __clas__ typo in _ChiplotleError
willprice b4c8264
Add warning discouraging usage to README
willprice c4cece2
Move examples to top level
willprice 1d1c52f
Correct some spelling issues in quick start tutorial
willprice 3c984c4
Spell check and code fix shapes tutorial
willprice 0c35f4c
Spell check fundamentals page
willprice b96529c
Replace windowz -> windows in docs
willprice fa5b063
Spell check faq
willprice 672450f
Force bytes not unicode in serial and baseplotter
willprice e676797
First stab at python 3 compatibility
willprice 30e9665
Fix python 2 test regressions
willprice 23007ab
Force allowedHPGLCommands to be bytes by protecting with property
willprice 0db03e8
Add DXY1100 and DXY1200 plotters
willprice c1db469
Add pre-commit hooks config
willprice 026e70e
Fix DXY-1100/1200 config
willprice a0f2843
Fix abstract_masterpiece_file example
willprice 9aabe97
Fix io.view to work with linux versions other than 2
willprice 7a701cf
Throw more helpful error when accidentially instantiating coordinate …
willprice 37a4062
Revert raising ValueError on CoordinateArray being passed anything bu…
willprice 4006c59
Throw more helpful error message on saving hpgl
willprice de06b96
Refactor abstract masterpiece example
willprice a61e2c2
Pin pytest to latest version 3.7.4
pyup-bot 8e4e917
Pin pytest-cov to latest version 2.5.1
pyup-bot fea2864
Pin tox to latest version 3.2.1
pyup-bot fc09066
Update numpy from 1.15.0 to 1.15.1
pyup-bot 36d7074
Merge pull request #1 from willprice/pyup-initial-update
willprice 4398899
Clean up imports + delete some dead code from interactive_commands.py
willprice 53a012f
Update pytest imports from py.test to pytest
willprice 7ffe19a
Convert old pytest raises(Error, "python code") usage to modern with-…
willprice 12b9251
Add codacy badge
willprice 48036c3
Update future from 0.16.0 to 0.17.1
pyup-bot 78ff9a7
Update pytest-cov from 2.5.1 to 2.6.1
pyup-bot 766eee6
Update tox from 3.2.1 to 3.7.0
pyup-bot b161dc3
Update pytest from 3.7.4 to 4.1.1
pyup-bot 855ac5c
Update numpy from 1.15.1 to 1.16.0
pyup-bot 778df02
Merge pull request #27 from willprice/pyup-update-tox-3.2.1-to-3.7.0
willprice 7faf703
Merge pull request #16 from willprice/pyup-update-future-0.16.0-to-0.…
willprice 80be4a2
Merge branch 'master' into pyup-update-pytest-cov-2.5.1-to-2.6.1
willprice b405e24
Merge pull request #28 from willprice/pyup-update-pytest-3.7.4-to-4.1.1
willprice abc32cc
Merge branch 'master' into pyup-update-numpy-1.15.1-to-1.16.0
willprice 57b2708
Merge pull request #29 from willprice/pyup-update-numpy-1.15.1-to-1.16.0
willprice ccc0abe
Merge branch 'master' into pyup-update-pytest-cov-2.5.1-to-2.6.1
willprice e7c018a
Merge pull request #26 from willprice/pyup-update-pytest-cov-2.5.1-to…
willprice 9be9b0a
Remove WIP note
willprice 6cd1c8d
Update pytest from 4.1.1 to 4.3.0
pyup-bot ba7c3a2
Update numpy from 1.16.0 to 1.16.2
pyup-bot 19fcc2b
Merge pull request #34 from willprice/pyup-update-numpy-1.16.0-to-1.16.2
willprice 24eced1
Merge branch 'master' into pyup-update-pytest-4.1.1-to-4.3.0
willprice e8a65b5
Merge pull request #33 from willprice/pyup-update-pytest-4.1.1-to-4.3.0
willprice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Python CircleCI 2.0 configuration file | ||
# | ||
# Check https://circleci.com/docs/2.0/language-python/ for more details | ||
version: 2 | ||
|
||
shared: &shared | ||
working_directory: ~/repo | ||
steps: | ||
- checkout | ||
|
||
- run: | ||
name: Install dependencies | ||
command: | | ||
if [[ ${PYTHON_VERSION} == 2* ]]; then | ||
mkdir .venv | ||
virtualenv .venv | ||
else | ||
python3 -m venv .venv | ||
fi | ||
source .venv/bin/activate | ||
|
||
sudo apt install hp2xx | ||
pip install tox | ||
pip install codecov | ||
pip install -r requirements.txt | ||
|
||
- run: | ||
name: Set up chiplotle | ||
command: | | ||
source .venv/bin/activate | ||
cd src | ||
(yes || true) | python -c "import chiplotle" | ||
|
||
- run: | ||
name: Run tests | ||
command: | | ||
source .venv/bin/activate | ||
# If we don't specify the python version then the default | ||
# 3.5 version that is part of all images is run which causes | ||
# issues. | ||
TOX_ENV="$(echo ${PYTHON_VERSION} | sed -E 's/([[:digit:]]+).([[:digit:]]+).([[:digit:]]+)/py\1\2/')" | ||
PYTHONPATH="$PWD" tox -e "$TOX_ENV" | ||
codecov | ||
|
||
jobs: | ||
py2.7: | ||
<<: *shared | ||
docker: | ||
- image: circleci/python:2.7 | ||
py3.5: | ||
<<: *shared | ||
docker: | ||
- image: circleci/python:3.5 | ||
py3.6: | ||
<<: *shared | ||
docker: | ||
- image: circleci/python:3.6 | ||
py3.7: | ||
<<: *shared | ||
docker: | ||
- image: circleci/python:3.7 | ||
|
||
workflows: | ||
version: 2 | ||
test: | ||
jobs: | ||
- py2.7 | ||
- py3.5 | ||
- py3.6 | ||
- py3.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[run] | ||
branch = true | ||
source = chiplotle | ||
omit = */test*.py | ||
|
||
[paths] | ||
source = | ||
chiplotle | ||
.tox/*/lib/python*/site-packages/chiplotle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,163 @@ | ||
*.pyc | ||
*.egg-info | ||
_venv* | ||
#### joe made this: http://goel.io/joe | ||
|
||
#####=== JetBrains ===##### | ||
# User-specific stuff | ||
.idea/**/workspace.xml | ||
.idea/**/tasks.xml | ||
.idea/**/usage.statistics.xml | ||
.idea/**/dictionaries | ||
.idea/**/shelf | ||
|
||
# Sensitive or high-churn files | ||
.idea/**/dataSources/ | ||
.idea/**/dataSources.ids | ||
.idea/**/dataSources.local.xml | ||
.idea/**/sqlDataSources.xml | ||
.idea/**/dynamic.xml | ||
.idea/**/uiDesigner.xml | ||
.idea/**/dbnavigator.xml | ||
|
||
# Gradle | ||
.idea/**/gradle.xml | ||
.idea/**/libraries | ||
|
||
# CMake | ||
cmake-build-*/ | ||
|
||
# Mongo Explorer plugin | ||
.idea/**/mongoSettings.xml | ||
|
||
# File-based project format | ||
*.iws | ||
|
||
# IntelliJ | ||
out/ | ||
|
||
# mpeltonen/sbt-idea plugin | ||
.idea_modules/ | ||
|
||
# JIRA plugin | ||
atlassian-ide-plugin.xml | ||
|
||
# Cursive Clojure plugin | ||
.idea/replstate.xml | ||
|
||
# Crashlytics plugin (for Android Studio and IntelliJ) | ||
com_crashlytics_export_strings.xml | ||
crashlytics.properties | ||
crashlytics-build.properties | ||
fabric.properties | ||
|
||
# Editor-based Rest Client | ||
.idea/httpRequests | ||
|
||
# Rider-specific rules | ||
*.sln.iml | ||
|
||
#####=== Python ===##### | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v1.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: check-added-large-files | ||
- id: check-ast | ||
- id: check-case-conflict | ||
- id: check-docstring-first | ||
- id: check-symlinks | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/willprice/pre-commit-hooks | ||
rev: v0.0.1 | ||
hooks: | ||
- id: black-formatter | ||
- repo: http://github.com/danielhoherd/pre-commit-circleci | ||
rev: v0.0.1 | ||
hooks: | ||
- id: circleci-validate |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
include INSTALL | ||
include README | ||
include COPYING | ||
include setup.py | ||
global-include test*.py | ||
include README.md INSTALL.rst COPYING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
.PHONY: all docs test compile upload_to_pypi clean format | ||
|
||
|
||
LIBRARY_DIR := src | ||
SRC_FILES := $(shell find $(LIBRARY_DIR)) | ||
SRC_FILES += setup.py | ||
TEST_FILES := $(shell find $(LIBRARY_DIR) -iname test*.py) | ||
|
||
all: test | ||
|
||
docs: | ||
$(MAKE) html -C docs | ||
|
||
test: compile | ||
tox | ||
|
||
compile: | ||
python -m compileall $(LIBRARY_DIR) -j $$(nproc) | ||
|
||
format: | ||
black $(LIBRARY_DIR) | ||
|
||
flake8: | ||
flake8 $(LIBRARY_DIR) | ||
|
||
dist: $(SRC_FILES) compile | ||
rm -rf dist | ||
python setup.py sdist | ||
|
||
upload_to_pypi: dist | ||
twine upload dist/* | ||
|
||
clean: | ||
rm -rf dist |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Chiplotle | ||
|
||
[![CircleCI Status](https://circleci.com/gh/willprice/chiplotle.svg?style=shield)](https://circleci.com/gh/willprice/chiplotle) | ||
[![Code coverage Status](https://codecov.io/gh/willprice/chiplotle/branch/master/graph/badge.svg)](https://codecov.io/gh/willprice/chiplotle) | ||
[![Documentation Status](https://readthedocs.org/projects/chiplotle/badge/?version=latest)](https://chiplotle.readthedocs.io/en/latest/?badge=latest) | ||
[![PyPI Version](https://badge.fury.io/py/Chiplotle.svg)](https://badge.fury.io/py/Chiplotle) | ||
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/ecede0d540c64622abab25fd79e8b74c)](https://www.codacy.com/app/will.price94/chiplotle?utm_source=github.com&utm_medium=referral&utm_content=willprice/chiplotle&utm_campaign=Badge_Grade) | ||
|
||
Chiplotle is a Python library that implements and extends the HPGL | ||
(Hewlett-Packard Graphics Language) plotter control language. It | ||
supports all the standard HPGL commands as well as our own more complex | ||
"compound HPGL" commands, implemented as Python classes. Chiplotle also | ||
provides direct control of your HPGL-aware hardware via a standard | ||
usb<->serial port interface. | ||
|
||
Chiplotle has been tested with a variety of HPGL devices from various | ||
companies, including Hewlett-Packard, Roland Digital Group, Houston | ||
Instrument, etc. It includes plotter-specific configuration files for | ||
many different plotter models, as well as a generic configuration that | ||
should work with any HPGL-compliant device. | ||
|
||
Chiplotle is written and maintained by Victor Adan and Douglas Repetto. | ||
|
||
Find all there is to know about Chiplotle at: | ||
http://music.columbia.edu/cmc/chiplotle |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nproc
not available in mac os... remove?