Skip to content

Commit

Permalink
Merge pull request #47 from jedie/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
jedie authored Nov 3, 2023
2 parents ff78139 + 426159b commit 206735e
Show file tree
Hide file tree
Showing 14 changed files with 2,156 additions and 636 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.10"]
python-version: ["3.12", "3.11", "3.10", "3.9"]
env:
PYTHONUNBUFFERED: 1
PYTHONWARNINGS: always
steps:
- name: Checkout
run: |
echo $GITHUB_REF $GITHUB_SHA
git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git .
git clone https://github.com/$GITHUB_REPOSITORY.git .
git fetch origin $GITHUB_SHA:temporary-ci-branch
git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA)
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
*.egg-info
__pycache__
/dist/
/coverage.json
/coverage.xml
/coverage.*
*.orig

!.github
!.editorconfig
Expand Down
1,359 changes: 1,295 additions & 64 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def main(argv):

# Call our entry point CLI:
try:
verbose_check_call(PROJECT_SHELL_SCRIPT, *sys.argv[1:])
verbose_check_call(PROJECT_SHELL_SCRIPT, *argv[1:])
except subprocess.CalledProcessError as err:
sys.exit(err.returncode)

Expand Down
2 changes: 1 addition & 1 deletion dev-cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def main(argv):

# Call our entry point CLI:
try:
verbose_check_call(PROJECT_SHELL_SCRIPT, *sys.argv[1:])
verbose_check_call(PROJECT_SHELL_SCRIPT, *argv[1:])
except subprocess.CalledProcessError as err:
sys.exit(err.returncode)

Expand Down
2 changes: 1 addition & 1 deletion dragonpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from dragonpy.vectrex.machine import run_Vectrex


__version__ = '0.9.0'
__version__ = '0.9.1'
__author__ = 'Jens Diemer <[email protected]>'


Expand Down
11 changes: 10 additions & 1 deletion dragonpy/cli/cli_app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
CLI for usage
"""
from __future__ import annotations

import inspect
import locale
import logging
Expand Down Expand Up @@ -38,7 +40,14 @@
type=click.Path(exists=True, file_okay=False, dir_okay=True, readable=True, path_type=Path)
)
ARGUMENT_NOT_EXISTING_DIR = dict(
type=click.Path(exists=False, file_okay=False, dir_okay=True, readable=False, writable=True, path_type=Path)
type=click.Path(
exists=False,
file_okay=False,
dir_okay=True,
readable=False,
writable=True,
path_type=Path,
)
)
ARGUMENT_EXISTING_FILE = dict(
type=click.Path(exists=True, file_okay=True, dir_okay=False, readable=True, path_type=Path)
Expand Down
6 changes: 3 additions & 3 deletions dragonpy/cli/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

import rich_click as click
from bx_py_utils.path import assert_is_file
from cli_base.cli_tools.subprocess_utils import verbose_check_call
from cli_base.cli_tools.version_info import print_version
from manageprojects.utilities import code_style
from manageprojects.utilities.publish import publish_package
from manageprojects.utilities.subprocess_utils import verbose_check_call
from manageprojects.utilities.version_info import print_version
from rich import print # noqa; noqa
from rich_click import RichGroup

Expand Down Expand Up @@ -118,7 +118,7 @@ def update():
verbose_check_call(bin_path / 'pip', 'install', '-U', 'pip-tools')

extra_env = dict(
CUSTOM_COMPILE_COMMAND='./cli.py update',
CUSTOM_COMPILE_COMMAND='./dev-cli.py update',
)

pip_compile_base = [
Expand Down
2 changes: 1 addition & 1 deletion dragonpy/core/gui_starter.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import logging
import tkinter as tk

from manageprojects.utilities.subprocess_utils import verbose_check_call
from cli_base.cli_tools.subprocess_utils import verbose_check_call
from rich import print # noqa

import dragonpy
Expand Down
22 changes: 11 additions & 11 deletions dragonpy/tests/test_BASIC_Dragon32.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@


import logging
import unittest

from dragonpy.tests.test_base import Test6809_Dragon32_Base

Expand Down Expand Up @@ -81,17 +80,18 @@ def test_code_save01(self):
['LIST', '10 ?123', '20 PRINT "FOO"', 'OK']
)

@unittest.expectedFailure # TODO:
def test_tokens_in_string(self):
self.periphery.add_to_input_queue(
# "10 PRINT ' FOR NEXT COMMENT\r"
"10 PRINT ' FOR NEXT\r"
'LIST\r'
)
self.periphery.add_to_input_queue("10 PRINT ' FOR NEXT COMMENT\rLIST\r")
op_call_count, cycles, output = self._run_until_OK(max_ops=1430000)
print(op_call_count, cycles, output)
self.assertEqual(output,
['10A=1', '20B=2', 'LIST', '10 A=1', '20 B=2', 'OK']
)
self.assertEqual(
output,
[
"10 PRINT ' FOR NEXT COMMENT",
'LIST',
"10 PRINT ' FOR NEXT COMMENT",
'OK',
],
)
output = self.machine.get_basic_program()
self.assertEqual(output, ['10 A=1', '20 B=2'])
self.assertEqual(output, ["10 PRINT ' FOR NEXT COMMENT"])
22 changes: 22 additions & 0 deletions dragonpy/tests/test_readme_history.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from unittest import TestCase

from bx_py_utils.auto_doc import assert_readme_block
from cli_base.cli_tools.git_history import get_git_history

import dragonpy
from dragonpy.cli.cli_app import PACKAGE_ROOT


class ReadmeHistoryTestCase(TestCase):
def test_readme_history(self):
git_history = get_git_history(
current_version=dragonpy.__version__,
add_author=False,
)
history = '\n'.join(git_history)
assert_readme_block(
readme_path=PACKAGE_ROOT / 'README.md',
text_block=f'\n{history}\n',
start_marker_line='[comment]: <> (✂✂✂ auto generated history start ✂✂✂)',
end_marker_line='[comment]: <> (✂✂✂ auto generated history end ✂✂✂)',
)
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ readme = "README.md"
authors = [
{name = 'Jens Diemer', email = '[email protected]'}
]
requires-python = ">=3.10,<4"
requires-python = ">=3.9,<4"
dependencies = [
"MC6809", # https://github.com/6809/MC6809
"dragonlib", # https://github.com/6809/dragonlib
"cli-base-utilities", # https://github.com/jedie/cli-base-utilities
"manageprojects", # https://github.com/jedie/manageprojects
"pygments", # https://pygments.org/
"bx_py_utils", # https://github.com/boxine/bx_py_utils
Expand Down Expand Up @@ -119,7 +120,7 @@ exclude_lines = [
legacy_tox_ini = """
[tox]
isolated_build = True
envlist = py{311,310}
envlist = py{312,311,310,39}
skip_missing_interpreters = True
[testenv]
Expand Down Expand Up @@ -165,4 +166,5 @@ _template = "https://github.com/jedie/cookiecutter_templates/"
applied_migrations = [
"04d5a25", # 2023-03-07T16:25:36+01:00
"da054d6", # 2023-08-04T17:39:02+02:00
"c1a9d97", # 2023-11-01T19:59:17+01:00
]
Loading

0 comments on commit 206735e

Please sign in to comment.