Skip to content

Commit 7ecff4b

Browse files
Merge pull request #1 from openapi/upkeep
Enhance README, refactor package, and improve testing setup
2 parents 9b62f02 + e0c1e8e commit 7ecff4b

File tree

17 files changed

+683
-31
lines changed

17 files changed

+683
-31
lines changed

.convcommit

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# convcommit - Conventional Commit message builder
2+
# This file is read by the `convcommit` CLI tool to populate
3+
# the interactive selector menus.
4+
# Commit this file to share the project's commit vocabulary with the team.
5+
#
6+
# FORMAT
7+
# type:<value> — commit type option (e.g. fix, feat, docs)
8+
# scope:<value> — commit scope option
9+
# message:<value> — commit message template
10+
#
11+
# SPECIAL PREFIXES
12+
# ~<value> — marks the default selection
13+
# _ — enables free-text manual input (press ".")
14+
# [X]<value> — forces key letter X for this entry (e.g. [B]build, [W]wip)
15+
#
16+
# HOW TO USE (interactive)
17+
# Run `convcommit` in a git repo. A menu appears for type, scope, message.
18+
# Press the letter in brackets [A][B]... or [.] for free-text input.
19+
# Stage and push in one shot:
20+
# convcommit -a -p
21+
#
22+
# HOW TO USE (direct flags — scripts, AI agents)
23+
# Bypass the selector entirely with explicit flags:
24+
# convcommit --type fix --scope auth --message "fix null pointer" --push
25+
# convcommit -t feat -s api -m "add endpoint" -a -p
26+
#
27+
# SMART PATTERN — stage specific files and commit in one command
28+
# Use --add instead of nested command substitution.
29+
# Anti-pattern (avoid):
30+
# msg=$(convcommit --type fix --message "fix") && git commit -m "$msg" && git push
31+
# Recommended:
32+
# convcommit --add src/auth.sh --type fix --scope auth --message "fix null pointer" --push
33+
# Stage multiple files:
34+
# convcommit --add src/auth.sh --add tests/auth_test.sh -t test -s auth -m "add tests" -p
35+
#
36+
# HOW TO USE (pipe / non-interactive)
37+
# Pipe selections as lines: one per stage (type, scope, message).
38+
# Use the letter shown in the menu, or "." to trigger free-text input.
39+
# Examples:
40+
# printf "G\n.\nfix null pointer in login\n" | convcommit
41+
# printf "F\n\nadd endpoint\n" | convcommit -a -p
42+
# Capture just the formatted message:
43+
# msg=$(printf "G\n\nfix null pointer\n" | convcommit)
44+
#
45+
# OTHER USEFUL FLAGS
46+
# --reset Regenerate this file with the latest defaults
47+
# --help Show all options
48+
#
49+
# INSTALLATION
50+
# convcommit is a single bash file with no dependencies.
51+
# Install it locally in your project:
52+
# curl -fsSL https://raw.githubusercontent.com/francescobianco/convcommit/refs/heads/main/bin/convcommit \
53+
# -o bin/convcommit && chmod +x bin/convcommit
54+
# Or system-wide:
55+
# curl -fsSL https://raw.githubusercontent.com/francescobianco/convcommit/refs/heads/main/bin/convcommit \
56+
# -o /usr/local/bin/convcommit && chmod +x /usr/local/bin/convcommit
57+
type:[B]build
58+
type:~chore
59+
type:[D]docs
60+
type:deps
61+
type:feat
62+
type:fix
63+
type:ci
64+
type:init
65+
type:merge
66+
type:perf
67+
type:refactor
68+
type:revert
69+
type:security
70+
type:style
71+
type:test
72+
type:[W]wip
73+
scope:_
74+
scope:~
75+
message:_
76+
message:~_

.github/assets/repo-header-a3.png

84.9 KB
Loading

.github/workflows/python.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Python
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: [ "3.10", "3.11", "3.12" ]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install Poetry
25+
uses: snok/install-poetry@v1
26+
with:
27+
virtualenvs-create: true
28+
virtualenvs-in-project: true
29+
30+
- name: Install dependencies
31+
run: poetry install --no-interaction
32+
33+
- name: Test
34+
run: poetry run pytest
35+
36+
- name: Build
37+
run: poetry build

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# IDEs and editors
2+
.idea/
3+
.vscode/
4+
15
# Byte-compiled / optimized / DLL files
26
__pycache__/
37
*.py[cod]
@@ -26,6 +30,7 @@ share/python-wheels/
2630
*.egg
2731
MANIFEST
2832

33+
2934
# PyInstaller
3035
# Usually these files are written by a python script from a template
3136
# before PyInstaller builds the exe, so as to inject date/other infos into it.

Makefile

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!make
2+
3+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
4+
# #
5+
# ____ _ #
6+
# / __ \____ ___ ____ ____ _____ (_) ® #
7+
# / / / / __ \/ _ \/ __ \/ __ `/ __ \/ / #
8+
# / /_/ / /_/ / __/ / / / /_/ / /_/ / / #
9+
# \____/ .___/\___/_/ /_/\__,_/ .___/_/ #
10+
# /_/ /_/ #
11+
# #
12+
# The Largest Certified API Marketplace #
13+
# Accelerate Digital Transformation • Simplify Processes • Lead Industry #
14+
# #
15+
# ═══════════════════════════════════════════════════════════════════════ #
16+
# #
17+
# Project: openapi-python-sdk #
18+
# Author: Michael Cuffaro (@maiku1008) #
19+
# Copyright: (c) 2025 Openapi®. All rights reserved. #
20+
# License: MIT #
21+
# Maintainer: Francesco Bianco #
22+
# Contact: https://openapi.com/ #
23+
# Repository: https://github.com/openapi-it/openapi-python-sdk/ #
24+
# Documentation: https://console.openapi.com/ #
25+
# #
26+
# ═══════════════════════════════════════════════════════════════════════ #
27+
# #
28+
# "Truth lies at the source of the stream." #
29+
# — English Proverb #
30+
# #
31+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
32+
33+
## =========
34+
## Variables
35+
## =========
36+
37+
export PATH := $(HOME)/.local/bin:$(PATH)
38+
VERSION := $(shell grep '^version' pyproject.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')
39+
40+
## ====================
41+
## Development Commands
42+
## ====================
43+
44+
dev-push:
45+
@git config credential.helper 'cache --timeout=3600'
46+
@git add .
47+
@git commit -m "$$(read -p 'Commit message: ' msg; echo $$msg)" || true
48+
@git push
49+
50+
## ================
51+
## Release Commands
52+
## ================
53+
54+
.PHONY: setup build publish release
55+
56+
setup:
57+
@poetry --version > /dev/null 2>&1 || \
58+
(echo "Installing Poetry..." && curl -sSL https://install.python-poetry.org | python3 -)
59+
60+
build: setup
61+
@echo "Building version $(VERSION)..."
62+
@poetry build
63+
64+
publish: build
65+
@echo "Publishing version $(VERSION) to PyPI..."
66+
@poetry publish
67+
68+
release: publish
69+
@echo "Tagging release $(VERSION)..."
70+
@git tag -fa "$(VERSION)" -m "Release $(VERSION)"
71+
@git push origin --tags -f
72+
@echo "Released $(VERSION) successfully."

0 commit comments

Comments
 (0)