Skip to content

Commit 4232a56

Browse files
committed
Optimize run docker shell script and fix setuptools
1 parent 9199beb commit 4232a56

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ jobs:
275275
# Run and upload coverage report
276276
# This coverage test does not cover the whole testing range, check /bat_files/rune_code_coverage.bat
277277
name: Run coverage
278-
needs: [run_test_bots, run_example_bots]
278+
# needs: [run_test_bots, run_example_bots]
279279
runs-on: ubuntu-latest
280280
timeout-minutes: 30
281281
env:
@@ -294,11 +294,13 @@ jobs:
294294
run: |
295295
mkdir htmlcov
296296
docker run -i -d \
297-
--mount type=bind,source=$(pwd)/htmlcov,destination=/root/python-sc2/htmlcov \
297+
-v $(pwd)/htmlcov:/root/python-sc2/htmlcov \
298298
--name my_container \
299+
--env 'PYTHONPATH=/root/python-sc2/' \
299300
$IMAGE_NAME
300301
echo "Install dev requirements because only non dev requirements exist in the docker image at the moment"
301-
docker exec -i my_container bash -c "uv sync --frozen --no-cache --no-install-project"
302+
docker exec -i test_container bash -c "pip install uv \
303+
&& cd python-sc2 && uv sync --frozen --no-cache --no-install-project"
302304
303305
- name: Run coverage on tests
304306
run: docker exec -i my_container bash -c "uv run pytest --cov=./"

dockerfiles/test_docker_image.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ docker run -i -d \
3939
--entrypoint /bin/bash \
4040
$IMAGE_NAME
4141

42+
# Install requirements
4243
docker exec -i test_container mkdir -p /root/python-sc2
4344
docker cp pyproject.toml test_container:/root/python-sc2/
4445
docker cp uv.lock test_container:/root/python-sc2/
46+
docker exec -i test_container bash -c "pip install uv && cd python-sc2 && uv sync --no-cache --no-install-project"
47+
4548
docker cp sc2 test_container:/root/python-sc2/sc2
4649
docker cp test test_container:/root/python-sc2/test
4750

48-
# Install python-sc2, via mount the python-sc2 folder will be available
49-
docker exec -i test_container bash -c "pip install uv && cd python-sc2 && uv sync --no-cache --no-install-project"
50-
5151
# Run various test bots
5252
docker exec -i test_container bash -c "cd python-sc2 && uv run python test/travis_test_script.py test/autotest_bot.py"
5353
docker exec -i test_container bash -c "cd python-sc2 && uv run python test/travis_test_script.py test/queries_test_bot.py"

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ version = "7.0.1"
44
description = "A StarCraft II API Client for Python 3"
55
authors = [{ name = "BurnySc2", email = "[email protected]" }]
66
requires-python = ">=3.9, <3.13"
7-
license = "MIT"
8-
documentation = "https://burnysc2.github.io/python-sc2/docs/index.html"
7+
license = { file = "LICENSE" }
98
keywords = ["StarCraft", "StarCraft 2", "StarCraft II", "AI", "Bot"]
109
classifiers = [
1110
"Intended Audience :: Developers",
@@ -67,6 +66,10 @@ dev = [
6766
"yapf>=0.43.0",
6867
]
6968

69+
[tool.setuptools.packages.find]
70+
where = ["."]
71+
include = ["sc2"]
72+
7073
[project.urls]
7174
Repository = "https://github.com/Burnysc2/python-sc2"
7275
Documentation = "https://burnysc2.github.io/python-sc2"

0 commit comments

Comments
 (0)