Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/build_debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
env:
LP_CREDENTIALS_FILE: /tmp/lp-creds.txt
run: |
python3 scripts/copy_to_other_distributions.py
python3 scripts/launchpad_copy.py copy-to-series
- name: Cleanup Launchpad credentials
if: always()
run: rm -f /tmp/lp-creds.txt
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
env:
LP_CREDENTIALS_FILE: /tmp/lp-creds.txt
run: |
python3 scripts/copy_package_proposed_to_ppa.py
python3 scripts/launchpad_copy.py promote
- name: Cleanup Launchpad credentials
if: always()
run: rm -f /tmp/lp-creds.txt
22 changes: 22 additions & 0 deletions .github/workflows/python_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Python Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y distro-info
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install pytest vcrpy launchpadlib
- name: Run tests
run: |
python3 -m pytest tests/ -v
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ repos:
rev: v1.7.7
hooks:
- id: actionlint
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.2
hooks:
- id: ruff-check
- id: ruff-format
14 changes: 6 additions & 8 deletions kolibri_server_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
import subprocess

import kolibri.utils.pskolibri as psutil

from kolibri.core.content.utils.paths import get_content_dir_path
from kolibri.core.utils.cache import RedisSettingsHelper
from kolibri.core.utils.cache import process_cache
from kolibri.utils.options import update_options_file
from kolibri.utils.conf import OPTIONS
from kolibri.utils.conf import KOLIBRI_HOME
from kolibri.utils.conf import OPTIONS
from kolibri.utils.options import update_options_file

# read the config file options
port = OPTIONS["Deployment"]["HTTP_PORT"]
Expand Down Expand Up @@ -64,12 +62,14 @@ def set_port(port):
"""
update_options_file("Deployment", "HTTP_PORT", port)


def set_zip_content_port(port):
"""
Modify Kolibri options to set the TCP port the hashi files will be served on
"""
update_options_file("Deployment", "ZIP_CONTENT_PORT", port)


def delete_redis_cache():
"""
Delete previous cache in redis to reset it when the service starts.
Expand Down Expand Up @@ -141,7 +141,7 @@ def check_redis_service():

def save_nginx_conf_port(port, zip_port, listen_address="0.0.0.0", nginx_conf=None):
"""
Adds the port for nginx to run to an existing config file.
Adds the port for nginx to run to an existing config file.
"""

if nginx_conf is None:
Expand Down Expand Up @@ -210,9 +210,7 @@ def save_nginx_conf_port(port, zip_port, listen_address="0.0.0.0", nginx_conf=No
help="Port to run hashi iframes used when installing/reconfiguring kolibri-server package",
)
args = parser.parse_args()
if (
args.debconfport
): # To be executed only when installing/reconfiguring the Debian package
if args.debconfport: # To be executed only when installing/reconfiguring the Debian package
set_port(args.debconfport)
if args.debconfzipport:
set_zip_content_port(args.debconfzipport)
Expand Down
13 changes: 13 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[tool.ruff]
target-version = "py310"
line-length = 120

[tool.ruff.lint]
select = ["E", "F", "I", "PLC0415"]
ignore = ["E501"]

[tool.ruff.lint.isort]
force-single-line = true

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["E501"]
69 changes: 0 additions & 69 deletions scripts/copy_package_proposed_to_ppa.py

This file was deleted.

Loading