diff --git a/.gitignore b/.gitignore index 7dcac56..a6ff003 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ .idea cache -config.py \ No newline at end of file +config.py + +before.requirements.txt +after.requirements.txt \ No newline at end of file diff --git a/README.md b/README.md index 24cb857..3ce4f84 100644 --- a/README.md +++ b/README.md @@ -17,14 +17,23 @@ This image contains all the different technologies and dependencies for agents t To bump the python version: 1. Set the `PYTHON_VERSION` environment variable in the [Dockerfile](docker/Dockerfile.bot) to the desired version. This will ensure it is installed in the image. 2. Update the `python` version range entry in the [pyproject.toml](pyproject.toml). This will ensure compatible dependencies are installed. +3. Follow the steps below to bump the dependencies and generate a report as they might change based upon the new python version. -### Bumping Python dependencies +### Bumping Python dependencies and generating a report The [pyproject.toml](pyproject.toml) file describes required dependencies for the bot image. To bump the dependencies, first set any specifically desired versions (or leave them as "*") in the `pyproject.toml` file. Then run the following command: ``` +# Report the previous requirements.txt file +PREVIOUS_VERSION=v0.0.0 # the previous version arenaclient-bot-base image that we're comparing to +# Take the requirements output from the console of the following command and save it to before.requirements.txt +docker run -it aiarena/arenaclient-bot-base:${PREVIOUS_VERSION} bash -c "pip install poetry && poetry export -f requirements.txt --without-hashes" + +# This will build the bot image and then run `poetry update` which will update the `poetry.lock` file with the latest versions. +# After running this, copy the requirements.txt content output from the console and save it to after.requirements.txt docker compose -f docker/docker-compose.yml run --rm poetry-update -``` -This will build the bot image and then run `poetry update` which will update the `poetry.lock` file with the latest versions. -It will also generate a report in the output of the command showing the changes made. \ No newline at end of file + +# This will generate a report showing the changes made. +python ./requirements_diff.py +``` \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 5695a90..6bc29f4 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -23,4 +23,4 @@ services: - ../pyproject.toml:/root/pyproject.toml - ../requirements_diff.py:/root/requirements_diff.py working_dir: /root/ - command: bash -c "pip install poetry && poetry export -f requirements.txt --output ./before.requirements.txt --without-hashes && poetry update && poetry export -f requirements.txt --output after.requirements.txt --without-hashes && python ./requirements_diff.py" + command: bash -c "pip install poetry && poetry update && poetry export -f requirements.txt --without-hashes"