feat: add structure for pypi release
This commit is contained in:
17
README.md
17
README.md
@@ -2,14 +2,14 @@
|
||||
[](https://lgtm.com/projects/g/gio101046/dopey/alerts/)
|
||||
[](https://lgtm.com/projects/g/gio101046/dopey/context:python)
|
||||
|
||||
The dopey brainf\*ck interpreter was created as a side project to become familiar with Python 3. The goal was to fully implement all the features of brainf\*ck as defined in this [wiki page](https://en.wikipedia.org/wiki/Brainfuck#Language_design) into dopey.
|
||||
Dopey is a brainf\*ck interpreter. It fully implements all the features of brainf\*ck as defined [here](https://en.wikipedia.org/wiki/Brainfuck#Language_design).
|
||||
|
||||
## Demo
|
||||

|
||||

|
||||
|
||||
## Implemetation Limitations
|
||||
|
||||
The dopey is limited to a memory buffer of **30,000** byte cells all initialized to zero. Any attempts to move the pointer past the bounds of the memory buffer will result in an exception being raised. Attempting to print any cell with a value outside of the defined ASCII characters may also result in an exception.
|
||||
Dopey is limited to a memory buffer of **30,000** byte cells all initialized to zero. Any attempts to move the pointer past the bounds of the memory buffer will result in an exception being raised. Attempting to print any cell with a value outside of the defined ASCII characters may also result in an exception.
|
||||
|
||||
## Requirements
|
||||
|
||||
@@ -25,13 +25,16 @@ or in some systems
|
||||
python3 --version
|
||||
```
|
||||
|
||||
## Running dopey
|
||||
## Installing
|
||||
|
||||
Clone the Github repository and from your terminal move to the root of the project and run the following lines:
|
||||
You can install dopey using `pip`. From the command line:
|
||||
|
||||
```bash
|
||||
chmod +x dopey.py
|
||||
./dopey.py my_file.bf
|
||||
# use pip python package manager to install dopey
|
||||
$ pip install dopey
|
||||
|
||||
# run dopey using python
|
||||
$ python -m dopey my-bf-file.bf
|
||||
```
|
||||
|
||||
You can also import an interpreter class included with dopey and use it in your own python scripts.
|
||||
|
||||
4
dopey/__init__.py
Normal file
4
dopey/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from dopey.dopey import Interpreter
|
||||
|
||||
# version of the dopey package
|
||||
__version__ = "1.0.0"
|
||||
4
dopey/__main__.py
Normal file
4
dopey/__main__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from dopey.dopey import _main
|
||||
|
||||
if __name__ == "__main__":
|
||||
_main()
|
||||
@@ -141,7 +141,7 @@ class Interpreter:
|
||||
if len(_Operation.loop_stack):
|
||||
raise MismatchBracketException
|
||||
|
||||
def main() -> None:
|
||||
def _main() -> None:
|
||||
file_location = None
|
||||
if len(sys.argv) != 2:
|
||||
print("Invalid or missing arguments...")
|
||||
@@ -157,4 +157,4 @@ def main() -> None:
|
||||
interpreter.execute(str_program)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
_main()
|
||||
29
setup.py
Normal file
29
setup.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import pathlib
|
||||
from setuptools import setup
|
||||
|
||||
HERE = pathlib.Path(__file__).parent
|
||||
README = (HERE / "README.md").read_text()
|
||||
|
||||
setup(
|
||||
name="dopey",
|
||||
version="1.0.1",
|
||||
description="A brainfuck interpreter made using python.",
|
||||
long_description=README,
|
||||
long_description_content_type="text/markdown",
|
||||
url="https://github.com/gio101046/dopey",
|
||||
author="Giovani Rodriguez",
|
||||
author_email="me@grodriguez.dev",
|
||||
license="MIT",
|
||||
classifiers=[
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
],
|
||||
packages=["dopey"],
|
||||
include_package_data=True,
|
||||
entry_points={
|
||||
"console_scripts": [
|
||||
"dopey=dopey.dopey:_main",
|
||||
]
|
||||
},
|
||||
)
|
||||
Reference in New Issue
Block a user