Skip to content

Commit 4a024de

Browse files
committed
updated the version
1 parent ae8d275 commit 4a024de

3 files changed

Lines changed: 94 additions & 1 deletion

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish Python Package (Token-based)
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch: # Allow manual trigger
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: '3.x'
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install build twine
26+
27+
- name: Build package
28+
run: python -m build
29+
30+
- name: Check package
31+
run: twine check dist/*
32+
33+
- name: Publish to PyPI
34+
env:
35+
TWINE_USERNAME: __token__
36+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
37+
run: twine upload dist/*

QUICK_FIX.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Quick Fix for PyPI Upload Error
2+
3+
## Immediate Solution
4+
5+
The error occurs because the project doesn't exist on PyPI yet or the token is incorrectly scoped.
6+
7+
### Step 1: Create an "Entire Account" API Token
8+
9+
1. Go to https://pypi.org/manage/account/
10+
2. Scroll to "API tokens"
11+
3. Click "Add API token"
12+
4. **Important**: Select "Entire account" scope (not project-specific)
13+
5. Copy the token (starts with `pypi-`)
14+
15+
### Step 2: Upload Using the Token
16+
17+
```bash
18+
# Install tools
19+
pip install build twine
20+
21+
# Build the package
22+
python -m build
23+
24+
# Upload using the token
25+
twine upload dist/* -u __token__ -p pypi-YourTokenHere
26+
```
27+
28+
Replace `pypi-YourTokenHere` with your actual token.
29+
30+
### Step 3: Verify
31+
32+
After successful upload, verify:
33+
```bash
34+
pip install translateplus
35+
python -c "import translateplus; print(translateplus.__version__)"
36+
```
37+
38+
## Why This Works
39+
40+
- "Entire account" tokens can create new projects on PyPI
41+
- Project-specific tokens only work for existing projects
42+
- The first upload automatically creates the project
43+
44+
## Alternative: Use .pypirc
45+
46+
Create `~/.pypirc`:
47+
```ini
48+
[pypi]
49+
username = __token__
50+
password = pypi-YourTokenHere
51+
```
52+
53+
Then simply run:
54+
```bash
55+
twine upload dist/*
56+
```

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools>=61.0", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
name = "translateplus"
6+
name = "translateplus-python"
77
version = "2.0.2"
88
description = "Official Python client library for TranslatePlus API - Professional translation service for text, HTML, emails, subtitles, and i18n files"
99
readme = "README.md"

0 commit comments

Comments
 (0)