Skip to content

Commit 4b450bb

Browse files
author
Pinklesh Parjapati
committed
Prepare package for PyPI publication
1 parent 62f291d commit 4b450bb

5 files changed

Lines changed: 229 additions & 5 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ wheels/
2121
*.egg
2222
MANIFEST
2323

24+
# PyPI
25+
.pypirc
26+
2427
# Virtual Environment
2528
venv/
2629
env/

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Pinklesh Parjapati
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

MANIFEST.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include README.md
2+
include LICENSE
3+
include pyproject.toml
4+
recursive-include fastapi_scaffold *.py
5+

PUBLISH.md

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# Publishing to PyPI
2+
3+
## 📦 How to Publish fastapi-create-project to PyPI
4+
5+
### **Prerequisites**
6+
7+
1. **Create PyPI Account**: https://pypi.org/account/register/
8+
2. **Create TestPyPI Account** (for testing): https://test.pypi.org/account/register/
9+
3. **Install build tools**:
10+
```bash
11+
pip install --upgrade build twine
12+
```
13+
14+
### **Step 1: Clean Previous Builds**
15+
16+
```bash
17+
cd /Users/pinkleshparjapati/Desktop/fastapi-create-project
18+
rm -rf dist/ build/ *.egg-info
19+
```
20+
21+
### **Step 2: Build the Package**
22+
23+
```bash
24+
python -m build
25+
```
26+
27+
This creates:
28+
- `dist/fastapi-create-project-0.1.0.tar.gz` (source distribution)
29+
- `dist/fastapi_create_project-0.1.0-py3-none-any.whl` (wheel)
30+
31+
### **Step 3: Test on TestPyPI (Recommended)**
32+
33+
```bash
34+
# Upload to TestPyPI
35+
python -m twine upload --repository testpypi dist/*
36+
37+
# Test installation from TestPyPI
38+
pip install --index-url https://test.pypi.org/simple/ fastapi-create-project
39+
```
40+
41+
### **Step 4: Publish to PyPI**
42+
43+
```bash
44+
# Upload to PyPI (PRODUCTION)
45+
python -m twine upload dist/*
46+
```
47+
48+
You'll be prompted for your PyPI username and password.
49+
50+
### **Step 5: Verify Installation**
51+
52+
```bash
53+
# Install from PyPI
54+
pip install fastapi-create-project
55+
56+
# Test it
57+
fastapi-create-project --version
58+
```
59+
60+
---
61+
62+
## 🔑 Using API Tokens (Recommended)
63+
64+
Instead of username/password, use API tokens:
65+
66+
1. Go to https://pypi.org/manage/account/token/
67+
2. Create a new API token
68+
3. Create `~/.pypirc`:
69+
70+
```ini
71+
[pypi]
72+
username = __token__
73+
password = pypi-YOUR-TOKEN-HERE
74+
75+
[testpypi]
76+
username = __token__
77+
password = pypi-YOUR-TESTPYPI-TOKEN-HERE
78+
```
79+
80+
Then upload:
81+
```bash
82+
python -m twine upload dist/*
83+
```
84+
85+
---
86+
87+
## 📝 Before Publishing Checklist
88+
89+
- [ ] Update version in `fastapi_scaffold/__init__.py`
90+
- [ ] Update version in `setup.py`
91+
- [ ] Update `README.md` with latest features
92+
- [ ] Test locally: `pip install -e .`
93+
- [ ] Create a test project and verify it works
94+
- [ ] Clean build artifacts: `rm -rf dist/ build/ *.egg-info`
95+
- [ ] Build: `python -m build`
96+
- [ ] Upload to TestPyPI first
97+
- [ ] Test installation from TestPyPI
98+
- [ ] Upload to PyPI
99+
- [ ] Create Git tag: `git tag v0.1.0 && git push origin v0.1.0`
100+
101+
---
102+
103+
## 🔄 Publishing Updates
104+
105+
When releasing a new version:
106+
107+
1. **Update version number** in both files:
108+
- `fastapi_scaffold/__init__.py``__version__ = "0.2.0"`
109+
- `setup.py``version="0.2.0"`
110+
111+
2. **Clean and rebuild**:
112+
```bash
113+
rm -rf dist/ build/ *.egg-info
114+
python -m build
115+
```
116+
117+
3. **Upload**:
118+
```bash
119+
python -m twine upload dist/*
120+
```
121+
122+
---
123+
124+
## 🌐 After Publishing
125+
126+
Your package will be available at:
127+
- **PyPI**: https://pypi.org/project/fastapi-create-project/
128+
- **Installation**: `pip install fastapi-create-project`
129+
130+
Users can install it globally:
131+
```bash
132+
pip install fastapi-create-project
133+
# or
134+
pipx install fastapi-create-project
135+
```
136+
137+
Then use from anywhere:
138+
```bash
139+
fastapi-create-project --version
140+
fastapi-create-project
141+
```
142+
143+
---
144+
145+
## 🚀 Quick Publish Commands
146+
147+
```bash
148+
# One-liner for publishing
149+
cd /Users/pinkleshparjapati/Desktop/fastapi-create-project && \
150+
rm -rf dist/ build/ *.egg-info && \
151+
python -m build && \
152+
python -m twine upload dist/*
153+
```
154+
155+
---
156+
157+
## ⚠️ Important Notes
158+
159+
1. **Package name must be unique** on PyPI
160+
2. **Can't delete or re-upload** same version number
161+
3. **Test on TestPyPI first** before production
162+
4. **Use semantic versioning**: MAJOR.MINOR.PATCH (e.g., 0.1.0, 0.2.0, 1.0.0)
163+
5. **Create GitHub releases** matching your PyPI versions
164+
165+
---
166+
167+
## 📊 Package Statistics
168+
169+
After publishing, view stats at:
170+
- https://pypi.org/project/fastapi-create-project/
171+
- https://pypistats.org/packages/fastapi-create-project
172+
173+
Track downloads:
174+
```bash
175+
pip install pypistats
176+
pypistats overall fastapi-create-project
177+
```
178+

setup.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
long_description = fh.read()
66

77
setup(
8-
name="fastapi-scaffold",
8+
name="fastapi-create-project",
99
version="0.1.0",
10-
author="Your Name",
11-
author_email="your.email@example.com",
12-
description="A CLI tool to generate FastAPI project scaffolding",
10+
author="Pinklesh Parjapati",
11+
author_email="ppinklesh@gmail.com",
12+
description="Automated FastAPI project generator with complete setup - creates scaffolding, venv, installs dependencies, and initializes database",
1313
long_description=long_description,
1414
long_description_content_type="text/markdown",
15-
url="https://github.com/yourusername/fastapi-scaffold",
15+
url="https://github.com/pinkleshparjapati/fastapi-create-project",
1616
packages=find_packages(),
1717
classifiers=[
1818
"Development Status :: 3 - Alpha",
@@ -31,10 +31,26 @@
3131
"typer>=0.9.0",
3232
"rich>=13.0.0",
3333
],
34+
keywords=[
35+
"fastapi",
36+
"scaffold",
37+
"generator",
38+
"cli",
39+
"boilerplate",
40+
"template",
41+
"project-generator",
42+
"alembic",
43+
"sqlalchemy",
44+
"poetry",
45+
],
3446
entry_points={
3547
"console_scripts": [
3648
"fastapi-create-project=fastapi_scaffold.cli:main",
3749
],
3850
},
51+
project_urls={
52+
"Bug Reports": "https://github.com/pinkleshparjapati/fastapi-create-project/issues",
53+
"Source": "https://github.com/pinkleshparjapati/fastapi-create-project",
54+
},
3955
)
4056

0 commit comments

Comments
 (0)