Skip to content

Commit

Permalink
Optimize run docker shell script and fix setuptools
Browse files Browse the repository at this point in the history
  • Loading branch information
BurnySc2 committed Dec 17, 2024
1 parent 9199beb commit 4232a56
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ jobs:
# Run and upload coverage report
# This coverage test does not cover the whole testing range, check /bat_files/rune_code_coverage.bat
name: Run coverage
needs: [run_test_bots, run_example_bots]
# needs: [run_test_bots, run_example_bots]
runs-on: ubuntu-latest
timeout-minutes: 30
env:
Expand All @@ -294,11 +294,13 @@ jobs:
run: |
mkdir htmlcov
docker run -i -d \
--mount type=bind,source=$(pwd)/htmlcov,destination=/root/python-sc2/htmlcov \
-v $(pwd)/htmlcov:/root/python-sc2/htmlcov \
--name my_container \
--env 'PYTHONPATH=/root/python-sc2/' \
$IMAGE_NAME
echo "Install dev requirements because only non dev requirements exist in the docker image at the moment"
docker exec -i my_container bash -c "uv sync --frozen --no-cache --no-install-project"
docker exec -i test_container bash -c "pip install uv \
&& cd python-sc2 && uv sync --frozen --no-cache --no-install-project"
- name: Run coverage on tests
run: docker exec -i my_container bash -c "uv run pytest --cov=./"
Expand Down
6 changes: 3 additions & 3 deletions dockerfiles/test_docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ docker run -i -d \
--entrypoint /bin/bash \
$IMAGE_NAME

# Install requirements
docker exec -i test_container mkdir -p /root/python-sc2
docker cp pyproject.toml test_container:/root/python-sc2/
docker cp uv.lock test_container:/root/python-sc2/
docker exec -i test_container bash -c "pip install uv && cd python-sc2 && uv sync --no-cache --no-install-project"

docker cp sc2 test_container:/root/python-sc2/sc2
docker cp test test_container:/root/python-sc2/test

# Install python-sc2, via mount the python-sc2 folder will be available
docker exec -i test_container bash -c "pip install uv && cd python-sc2 && uv sync --no-cache --no-install-project"

# Run various test bots
docker exec -i test_container bash -c "cd python-sc2 && uv run python test/travis_test_script.py test/autotest_bot.py"
docker exec -i test_container bash -c "cd python-sc2 && uv run python test/travis_test_script.py test/queries_test_bot.py"
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ version = "7.0.1"
description = "A StarCraft II API Client for Python 3"
authors = [{ name = "BurnySc2", email = "[email protected]" }]
requires-python = ">=3.9, <3.13"
license = "MIT"
documentation = "https://burnysc2.github.io/python-sc2/docs/index.html"
license = { file = "LICENSE" }
keywords = ["StarCraft", "StarCraft 2", "StarCraft II", "AI", "Bot"]
classifiers = [
"Intended Audience :: Developers",
Expand Down Expand Up @@ -67,6 +66,10 @@ dev = [
"yapf>=0.43.0",
]

[tool.setuptools.packages.find]
where = ["."]
include = ["sc2"]

[project.urls]
Repository = "https://github.com/Burnysc2/python-sc2"
Documentation = "https://burnysc2.github.io/python-sc2"
Expand Down

0 comments on commit 4232a56

Please sign in to comment.