From 4232a56086e0d0552a4bef98044d622d2cc54025 Mon Sep 17 00:00:00 2001 From: burnysc2 Date: Tue, 17 Dec 2024 22:36:17 +0100 Subject: [PATCH] Optimize run docker shell script and fix setuptools --- .github/workflows/ci.yml | 8 +++++--- dockerfiles/test_docker_image.sh | 6 +++--- pyproject.toml | 7 +++++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0387aa4..fea6b41a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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=./" diff --git a/dockerfiles/test_docker_image.sh b/dockerfiles/test_docker_image.sh index 189d8d76..4b203c2e 100644 --- a/dockerfiles/test_docker_image.sh +++ b/dockerfiles/test_docker_image.sh @@ -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" diff --git a/pyproject.toml b/pyproject.toml index 726ff1a2..35521a2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,8 +4,7 @@ version = "7.0.1" description = "A StarCraft II API Client for Python 3" authors = [{ name = "BurnySc2", email = "gamingburny@gmail.com" }] 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", @@ -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"