aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martínez <jjm@usebox.net>2019-07-27 10:52:58 +0100
committerGitHub <noreply@github.com>2019-07-27 10:52:58 +0100
commit5797d6d4aaf6bd6155a4312f3d7ca4ad251b190a (patch)
tree91abced97331d5d40088419f424952f99f6457ed
parent12b94cec43b00be6c48c865602c642927ad55f86 (diff)
parent2cfc3a0828e76af363c7185403076c3782e52ed5 (diff)
downloadz80count-5797d6d4aaf6bd6155a4312f3d7ca4ad251b190a.tar.gz
z80count-5797d6d4aaf6bd6155a4312f3d7ca4ad251b190a.zip
Merge pull request #4 from patxoca/master
Package z80count as a python distribution
-rw-r--r--.gitignore2
-rw-r--r--MANIFEST.in3
-rw-r--r--README.md15
-rw-r--r--etc/demo-vim.gif (renamed from demo-vim.gif)bin1407647 -> 1407647 bytes
-rw-r--r--setup.py40
-rw-r--r--tests/test_parser.py (renamed from tests.py)2
-rw-r--r--tox.ini8
-rw-r--r--z80count/__init__.py1
-rw-r--r--[-rwxr-xr-x]z80count/z80count.py (renamed from z80count.py)8
-rw-r--r--z80count/z80table.json (renamed from z80table.json)0
10 files changed, 69 insertions, 10 deletions
diff --git a/.gitignore b/.gitignore
index 088157a..6d74752 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,4 +6,4 @@ dist
*.swp
*~
.tags
-
+.tox
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..3a8ed9a
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,3 @@
+include etc/*
+include tests/*
+include z80count/z80table.json
diff --git a/README.md b/README.md
index 56be7a5..ccbd7e1 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,19 @@ and adds comments to the code with the cycles used by the instruction.
It needs testing and probably a proper Z80 parser, but it works for me and the
Z80 assembler syntax I use.
-![Demo with vim](./demo-vim.gif)
+![Demo with vim](./etc/demo-vim.gif)
+
+## Installation
+
+To install for production download the package from [z80count's releases tab](https://github.com/reidrac/z80count/releases), unpack and run:
+
+ python setup.py install
+
+To install for developmet run:
+
+ git clone https://github.com/reidrac/z80count.git
+ cd z80count
+ pip install -e ".[dev]"
## Requirements
@@ -144,4 +156,3 @@ Feel free to open a PR if you find a bug!
- Juan J. Martinez <jjm@usebox.net>
- Alexis Roda (https://github.com/patxoca)
-
diff --git a/demo-vim.gif b/etc/demo-vim.gif
index bea6dc2..bea6dc2 100644
--- a/demo-vim.gif
+++ b/etc/demo-vim.gif
Binary files differ
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..8e0cf64
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,40 @@
+from setuptools import find_packages
+from setuptools import setup
+
+version = "0.5.0"
+
+setup(
+ name="z80count",
+ version=version,
+ description="A tool to annotate Z80 assembler with cycle counts.",
+ long_description="",
+ # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
+ classifiers=[
+ "Environment :: Console",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: MIT License",
+ "Programming Language :: Python :: 3 :: Only",
+ "Topic :: Software Development",
+ ],
+ keywords="",
+ author="Juan J. Martinez",
+ author_email="jjm@usebox.net",
+ url="https://github.com/reidrac/z80count",
+ license="MIT",
+ packages=find_packages(),
+ include_package_data=True,
+ zip_safe=False,
+ install_requires=[
+ ],
+ extras_require={
+ "dev": [
+ "pytest",
+ "tox",
+ ]
+ },
+ entry_points={
+ "console_scripts": [
+ "z80count = z80count.z80count:main",
+ ]
+ },
+)
diff --git a/tests.py b/tests/test_parser.py
index b235ba0..3153415 100644
--- a/tests.py
+++ b/tests/test_parser.py
@@ -2,7 +2,7 @@
import pytest
-from z80count import Parser
+from z80count.z80count import Parser
data = (
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..2df04a4
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,8 @@
+[tox]
+envlist = py{32,33,34,35,36,37}
+
+[testenv]
+deps =
+ pytest
+
+commands = py.test
diff --git a/z80count/__init__.py b/z80count/__init__.py
new file mode 100644
index 0000000..40a96af
--- /dev/null
+++ b/z80count/__init__.py
@@ -0,0 +1 @@
+# -*- coding: utf-8 -*-
diff --git a/z80count.py b/z80count/z80count.py
index 11f7e42..5491e4d 100755..100644
--- a/z80count.py
+++ b/z80count/z80count.py
@@ -1,5 +1,5 @@
-#!/usr/bin/env python3
-#
+# -*- coding: utf-8 -*-
+
# Copyright (C) 2019 by Juan J. Martinez <jjm@usebox.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -152,7 +152,3 @@ def main():
output, total, total_cond = z80count(
line, parser, total, total_cond, args.subt, args.update, args.tabstop, args.debug)
out_f.write(output)
-
-
-if __name__ == "__main__":
- main()
diff --git a/z80table.json b/z80count/z80table.json
index cefed4f..cefed4f 100644
--- a/z80table.json
+++ b/z80count/z80table.json