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
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
26 changes: 22 additions & 4 deletions .github/workflows/regression-testing.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,43 @@
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: |
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:
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 }}

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
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,19 @@ def get_stubs_version_range() -> str:
"console_scripts": ["lean=lean.main:main"]
},
install_requires=install_requires,
python_requires=">= 3.7",
python_requires=">= 3.8",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Financial and Insurance Industry",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"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