Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
version: 2
updates:
- package-ecosystem: "github-actions"
# Экосистема uv покрывает и pyproject.toml, и uv.lock. Отдельный блок pip на
# том же каталоге давал бы вторую пачку PR на те же зависимости.
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 1
labels: ["dependencies", "automated"]
commit-message:
prefix: "chore"
groups:
github-actions-all:
uv-all:
patterns: ["*"]

- package-ecosystem: "pip"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 1
labels: ["dependencies", "automated"]
commit-message:
prefix: "chore"
groups:
pip-all:
github-actions-all:
patterns: ["*"]
24 changes: 24 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: PR Title

# Заголовок PR обязан быть conventional commit: при squash-мерже он становится
# сообщением коммита, а по нему release-please определяет, какой разряд версии
# поднять. Проверка отдельных коммитов ветки намеренно не делается, чтобы не
# мешать работе внутри PR.
on:
pull_request_target:
types:
- opened
- edited
- synchronize
- reopened

permissions:
pull-requests: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 13 additions & 8 deletions .github/workflows/pyci.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
name: Python CI

on:
- push
- pull_request
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: '3.13'

# setup-python не нужен: версию питона держит .python-version, и uv сам
# ставит её при первом `uv sync`. Единый источник версии, поэтому раннер
# и образ кита не могут разойтись.
- uses: astral-sh/setup-uv@v10.0.0

- name: Install
run: |
pip install uv
make install
run: make install
- name: Run linter
run: make lint
- name: Run tests
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release Please

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write
# Trusted publishing на PyPI: токена в секретах нет, uv обменивает OIDC-токен
# раннера на разрешение публикации.
id-token: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v5
id: release

# Публикация живёт вторым шагом этого же workflow. Схема «release-please
# ставит тег, а отдельный workflow публикует по тегу» не работает: тег
# ставит GITHUB_TOKEN, а от его событий GitHub workflow не запускает.
- uses: actions/checkout@v7
if: ${{ steps.release.outputs.release_created }}

- uses: astral-sh/setup-uv@v10.0.0
if: ${{ steps.release.outputs.release_created }}

- name: Publish to PyPI
if: ${{ steps.release.outputs.release_created }}
run: make publish
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ coverage.xml
.hypothesis/
.pytest_cache/

# pyenv
.python-version

# Environments
.venv

Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.3.0"
}
21 changes: 13 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
export PYTHONPATH=src

check: test lint
@echo Done!
install:
@uv sync

lint:
@uv run ruff check .

test: lint
test:
@uv run pytest test

lint:
@uv run ruff check src test
check: install lint test

install:
@uv sync
build:
@uv build

publish: build
@uv publish --trusted-publishing always

.PHONY: all test install
.PHONY: install lint test check build publish
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repository = "https://github.com/hexlet-components/python-points"
classifiers = [
"Intended Audience :: Education",
"License :: OSI Approved :: ISC License (ISCL)",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3",
"Topic :: Education",
"Topic :: Software Development :: Libraries",
"Typing :: Typed",
Expand Down
9 changes: 9 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
".": {
"release-type": "python",
"package-name": "hexlet-points"
}
}
}