Skip to content

Commit aa10dd2

Browse files
committed
Merge branch 'release/5.1.0'
2 parents b70912b + 243d0f2 commit aa10dd2

Some content is hidden

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

98 files changed

+5789
-17777
lines changed

.coveragerc

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

.devcontainer/Dockerfile

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

.devcontainer/devcontainer.json

Lines changed: 27 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,29 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/python
13
{
2-
"name": "Python 3",
3-
"build": {
4-
"dockerfile": "Dockerfile",
5-
"context": "..",
6-
"args": {
7-
// Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9
8-
"VARIANT": "3.11",
9-
// Options
10-
"INSTALL_NODE": "false",
11-
"NODE_VERSION": "lts/*"
12-
}
13-
},
14-
"containerEnv": {
15-
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}",
16-
"GITHUB_USER": "${localEnv:GITHUB_USER}"
17-
},
18-
"workspaceFolder": "/fhiry",
19-
"workspaceMount": "src=fhiry,dst=/fhiry,type=volume,volume-driver=local",
20-
// Set *default* container specific settings.json values on container create.
21-
"settings": {
22-
"python.pythonPath": "/usr/local/bin/python",
23-
"python.languageServer": "Pylance",
24-
"python.linting.enabled": true,
25-
"python.linting.pylintEnabled": true,
26-
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
27-
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
28-
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
29-
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
30-
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
31-
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
32-
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
33-
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
34-
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
35-
},
36-
// Add the IDs of extensions you want installed when the container is created.
37-
"extensions": [
38-
"ms-python.python",
39-
"ms-python.vscode-pylance"
40-
],
41-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
42-
// "forwardPorts": [],
4+
"name": "fhiry",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye",
7+
"runArgs": [
8+
// avoid UID/GID remapping under rootless Podman
9+
"--userns=keep-id"
10+
],
11+
"features": {},
12+
4313
// Use 'postCreateCommand' to run commands after the container is created.
44-
"postCreateCommand": "pip3 install --user -e .",
45-
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
46-
// "remoteUser": "vscode"
47-
}
14+
"postCreateCommand": "./.devcontainer/postCreateCommand.sh",
15+
16+
// Configure tool-specific properties.
17+
"customizations": {
18+
"vscode": {
19+
"extensions": ["ms-python.python", "editorconfig.editorconfig"],
20+
"settings": {
21+
"python.testing.pytestArgs": ["tests"],
22+
"python.testing.unittestEnabled": false,
23+
"python.testing.pytestEnabled": true,
24+
"python.defaultInterpreterPath": "/workspaces/fhiry/.venv/bin/python",
25+
"python.testing.pytestPath": "/workspaces/fhiry/.venv/bin/pytest"
26+
}
27+
}
28+
}
29+
}

.devcontainer/postCreateCommand.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#! /usr/bin/env bash
2+
3+
# Install uv
4+
curl -LsSf https://astral.sh/uv/install.sh | sh
5+
6+
# Install Dependencies
7+
uv sync
8+
9+
# Install pre-commit hooks
10+
uv run pre-commit install --install-hooks
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "Setup Python Environment"
2+
description: "Set up Python environment for the given Python version"
3+
4+
inputs:
5+
python-version:
6+
description: "Python version to use"
7+
required: true
8+
default: "3.11"
9+
uv-version:
10+
description: "uv version to use"
11+
required: true
12+
default: "0.8.8"
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: ${{ inputs.python-version }}
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v6
23+
with:
24+
version: ${{ inputs.uv-version }}
25+
enable-cache: 'true'
26+
cache-suffix: ${{ matrix.python-version }}
27+
28+
- name: Install Python dependencies
29+
run: uv sync --frozen
30+
shell: bash

.github/workflows/docs.yml

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,15 @@ on:
66
types: [published]
77

88
jobs:
9-
deploy:
9+
deploy-docs:
1010
runs-on: ubuntu-latest
11-
timeout-minutes: 15
11+
timeout-minutes: 20
1212
steps:
13-
- uses: actions/checkout@v4
14-
- name: Install uv
15-
uses: astral-sh/setup-uv@v6
16-
with:
17-
enable-cache: true
18-
- name: "Set up Python"
19-
uses: actions/setup-python@v5
20-
with:
21-
python-version-file: "pyproject.toml"
22-
- name: Install dependencies
23-
run: |
24-
uv sync --all-extras --dev
25-
uv pip install -r docs/requirements.txt
26-
- name: Create docs
27-
run: |
28-
uv run python -m sphinx -b html docs/ docs/_build/html
29-
cp docs/_config.yml docs/_build/html/_config.yml
30-
- name: Deploy Docs 🚀
31-
uses: JamesIves/github-pages-deploy-action@v4
32-
with:
33-
branch: gh-pages # The branch the action should deploy to.
34-
folder: docs/_build/html # The folder the action should deploy.
13+
- name: Check out
14+
uses: actions/checkout@v4
15+
16+
- name: Set up the environment
17+
uses: ./.github/actions/setup-python-env
18+
19+
- name: Deploy documentation
20+
run: uv run mkdocs gh-deploy --force

.github/workflows/publish.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,13 @@ jobs:
1111
timeout-minutes: 20
1212
steps:
1313
- uses: actions/checkout@v4
14-
- name: Install uv
15-
uses: astral-sh/setup-uv@v6
16-
with:
17-
enable-cache: true
18-
- name: "Set up Python"
19-
uses: actions/setup-python@v5
20-
with:
21-
python-version-file: "pyproject.toml"
22-
- name: Install dependencies
23-
run: |
24-
uv sync --all-extras --dev
14+
15+
- name: Set up the environment
16+
uses: ./.github/actions/setup-python-env
17+
2518
- name: Build and publish
2619
run: |
27-
uv run python setup.py bdist_wheel
20+
uv build
2821
- name: Publish distribution 📦 to PyPI
2922
if: startsWith(github.ref, 'refs/tags')
3023
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/pytest.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
name: Python Test
22

33
on:
4+
schedule:
5+
- cron: '1 1 2,16 * *' # every 2nd and 16th at 01:01. To flag any dependency issues.
46
push:
57
branches:
68
- develop
79
pull_request:
810
branches:
911
- master
1012
- develop
13+
- main
1114

1215
jobs:
1316
build:
@@ -21,17 +24,21 @@ jobs:
2124

2225
steps:
2326
- uses: actions/checkout@v4
24-
- name: Install uv
25-
uses: astral-sh/setup-uv@v6
26-
with:
27-
enable-cache: true
28-
- name: "Set up Python"
29-
uses: actions/setup-python@v5
30-
with:
31-
python-version-file: "pyproject.toml"
32-
- name: Install dependencies
33-
run: |
34-
uv sync --all-extras --dev
27+
28+
- name: Set up the environment
29+
uses: ./.github/actions/setup-python-env
3530

3631
- name: Run tests
37-
run: uv run pytest tests
32+
run: uv run python -m pytest tests --cov --cov-config=pyproject.toml --cov-report=xml
33+
34+
check-docs:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Check out
38+
uses: actions/checkout@v4
39+
40+
- name: Set up the environment
41+
uses: ./.github/actions/setup-python-env
42+
43+
- name: Check if documentation can be built
44+
run: uv run mkdocs build

.github/workflows/tox.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- master
7+
- main
78

89
jobs:
910
build:
@@ -17,17 +18,10 @@ jobs:
1718

1819
steps:
1920
- uses: actions/checkout@v4
20-
- name: Install uv
21-
uses: astral-sh/setup-uv@v6
22-
with:
23-
enable-cache: true
24-
- name: "Set up Python"
25-
uses: actions/setup-python@v5
26-
with:
27-
python-version-file: "pyproject.toml"
28-
- name: Install dependencies
29-
run: |
30-
uv sync --all-extras --dev
21+
22+
- name: Set up the environment
23+
uses: ./.github/actions/setup-python-env
24+
3125
- name: Test with tox
3226
run: |
3327
uv run tox

.github/workflows/upgrade.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Dependencies upgrade
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
flake-update:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
11+
- uses: astral-sh/setup-uv@v6
12+
13+
# https://docs.astral.sh/uv/concepts/projects/#upgrading-locked-package-versions
14+
- run: uv lock --upgrade
15+
16+
- name: Create Pull Request
17+
uses: peter-evans/create-pull-request@v7
18+
with:
19+
title: "[Automated] Dependencies upgrade"
20+
commit-message: "[Automated] Dependencies upgrade"
21+
branch: "auto/uv-sync-upgrade"
22+
add-paths: uv.lock
23+
delete-branch: true
24+
labels: |
25+
automated pr
26+
body-path: result
27+
draft: true

0 commit comments

Comments
 (0)