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: 3 additions & 1 deletion .github/workflows/build_deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ jobs:
- name: Update repository indexes
run: sudo apt update
- name: Install Debian build package dependencies
run: sudo apt install -y devscripts debhelper dh-python python3-all python3-pytest po-debconf python3-setuptools python3-pip build-essential
run: sudo apt install -y devscripts debhelper dh-python python3-all python3-pytest po-debconf python3-setuptools python3-pip python3-distro-info build-essential
- name: Install Python dependencies for changelog generation
run: pip install packaging

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't this just be pip install .

- name: Run the build
run: make kolibri.deb
- name: Get DEB filename
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Python tests

on:
pull_request:
branches:
- main

jobs:
test:
name: Run Python tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y python3-distro-info
- name: Install Python dependencies
run: pip install -e ".[test]"
- name: Run tests
run: python3 -m pytest tests/ -v
Empty file added CHANGELOG
Empty file.
18 changes: 18 additions & 0 deletions COMMENT_REPLIES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why has this been committed?

{
"comment_id": 2836309163,
"body": "Fixed — expanded the docstring with explicit examples showing the hyphen-to-tilde conversion for each suffix type, plus annotated the stable case as unchanged."
},
{
"comment_id": 2836309926,
"body": "Removed the stale TODO."
},
{
"comment_id": 2836310785,
"body": "Fixed — `fetch_github_releases()` now accepts `latest_existing` and stops pagination once the oldest release on a page is at or below that version. Called from `main()` with the latest version from `debian/changelog`."
},
{
"comment_id": 2836312292,
"body": "Fixed — `python3-distro-info` is now installed in both the test CI and build CI workflows. Tests no longer mock `get_current_lts_codename`; they use the real package (skipping gracefully when not installed locally). Build CI also installs `packaging` for the changelog script."
}
]
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ make kolibri.deb

This will build the debian file into the `dist` folder.

### Running tests

Install the project with test dependencies:
```
pip install -e ".[test]"
```

Then run:
```
python3 -m pytest tests/ -v
```

### Building sources

This is primarily used to build sources for uploading to launchpad to release to the PPA.
Expand Down
Empty file added build_tools/__init__.py
Empty file.
10 changes: 4 additions & 6 deletions build_tools/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,11 @@ SOURCE_DIR=`ls -d kolibri*/`
cp -r ../debian $SOURCE_DIR
DEB_VERSION=`cat VERSION | sed -s 's/^\+\.\+\.\+\([abc]\|\.dev\)/\~\0/g'`

# use the environment variables if they are set:
DEBFULLNAME="${DEBFULLNAME:-Learning Equality \(Learning Equality\'s public signing key\)}"
DEBEMAIL="${DEBEMAIL:-accounts@learningequality.org>}"

cd $SOURCE_DIR
DEBFULLNAME=$DEBFULLNAME DEBEMAIL=$DEBEMAIL dch -b -v $DEB_VERSION-0ubuntu1 'New upstream release'
DEBFULLNAME=$DEBFULLNAME DEBEMAIL=$DEBEMAIL dch -r 'New upstream release'
python3 ../../build_tools/generate_changelog.py \
--debian-changelog debian/changelog \
--version-file ../VERSION \
--packaging-changelog ../../CHANGELOG

# package can't be run from a virtualenv
if [[ "$VIRTUAL_ENV" != "" ]]
Expand Down
Loading