Skip to content

Commit f68b912

Browse files
authored
Merge pull request #9 from jedie/modernize
Modernize
2 parents 6659e5b + fd5eefa commit f68b912

File tree

130 files changed

+4963
-25641
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+4963
-25641
lines changed

.coveragerc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[run]
2+
branch = True
3+
source = MC6809
4+
omit =
5+
*/tests/*
6+
*/site-packages/*
7+
8+
[report]
9+
# Regexes for lines to exclude from consideration
10+
exclude_lines =
11+
# Have to re-enable the standard pragma
12+
pragma: no cover
13+
14+
# Don't complain about missing debug-only code:
15+
def __repr__
16+
if self\.debug
17+
18+
# Don't complain if tests don't hit defensive assertion code:
19+
raise AssertionError
20+
raise NotImplementedError
21+
22+
# Don't complain if non-runnable code isn't run:
23+
if __name__ == .__main__.:
24+
25+
#ignore_errors = True
26+
27+
[html]
28+
directory = coverage_html

.editorconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 4
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.{html,css,js}]
13+
insert_final_newline = false
14+
15+
[*.py]
16+
line_length = 119
17+
18+
[{Makefile,**.mk}]
19+
indent_style = tab
20+
insert_final_newline = false
21+
22+
[*.{yml}]
23+
indent_style = space
24+
indent_size = 2

.flake8

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[flake8]
2+
exclude = .pytest_cache
3+
ignore = E501
4+
max-line-length = 119

.github/workflows/pythonapp.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: test
2+
3+
on:
4+
schedule:
5+
- cron: '0 8 * * *'
6+
push:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
max-parallel: 4
13+
matrix:
14+
python-version: [3.8, 3.7, 3.6, pypy3]
15+
steps:
16+
- uses: actions/checkout@v1
17+
- name: 'Set up Python ${{ matrix.python-version }}'
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: '${{ matrix.python-version }}'
21+
22+
- name: 'Install package'
23+
run: |
24+
make install-poetry
25+
source $HOME/.poetry/env
26+
make install
27+
28+
- name: 'List installed packages'
29+
run: |
30+
source $HOME/.poetry/env
31+
poetry run pip freeze
32+
33+
- name: 'List all tox test environments'
34+
run: |
35+
source $HOME/.poetry/env
36+
make tox-listenvs
37+
38+
- name: 'Run tests with Python v${{ matrix.python-version }}'
39+
run: |
40+
source $HOME/.poetry/env
41+
make pytest
42+
43+
# - name: 'Run linters'
44+
# if: matrix.python-version == '3.8'
45+
# run: |
46+
# source $HOME/.poetry/env
47+
# make lint
48+
49+
- name: 'Upload coverage report'
50+
run: bash <(curl -s https://codecov.io/bash)

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,6 @@ nosetests.xml
3838
.project
3939
.pydevproject
4040
.idea/*
41-
.settings/*
41+
.settings/*
42+
/publish.log
43+
/coverage.xml

.isort.cfg

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Configuring isort
2+
# https://github.com/timothycrosley/isort/wiki/isort-Settings
3+
4+
[settings]
5+
atomic=true
6+
line_length=119
7+
case_sensitive=false
8+
9+
# https://github.com/timothycrosley/isort#multi-line-output-modes
10+
# 3 - Vertical Hanging Indent
11+
multi_line_output=3
12+
include_trailing_comma=true
13+
14+
known_first_party=dragonpy
15+
16+
no_lines_before=LOCALFOLDER
17+
18+
default_section=THIRDPARTY
19+
sections=FUTURE,STDLIB,EXTERNAL,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
20+
21+
lines_after_imports=2

.travis.yml

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
11
# Config file for automatic testing at travis-ci.org
22

33
language: python
4-
sudo: false
5-
6-
python:
7-
- "2.7"
8-
- "3.4"
9-
- "pypy"
10-
- "pypy3"
4+
cache: pip
5+
6+
matrix:
7+
include:
8+
- os: linux
9+
python: 3.6
10+
env: TOXENV=py36
11+
- os: linux
12+
python: 3.7
13+
env: TOXENV=py37
14+
- os: linux
15+
python: 3.8
16+
env: TOXENV=py38
17+
- os: linux
18+
python: pypy3
19+
# TODO:
20+
#- os: osx
21+
# language: generic
1122

1223
install:
13-
- pip install --upgrade pip
14-
- pip install .
15-
- pip install coveralls
24+
- make install-poetry
25+
- source $HOME/.poetry/env
26+
- make install
27+
- poetry run pip freeze
28+
- make tox-listenvs
1629

1730
script:
18-
- coverage run --source=dragonpy ./setup.py nosetests
31+
- if [ "$TOXENV" == "" ]; then make pytest; fi
32+
- if [ "$TOXENV" != "" ]; then make tox; fi
33+
- if [ "$TOXENV" != "" ]; then make lint; fi
1934

2035
after_success:
21-
- coveralls
22-
23-
# blacklist
24-
branches:
25-
except:
26-
- wip
27-
- WIP
28-
- experimental
29-
30-
# whitelist
31-
#branches:
32-
# only:
33-
# - master
34-
# - stable
35-
36-
notifications:
37-
irc: "irc.freenode.org#pylucid"
36+
- coveralls
37+
# https://github.com/codecov/codecov-bash
38+
- bash <(curl -s https://codecov.io/bash)

Makefile

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
SHELL := /bin/bash
2+
MAX_LINE_LENGTH := 119
3+
POETRY_VERSION := $(shell poetry --version 2>/dev/null)
4+
5+
help: ## List all commands
6+
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9 -]+:.*?## / {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
7+
8+
check-poetry:
9+
@if [[ "${POETRY_VERSION}" == *"Poetry"* ]] ; \
10+
then \
11+
echo "Found ${POETRY_VERSION}, ok." ; \
12+
else \
13+
echo 'Please install poetry first, with e.g.:' ; \
14+
echo 'make install-poetry' ; \
15+
exit 1 ; \
16+
fi
17+
18+
install-poetry: ## install or update poetry
19+
@if [[ "${POETRY_VERSION}" == *"Poetry"* ]] ; \
20+
then \
21+
echo 'Update poetry v$(POETRY_VERSION)' ; \
22+
poetry self update ; \
23+
else \
24+
echo 'Install poetry' ; \
25+
curl -sSL "https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python3 ; \
26+
fi
27+
28+
install: check-poetry ## install DragonPy via poetry
29+
poetry install
30+
31+
update: check-poetry ## Update the dependencies as according to the pyproject.toml file
32+
poetry update
33+
34+
lint: ## Run code formatters and linter
35+
poetry run flynt --fail-on-change --line_length=${MAX_LINE_LENGTH} dragonpy
36+
poetry run isort --check-only --recursive dragonpy
37+
poetry run flake8 dragonpy
38+
39+
fix-code-style: ## Fix code formatting
40+
poetry run flynt --line_length=${MAX_LINE_LENGTH} dragonpy
41+
poetry run autopep8 --ignore-local-config --max-line-length=${MAX_LINE_LENGTH} --aggressive --aggressive --in-place --recursive dragonpy
42+
poetry run isort --apply --recursive dragonpy
43+
44+
tox-listenvs: check-poetry ## List all tox test environments
45+
poetry run tox --listenvs
46+
47+
tox: check-poetry ## Run pytest via tox with all environments
48+
poetry run tox
49+
50+
tox-py36: check-poetry ## Run pytest via tox with *python v3.6*
51+
poetry run tox -e py36
52+
53+
tox-py37: check-poetry ## Run pytest via tox with *python v3.7*
54+
poetry run tox -e py37
55+
56+
tox-py38: check-poetry ## Run pytest via tox with *python v3.8*
57+
poetry run tox -e py38
58+
59+
pytest: check-poetry ## Run pytest
60+
poetry run pytest
61+
62+
update-rst-readme: ## update README.rst from README.creole
63+
poetry run update_rst_readme
64+
65+
publish: ## Release new version to PyPi
66+
poetry run publish
67+
68+
download-roms: ## Download/Test only ROM files
69+
poetry run DragonPy download-roms
70+
71+
profile: ## Profile the MC6809 emulation benchmark
72+
poetry run MC6809 profile
73+
74+
benchmark: ## Run MC6809 emulation benchmark
75+
poetry run MC6809 benchmark
76+
77+
editor: check-poetry ## Run only the BASIC editor
78+
poetry run DragonPy editor
79+
80+
Vectrex: check-poetry ## Run GUI with Vectrex emulation (not working, yet!)
81+
poetry run DragonPy --machine Vectrex run
82+
83+
sbc09: check-poetry ## Run GUI with sbc09 ROM emulation
84+
poetry run DragonPy --machine sbc09 run
85+
86+
Multicomp6809: check-poetry ## Run GUI with Multicomp6809 ROM emulation
87+
poetry run DragonPy --machine Multicomp6809 run
88+
89+
Simple6809: check-poetry ## Run GUI with Simple6809 ROM emulation
90+
poetry run DragonPy --machine Simple6809 run
91+
92+
CoCo2b: check-poetry ## Run GUI with CoCo 2b emulation
93+
poetry run DragonPy --machine CoCo2b run
94+
95+
Dragon32: check-poetry ## Run GUI with Dragon 32 emulation
96+
poetry run DragonPy --machine Dragon32 run
97+
98+
Dragon64: check-poetry ## Run GUI with Dragon 64 emulation
99+
poetry run DragonPy --machine Dragon64 run
100+
101+
run: check-poetry ## *Run the DragonPy Emulator GUI*
102+
poetry run DragonPy
103+
104+
.PHONY: help install lint fix test publish

0 commit comments

Comments
 (0)