Skip to content

Commit 9c998f1

Browse files
committed
Release v1.0.0 - Complete rewrite with CLI and TUI tools
- Modern SDK with Pydantic models and type hints - Comprehensive CLI tool (namecheap-cli) - Interactive DNS TUI manager - Smart DNS builder with fluent interface - Auto-configuration from environment - Helpful error messages - Full documentation and examples
1 parent 2ce6db4 commit 9c998f1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+5556
-6445
lines changed

.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
NAMECHEAP_API_USER=your_username # Your Namecheap account username
1111
NAMECHEAP_API_KEY=your_api_key # From API Access page
1212
NAMECHEAP_USERNAME=your_username # Same as API_USER
13-
NAMECHEAP_CLIENT_IP=your_whitelisted_ip # Your whitelisted IP
14-
NAMECHEAP_USE_SANDBOX=True # Use sandbox for testing
13+
NAMECHEAP_CLIENT_IP=your_whitelisted_ip # Your whitelisted IP (optional - will auto-detect)
14+
NAMECHEAP_SANDBOX=true # Set to "false" for production API (default: true for safety)

.github/workflows/lint.yml

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,24 @@ jobs:
1010
lint:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
14-
- name: Set up Python
15-
uses: actions/setup-python@v4
13+
- uses: actions/checkout@v4
14+
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v5
1617
with:
17-
python-version: '3.x'
18+
enable-cache: true
19+
20+
- name: Set up Python
21+
run: uv python install 3.12
22+
1823
- name: Install dependencies
19-
run: |
20-
python -m pip install --upgrade pip
21-
pip install poetry
22-
poetry install
23-
- name: Lint with Black
24-
run: |
25-
poetry run black --check .
26-
- name: Lint with isort
27-
run: |
28-
pip install isort==6.0.1
29-
isort --check .
24+
run: uv sync --all-extras
25+
26+
- name: Run ruff check
27+
run: uv run ruff check
28+
29+
- name: Run ruff format check
30+
run: uv run ruff format --check
31+
3032
- name: Type check with mypy
31-
run: |
32-
poetry run mypy namecheap
33-
- name: Lint with Ruff
34-
run: |
35-
poetry run ruff check .
33+
run: uv run mypy src/namecheap

.github/workflows/publish.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ jobs:
1717
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
1818

1919
steps:
20-
- uses: actions/checkout@v3
21-
- name: Set up Python
22-
uses: actions/setup-python@v4
20+
- uses: actions/checkout@v4
21+
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v5
2324
with:
24-
python-version: '3.x'
25-
- name: Install dependencies
26-
run: |
27-
python -m pip install --upgrade pip
28-
pip install build poetry
25+
enable-cache: true
26+
27+
- name: Set up Python
28+
run: uv python install 3.12
29+
2930
- name: Set version from tag (if triggered by tag)
3031
if: startsWith(github.ref, 'refs/tags/')
3132
run: |
@@ -34,9 +35,11 @@ jobs:
3435
VERSION=${TAG_NAME#v}
3536
echo "Using version from tag: ${VERSION}"
3637
37-
# Set version in pyproject.toml (single source of truth)
38-
poetry version ${VERSION}
38+
# Update version in pyproject.toml
39+
sed -i "s/^version = .*/version = \"${VERSION}\"/" pyproject.toml
40+
3941
- name: Build package
40-
run: python -m build
42+
run: uv build
43+
4144
- name: Publish package
4245
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/release.yml

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,17 @@ jobs:
2424
id-token: write # Needed for PyPI trusted publishing
2525

2626
steps:
27-
- uses: actions/checkout@v3
27+
- uses: actions/checkout@v4
2828
with:
2929
fetch-depth: 0
3030

31-
- name: Set up Python
32-
uses: actions/setup-python@v4
31+
- name: Install uv
32+
uses: astral-sh/setup-uv@v5
3333
with:
34-
python-version: '3.x'
35-
36-
- name: Install dependencies
37-
run: |
38-
python -m pip install --upgrade pip
39-
pip install poetry build
34+
enable-cache: true
35+
36+
- name: Set up Python
37+
run: uv python install 3.12
4038

4139
- name: Configure Git
4240
run: |
@@ -46,11 +44,37 @@ jobs:
4644
- name: Bump version
4745
id: bump_version
4846
run: |
49-
# Bump version using Poetry (single source of truth)
50-
poetry version ${{ github.event.inputs.version_part }}
51-
NEW_VERSION=$(poetry version -s)
47+
# Get current version
48+
CURRENT_VERSION=$(grep '^version = ' pyproject.toml | cut -d'"' -f2)
49+
50+
# Calculate new version
51+
IFS='.' read -ra VERSION_PARTS <<< "$CURRENT_VERSION"
52+
MAJOR=${VERSION_PARTS[0]}
53+
MINOR=${VERSION_PARTS[1]}
54+
PATCH=${VERSION_PARTS[2]}
55+
56+
case "${{ github.event.inputs.version_part }}" in
57+
major)
58+
MAJOR=$((MAJOR + 1))
59+
MINOR=0
60+
PATCH=0
61+
;;
62+
minor)
63+
MINOR=$((MINOR + 1))
64+
PATCH=0
65+
;;
66+
patch)
67+
PATCH=$((PATCH + 1))
68+
;;
69+
esac
70+
71+
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
72+
73+
# Update version in pyproject.toml
74+
sed -i "s/^version = .*/version = \"${NEW_VERSION}\"/" pyproject.toml
75+
5276
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV
53-
echo "Bumped version to ${NEW_VERSION}"
77+
echo "Bumped version from ${CURRENT_VERSION} to ${NEW_VERSION}"
5478
5579
- name: Commit version changes
5680
run: |
@@ -64,7 +88,7 @@ jobs:
6488
git push origin "v${NEW_VERSION}"
6589
6690
- name: Build package
67-
run: python -m build
91+
run: uv build
6892

6993
- name: Create GitHub Release
7094
uses: actions/create-release@v1

.gitignore

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,41 @@ poetry.lock
126126

127127
# PyPI auth
128128
.pypirc
129-
.pypirc.template
129+
.pypirc.template# Created by https://www.toptal.com/developers/gitignore/api/ptyhon,macos
130+
# Edit at https://www.toptal.com/developers/gitignore?templates=ptyhon,macos
131+
132+
### macOS ###
133+
# General
134+
.DS_Store
135+
.AppleDouble
136+
.LSOverride
137+
138+
# Icon must end with two \r
139+
Icon
140+
141+
# Thumbnails
142+
._*
143+
144+
# Files that might appear in the root of a volume
145+
.DocumentRevisions-V100
146+
.fseventsd
147+
.Spotlight-V100
148+
.TemporaryItems
149+
.Trashes
150+
.VolumeIcon.icns
151+
.com.apple.timemachine.donotpresent
152+
153+
# Directories potentially created on remote AFP share
154+
.AppleDB
155+
.AppleDesktop
156+
Network Trash Folder
157+
Temporary Items
158+
.apdisk
159+
160+
### macOS Patch ###
161+
# iCloud generated files
162+
*.icloud
163+
164+
#!! ERROR: ptyhon is undefined. Use list command to see defined gitignore types !!#
165+
166+
# End of https://www.toptal.com/developers/gitignore/api/ptyhon,macos

.pre-commit-config.yaml

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,32 @@
11
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.5.0
4-
hooks:
5-
- id: check-yaml
6-
- id: end-of-file-fixer
7-
- id: trailing-whitespace
8-
- id: check-toml
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
- id: check-json
10+
- id: check-toml
11+
- id: check-merge-conflict
12+
- id: debug-statements
913

10-
- repo: https://github.com/astral-sh/ruff-pre-commit
11-
rev: v0.5.0
12-
hooks:
13-
- id: ruff
14-
args: [--fix]
15-
- id: ruff-format
14+
- repo: https://github.com/astral-sh/ruff-pre-commit
15+
rev: v0.7.0
16+
hooks:
17+
- id: ruff
18+
args: [--fix]
19+
- id: ruff-format
1620

17-
- repo: https://github.com/pre-commit/mirrors-mypy
18-
rev: v1.9.0
19-
hooks:
20-
- id: mypy
21-
files: ^namecheap/
22-
additional_dependencies:
23-
- types-requests
21+
- repo: https://github.com/pre-commit/mirrors-mypy
22+
rev: v1.11.0
23+
hooks:
24+
- id: mypy
25+
args: [--strict]
26+
additional_dependencies:
27+
- pydantic>=2.5.0
28+
- httpx>=0.27.0
29+
- types-xmltodict>=0.13.0
30+
- python-dotenv>=1.0.0
31+
- tldextract>=5.0.0
32+
files: ^src/

0 commit comments

Comments
 (0)