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

[WIP] Upgrade for python 3 #7

Open
wants to merge 94 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
b8ff8fb
Remove DS_Store
willprice Aug 20, 2018
2c017fd
Run 2to3 and manually fix @apply decorators
willprice Aug 20, 2018
ef83357
Ignore pytest cache dir
willprice Aug 20, 2018
fa9490e
Add requirements.txt
willprice Aug 20, 2018
e0c8f8d
Fix chiplotele.tools.io.export errors
willprice Aug 20, 2018
6e9de3c
Fix relativise type check
willprice Aug 20, 2018
a4d4f02
Fix virtual_serial_port maxint -> maxsize
willprice Aug 20, 2018
fc6af5a
Fix LayerVisitor tests
willprice Aug 20, 2018
732735c
Update division methods of CoordinateArray to Python 3
willprice Aug 20, 2018
0c0527f
Fix broken pens_updown_to_papr method (fix by @victoradan)
willprice Aug 20, 2018
b2ebfe6
Pasteurize lib to attempt to make py2/3 compatible
willprice Aug 20, 2018
b73931a
Add circleci config, makefile and tox support
willprice Aug 20, 2018
9c81d2e
Add build status badge to README
willprice Aug 20, 2018
67e3325
Fix chiplotle config file coding line
willprice Aug 20, 2018
a86feee
Fix cirleci config
willprice Aug 20, 2018
c1f5493
Add docs and pypi badge
willprice Aug 21, 2018
f5f3dbb
Ditch requirements-dev.txt keep everything in requirements.txt
willprice Aug 21, 2018
3789e7e
Use RTD docs theme, extract version to __version__.py, fix docs Makef…
willprice Aug 21, 2018
0f7662b
Add joe generated gitignore file
willprice Aug 21, 2018
b63d355
Fix venv creation bug in circleci config for py27
willprice Aug 21, 2018
c68d502
Reorder doc index and rename Chiplotle API page to API
willprice Aug 21, 2018
d7107d3
Fix circleci bug: parsing python version with multiple digits
willprice Aug 21, 2018
35d7235
Fix failing python 2 tests due to unicode literals
willprice Aug 21, 2018
1a75f93
Fix inflate_hpgl_string tests
willprice Aug 21, 2018
1fb63aa
Fix hpgl parsing python 2 test failures
willprice Aug 21, 2018
25e71db
Fix more test failures due to unicode literals and pytest.raises
willprice Aug 21, 2018
a7fa64e
Fix remaining broken python 2 tests relying on str instance checks
willprice Aug 21, 2018
9e8d89e
Fix last instance of isinstance check that uses str
willprice Aug 21, 2018
54561b1
Run black formatter on lib
willprice Aug 21, 2018
90baf11
Import __version__.* constants into __init__
willprice Aug 21, 2018
e8ff1a1
Run black on setup.py
willprice Aug 21, 2018
612bc97
Add classifiers and break up keywords in setup.py
willprice Aug 21, 2018
385f745
Attempt to fix RTD build by copying chiplotle config
willprice Aug 21, 2018
5153776
Add coverage
willprice Aug 22, 2018
28e75d5
Add code coverage status badge to README.md
willprice Aug 22, 2018
306ea01
Include README.md in MANIFEST, update INSTALL file suffix to rst
willprice Aug 22, 2018
e2e8871
Remove unused test script
willprice Aug 22, 2018
89927de
Move chiplotle package dir to subfolder, add coverage support
willprice Aug 23, 2018
475a193
Move docs up to root dir
willprice Aug 23, 2018
4133c2b
Attempt to fix circleci failure due to no being able to import chiplotle
willprice Aug 23, 2018
279d757
Fix print syntax in dynamically python code in strings
willprice Aug 23, 2018
9e4aea7
Print __version__ imported from __init__ not chiplotle.core.cfg.cfg
willprice Aug 23, 2018
c01fc1b
Specify serial commands as byte strings in what_plotter_in_port.py
willprice Aug 23, 2018
f09e60b
Add future dependency to setup.py
willprice Aug 23, 2018
eb69e7c
Bump pyserial version dep to >=3.0
willprice Aug 23, 2018
99bd178
Fix __clas__ typo in _ChiplotleError
willprice Aug 23, 2018
b4c8264
Add warning discouraging usage to README
willprice Aug 23, 2018
c4cece2
Move examples to top level
willprice Aug 30, 2018
1d1c52f
Correct some spelling issues in quick start tutorial
willprice Aug 30, 2018
3c984c4
Spell check and code fix shapes tutorial
willprice Aug 30, 2018
0c35f4c
Spell check fundamentals page
willprice Aug 30, 2018
b96529c
Replace windowz -> windows in docs
willprice Aug 30, 2018
fa5b063
Spell check faq
willprice Aug 30, 2018
672450f
Force bytes not unicode in serial and baseplotter
willprice Aug 30, 2018
e676797
First stab at python 3 compatibility
willprice Sep 1, 2018
30e9665
Fix python 2 test regressions
willprice Sep 1, 2018
23007ab
Force allowedHPGLCommands to be bytes by protecting with property
willprice Sep 1, 2018
0db03e8
Add DXY1100 and DXY1200 plotters
willprice Sep 1, 2018
c1db469
Add pre-commit hooks config
willprice Sep 1, 2018
026e70e
Fix DXY-1100/1200 config
willprice Sep 1, 2018
a0f2843
Fix abstract_masterpiece_file example
willprice Sep 2, 2018
9aabe97
Fix io.view to work with linux versions other than 2
willprice Sep 2, 2018
7a701cf
Throw more helpful error when accidentially instantiating coordinate …
willprice Sep 2, 2018
37a4062
Revert raising ValueError on CoordinateArray being passed anything bu…
willprice Sep 2, 2018
4006c59
Throw more helpful error message on saving hpgl
willprice Sep 2, 2018
de06b96
Refactor abstract masterpiece example
willprice Sep 2, 2018
a61e2c2
Pin pytest to latest version 3.7.4
pyup-bot Sep 3, 2018
8e4e917
Pin pytest-cov to latest version 2.5.1
pyup-bot Sep 3, 2018
fea2864
Pin tox to latest version 3.2.1
pyup-bot Sep 3, 2018
fc09066
Update numpy from 1.15.0 to 1.15.1
pyup-bot Sep 3, 2018
36d7074
Merge pull request #1 from willprice/pyup-initial-update
willprice Sep 3, 2018
4398899
Clean up imports + delete some dead code from interactive_commands.py
willprice Sep 3, 2018
53a012f
Update pytest imports from py.test to pytest
willprice Sep 3, 2018
7ffe19a
Convert old pytest raises(Error, "python code") usage to modern with-…
willprice Sep 3, 2018
12b9251
Add codacy badge
willprice Sep 3, 2018
48036c3
Update future from 0.16.0 to 0.17.1
pyup-bot Oct 31, 2018
78ff9a7
Update pytest-cov from 2.5.1 to 2.6.1
pyup-bot Jan 7, 2019
766eee6
Update tox from 3.2.1 to 3.7.0
pyup-bot Jan 12, 2019
b161dc3
Update pytest from 3.7.4 to 4.1.1
pyup-bot Jan 13, 2019
855ac5c
Update numpy from 1.15.1 to 1.16.0
pyup-bot Jan 14, 2019
778df02
Merge pull request #27 from willprice/pyup-update-tox-3.2.1-to-3.7.0
willprice Jan 19, 2019
7faf703
Merge pull request #16 from willprice/pyup-update-future-0.16.0-to-0.…
willprice Jan 19, 2019
80be4a2
Merge branch 'master' into pyup-update-pytest-cov-2.5.1-to-2.6.1
willprice Jan 19, 2019
b405e24
Merge pull request #28 from willprice/pyup-update-pytest-3.7.4-to-4.1.1
willprice Jan 19, 2019
abc32cc
Merge branch 'master' into pyup-update-numpy-1.15.1-to-1.16.0
willprice Jan 19, 2019
57b2708
Merge pull request #29 from willprice/pyup-update-numpy-1.15.1-to-1.16.0
willprice Jan 19, 2019
ccc0abe
Merge branch 'master' into pyup-update-pytest-cov-2.5.1-to-2.6.1
willprice Jan 19, 2019
e7c018a
Merge pull request #26 from willprice/pyup-update-pytest-cov-2.5.1-to…
willprice Jan 19, 2019
9be9b0a
Remove WIP note
willprice Jan 19, 2019
6cd1c8d
Update pytest from 4.1.1 to 4.3.0
pyup-bot Feb 27, 2019
ba7c3a2
Update numpy from 1.16.0 to 1.16.2
pyup-bot Feb 27, 2019
19fcc2b
Merge pull request #34 from willprice/pyup-update-numpy-1.16.0-to-1.16.2
willprice Aug 5, 2019
24eced1
Merge branch 'master' into pyup-update-pytest-4.1.1-to-4.3.0
willprice Aug 5, 2019
e8a65b5
Merge pull request #33 from willprice/pyup-update-pytest-4.1.1-to-4.3.0
willprice Oct 18, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file removed ._.DS_Store
Binary file not shown.
70 changes: 70 additions & 0 deletions .circleci/config.yml
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
9 changes: 9 additions & 0 deletions .coveragerc
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
166 changes: 163 additions & 3 deletions .gitignore
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/

21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
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.
6 changes: 1 addition & 5 deletions MANIFEST.in
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
34 changes: 34 additions & 0 deletions Makefile
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)
Copy link
Collaborator

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?


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
8 changes: 0 additions & 8 deletions README

This file was deleted.

25 changes: 25 additions & 0 deletions README.md
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&amp;utm_medium=referral&amp;utm_content=willprice/chiplotle&amp;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
Loading