Skip to content
5 changes: 5 additions & 0 deletions .github/workflows-config/os-versions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ubuntu-22.04
ubuntu-24.04
macos-15
macos-14
windows-latest
6 changes: 6 additions & 0 deletions .github/workflows-config/python-versions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
3.8
3.9
3.10
3.11
3.12
3.13
34 changes: 23 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,33 @@ name: Build
on: [push, pull_request]

jobs:
load-matrix:
runs-on: ubuntu-latest
outputs:
python: ${{ steps.set-matrix.outputs.python }}
os: ${{ steps.set-matrix.outputs.os }}
steps:
- uses: actions/checkout@v4
- id: set-matrix
run: |
echo "python=$(jq -Rsc 'split("\n") | map(select(length > 0))' .github/workflows-config/python-versions.txt)" >> $GITHUB_OUTPUT
echo "os=$(jq -Rsc 'split("\n") | map(select(length > 0))' .github/workflows-config/os-versions.txt)" >> $GITHUB_OUTPUT

test:
needs: load-matrix
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-22.04, ubuntu-24.04, macos-15, macos-14, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: ${{ fromJson(needs.load-matrix.outputs.os) }}
python-version: ${{ fromJson(needs.load-matrix.outputs.python) }}

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -43,10 +56,10 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

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

Expand Down Expand Up @@ -79,10 +92,10 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

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

Expand Down Expand Up @@ -189,10 +202,9 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2

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

Expand Down
35 changes: 30 additions & 5 deletions .github/workflows/regression-testing.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,55 @@
name: Regression Testing

on:
push:
branches: ['*']
tags: ['*']
pull_request:
branches: [ master ]
schedule:
- cron: 0 0 * * *

jobs:
load-matrix:
runs-on: ubuntu-latest
outputs:
python: ${{ steps.set-matrix.outputs.python }}
os: ${{ steps.set-matrix.outputs.os }}
steps:
- uses: actions/checkout@v4
- id: set-matrix
run: |
if [ "${{ github.event_name }}" == "schedule" ]; then
echo "python=$(jq -Rsc 'split("\n") | map(select(length > 0))' .github/workflows-config/python-versions.txt)" >> $GITHUB_OUTPUT
echo "os=$(jq -Rsc 'split("\n") | map(select(length > 0))' .github/workflows-config/os-versions.txt)" >> $GITHUB_OUTPUT
else
echo 'python=["3.13"]' >> $GITHUB_OUTPUT
echo 'os=["ubuntu-24.04","macos-15","windows-latest"]' >> $GITHUB_OUTPUT
fi

test:
needs: load-matrix
runs-on: ${{ matrix.os }}

strategy:
max-parallel: 1
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
os: ${{ fromJson(needs.load-matrix.outputs.os) }}
python-version: ${{ fromJson(needs.load-matrix.outputs.python) }}

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: pip install -r requirements.txt
run: |
pip install setuptools==69.5.1 wheel
pip install -r requirements.txt

- name: Run normal tests
run: python -m pytest -s -rs
Expand Down
5 changes: 4 additions & 1 deletion lean/components/util/path_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# limitations under the License.

from pathlib import Path
from typing import Optional

from lean.components import reserved_names, output_reserved_names, forbidden_characters
from lean.components.config.lean_config_manager import LeanConfigManager
Expand All @@ -29,13 +30,15 @@ def __init__(self, lean_config_manager: LeanConfigManager, platform_manager: Pla
self._lean_config_manager = lean_config_manager
self._platform_manager = platform_manager

def get_relative_path(self, destination: Path, source: Path = Path.cwd()) -> Path:
def get_relative_path(self, destination: Path, source: Optional[Path] = None) -> Path:
"""Returns a path relative to another one.

:param destination: the path to point to
:param source: the root where the relative path is relative to
:return: the destination path relative to the source path, or destination path if it is not relative
"""
if source is None:
source = Path.cwd()
try:
return destination.relative_to(source)
except ValueError:
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ def get_stubs_version_range() -> str:
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12"
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13"
],
project_urls={
"Documentation": "https://www.lean.io/docs/v2/lean-cli/key-concepts/getting-started",
Expand Down
Loading