Skip to content

Commit 24a0bc3

Browse files
committed
docs(readme): document import checker and update file map
1 parent 20ca4f5 commit 24a0bc3

File tree

7 files changed

+1820
-1
lines changed

7 files changed

+1820
-1
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# .github/workflows/auto-pyproject-update.yml
2+
name: Auto update pyproject
3+
4+
on:
5+
push:
6+
branches: [ "main" ]
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
bump:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.12"
21+
22+
- name: Install editor deps
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install tomlkit
26+
27+
- name: Decide bump level from commit message
28+
id: decide
29+
run: |
30+
msg="$(git log -1 --pretty=%B)"
31+
level="patch"
32+
if echo "$msg" | grep -qi "breaking change"; then level="major"; fi
33+
if echo "$msg" | grep -qi "^feat:"; then level="minor"; fi
34+
echo "level=$level" >> "$GITHUB_OUTPUT"
35+
36+
- name: Bump version
37+
run: |
38+
python scripts/pyproject_editor.py bump-version "${{ steps.decide.outputs.level }}"
39+
40+
- name: Commit & push if changed
41+
run: |
42+
if ! git diff --quiet; then
43+
git config user.name "github-actions[bot]"
44+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
45+
git add pyproject.toml
46+
git commit -m "chore: bump version (${{ steps.decide.outputs.level }}) [skip ci]"
47+
git push
48+
fi
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# .github/workflows/auto-upgrade-pyproject.yml
2+
name: Auto upgrade pyproject constraints
3+
4+
on:
5+
schedule:
6+
- cron: "0 6 * * 1" # Mondays 06:00 UTC
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
upgrade:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.12"
23+
24+
- name: Install deps
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install tomlkit packaging
28+
29+
- name: Run updater (caret, no majors, no pre-releases)
30+
run: |
31+
python scripts/pyproject_updater.py --strategy caret --groups main,dev --respect-major --no-prerelease
32+
33+
- name: Create PR if changed
34+
run: |
35+
if ! git diff --quiet; then
36+
git checkout -b chore/upgrade-pyproject-constraints
37+
git config user.name "github-actions[bot]"
38+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
39+
git add pyproject.toml
40+
git commit -m "chore: upgrade dependency constraints in pyproject"
41+
git push --force --set-upstream origin chore/upgrade-pyproject-constraints
42+
gh pr create --title "chore: upgrade pyproject constraints" \
43+
--body "Automated update of dependency constraints via PyPI latest." \
44+
--base "${GITHUB_REF_NAME:-main}" || true
45+
fi
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ repository = "https://github.com/DiogoRibeiro7/my_python_package"
1212
python = ">=3.10"
1313

1414
[tool.poetry.dev-dependencies]
15-
pytest = "^8.0.0"
15+
pytest = "^8.4.1"
16+
tomlkit = "^0.13.3"
17+
packaging = "^25.0"
1618

1719
[build-system]
1820
requires = ["poetry-core"]

0 commit comments

Comments
 (0)