Skip to content

Commit

Permalink
new feat(util): can launch embedded demo from cmd line
Browse files Browse the repository at this point in the history
  • Loading branch information
wkta committed Jun 16, 2023
1 parent 7aa5668 commit d3eae9d
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 8 deletions.
20 changes: 12 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
from distutils.core import setup
import os
from pathlib import Path


lib_folder = os.path.dirname(os.path.realpath(__file__))

requirements_file = lib_folder + '/runtime-req.txt'
whats_required = [] # Here we'll get content of requirements.txt
whats_required = [] # Here we'll get content of requirements.txt
if os.path.isfile(requirements_file):
with open(requirements_file) as fp:
whats_required = fp.read().splitlines()

# need sys so we can include pyved_engine
import sys

sys.path.append('src')
from pyved_engine.__version__ import ENGI_VERSION

from setuptools import setup

pck_list=[
pck_list = [
"pyved_engine",
"pyved_engine.foundation",
"pyved_engine.compo",
Expand All @@ -43,10 +41,10 @@
name='pyved-engine',
version=str(ENGI_VERSION),

description='Custom game engine built upon python/pygame',
description='Custom game engine built upon python/pygame',
long_description=long_desc,
long_description_content_type='text/markdown',

keywords=['Python', 'Pygame', 'Game Engine'],
author='moonb3ndr et al.',
author_email='thomas.iw@kata.games',
Expand All @@ -55,5 +53,11 @@
packages=pck_list,
url="https://github.com/gaudiatech/pyved-engine",
install_requires=whats_required,
include_package_data=True
include_package_data=True,

entry_points={
'console_scripts': [
'pyvedengine = cmdline.__main__:main'
]
}
)
15 changes: 15 additions & 0 deletions src/cmdline/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""
The following module implements the command line that becomes available,
once the user has installed pyved-engine locally...
After installation, for example you can type:
"pyvedengine test chess"
To run the embedded demo named chess
Embedded demos:
- chess
- bullethell
- rogue
"""

# TODO the command isnt working as expected, need to work more on that part!
13 changes: 13 additions & 0 deletions src/cmdline/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

from .emb_demos import my_demo1


def main(): # parse sub commands? TODO
# - print version
from pyved_engine.__version__ import ENGI_VERSION
print("version is", ENGI_VERSION)
command_test()


def command_test():
my_demo1.run()
Empty file.
3 changes: 3 additions & 0 deletions src/cmdline/emb_demos/my_demo1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

def run():
print("yop")

0 comments on commit d3eae9d

Please sign in to comment.