Skip to content

Commit

Permalink
Merge branch 'dev' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
maksyuki committed Dec 29, 2021
2 parents 2e872f6 + ee3a844 commit db6258d
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/publish-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ jobs:
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
run:
python -m build
- name: Publish a Python distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ __pycache__
.coverage
export-res
dist
*.egg-info
packaged-examples
*.egg-info
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ Another method is `git clone` this repo, `pip install` dependencies, and then ru
$ git clone https://github.com/maksyuki/TaichiGAME.git
$ cd TaichiGAME/
$ python3 -m pip install -r requirements.txt
$ cd examples/ # necessary, run testbed.py from other path can trigger module import error
$ python3 testbed.py
$ cd TaichiGAME/ # necessary, run main.py in project root path can trigger module import error
$ python3 main.py example testbed
```

> NOTE: When running code, you maybe notice terminal print some informations like `[Taichi] version 0.8.7, llvm 10.0.0, commit 1c3c705a, osx, python 3.8.8`. I have tested TaichiGAME under `taichi>=0.7`. Your output maybe different from mine, but it doesn't matter.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 10 additions & 3 deletions TaichiGAME/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@ def _exec_python_file(filename: str):
@staticmethod
def _get_examples_dir() -> Path:
"""Get the path to the examples directory."""
root_dir = '.'
root_dir = os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(__file__))))

examples_dir = Path(root_dir) / 'TaichiGAME/packaged-examples'
examples_dir = Path(root_dir) / 'TaichiGAME/examples'
return examples_dir

@staticmethod
Expand All @@ -76,7 +75,15 @@ def _get_available_examples() -> Dict[str, Path]:
examples_dir = TaichiGAMEMain._get_examples_dir()
all_examples = examples_dir.rglob('*.py')
all_example_names = {f.stem: f.parent for f in all_examples}
return all_example_names

res: Dict[str, Path] = {}
for v in all_example_names:
if v == 'main' or v == '__init__':
continue

res[v] = all_example_names[v]

return res

@staticmethod
def _example_choices_type(choices):
Expand Down
14 changes: 2 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
import os
import setuptools

try:
os.makedirs('TaichiGAME/packaged-examples')
except FileExistsError:
pass

os.system('cp ./examples/testbed.py ./TaichiGAME/packaged-examples/')
os.system('cp ./examples/ti_testbed.py ./TaichiGAME/packaged-examples/')

with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()

setuptools.setup(
name="TaichiGAME",
version="0.0.1",
version="0.0.2",
author="maksyuki",
author_email="[email protected]",
description="GPU Accelerated Motion Engine based on Taichi Lang",
Expand Down Expand Up @@ -47,9 +38,8 @@
],
license='MIT',
keywords=['phyics engine', 'dynamics simulation', 'robot motion control'],
packages=setuptools.find_packages(exclude=['examples', 'tests']),
packages=setuptools.find_packages(exclude=['tests']),
include_package_data=True,
package_data={'examples': ['testbed.py']},
install_requires=['taichi'],
python_requires=">=3.7,<3.10",
)

0 comments on commit db6258d

Please sign in to comment.