Rework code structure and metadata to be setuptools-friendly

This commit is contained in:
Michael Martin 2024-07-19 21:06:02 -07:00
parent c0307c7ea4
commit 94d0b9d0c4
18 changed files with 75 additions and 34 deletions

19
LICENSE Normal file
View File

@ -0,0 +1,19 @@
Ophis, Copyright (C) 2002-2024 Michael Martin and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

7
MANIFEST.in Normal file
View File

@ -0,0 +1,7 @@
include tests/*.oph
include tests/*.bin
include tests/*.py
include tests/sub/*.oph
include tests/sub/sub/*.oph
graft examples
graft platform

2
README
View File

@ -11,7 +11,7 @@ It is provided under the MIT license, reproduced below:
---
Ophis, Copyright (C) 2002-2014 Michael Martin and contributors
Ophis, Copyright (C) 2002-2024 Michael Martin and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

29
pyproject.toml Normal file
View File

@ -0,0 +1,29 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "ophis-asm"
version = "2.2.0"
authors = [
{ name="Michael Martin", email="mcmartin@gmail.com" },
]
description = "A cross-assembler for the 6502 series of chips"
readme = "README"
requires-python = ">=3.6"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Topic :: Software Development :: Assemblers"
]
dependencies = []
[project.scripts]
ophis = "Ophis:ophis_argv"
[tool.setuptools.package-dir]
Ophis = "src/Ophis"

View File

@ -2,7 +2,7 @@
import optparse
# Copyright 2002-2014 Michael C. Martin and additional contributors.
# Copyright 2002-2024 Michael C. Martin and additional contributors.
# You may use, modify, and distribute this file under the MIT
# license: See README for details.

View File

@ -2,7 +2,7 @@
Provides the core assembler directives."""
# Copyright 2002-2014 Michael C. Martin and additional contributors.
# Copyright 2002-2024 Michael C. Martin and additional contributors.
# You may use, modify, and distribute this file under the MIT
# license: See README for details.

View File

@ -3,7 +3,7 @@
Implements the symbol lookup, through nested environments -
any non-temporary variable is stored at the top level."""
# Copyright 2002-2014 Michael C. Martin and additional contributors.
# Copyright 2002-2024 Michael C. Martin and additional contributors.
# You may use, modify, and distribute this file under the MIT
# license: See README for details.

View File

@ -3,7 +3,7 @@
Keeps track of the number of errors inflicted so far, and
where in the assembly the errors are occurring."""
# Copyright 2002-2014 Michael C. Martin and additional contributors.
# Copyright 2002-2024 Michael C. Martin and additional contributors.
# You may use, modify, and distribute this file under the MIT
# license: See README for details.

View File

@ -10,7 +10,7 @@ import sys
import os
import os.path
# Copyright 2002-2014 Michael C. Martin and additional contributors.
# Copyright 2002-2024 Michael C. Martin and additional contributors.
# You may use, modify, and distribute this file under the MIT
# license: See README for details.

View File

@ -3,7 +3,7 @@
Classes for representing the Intermediate nodes upon which the
assembler passes operate."""
# Copyright 2002-2014 Michael C. Martin and additional contributors.
# Copyright 2002-2024 Michael C. Martin and additional contributors.
# You may use, modify, and distribute this file under the MIT
# license: See README for details.

View File

@ -4,7 +4,7 @@
traditional to mix binary with reconstructed instructions that
have all arguments precomputed. This class manages that."""
# Copyright 2002-2014 Michael C. Martin and additional contributors.
# Copyright 2002-2024 Michael C. Martin and additional contributors.
# You may use, modify, and distribute this file under the MIT
# license: See README for details.

View File

@ -4,7 +4,7 @@
set via .alias commands and prevented from escaping
with .scope and .scend commands."""
# Copyright 2002-2014 Michael C. Martin and additional contributors.
# Copyright 2002-2024 Michael C. Martin and additional contributors.
# You may use, modify, and distribute this file under the MIT
# license: See README for details.

View File

@ -3,7 +3,7 @@
When invoked as main, interprets its command line and goes from there.
Otherwise, use run_ophis(cmdline-list) to use it inside a script."""
# Copyright 2002-2014 Michael C. Martin and additional contributors.
# Copyright 2002-2024 Michael C. Martin and additional contributors.
# You may use, modify, and distribute this file under the MIT
# license: See README for details.
@ -109,7 +109,3 @@ def run_ophis(args):
Ophis.CorePragmas.reset()
return run_all()
if __name__ == '__main__':
sys.exit(run_ophis(sys.argv[1:]))

View File

@ -3,7 +3,7 @@
Tables for the assembly of 6502-family instructions, mapping
opcodes and addressing modes to binary instructions."""
# Copyright 2002-2014 Michael C. Martin and additional contributors.
# Copyright 2002-2024 Michael C. Martin and additional contributors.
# You may use, modify, and distribute this file under the MIT
# license: See README for details.

View File

@ -7,7 +7,7 @@
very extensible; additional analyses or optimizations may be
added as new subclasses of Pass."""
# Copyright 2002-2014 Michael C. Martin and additional contributors.
# Copyright 2002-2024 Michael C. Martin and additional contributors.
# You may use, modify, and distribute this file under the MIT
# license: See README for details.

View File

@ -1,5 +1,11 @@
"Ophis - a cross-assembler for the 6502 series of chips"
# Copyright 2002-2014 Michael C. Martin and additional contributors.
# Copyright 2002-2024 Michael C. Martin and additional contributors.
# You may use, modify, and distribute this file under the MIT
# license: See README for details.
import sys
import Ophis.Main
def ophis_argv():
sys.exit(Ophis.Main.run_ophis(sys.argv[1:]))

View File

@ -1,16 +0,0 @@
from distutils.core import setup
setup(name='Ophis',
version='2.1',
description='A cross-assembler for the 6502 series of processors',
url='https://github.com/michaelcmartin/Ophis',
author="Michael Martin",
author_email="mcmartin@gmail.com",
license="MIT",
long_description="Ophis is a cross-assembler for the 65xx series of "
"chips. It supports the stock 6502 opcodes, the 65c02 "
"extensions, and syntax for the \"undocumented "
"opcodes\" in the 6510 chip used on the Commodore 64. "
"(Syntax for these opcodes matches those given in the "
"VICE team's documentation.)",
packages=['Ophis'],
scripts=['scripts/ophis'])

View File

@ -8,7 +8,7 @@ prologue = '"""' + """Opcodes file.
Tables for the assembly of 6502-family instructions, mapping
opcodes and addressing modes to binary instructions.""" + '"""' + """
# Copyright 2002-2014 Michael C. Martin and additional contributors.
# Copyright 2002-2024 Michael C. Martin and additional contributors.
# You may use, modify, and distribute this file under the MIT
# license: See README for details.