Skip to content

Commit

Permalink
rename python source code folder to avoid name collision
Browse files Browse the repository at this point in the history
  • Loading branch information
JBenda committed Jan 2, 2025
1 parent 4ac28b2 commit 4124e58
Show file tree
Hide file tree
Showing 17 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ jobs:
- name: Test python release
run: |
python3 -m pip install dist/*.whl --user
python3 -m pytest
python3 -m pytest inkcpp_python/tests
- name: Remove wheel
run: |
rm dist/*.whl
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
path = proofing/ink-proof
url = https://github.com/chromy/ink-proof.git
shallow = true
[submodule "inkcpp_py/pybind11"]
path = inkcpp_py/pybind11
[submodule "inkcpp_python/pybind11"]
path = inkcpp_python/pybind11
url = https://github.com/pybind/pybind11.git
branch = stable
shallow = true
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ endif()

if (INKCPP_PY)
add_compile_options(-fPIC)
add_subdirectory(inkcpp_py)
add_subdirectory(inkcpp_python)
endif(INKCPP_PY)
add_subdirectory(shared)
add_subdirectory(inkcpp)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ python -m pip install dist/*.whl --user
# if inklecate is not in the same directory / inside Path set INKLECATE enviroment variable
export INKLECATE=<PATH-TO-inklecate> # unix
set INKLECTATE=<PATH-TO-inklecate> # windows
python -m pytest
python -m pytest inkcpp_python/tests
```

Right now this only executes the internal unit tests which test the functions of particular classes. Soon it'll run more complex tests on .ink files using ink-proof.
Expand All @@ -189,15 +189,15 @@ Right now this only executes the internal unit tests which test the functions of
## Python Bindings

The easy way to start is installing it with pip: `pip install inkcpp_py`.
An example can be found at [example.py](./inkcpp_py/example.py).
An example can be found at [example.py](./inkcpp_python/example.py).
To build it from source use:

```sh
git clone --recurse-submodules https://github.com/JBenda/inkcpp.git
pip install .
```

The python bindnigs are defined in `inkcpp_py` subfolder.
The python bindnigs are defined in `inkcpp_python` subfolder.

## Dependencies
The compiler depends on Nlohmann's JSON library and the C++ STL.
Expand Down
4 changes: 2 additions & 2 deletions inkcpp/include/story.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ class story
* `pip install .`
*
* Here can you find an
* [example](https://raw.githubusercontent.com/JBenda/inkcpp/master/inkcpp_py/example.py) inclusive
* [story](https://raw.githubusercontent.com/JBenda/inkcpp/master/inkcpp_py/unreal_example.ink).
* [example](https://raw.githubusercontent.com/JBenda/inkcpp/master/inkcpp_python/example.py) inclusive
* [story](https://raw.githubusercontent.com/JBenda/inkcpp/master/inkcpp_python/unreal_example.ink).
*
* [Python module documentation](./inkcpp_py.html)
*/
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def story_path(tmpdir_factory):

@pytest.fixture(scope='session', autouse=True)
def assets(story_path, inklecate_cmd):
print(ink.__dict__, file=sys.stderr)
res = {}
for (name, files) in story_path.items():
if not os.path.exists(files[0]):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from setuptools.command.build_ext import build_ext


# echo "[\n$(find shared/** inkcpp/** inkcpp_compiler/** inkcpp_py/** -not -path '*/.*' | tr '\n' ' ' | sed -e 's/[^ ]\+/"\0"/g' -e 's/[[:blank:]]*$//' -e 's/ /,\n/g')\n]"
# echo "[\n$(find shared/** inkcpp/** inkcpp_compiler/** inkcpp_python/** -not -path '*/.*' | tr '\n' ' ' | sed -e 's/[^ ]\+/"\0"/g' -e 's/[[:blank:]]*$//' -e 's/ /,\n/g')\n]"
# + "CMakeLists.txt"

# Convert distutils Windows platform specifiers to CMake -A arguments
Expand All @@ -37,7 +37,7 @@ def src_files(dir):

def glob_src_files():
files = []
dirs = ['./inkcpp', './inkcpp_compiler', './inkcpp_py', './shared']
dirs = ['./inkcpp', './inkcpp_compiler', './inkcpp_python', './shared']
for dir in dirs:
files += src_files(dir)
return files
Expand All @@ -46,7 +46,7 @@ def glob_src_files():
class CMakeExtension(Extension):
def __init__(self, name: str, sourcedir: str = "") -> None:
src_files = glob_src_files()
# src_files = json.load(open('inkcpp_py/sources.json'))
# src_files = json.load(open('inkcpp_python/sources.json'))
src_files += ["CMakeLists.txt", "Config.cmake.in"]
super().__init__(name, sources=src_files)
self.sourcedir = os.fspath(Path(sourcedir).resolve())
Expand Down

0 comments on commit 4124e58

Please # to comment.