Skip to content

Commit fd5dcdd

Browse files
feat: Enhance repository with professional metadata, badges, and CI/CD
This commit introduces a comprehensive set of improvements to professionalize the repository. - Updates `pyproject.toml` with rich project metadata, including classifiers, keywords, and project URLs, and configures pytest for coverage reporting. - Enhances `README.md` with a full suite of status badges for PyPI, build status, code coverage, and more. - Implements a new, unified CI/CD workflow in `.github/workflows/ci-cd.yml` that handles linting, testing on multiple Python versions, coverage uploads to Codecov, and automated PyPI publishing on new version tags. - The CI/CD workflow is configured to run on pushes and pull requests to both the `main` and `develop` branches. - Removes the old, redundant CI workflow.
1 parent 48efbc2 commit fd5dcdd

4 files changed

Lines changed: 189 additions & 4 deletions

File tree

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
name: CI
1+
name: CI/CD
22

33
on:
44
push:
55
branches:
66
- main
77
- develop
8+
tags:
9+
- 'v*.*.*'
810
pull_request:
911
branches:
1012
- main
@@ -60,3 +62,33 @@ jobs:
6062

6163
- name: Run tests
6264
run: poetry run pytest
65+
66+
- name: Upload coverage to Codecov
67+
uses: codecov/codecov-action@e33b93050c003a37829704e03102d2427f715e21
68+
with:
69+
token: ${{ secrets.CODECOV_TOKEN }}
70+
fail_ci_if_error: true
71+
72+
release:
73+
if: startsWith(github.ref, 'refs/tags/v')
74+
needs: test
75+
runs-on: ubuntu-latest
76+
permissions:
77+
id-token: write
78+
steps:
79+
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493
80+
- name: Set up Python
81+
uses: actions/setup-python@cfd55ca82492758d853442341ad4d8010466803a
82+
with:
83+
python-version: '3.12'
84+
85+
- name: Install Poetry
86+
uses: snok/install-poetry@ff8a7d7de27005376176819789742a2280cc35e2
87+
- name: Build package
88+
run: poetry build
89+
90+
- name: Publish to PyPI
91+
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf
92+
with:
93+
user: __token__
94+
password: ${{ secrets.PYPI_API_TOKEN }}

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# my_python_project
22

3+
[![PyPI Version](https://img.shields.io/pypi/v/my_python_project)](https://pypi.org/project/my_python_project/)
4+
[![Build Status](https://img.shields.io/github/actions/workflow/status/[USERNAME]/[REPO_NAME]/ci-cd.yml?branch=main)](https://github.com/[USERNAME]/[REPO_NAME]/actions/workflows/ci-cd.yml)
5+
[![Codecov](https://img.shields.io/codecov/c/github/[USERNAME]/[REPO_NAME])](https://codecov.io/gh/[USERNAME]/[REPO_NAME])
6+
[![License](https://img.shields.io/badge/License-Prosperity%203.0.0-blue.svg)](LICENSE)
7+
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
8+
[![Python Versions](https://img.shields.io/pypi/pyversions/my_python_project)](https://pypi.org/project/my_python_project)
9+
310
This is a best-in-class Python package template.
411

512
## Getting Started

poetry.lock

Lines changed: 129 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
[tool.poetry]
22
name = "my_python_project"
33
version = "0.1.0"
4-
description = ""
4+
description = "A best-in-class Python package template."
55
authors = ["CoReason, Inc. <gowtham.rao@coreason.ai>"]
66
readme = "README.md"
7+
license = "Prosperity-3.0.0"
8+
homepage = "https://github.com/[USERNAME]/[REPO_NAME]"
9+
repository = "https://github.com/[USERNAME]/[REPO_NAME]"
10+
documentation = "https://github.com/[USERNAME]/[REPO_NAME]"
11+
keywords = ["template", "poetry", "python"]
12+
classifiers = [
13+
"Development Status :: 3 - Alpha",
14+
"Intended Audience :: Developers",
15+
"License :: Other/Proprietary License",
16+
"Operating System :: OS Independent",
17+
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python :: 3.10",
19+
"Programming Language :: Python :: 3.11",
20+
"Programming Language :: Python :: 3.12",
21+
]
722

823
[tool.poetry.dependencies]
924
python = "^3.10"
@@ -13,7 +28,11 @@ pytest = "^8.4.2"
1328
ruff = "^0.14.2"
1429
mypy = "^1.18.2"
1530
pre-commit = "^4.3.0"
31+
pytest-cov = "^5.0.0"
1632

1733
[build-system]
1834
requires = ["poetry-core"]
1935
build-backend = "poetry.core.masonry.api"
36+
37+
[tool.pytest.ini_options]
38+
addopts = "--cov=src --cov-report=xml"

0 commit comments

Comments
 (0)