Skip to content
Snippets Groups Projects
Commit ab05d63b authored by Daniel de Leng's avatar Daniel de Leng
Browse files

Clean up repository

parent 15241610
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,7 @@ compile: ...@@ -17,7 +17,7 @@ compile:
paths: paths:
- docs - docs
- build - build
- generate_pydocs.py - scripts/generate_pydocs.py
expire_in: 10 minutes expire_in: 10 minutes
only: only:
- master - master
...@@ -51,7 +51,7 @@ pack-linux: ...@@ -51,7 +51,7 @@ pack-linux:
- cd build/python-api-src - cd build/python-api-src
- stubgen -m commandcenter -o . - stubgen -m commandcenter -o .
- cd ../.. - cd ../..
- python3 generate_pydocs.py - python3 scripts/generate_pydocs.py
artifacts: artifacts:
paths: paths:
- build/python-api-src/commandcenter.cpython-312-x86_64-linux-gnu.so - build/python-api-src/commandcenter.cpython-312-x86_64-linux-gnu.so
......
...@@ -23,6 +23,6 @@ We can access m_unit in the unit file and with sc2::Function() we can access any ...@@ -23,6 +23,6 @@ We can access m_unit in the unit file and with sc2::Function() we can access any
Common problems: Common problems:
1. The return in python is a memory address: 1. The return in python is a memory address:
Make sure that it returns a correct type. Make sure that it returns a correct type.
2. The compiler complains about files I have not even touched: 2. The compiler complains about files I have not even touched:
Make sure that the startUp is library and you have release x64. If you just added a new function in pybind, check it. Make sure that the startUp is library and you have release x64. If you just added a new function in pybind, check it.
MIT License MIT License
Copyright (c) 2024 Daniel de Leng
Copyright (c) 2018 David Bergström Copyright (c) 2018 Jonas Kvarnström, David Bergström
Copyright (c) 2017 David Churchill Copyright (c) 2017 David Churchill
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
......
...@@ -105,7 +105,18 @@ After creating the .pyi file run the generate_pydocs.py file according to the in ...@@ -105,7 +105,18 @@ After creating the .pyi file run the generate_pydocs.py file according to the in
# How to use the library with PyCharm # How to use the library with PyCharm
See [separate page](pycharm.md). Start by downloading the library. Click the latest tag in the [PyCommandCenter repository](https://gitlab.liu.se/starcraft-ai-course/pycommandcenter/-/tags) and find a `.pyd` link at the bottom of the tag page.
Place the library in your repository.
Add the library to the Python path in Python by:
1. File->Settings->Project: (project name)->Project Interpreter.
2. Select the cog in the upper right corner and select "Show All".
3. In the new window that opens, select the icon which shows a few folders connected with lines.
4. In the new window, first press the plus icon, and then select the path of your repository (the path to where you placed the library).
5. Restart PyCharm with "File->Invalidate Caches/Restart->Invalidate and Restart".
# Building the documentation # Building the documentation
......
# Installing PyCommandCenter in PyCharm
Start by downloading the library. Click the latest tag in the [PyCommandCenter repository](https://gitlab.liu.se/starcraft-ai-course/pycommandcenter/-/tags) and find a `.pyd` link at the bottom of the tag page.
Place the library in your repository.
Add the library to the Python path in Python by:
1. File->Settings->Project: (project name)->Project Interpreter.
2. Select the cog in the upper right corner and select "Show All".
3. In the new window that opens, select the icon which shows a few folders connected with lines.
4. In the new window, first press the plus icon, and then select the path of your repository (the path to where you placed the library).
5. Restart PyCharm with "File->Invalidate Caches/Restart->Invalidate and Restart".
File moved
...@@ -3,7 +3,7 @@ import sys ...@@ -3,7 +3,7 @@ import sys
sys.path.append('build/python-api-src') sys.path.append('build/python-api-src')
from library import UnitTypeID, UNIT_TYPEID from commandcenter import UnitTypeID, UNIT_TYPEID
class TestUnitType(unittest.TestCase): class TestUnitType(unittest.TestCase):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment