From 14526ba020f3eeb024bcfd024c930e4bc100633d Mon Sep 17 00:00:00 2001 From: Hantao Cui Date: Sun, 4 Jan 2026 20:25:20 +0800 Subject: [PATCH 1/4] Update dependencies in pyproject.toml for compatibility and version constraints. - Restrict scipy version to <=1.16.3 for stability. - Set pandapower dependency to version 3.3 for consistency with recent changes. --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 66375349a..af57849a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,9 +22,9 @@ classifiers = [ ] dependencies = [ - "kvxopt>=1.3.2.0", + "kvxopt>=1.3.2.0,<1.4", "numpy", - "scipy<1.14", + "scipy<=1.16.3", "sympy>=1.6,!=1.10.0", "pandas", "matplotlib", @@ -68,7 +68,7 @@ doc = [ "mdit-py-plugins>=0.3.1,<0.4", ] interop = [ - "pandapower", + "pandapower==3.3", "pypowsybl", ] web = [ From 9f71e6b319fa1b68a3efcaeedf25a67625f85612 Mon Sep 17 00:00:00 2001 From: Hantao Cui Date: Sun, 4 Jan 2026 21:09:29 +0800 Subject: [PATCH 2/4] Add ipywidgets to dependencies in pyproject.toml --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index af57849a7..7c9f36cae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,7 @@ dependencies = [ "dill", "pathos", "tqdm", + "ipywidgets", "pyyaml", "coloredlogs", "chardet", From b2785ce4e05819008df84057a5d99ecc90b62421 Mon Sep 17 00:00:00 2001 From: Hantao Cui Date: Sun, 4 Jan 2026 21:16:39 +0800 Subject: [PATCH 3/4] Remove Azure Pipelines configuration and split GH Actions for quick reporting. - Updated files and dependencies in pyproject.toml so that we don't have scattered deps in CI files. - Added pytest-xdist, nbmake, and line_profiler to the development dependencies. --- .azure-pipelines/azure-pipelines-linux.yml | 35 ------ .azure-pipelines/azure-pipelines-macos.yml | 30 ----- .azure-pipelines/azure-pipelines-win.yml | 34 ------ .github/workflows/pythonapp.yml | 127 +++++++++++++++------ azure-pipelines.yml | 4 - pyproject.toml | 3 + 6 files changed, 96 insertions(+), 137 deletions(-) delete mode 100644 .azure-pipelines/azure-pipelines-linux.yml delete mode 100644 .azure-pipelines/azure-pipelines-macos.yml delete mode 100644 .azure-pipelines/azure-pipelines-win.yml delete mode 100644 azure-pipelines.yml diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml deleted file mode 100644 index 6c9a423cb..000000000 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ /dev/null @@ -1,35 +0,0 @@ -# Python package -# Create and test a Python package on multiple Python versions. -# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/python - -jobs: -- job: linux - pool: - vmImage: ubuntu-latest - timeoutInMinutes: 360 - strategy: - matrix: - linux_python3.11: - python.version: '3.11' - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '$(python.version)' - displayName: 'Use Python $(python.version)' - - - script: | - python -m pip install --upgrade pip - pip install .[dev,interop] - displayName: 'Install dependencies' - - - script: | - pip install pytest pytest-azurepipelines - coverage run -m pytest # Run the tests and check for test coverage. - coverage report -m # Generate test coverage report. - displayName: 'pytest and coverage' - - - script: | - make -C docs html # Build the documentation. - displayName: 'make documentation' diff --git a/.azure-pipelines/azure-pipelines-macos.yml b/.azure-pipelines/azure-pipelines-macos.yml deleted file mode 100644 index ee288fa49..000000000 --- a/.azure-pipelines/azure-pipelines-macos.yml +++ /dev/null @@ -1,30 +0,0 @@ -# Python package -# Create and test a Python package on multiple Python versions. -# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/python - -jobs: -- job: macos - pool: - vmImage: macOS-latest - timeoutInMinutes: 360 - strategy: - matrix: - macos_python3.11: - python.version: '3.11' - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '$(python.version)' - displayName: 'Use Python $(python.version)' - - - script: | - python -m pip install --upgrade pip - pip install .[all] - displayName: 'Install dependencies' - - - script: | - pip install pytest pytest-azurepipelines - pytest - displayName: 'pytest' diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml deleted file mode 100644 index ff8ac0b16..000000000 --- a/.azure-pipelines/azure-pipelines-win.yml +++ /dev/null @@ -1,34 +0,0 @@ -# Python package -# Create and test a Python package on multiple Python versions. -# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/python - -jobs: -- job: win - pool: - vmImage: windows-latest - timeoutInMinutes: 360 - strategy: - matrix: - win_python3.11: - python.version: '3.11' - - steps: - - powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" - displayName: Add conda to PATH - - - script: conda create --yes --quiet --name andesEnv - displayName: Create Anaconda environment - - - script: | - call activate andesEnv - conda install --yes --quiet --name andesEnv python=%PYTHON_VERSION% - displayName: Install Anaconda packages - - - script: | - call activate andesEnv - python -m pip install --upgrade pip - pip install pytest pytest-azurepipelines - pip install .[dev,interop] - pytest - displayName: pytest diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 8eb432b55..68ec86492 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -3,48 +3,107 @@ name: Python application on: [push, pull_request] jobs: - build: - name: ANDES Tests - runs-on: ubuntu-latest + test: + name: Test (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 # Required for setuptools-scm - - uses: conda-incubator/setup-miniconda@v3 + fetch-depth: 0 + + - uses: actions/setup-python@v5 with: - miniforge-variant: Miniforge3 - miniforge-version: latest - use-mamba: true python-version: '3.11' - channels: conda-forge,defaults - channel-priority: true - activate-environment: test-env - - shell: bash -el {0} - name: Install dependencies - run: | - mamba install -y nbmake pytest-xdist line_profiler flake8 pytest build - pip install -e .[dev] - - shell: bash -el {0} - name: Run pip check - run: | - pip check - - shell: bash -el {0} - name: Lint with flake8 - if: github.event_name == 'pull_request' - run: | - flake8 . - - shell: bash -el {0} - name: Run tests + + - name: Install dependencies + run: pip install -e .[dev,interop] + + - name: Run tests with coverage + if: matrix.os == 'ubuntu-latest' run: | - pytest - pytest --nbmake examples --ignore=examples/verification - - shell: bash -el {0} - name: Build and publish if tagged - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + coverage run -m pytest + coverage report -m + + - name: Run tests + if: matrix.os != 'ubuntu-latest' + run: pytest + + lint: + name: Lint + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install flake8 + run: pip install flake8 + + - name: Lint with flake8 + run: flake8 . + + notebooks: + name: Notebook Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install dependencies + run: pip install -e .[dev] + + - name: Run notebook tests + run: pytest --nbmake examples --ignore=examples/verification + + docs: + name: Build Docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install dependencies + run: pip install -e .[dev] + + - name: Build docs + run: make -C docs html + + publish: + name: Publish to PyPI + runs-on: ubuntu-latest + needs: [test, notebooks, docs] + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Build and publish run: | + pip install build twine python -m build - pip install twine twine upload dist/* env: TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.pypi_password }} \ No newline at end of file + TWINE_PASSWORD: ${{ secrets.pypi_password }} diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 79aa27eab..000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,4 +0,0 @@ -jobs: - - template: ./.azure-pipelines/azure-pipelines-linux.yml - - template: ./.azure-pipelines/azure-pipelines-macos.yml - - template: ./.azure-pipelines/azure-pipelines-win.yml \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 7c9f36cae..9241446c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,10 @@ dependencies = [ dev = [ "coverage", "pytest==7.4", + "pytest-xdist", + "nbmake", "flake8", + "line_profiler", "sphinx", "ipython", "numpydoc", From 657a99f3c3d25b684901209baeb1bf0129573ed5 Mon Sep 17 00:00:00 2001 From: Hantao Cui Date: Sun, 4 Jan 2026 21:39:29 +0800 Subject: [PATCH 4/4] Update pandapower dependency version constraint and modify CI installation steps. - Changed pandapower dependency in pyproject.toml to allow versions from 3.0 to 3.3 for better compatibility. - Updated GitHub Actions workflow to install interop dependencies alongside development dependencies. --- .github/workflows/pythonapp.yml | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 68ec86492..b976990a7 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -62,7 +62,7 @@ jobs: python-version: '3.11' - name: Install dependencies - run: pip install -e .[dev] + run: pip install -e .[dev,interop] - name: Run notebook tests run: pytest --nbmake examples --ignore=examples/verification @@ -80,7 +80,7 @@ jobs: python-version: '3.11' - name: Install dependencies - run: pip install -e .[dev] + run: pip install -e .[dev,interop] - name: Build docs run: make -C docs html diff --git a/pyproject.toml b/pyproject.toml index 9241446c7..5182d41af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,7 +72,7 @@ doc = [ "mdit-py-plugins>=0.3.1,<0.4", ] interop = [ - "pandapower==3.3", + "pandapower>=3,<=3.3", "pypowsybl", ] web = [