Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Setup enviroment
description: Setup python environment with uv and install apt depdendencies

inputs:
install-texlive:
description: "Whether to install texlive dependencies"
required: false
# Composite actions don't support boolean inputs yet.
# See https://github.com/actions/runner/issues/2238
default: "false"

runs:
using: "composite"

steps:
- name: Install apt dependencies
run: |
sudo apt-get update
sudo apt-get install -y curl libpq-dev libdb-dev
shell: sh

- name: Install texlive
if: inputs.install-texlive == 'true'
run: |
sudo apt-get install -y texlive-latex-base texlive-lang-polish texlive-lang-czechslovak texlive-latex-extra texlive-pstricks texlive-luatex
shell: sh

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "latest"
python-version: "3.11"
activate-environment: true

- name: Install python dependencies
run: |
uv pip install -r requirements.txt
shell: sh
20 changes: 5 additions & 15 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,12 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install apt dependencies
run: |
sudo apt-get update
sudo apt-get install -y curl libpq-dev libdb-dev
- uses: ./.github/actions/setup-env

- name: Install pip dependencies
- name: Install python dependencies for generating docs
run: |
python -m pip install --upgrade pip wheel setuptools
python setup.py install_egg_info
pip install --upgrade -r rst/requirements.txt
pip install --upgrade -r requirements.txt
uv pip install --upgrade -r rst/requirements.txt
uv pip install --upgrade -r requirements.txt

- name: Run Sphinx
run: |
Expand All @@ -52,4 +42,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v4
17 changes: 2 additions & 15 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,9 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
- uses: ./.github/actions/setup-env
with:
python-version: '3.11'

- name: Install apt dependencies
run: |
sudo apt-get update
sudo apt-get install -y curl libpq-dev libdb-dev
sudo apt-get install -y texlive-latex-base texlive-lang-polish texlive-lang-czechslovak texlive-latex-extra texlive-pstricks texlive-luatex

- name: Install pip dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
python setup.py install_egg_info
pip install --upgrade -r requirements.txt
install-texlive: "true"

- name: Run tests
run: |
Expand Down
17 changes: 2 additions & 15 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,9 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
- uses: ./.github/actions/setup-env
with:
python-version: '3.11'

- name: Install apt dependencies
run: |
sudo apt-get update
sudo apt-get install -y curl libpq-dev libdb-dev
sudo apt-get install -y texlive-latex-base texlive-lang-polish texlive-latex-extra texlive-pstricks texlive-luatex

- name: Install pip dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
python setup.py install_egg_info
pip install --upgrade -r requirements.txt
install-texlive: "true"

- name: Run tests
run: |
Expand Down
16 changes: 3 additions & 13 deletions .github/workflows/translations-download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: ./.github/actions/setup-env

- name: Install apt dependencies
- name: Install gettext
run: |
sudo apt-get update
sudo apt-get install -y curl libpq-dev libdb-dev gettext

- name: Install pip dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
python setup.py install_egg_info
pip install --upgrade -r requirements.txt
sudo apt-get install -y gettext

- name: Install TX client
run: |
Expand Down
16 changes: 3 additions & 13 deletions .github/workflows/translations-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: ./.github/actions/setup-env

- name: Install apt dependencies
- name: Install gettext
run: |
sudo apt-get update
sudo apt-get install -y curl libpq-dev libdb-dev gettext

- name: Install pip dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
python setup.py install_egg_info
pip install --upgrade -r requirements.txt
sudo apt-get install -y gettext

- name: Install TX client
run: |
Expand Down
16 changes: 11 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,25 @@ RUN sed -i -e "s/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/" /etc/locale.gen && \
locale-gen

# Installing python dependencies
RUN pip3 install uv

USER oioioi

ENV PATH $PATH:/home/oioioi/.local/bin/
ENV UV_NO_CACHE 1
ENV VIRTUAL_ENV /home/oioioi/venv
RUN uv venv $VIRTUAL_ENV
# The python executable from the venv must have priority over the system one.
ENV PATH $VIRTUAL_ENV/bin/:$PATH

ENV BERKELEYDB_DIR /usr
RUN pip3 install --user psycopg2-binary twisted uwsgi
RUN pip3 install --user bsddb3==6.2.7
RUN uv pip install psycopg2-binary twisted uwsgi
RUN uv pip install bsddb3==6.2.7

WORKDIR /sio2/oioioi

COPY --chown=oioioi:oioioi . ./
RUN pip3 install --user -r requirements.txt filetracker[server]
RUN pip3 install --user -r requirements_static.txt
RUN uv pip install -r requirements.txt filetracker[server]
RUN uv pip install -r requirements_static.txt

# Installing node dependencies
ENV PATH $PATH:/sio2/oioioi/node_modules/.bin
Expand Down
2 changes: 1 addition & 1 deletion GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ We only need to build (here comes the magic word) SIO dependent images.
Once you built the image, you can set the container up.
Remember - things like dependencies (`requirements[_static].txt`, `setup.py`) are downloaded during the built,
so if you changed something in those places you either need to build the image again,
or apply these changes by hand (e.g. do `pip install`).
or apply these changes by hand (e.g. do `uv pip install`).
If you have good internet connection and adequate CPU, it shouldn't be hard to build the image again,
especially that it is more stable approach.

Expand Down
7 changes: 4 additions & 3 deletions rst/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
sphinx>7.1.0
furo
sphinx-autoapi==3.0.0 # sphinx extension https://sphinx-autoapi.readthedocs.io/en/latest/index.html
pydantic==2.5.2
pydantic-settings
# sphinx extension https://sphinx-autoapi.readthedocs.io/en/latest/index.html
sphinx-autoapi>3.5.0
pydantic
pydantic-settings