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
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: '2.3.2'
poetry-version: '2.4.1'

- name: Install dependencies
run: poetry install
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: '2.3.2'
poetry-version: '2.4.1'

- name: Install dependencies
run: poetry install --with docs
Expand All @@ -35,7 +35,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']

steps:
- uses: actions/checkout@v6
Expand All @@ -48,7 +48,7 @@ jobs:
- name: Set up Poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: "2.3.2"
poetry-version: "2.4.1"

- name: Install dependencies
run: poetry install
Expand Down
7 changes: 7 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ Changelog
Below you'll find all the changes that have been made to the code with
newest changes first.

0.23.x
------
* v0.23.0
* Drop support for python 3.9
* Add `sample_programs_repo_commit_hash` and
`sample_programs_website_repo_commit_hash` methods to `Repo` class

0.22.x
------
* v0.22.2
Expand Down
718 changes: 344 additions & 374 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[project]
name = "subete"
version = "0.22.2"
version = "0.23.0"
description = "The Sample Programs API in Python"
authors = [
{name = "Jeremy Grifski", email = "jeremy.grifski@therenegadecoder.com"}
]
readme = "README.md"
requires-python = ">=3.9,<4.0"
requires-python = ">=3.10,<4.0"
license = {text = "LICENSE"}
dependencies = [
"pyyaml (>=6,<7)",
Expand All @@ -33,8 +33,8 @@ classifiers = [

[dependency-groups]
dev = [
"pytest (>=8.3.5,<9.0.0)",
"pytest-cov (>=6.0.0,<7.0.0)"
"pytest (>=9.0.3,<10.0.0)",
"pytest-cov (>=7.1.0,<8.0.0)"
]
docs = [
"sphinx (>=7.4.7,<8.0.0)",
Expand Down
29 changes: 29 additions & 0 deletions subete/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,35 @@ def sample_programs_repo_dir(self) -> str:
"""
return self._sample_programs_repo_dir

def sample_programs_repo_commit_hash(self) -> str:
"""
Retreives the hash of the HEAD commit hash for the sample programs repository

Assuming you have a Repo object called repo, here's how you would use
this method::

commit_hash: int = repo.sample_programs_repo_commit_hash()

:return: the HEAD commit hash for the sample programs repository
"""

return self._sample_programs_repo.head.commit.hexsha

def sample_programs_website_repo_commit_hash(self) -> str:
"""
Retreives the hash of the HEAD commit hash for the sample programs website
repository

Assuming you have a Repo object called repo, here's how you would use
this method::

commit_hash: int = repo.sample_programs_website_repo_commit_hash()

:return: the HEAD commit hash for the sample programs website repository
"""

return self._sample_programs_website_repo.head.commit.hexsha

def total_programs(self) -> int:
"""
Retrieves the total number of programs in the sample programs repo.
Expand Down
13 changes: 13 additions & 0 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from unittest.mock import patch
import tempfile
import re

import pytest

Expand All @@ -8,6 +9,8 @@
SAMPLE_PROGRAMS_TEMP_DIR = tempfile.TemporaryDirectory()
SAMPLE_PROGRAMS_WEBSITE_TEMP_DIR = tempfile.TemporaryDirectory()

EXPECTED_COMMIT_HASH_PATTERN = re.compile("[0-9a-f]{40,}", re.I);


def test_doc_url_multiword_lang(test_repo):
language: subete.LanguageCollection = test_repo["Commodore BASIC"]
Expand Down Expand Up @@ -134,6 +137,16 @@ def test_repo_languages(test_repo):
assert len(list(test_repo)) > 0


def test_repo_commit_hash(test_repo):
commit_hash = test_repo.sample_programs_repo_commit_hash()
assert EXPECTED_COMMIT_HASH_PATTERN.fullmatch(commit_hash) is not None


def test_website_repo_commit_hash(test_repo):
commit_hash = test_repo.sample_programs_website_repo_commit_hash()
assert EXPECTED_COMMIT_HASH_PATTERN.fullmatch(commit_hash) is not None


def test_repo_total_programs(test_repo):
assert test_repo.total_programs() > 0

Expand Down