Skip to content

Commit bf760e6

Browse files
authored
feat: add publish to PyPI in cd (#41)
1 parent ad9d25c commit bf760e6

File tree

4 files changed

+61
-10
lines changed

4 files changed

+61
-10
lines changed

.github/workflows/cd.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,41 @@ jobs:
5555
echo "published=${{ steps.release.outputs.new_release_published }}" >> $GITHUB_OUTPUT
5656
echo "New release: ${{ steps.release.outputs.new_release_version }}"
5757
fi
58+
59+
publish:
60+
name: publish to pypi
61+
runs-on: ubuntu-latest
62+
needs: versioning
63+
if: needs.versioning.outputs.new_release_published == 'true'
64+
environment:
65+
name: pypi
66+
url: https://pypi.org/p/leetcode-py
67+
permissions:
68+
id-token: write
69+
steps:
70+
- name: Checkout
71+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
72+
73+
- name: Set up Python
74+
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
75+
with:
76+
python-version: "3.13"
77+
78+
- name: Install Poetry
79+
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
80+
with:
81+
version: latest
82+
virtualenvs-create: true
83+
virtualenvs-in-project: true
84+
85+
- name: Update version in pyproject.toml
86+
run: |
87+
poetry version ${{ needs.versioning.outputs.new_release_version }}
88+
89+
- name: Build package
90+
run: poetry build
91+
92+
- name: Publish to PyPI
93+
uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc # v1.12.2
94+
with:
95+
verbose: true

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ A modern Python LeetCode practice environment that goes beyond basic problem sol
1717
- 🚀 **Modern Python**: PEP 585/604 type hints, Poetry, and professional tooling
1818
- 📊 **Quality Assurance**: 95%+ test coverage, security scanning, automated linting
1919

20-
Includes all **75 Grind problems** - the most essential coding interview questions curated for maximum impact.
21-
2220
## 🎯 What's Included
2321

24-
**Current**: All 75 problems from [Grind 75](https://www.techinterviewhandbook.org/grind75/) - the most essential coding interview problems curated by the creator of Blind 75.
22+
**Current**: All 75 problems from [Grind 75](https://www.techinterviewhandbook.org/grind75/) - the most essential coding interview questions curated by the creator of Blind 75.
2523

2624
**Future**: Planned expansion to all 169 Grind problems for comprehensive interview preparation.
2725

poetry.lock

Lines changed: 2 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 & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
[tool.poetry]
2-
name = "leetcode-py"
3-
version = "0.1.0"
4-
description = "LeetCode solutions in Python"
5-
authors = ["Your Name <your.email@example.com>"]
2+
name = "leetcode-py-sdk"
3+
version = "0.1.0" # use git tag instead
4+
description = "Modern Python LeetCode practice environment with automated problem generation, beautiful data structure visualizations, and comprehensive testing"
5+
authors = ["Wisaroot Lertthaweedech <l.wisaroot@gmail.com>"]
6+
license = "Apache-2.0"
67
readme = "README.md"
8+
homepage = "https://github.com/wisarootl/leetcode-py"
9+
repository = "https://github.com/wisarootl/leetcode-py"
10+
keywords = ["leetcode", "algorithms", "data-structures", "interview-prep", "coding-practice"]
11+
classifiers = [
12+
"Development Status :: 4 - Beta",
13+
"Intended Audience :: Developers",
14+
"Intended Audience :: Education",
15+
"Topic :: Software Development :: Libraries :: Python Modules",
16+
"Topic :: Education",
17+
"License :: OSI Approved :: Apache Software License",
18+
"Programming Language :: Python :: 3",
19+
"Programming Language :: Python :: 3.13",
20+
]
21+
packages = [{include = "leetcode_py"}]
722

823
[tool.poetry.dependencies]
924
python = "^3.13"
25+
graphviz = "^0.21"
1026
requests = "^2.32.5"
1127
typer = "^0.17.0"
1228

@@ -17,7 +33,6 @@ loguru = "^0.7.3"
1733
[tool.poetry.group.dev.dependencies]
1834
black = "^25.1.0"
1935
cookiecutter = "^2.6.0"
20-
graphviz = "^0.21"
2136
ipykernel = "^6.30.1"
2237
isort = "^6.0.1"
2338
jupytext = "^1.16.6"

0 commit comments

Comments
 (0)