Skip to content

Commit 7b5ecf2

Browse files
authored
Merge pull request #254 from PyLops/dev
Prepare for v0.12.0
2 parents 3e732dd + ecc9966 commit 7b5ecf2

95 files changed

Lines changed: 5783 additions & 1042 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yaml

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
1-
name: PyProx
1+
name: PyProximal-testing
22

3-
on: [push, pull_request]
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
push:
7+
branches:
8+
- main
9+
- dev
410

511
jobs:
612
build:
713
strategy:
814
matrix:
915
platform: [ ubuntu-latest, macos-latest ]
10-
python-version: ["3.10", "3.11", "3.12"]
16+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
1117

1218
runs-on: ${{ matrix.platform }}
19+
1320
steps:
14-
- uses: actions/checkout@v4
15-
- name: Get history and tags for SCM versioning to work
16-
run: |
17-
git fetch --prune --unshallow
18-
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
19-
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v5
21-
with:
22-
python-version: ${{ matrix.python-version }}
23-
- name: Install dependencies
24-
run: |
25-
python -m pip install --upgrade pip setuptools
26-
pip install flake8 pytest
27-
if [ -f requirements.txt ]; then pip install -r requirements-dev.txt; fi
28-
- name: Install pyproximal
29-
run: |
30-
python -m setuptools_scm
31-
pip install .
32-
- name: Test with pytest
33-
run: |
34-
pytest
21+
- name: Check out source repository
22+
uses: actions/checkout@v6
23+
with:
24+
fetch-depth: 0
25+
- name: Install uv with Python ${{ matrix.python-version }}
26+
uses: astral-sh/setup-uv@v6
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
- name: Install dependencies and pyproximal
30+
run: uv sync --locked --all-extras --all-groups
31+
- name: Test with pytest
32+
run: uv run pytest --color=yes pytests/
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow uploads PyProximal coverage analysis on Codacy
2+
# For more information see: https://github.com/codacy/codacy-coverage-reporter-action
3+
name: PyProximal-coverage
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches: [dev]
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out source repository
15+
uses: actions/checkout@v6
16+
with:
17+
fetch-depth: 0
18+
- name: Install uv with Python
19+
uses: astral-sh/setup-uv@v6
20+
with:
21+
python-version: "3.11"
22+
- name: Install dependencies and pyproximal
23+
run: uv sync --locked --all-extras --all-groups
24+
- name: Coverage with pytest
25+
run: |
26+
uv run coverage run -m pytest
27+
uv run coverage xml
28+
uv run coverage html
29+
- name: Upload HTML coverage report
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: coverage-html
33+
path: htmlcov/
34+
- name: Run codacy-coverage-reporter
35+
if: github.event_name == 'push'
36+
uses: codacy/codacy-coverage-reporter-action@v1
37+
with:
38+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
39+
coverage-reports: coverage.xml

.github/workflows/deploy.yaml

Lines changed: 57 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,67 @@
11
# This workflow uploads PyProx on PyPI using Twine when a release is created
2-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3-
name: PyProx-deploy
2+
# For more information see: https://github.com/python-attrs/attrs/blob/main/.github/workflows/pypi-package.yml
3+
name: PyProximal-deploy
44

55
on:
6+
push:
7+
tags: ["*"]
68
release:
7-
types: [published]
9+
types:
10+
- published
11+
workflow_dispatch:
812

913
jobs:
10-
deploy:
14+
build-package:
15+
name: Build & verify package
1116
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Check out source repository
20+
uses: actions/checkout@v6
21+
with:
22+
fetch-depth: 0
23+
- name: Build and inspect package
24+
uses: hynek/build-and-inspect-python-package@v2
25+
26+
release-test-pypi:
27+
name: Publish in-dev package to test.pypi.org
28+
if: github.repository_owner == 'PyLops' && github.ref_type == 'tag'
29+
runs-on: ubuntu-latest
30+
needs: build-package
31+
permissions:
32+
contents: read
33+
id-token: write
34+
35+
steps:
36+
- name: Download package
37+
uses: actions/download-artifact@v8
38+
with:
39+
name: Packages
40+
path: dist
41+
42+
- name: Upload package to Test PyPI
43+
uses: pypa/gh-action-pypi-publish@release/v1
44+
with:
45+
attestations: true
46+
repository-url: https://test.pypi.org/legacy/
47+
48+
release-pypi:
49+
name: Publish released package to pypi.org
50+
if: github.repository_owner == 'PyLops' && github.event.action == 'published'
51+
runs-on: ubuntu-latest
52+
needs: build-package
53+
permissions:
54+
contents: read
55+
id-token: write
56+
1257
steps:
13-
- uses: actions/checkout@v2
14-
- name: Set up Python
15-
uses: actions/setup-python@v2
58+
- name: Download package
59+
uses: actions/download-artifact@v8
1660
with:
17-
python-version: '3.x'
18-
- name: Install dependencies
19-
run: |
20-
python -m pip install --upgrade pip
21-
pip install build
22-
- name: Build package
23-
run: python -m build
24-
- name: Publish package
25-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
61+
name: Packages
62+
path: dist
63+
64+
- name: Upload package to PyPI
65+
uses: pypa/gh-action-pypi-publish@release/v1
2666
with:
27-
user: __token__
28-
password: ${{ secrets.PYPI_API_TOKEN }}
67+
attestations: true

.github/workflows/flake8.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/mypy.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This workflow runs MyPy on the PR
2+
name: PyProximal-mypy
3+
4+
on: [push, pull_request]
5+
6+
jobs:
7+
mypy:
8+
runs-on: ubuntu-latest
9+
name: MyPy
10+
steps:
11+
- name: Check out source repository
12+
uses: actions/checkout@v6
13+
with:
14+
fetch-depth: 0
15+
- name: Install uv with Python
16+
uses: astral-sh/setup-uv@v6
17+
with:
18+
python-version: "3.11"
19+
enable-cache: true
20+
- name: Install dependencies and pyproximal
21+
run: uv sync --locked --all-extras --all-groups
22+
- name: Run Mypy
23+
run: |
24+
uv run mypy pyproximal/

.github/workflows/ruff.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This workflow runs Ruff on the PR
2+
# For more information see: https://github.com/marketplace/actions/ruff-action
3+
name: PyProximal-ruff
4+
5+
on: [push, pull_request]
6+
7+
jobs:
8+
ruff-lint:
9+
runs-on: ubuntu-latest
10+
name: Lint
11+
steps:
12+
- name: Check out source repository
13+
uses: actions/checkout@v6
14+
with:
15+
fetch-depth: 0
16+
- name: Lint with ruff
17+
uses: astral-sh/ruff-action@v3
18+
with:
19+
src: "./pyproximal"

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ build
1717
dist
1818
pyproximal.egg-info/
1919

20-
# setuptools_scm generated #
20+
# hatchling generated #
2121
pyproximal/version.py
2222

2323
# Development #
24+
.codacy
2425
.vscode
2526
.ipynb_checkpoints/
2627
notebooks

.pre-commit-config.yaml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,27 @@ repos:
55
hooks:
66
- id: trailing-whitespace
77
- id: end-of-file-fixer
8+
- id: mixed-line-ending
9+
- id: check-toml
810
- id: check-yaml
11+
- id: check-added-large-files
12+
- id: check-case-conflict
13+
- id: check-merge-conflict
914

10-
- repo: https://github.com/psf/black
11-
rev: 25.1.0
15+
- repo: https://github.com/astral-sh/ruff-pre-commit
16+
rev: v0.14.14
1217
hooks:
13-
- id: black
14-
args: # arguments to configure black
15-
- --line-length=88
18+
- id: ruff-check
19+
args: [ --fix ]
20+
- id: ruff-format
1621

17-
- repo: https://github.com/pycqa/isort
18-
rev: 6.0.1
22+
- repo: https://github.com/astral-sh/uv-pre-commit
23+
rev: 0.9.28
1924
hooks:
20-
- id: isort
21-
name: isort (python)
22-
args:
23-
[
24-
"--profile",
25-
"black",
26-
"--skip",
27-
"__init__.py",
28-
"--filter-files",
29-
"--line-length=88",
30-
]
25+
- id: uv-lock
26+
27+
- repo: https://github.com/abravalheri/validate-pyproject
28+
rev: "v0.23"
29+
hooks:
30+
- id: validate-pyproject
31+
additional_dependencies: ["validate-pyproject-schema-store[all]"]

.readthedocs.yaml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@
55
# Required
66
version: 2
77

8-
# Set the version of Python and other tools you might need
9-
build:
10-
os: ubuntu-20.04
11-
tools:
12-
python: "3.11"
13-
148
# Build documentation in the docs/ directory with Sphinx
159
sphinx:
1610
configuration: docs/source/conf.py
1711

18-
# Declare the Python requirements required to build your docs
19-
python:
20-
install:
21-
- requirements: requirements-doc.txt
22-
- method: pip
23-
path: .
12+
# Set the version of environment using UV
13+
build:
14+
os: ubuntu-24.04
15+
tools:
16+
python: "3.13"
17+
jobs:
18+
pre_create_environment:
19+
- asdf plugin add uv
20+
- asdf install uv latest
21+
- asdf global uv latest
22+
create_environment:
23+
- uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
24+
install:
25+
- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --locked --all-extras --all-groups

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Changelog
22
=========
33

4+
# 0.12.0
5+
6+
* Added ``pyproximal.optimization.primal.ConsensusADMM``
7+
and ``pyproximal.optimization.primal.PPXA`` solvers
8+
* Modified role of x and y in
9+
``pyproximal.optimization.primal.DouglasRachfordSplitting``
10+
* Fix norm computation in ``pyproximal.proximal.L1`` for
11+
2D-arrays
12+
413
# 0.11.1
514
* Added ``typing_extensions`` to dependencies
615

0 commit comments

Comments
 (0)