Skip to content

Commit a68434f

Browse files
authored
Merge pull request #241 from mrava87/build-uv
build: added support for uv
2 parents 3c10481 + 9c1713b commit a68434f

38 files changed

Lines changed: 3775 additions & 493 deletions

.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 }}
1319
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
20+
- uses: actions/checkout@v4
21+
- name: Get history and tags for SCM versioning to work
22+
run: |
23+
git fetch --prune --unshallow
24+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
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: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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: [main]
9+
10+
jobs:
11+
build:
12+
strategy:
13+
matrix:
14+
platform: [ubuntu-latest]
15+
python-version: ["3.11"]
16+
17+
runs-on: ${{ matrix.platform }}
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Get history and tags for SCM versioning to work
23+
run: |
24+
git fetch --prune --unshallow
25+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
26+
27+
- name: Install uv with Python ${{ matrix.python-version }}
28+
uses: astral-sh/setup-uv@v6
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
32+
- name: Install dependencies and pyproximal
33+
run: uv sync --locked --all-extras --all-groups
34+
35+
- name: Coverage with pytest
36+
run: |
37+
uv run coverage run -m pytest
38+
uv run coverage xml
39+
uv run coverage html
40+
41+
- name: Upload HTML coverage report
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: coverage-html
45+
path: htmlcov/
46+
47+
- name: Run codacy-coverage-reporter
48+
if: github.event_name == 'push'
49+
uses: codacy/codacy-coverage-reporter-action@v1
50+
with:
51+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
52+
coverage-reports: coverage.xml

.github/workflows/deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This workflow uploads PyProx on PyPI using Twine when a release is created
22
# 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
3+
name: PyProximal-deploy
44

55
on:
66
release:

.github/workflows/flake8.yaml

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

.github/workflows/mypy.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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@v4
13+
- name: Install uv with Python
14+
uses: astral-sh/setup-uv@v6
15+
with:
16+
python-version: "3.11"
17+
enable-cache: true
18+
- name: Install dependencies and pyproximal
19+
run: uv sync --locked --all-extras --all-groups
20+
- name: Run Mypy
21+
run: |
22+
uv run mypy pyproximal/

.github/workflows/ruff.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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@v4
14+
- name: ruff Lint
15+
uses: astral-sh/ruff-action@v3
16+
with:
17+
src: "./pyproximal"

.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

CONTRIBUTING.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ Ready to contribute?
4646

4747
1. Follow all installation instructions in the [Step-by-step installation for developers](https://pyproximal.readthedocs.io/en/stable/installation.html#step-by-step-installation-for-developers) section of the documentation.
4848

49-
1. Fork the `PyProximal` repo.
50-
5149
2. Create a branch for local development:
5250
```
5351
git checkout -b name-of-your-branch
@@ -58,21 +56,28 @@ Ready to contribute?
5856
```
5957
make tests
6058
```
59+
or
60+
```
61+
make tests_uv
62+
```
6163
62-
4. Run flake8 to check the quality of your code:
64+
4. Run ruff to check the quality of your code:
6365
```
6466
make lint
6567
```
66-
Note that PyLops does not enforce full compliance with flake8, rather this is used as a
67-
guideline and will also be run as part of our CI.
68-
Make sure to limit to a minimum flake8 warnings before making a PR.
68+
or
69+
```
70+
make lint_uv
71+
```
72+
73+
Note that PyProximal enforces full compliance with ruff and it will also be run as part of our CI.
6974
7075
5. Update the docs
7176
```
7277
make docupdate
7378
```
7479
75-
6. Commit your changes and push your branch to GitLab::
80+
6. Commit your changes and push your branch to GitHub:
7681
```
7782
git add .
7883
git commit -m "Your detailed description of your changes."

0 commit comments

Comments
 (0)