putplace 0.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of putplace might be problematic. Click here for more details.
- putplace-0.4.1/.env.example +115 -0
- putplace-0.4.1/.github/PYPI_PUBLISHING_SETUP.md +271 -0
- putplace-0.4.1/.github/workflows/publish-pypi.yml +81 -0
- putplace-0.4.1/.github/workflows/publish-testpypi.yml +65 -0
- putplace-0.4.1/.gitignore +90 -0
- putplace-0.4.1/.readthedocs.yaml +30 -0
- putplace-0.4.1/CHANGELOG.md +94 -0
- putplace-0.4.1/CLAUDE.md +345 -0
- putplace-0.4.1/CONFIG.md +305 -0
- putplace-0.4.1/FILE_UPLOAD_WORKFLOW.md +288 -0
- putplace-0.4.1/PKG-INFO +346 -0
- putplace-0.4.1/README.md +301 -0
- putplace-0.4.1/READTHEDOCS_SETUP.md +134 -0
- putplace-0.4.1/SECURITY.md +607 -0
- putplace-0.4.1/docs/AUTHENTICATION.md +543 -0
- putplace-0.4.1/docs/AWS_CREDENTIALS_SETUP.md +278 -0
- putplace-0.4.1/docs/CLIENT_QUICKSTART.md +302 -0
- putplace-0.4.1/docs/Makefile +34 -0
- putplace-0.4.1/docs/README.md +218 -0
- putplace-0.4.1/docs/api-reference.md +957 -0
- putplace-0.4.1/docs/architecture.md +659 -0
- putplace-0.4.1/docs/client-guide.md +971 -0
- putplace-0.4.1/docs/conf.py +139 -0
- putplace-0.4.1/docs/configuration.md +855 -0
- putplace-0.4.1/docs/deployment.md +838 -0
- putplace-0.4.1/docs/development.md +816 -0
- putplace-0.4.1/docs/index.md +239 -0
- putplace-0.4.1/docs/installation.md +557 -0
- putplace-0.4.1/docs/quickstart.md +329 -0
- putplace-0.4.1/docs/requirements.txt +17 -0
- putplace-0.4.1/docs/storage.md +763 -0
- putplace-0.4.1/docs/troubleshooting.md +900 -0
- putplace-0.4.1/ppclient.conf.example +69 -0
- putplace-0.4.1/ppserver.toml.example +40 -0
- putplace-0.4.1/pyproject.toml +119 -0
- putplace-0.4.1/src/putplace/__init__.py +5 -0
- putplace-0.4.1/src/putplace/auth.py +279 -0
- putplace-0.4.1/src/putplace/config.py +167 -0
- putplace-0.4.1/src/putplace/database.py +387 -0
- putplace-0.4.1/src/putplace/main.py +3048 -0
- putplace-0.4.1/src/putplace/models.py +179 -0
- putplace-0.4.1/src/putplace/ppclient.py +586 -0
- putplace-0.4.1/src/putplace/ppserver.py +453 -0
- putplace-0.4.1/src/putplace/scripts/__init__.py +1 -0
- putplace-0.4.1/src/putplace/scripts/create_api_key.py +119 -0
- putplace-0.4.1/src/putplace/storage.py +456 -0
- putplace-0.4.1/src/putplace/user_auth.py +52 -0
- putplace-0.4.1/src/putplace/version.py +6 -0
- putplace-0.4.1/tasks.py +545 -0
- putplace-0.4.1/test_aws_s3.py +219 -0
- putplace-0.4.1/test_aws_s3_README.md +156 -0
- putplace-0.4.1/tests/README.md +138 -0
- putplace-0.4.1/tests/__init__.py +1 -0
- putplace-0.4.1/tests/conftest.py +221 -0
- putplace-0.4.1/tests/test_admin_creation.py +225 -0
- putplace-0.4.1/tests/test_api.py +288 -0
- putplace-0.4.1/tests/test_auth.py +342 -0
- putplace-0.4.1/tests/test_client.py +331 -0
- putplace-0.4.1/tests/test_client_config.py +401 -0
- putplace-0.4.1/tests/test_console_scripts.py +325 -0
- putplace-0.4.1/tests/test_database.py +262 -0
- putplace-0.4.1/tests/test_e2e.py +503 -0
- putplace-0.4.1/tests/test_models.py +162 -0
- putplace-0.4.1/tests/test_storage.py +176 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# PutPlace Configuration Example
|
|
2
|
+
# Copy this file to .env and update with your values
|
|
3
|
+
# IMPORTANT: Never commit .env to version control!
|
|
4
|
+
|
|
5
|
+
# =============================================================================
|
|
6
|
+
# MongoDB Configuration
|
|
7
|
+
# =============================================================================
|
|
8
|
+
MONGODB_URL=mongodb://localhost:27017
|
|
9
|
+
MONGODB_DATABASE=putplace
|
|
10
|
+
MONGODB_COLLECTION=file_metadata
|
|
11
|
+
|
|
12
|
+
# =============================================================================
|
|
13
|
+
# API Configuration
|
|
14
|
+
# =============================================================================
|
|
15
|
+
API_TITLE=PutPlace API
|
|
16
|
+
API_VERSION=0.1.0
|
|
17
|
+
API_DESCRIPTION=File metadata storage API
|
|
18
|
+
|
|
19
|
+
# =============================================================================
|
|
20
|
+
# Storage Backend Configuration
|
|
21
|
+
# =============================================================================
|
|
22
|
+
|
|
23
|
+
# Storage backend type: "local" or "s3"
|
|
24
|
+
STORAGE_BACKEND=local
|
|
25
|
+
|
|
26
|
+
# Local Storage Settings (used when STORAGE_BACKEND=local)
|
|
27
|
+
STORAGE_PATH=/var/putplace/files
|
|
28
|
+
|
|
29
|
+
# S3 Storage Settings (used when STORAGE_BACKEND=s3)
|
|
30
|
+
S3_BUCKET_NAME=my-putplace-bucket
|
|
31
|
+
S3_REGION_NAME=us-east-1
|
|
32
|
+
S3_PREFIX=files/
|
|
33
|
+
|
|
34
|
+
# =============================================================================
|
|
35
|
+
# AWS Credentials (Optional - see SECURITY.md for best practices)
|
|
36
|
+
# =============================================================================
|
|
37
|
+
|
|
38
|
+
# RECOMMENDED APPROACHES (in order of preference):
|
|
39
|
+
#
|
|
40
|
+
# 1. IAM ROLES (Best for production on AWS)
|
|
41
|
+
# - No configuration needed!
|
|
42
|
+
# - Just attach IAM role to EC2/ECS/Lambda
|
|
43
|
+
# - Leave all AWS_* variables commented out
|
|
44
|
+
#
|
|
45
|
+
# 2. AWS PROFILE (Good for on-premises or multi-account)
|
|
46
|
+
# - Store credentials in ~/.aws/credentials
|
|
47
|
+
# - Use named profile:
|
|
48
|
+
# AWS_PROFILE=putplace-prod
|
|
49
|
+
#
|
|
50
|
+
# 3. DEFAULT CREDENTIAL CHAIN (Good for development)
|
|
51
|
+
# - Uses ~/.aws/credentials default profile
|
|
52
|
+
# - Leave all AWS_* variables commented out
|
|
53
|
+
#
|
|
54
|
+
# 4. EXPLICIT CREDENTIALS (Not recommended - use only if necessary)
|
|
55
|
+
# - Uncommenting these will override profile and IAM role
|
|
56
|
+
# - AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
|
|
57
|
+
# - AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
|
|
58
|
+
|
|
59
|
+
# AWS Profile (recommended for on-premises)
|
|
60
|
+
# AWS_PROFILE=putplace-prod
|
|
61
|
+
|
|
62
|
+
# Explicit AWS credentials (NOT RECOMMENDED - use IAM roles or profiles instead)
|
|
63
|
+
# AWS_ACCESS_KEY_ID=
|
|
64
|
+
# AWS_SECRET_ACCESS_KEY=
|
|
65
|
+
|
|
66
|
+
# =============================================================================
|
|
67
|
+
# Configuration Examples
|
|
68
|
+
# =============================================================================
|
|
69
|
+
|
|
70
|
+
# Example 1: Local Storage (Development)
|
|
71
|
+
# -----------------------------------------------------------------------------
|
|
72
|
+
# STORAGE_BACKEND=local
|
|
73
|
+
# STORAGE_PATH=/tmp/putplace-dev
|
|
74
|
+
# MONGODB_URL=mongodb://localhost:27017
|
|
75
|
+
# MONGODB_DATABASE=putplace_dev
|
|
76
|
+
|
|
77
|
+
# Example 2: S3 Storage with IAM Role (Production on AWS)
|
|
78
|
+
# -----------------------------------------------------------------------------
|
|
79
|
+
# STORAGE_BACKEND=s3
|
|
80
|
+
# S3_BUCKET_NAME=putplace-prod-bucket
|
|
81
|
+
# S3_REGION_NAME=us-east-1
|
|
82
|
+
# # No AWS credentials needed - uses IAM role attached to EC2/ECS instance
|
|
83
|
+
|
|
84
|
+
# Example 3: S3 Storage with AWS Profile (Production on-premises)
|
|
85
|
+
# -----------------------------------------------------------------------------
|
|
86
|
+
# STORAGE_BACKEND=s3
|
|
87
|
+
# S3_BUCKET_NAME=putplace-prod-bucket
|
|
88
|
+
# S3_REGION_NAME=us-west-2
|
|
89
|
+
# AWS_PROFILE=putplace-prod
|
|
90
|
+
# # Credentials stored in ~/.aws/credentials file
|
|
91
|
+
|
|
92
|
+
# Example 4: S3 Storage with Environment Variables (CI/CD)
|
|
93
|
+
# -----------------------------------------------------------------------------
|
|
94
|
+
# STORAGE_BACKEND=s3
|
|
95
|
+
# S3_BUCKET_NAME=putplace-ci-bucket
|
|
96
|
+
# S3_REGION_NAME=us-east-1
|
|
97
|
+
# # AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY set by CI/CD system
|
|
98
|
+
|
|
99
|
+
# =============================================================================
|
|
100
|
+
# Security Notes
|
|
101
|
+
# =============================================================================
|
|
102
|
+
#
|
|
103
|
+
# 1. Never commit .env file to version control
|
|
104
|
+
# - Add .env to .gitignore (already done)
|
|
105
|
+
#
|
|
106
|
+
# 2. Set restrictive file permissions:
|
|
107
|
+
# chmod 600 .env
|
|
108
|
+
# chown putplace:putplace .env
|
|
109
|
+
#
|
|
110
|
+
# 3. Use different configurations for dev/staging/production
|
|
111
|
+
#
|
|
112
|
+
# 4. For production deployments, see SECURITY.md for best practices
|
|
113
|
+
#
|
|
114
|
+
# 5. Prefer IAM roles > AWS profiles > environment variables > hardcoded credentials
|
|
115
|
+
#
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# PyPI Publishing Setup Guide
|
|
2
|
+
|
|
3
|
+
This guide explains how to set up GitHub Actions for automated publishing to PyPI and TestPyPI.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Two GitHub Actions workflows are configured:
|
|
8
|
+
|
|
9
|
+
- **`publish-testpypi.yml`** - Publishes to TestPyPI (for testing)
|
|
10
|
+
- **`publish-pypi.yml`** - Publishes to production PyPI (on version tags)
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
You need API tokens from both PyPI and TestPyPI.
|
|
15
|
+
|
|
16
|
+
### 1. Create TestPyPI Account and API Token
|
|
17
|
+
|
|
18
|
+
1. **Create account**: https://test.pypi.org/account/register/
|
|
19
|
+
2. **Verify email**: Check your email and verify the account
|
|
20
|
+
3. **Create API token**:
|
|
21
|
+
- Go to: https://test.pypi.org/manage/account/token/
|
|
22
|
+
- Click "Add API token"
|
|
23
|
+
- Token name: `putplace-github-actions`
|
|
24
|
+
- Scope: "Entire account" (or specific to putplace project)
|
|
25
|
+
- Click "Add token"
|
|
26
|
+
- **⚠️ COPY THE TOKEN NOW** - You won't see it again!
|
|
27
|
+
|
|
28
|
+
### 2. Create PyPI Account and API Token
|
|
29
|
+
|
|
30
|
+
1. **Create account**: https://pypi.org/account/register/
|
|
31
|
+
2. **Verify email**: Check your email and verify the account
|
|
32
|
+
3. **Create API token**:
|
|
33
|
+
- Go to: https://pypi.org/manage/account/token/
|
|
34
|
+
- Click "Add API token"
|
|
35
|
+
- Token name: `putplace-github-actions`
|
|
36
|
+
- Scope: "Entire account" (or specific to putplace project)
|
|
37
|
+
- Click "Add token"
|
|
38
|
+
- **⚠️ COPY THE TOKEN NOW** - You won't see it again!
|
|
39
|
+
|
|
40
|
+
## Configure GitHub Secrets
|
|
41
|
+
|
|
42
|
+
1. **Go to GitHub repository settings**:
|
|
43
|
+
- Navigate to: https://github.com/jdrumgoole/putplace/settings/secrets/actions
|
|
44
|
+
|
|
45
|
+
2. **Add TEST_PYPI_API_TOKEN secret**:
|
|
46
|
+
- Click "New repository secret"
|
|
47
|
+
- Name: `TEST_PYPI_API_TOKEN`
|
|
48
|
+
- Value: Paste the TestPyPI token (starts with `pypi-`)
|
|
49
|
+
- Click "Add secret"
|
|
50
|
+
|
|
51
|
+
3. **Add PYPI_API_TOKEN secret**:
|
|
52
|
+
- Click "New repository secret"
|
|
53
|
+
- Name: `PYPI_API_TOKEN`
|
|
54
|
+
- Value: Paste the PyPI token (starts with `pypi-`)
|
|
55
|
+
- Click "Add secret"
|
|
56
|
+
|
|
57
|
+
## Usage
|
|
58
|
+
|
|
59
|
+
### Publishing to TestPyPI (Testing)
|
|
60
|
+
|
|
61
|
+
**Method 1: Manual trigger via GitHub UI**
|
|
62
|
+
|
|
63
|
+
1. Go to: https://github.com/jdrumgoole/putplace/actions/workflows/publish-testpypi.yml
|
|
64
|
+
2. Click "Run workflow"
|
|
65
|
+
3. Select branch (usually `main`)
|
|
66
|
+
4. Click "Run workflow"
|
|
67
|
+
|
|
68
|
+
**Method 2: Trigger on push (optional)**
|
|
69
|
+
|
|
70
|
+
Uncomment the `push` trigger in `publish-testpypi.yml`:
|
|
71
|
+
|
|
72
|
+
```yaml
|
|
73
|
+
on:
|
|
74
|
+
workflow_dispatch:
|
|
75
|
+
push:
|
|
76
|
+
branches:
|
|
77
|
+
- main
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
This will publish to TestPyPI on every push to main (useful for testing).
|
|
81
|
+
|
|
82
|
+
**Method 3: Use invoke command**
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
invoke publish-test
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Publishing to Production PyPI
|
|
89
|
+
|
|
90
|
+
**⚠️ IMPORTANT: Only publish to production when ready for a real release!**
|
|
91
|
+
|
|
92
|
+
The production workflow is triggered by **version tags only**:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Ensure version is updated in pyproject.toml
|
|
96
|
+
# Example: version = "0.4.0"
|
|
97
|
+
|
|
98
|
+
# Create and push a version tag
|
|
99
|
+
git tag -a v0.4.0 -m "Release version 0.4.0"
|
|
100
|
+
git push origin v0.4.0
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The workflow will:
|
|
104
|
+
1. Verify the tag version matches `pyproject.toml`
|
|
105
|
+
2. Build the package
|
|
106
|
+
3. Publish to PyPI automatically
|
|
107
|
+
|
|
108
|
+
**Manual trigger** is also available (use with caution):
|
|
109
|
+
1. Go to: https://github.com/jdrumgoole/putplace/actions/workflows/publish-pypi.yml
|
|
110
|
+
2. Click "Run workflow"
|
|
111
|
+
|
|
112
|
+
## Verifying Publications
|
|
113
|
+
|
|
114
|
+
### After TestPyPI Publication
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# View the package
|
|
118
|
+
open https://test.pypi.org/project/putplace/
|
|
119
|
+
|
|
120
|
+
# Test installation
|
|
121
|
+
pip install --index-url https://test.pypi.org/simple/ putplace
|
|
122
|
+
|
|
123
|
+
# Or with dependencies from PyPI
|
|
124
|
+
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple putplace
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### After PyPI Publication
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# View the package
|
|
131
|
+
open https://pypi.org/project/putplace/
|
|
132
|
+
|
|
133
|
+
# Install
|
|
134
|
+
pip install putplace
|
|
135
|
+
|
|
136
|
+
# Verify version
|
|
137
|
+
python -c "import putplace; print(putplace.__version__)"
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Workflow Details
|
|
141
|
+
|
|
142
|
+
### TestPyPI Workflow (`publish-testpypi.yml`)
|
|
143
|
+
|
|
144
|
+
- **Trigger**: Manual via workflow_dispatch
|
|
145
|
+
- **Builds**: Package using `python -m build`
|
|
146
|
+
- **Checks**: Validates package with `twine check`
|
|
147
|
+
- **Publishes**: To test.pypi.org
|
|
148
|
+
- **Skip existing**: Yes (won't fail if version exists)
|
|
149
|
+
|
|
150
|
+
### PyPI Workflow (`publish-pypi.yml`)
|
|
151
|
+
|
|
152
|
+
- **Trigger**: Git tags matching `v*` (e.g., `v0.4.0`)
|
|
153
|
+
- **Version check**: Ensures tag matches `pyproject.toml`
|
|
154
|
+
- **Builds**: Package using `python -m build`
|
|
155
|
+
- **Checks**: Validates package with `twine check`
|
|
156
|
+
- **Publishes**: To pypi.org
|
|
157
|
+
|
|
158
|
+
## Release Workflow Example
|
|
159
|
+
|
|
160
|
+
Complete workflow for releasing a new version:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# 1. Update version in pyproject.toml
|
|
164
|
+
# Edit: version = "0.4.0"
|
|
165
|
+
|
|
166
|
+
# 2. Update version in src/putplace/version.py (if exists)
|
|
167
|
+
# Edit: __version__ = "0.4.0"
|
|
168
|
+
|
|
169
|
+
# 3. Update CHANGELOG.md (if exists)
|
|
170
|
+
# Add release notes
|
|
171
|
+
|
|
172
|
+
# 4. Commit version bump
|
|
173
|
+
git add pyproject.toml src/putplace/version.py CHANGELOG.md
|
|
174
|
+
git commit -m "Bump version to 0.4.0"
|
|
175
|
+
|
|
176
|
+
# 5. Push to main
|
|
177
|
+
git push origin main
|
|
178
|
+
|
|
179
|
+
# 6. Test with TestPyPI first (optional but recommended)
|
|
180
|
+
invoke publish-test
|
|
181
|
+
|
|
182
|
+
# 7. Create and push version tag
|
|
183
|
+
git tag -a v0.4.0 -m "Release version 0.4.0"
|
|
184
|
+
git push origin v0.4.0
|
|
185
|
+
|
|
186
|
+
# 8. GitHub Actions will automatically publish to PyPI
|
|
187
|
+
|
|
188
|
+
# 9. Verify publication
|
|
189
|
+
open https://pypi.org/project/putplace/
|
|
190
|
+
|
|
191
|
+
# 10. Create GitHub release (optional)
|
|
192
|
+
# Go to: https://github.com/jdrumgoole/putplace/releases/new
|
|
193
|
+
# - Tag: v0.4.0
|
|
194
|
+
# - Release title: "PutPlace v0.4.0"
|
|
195
|
+
# - Description: Copy from CHANGELOG.md
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Troubleshooting
|
|
199
|
+
|
|
200
|
+
### Error: "Invalid or non-existent authentication information"
|
|
201
|
+
|
|
202
|
+
**Problem**: GitHub secret not configured correctly
|
|
203
|
+
|
|
204
|
+
**Solution**:
|
|
205
|
+
1. Check secret name matches exactly: `TEST_PYPI_API_TOKEN` or `PYPI_API_TOKEN`
|
|
206
|
+
2. Regenerate API token and update secret
|
|
207
|
+
3. Ensure token has correct scope
|
|
208
|
+
|
|
209
|
+
### Error: "File already exists"
|
|
210
|
+
|
|
211
|
+
**Problem**: Version already published to PyPI
|
|
212
|
+
|
|
213
|
+
**Solution**:
|
|
214
|
+
1. Increment version in `pyproject.toml`
|
|
215
|
+
2. Create new tag with new version
|
|
216
|
+
3. PyPI doesn't allow replacing existing versions (immutable)
|
|
217
|
+
|
|
218
|
+
### Error: "Version mismatch"
|
|
219
|
+
|
|
220
|
+
**Problem**: Git tag version doesn't match `pyproject.toml`
|
|
221
|
+
|
|
222
|
+
**Solution**:
|
|
223
|
+
1. Check version in `pyproject.toml`: `grep version pyproject.toml`
|
|
224
|
+
2. Delete incorrect tag: `git tag -d v0.4.0 && git push origin :refs/tags/v0.4.0`
|
|
225
|
+
3. Fix version and create new tag
|
|
226
|
+
|
|
227
|
+
### Error: "Package build failed"
|
|
228
|
+
|
|
229
|
+
**Problem**: Build process error
|
|
230
|
+
|
|
231
|
+
**Solution**:
|
|
232
|
+
1. Test build locally: `python -m build`
|
|
233
|
+
2. Check `pyproject.toml` configuration
|
|
234
|
+
3. Ensure all required files are committed
|
|
235
|
+
4. Check GitHub Actions logs for details
|
|
236
|
+
|
|
237
|
+
## Security Best Practices
|
|
238
|
+
|
|
239
|
+
1. **Never commit API tokens** to the repository
|
|
240
|
+
2. **Use GitHub Secrets** for all sensitive credentials
|
|
241
|
+
3. **Scope tokens** to specific projects when possible
|
|
242
|
+
4. **Rotate tokens** periodically
|
|
243
|
+
5. **Review workflow logs** for any exposed secrets (GitHub auto-redacts them)
|
|
244
|
+
6. **Enable 2FA** on PyPI and TestPyPI accounts
|
|
245
|
+
|
|
246
|
+
## Alternative: Local Publishing
|
|
247
|
+
|
|
248
|
+
If you prefer to publish manually from your machine:
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
# TestPyPI
|
|
252
|
+
invoke publish-test
|
|
253
|
+
|
|
254
|
+
# Production PyPI
|
|
255
|
+
invoke publish
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
These commands are configured in `tasks.py` and use your local credentials from `~/.pypirc`.
|
|
259
|
+
|
|
260
|
+
## Further Reading
|
|
261
|
+
|
|
262
|
+
- **PyPI Help**: https://pypi.org/help/
|
|
263
|
+
- **TestPyPI**: https://test.pypi.org/
|
|
264
|
+
- **GitHub Actions**: https://docs.github.com/en/actions
|
|
265
|
+
- **PyPA Publish Action**: https://github.com/pypa/gh-action-pypi-publish
|
|
266
|
+
- **Python Packaging Guide**: https://packaging.python.org/
|
|
267
|
+
|
|
268
|
+
## Need Help?
|
|
269
|
+
|
|
270
|
+
- **GitHub Issues**: https://github.com/jdrumgoole/putplace/issues
|
|
271
|
+
- **PyPI Support**: https://pypi.org/help/#support
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
# Only trigger on version tags for production releases
|
|
5
|
+
push:
|
|
6
|
+
tags:
|
|
7
|
+
- 'v*'
|
|
8
|
+
|
|
9
|
+
# Allow manual triggering (with extra caution)
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build-and-publish:
|
|
14
|
+
name: Build and publish to PyPI
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
# Required for trusted publishing with OIDC
|
|
18
|
+
permissions:
|
|
19
|
+
id-token: write
|
|
20
|
+
contents: read
|
|
21
|
+
|
|
22
|
+
# Environment for PyPI publishing (adds extra security layer)
|
|
23
|
+
environment:
|
|
24
|
+
name: pypi
|
|
25
|
+
url: https://pypi.org/p/putplace
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout repository
|
|
29
|
+
uses: actions/checkout@v4
|
|
30
|
+
|
|
31
|
+
- name: Verify version tag
|
|
32
|
+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
|
33
|
+
run: |
|
|
34
|
+
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
|
|
35
|
+
PROJECT_VERSION=$(grep '^version =' pyproject.toml | cut -d'"' -f2)
|
|
36
|
+
echo "Tag version: $TAG_VERSION"
|
|
37
|
+
echo "Project version: $PROJECT_VERSION"
|
|
38
|
+
if [ "$TAG_VERSION" != "$PROJECT_VERSION" ]; then
|
|
39
|
+
echo "❌ Error: Tag version ($TAG_VERSION) does not match project version ($PROJECT_VERSION)"
|
|
40
|
+
exit 1
|
|
41
|
+
fi
|
|
42
|
+
echo "✓ Version numbers match"
|
|
43
|
+
|
|
44
|
+
- name: Set up Python
|
|
45
|
+
uses: actions/setup-python@v5
|
|
46
|
+
with:
|
|
47
|
+
python-version: '3.11'
|
|
48
|
+
|
|
49
|
+
- name: Install uv
|
|
50
|
+
uses: astral-sh/setup-uv@v3
|
|
51
|
+
with:
|
|
52
|
+
version: "latest"
|
|
53
|
+
|
|
54
|
+
- name: Install build dependencies
|
|
55
|
+
run: |
|
|
56
|
+
python -m pip install --upgrade pip
|
|
57
|
+
pip install build twine
|
|
58
|
+
|
|
59
|
+
- name: Build package
|
|
60
|
+
run: |
|
|
61
|
+
python -m build
|
|
62
|
+
echo "✓ Package built successfully"
|
|
63
|
+
ls -lh dist/
|
|
64
|
+
|
|
65
|
+
- name: Check package with twine
|
|
66
|
+
run: |
|
|
67
|
+
twine check dist/*
|
|
68
|
+
|
|
69
|
+
- name: Publish to PyPI
|
|
70
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
71
|
+
with:
|
|
72
|
+
# No password needed - using OIDC trusted publishing
|
|
73
|
+
verbose: true
|
|
74
|
+
|
|
75
|
+
- name: Success message
|
|
76
|
+
run: |
|
|
77
|
+
echo "✓ Package published to PyPI"
|
|
78
|
+
echo "View at: https://pypi.org/project/putplace/"
|
|
79
|
+
echo ""
|
|
80
|
+
echo "Install with:"
|
|
81
|
+
echo " pip install putplace"
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
name: Publish to TestPyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
# Allow manual triggering from GitHub Actions tab
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
|
|
7
|
+
# Optionally trigger on push to main (remove if not needed)
|
|
8
|
+
# push:
|
|
9
|
+
# branches:
|
|
10
|
+
# - main
|
|
11
|
+
|
|
12
|
+
# Trigger on version tags (recommended for releases)
|
|
13
|
+
# push:
|
|
14
|
+
# tags:
|
|
15
|
+
# - 'v*'
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
build-and-publish:
|
|
19
|
+
name: Build and publish to TestPyPI
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout repository
|
|
24
|
+
uses: actions/checkout@v4
|
|
25
|
+
|
|
26
|
+
- name: Set up Python
|
|
27
|
+
uses: actions/setup-python@v5
|
|
28
|
+
with:
|
|
29
|
+
python-version: '3.11'
|
|
30
|
+
|
|
31
|
+
- name: Install uv
|
|
32
|
+
uses: astral-sh/setup-uv@v3
|
|
33
|
+
with:
|
|
34
|
+
version: "latest"
|
|
35
|
+
|
|
36
|
+
- name: Install build dependencies
|
|
37
|
+
run: |
|
|
38
|
+
python -m pip install --upgrade pip
|
|
39
|
+
pip install build twine
|
|
40
|
+
|
|
41
|
+
- name: Build package
|
|
42
|
+
run: |
|
|
43
|
+
python -m build
|
|
44
|
+
echo "✓ Package built successfully"
|
|
45
|
+
ls -lh dist/
|
|
46
|
+
|
|
47
|
+
- name: Check package with twine
|
|
48
|
+
run: |
|
|
49
|
+
twine check dist/*
|
|
50
|
+
|
|
51
|
+
- name: Publish to TestPyPI
|
|
52
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
53
|
+
with:
|
|
54
|
+
repository-url: https://test.pypi.org/legacy/
|
|
55
|
+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
|
56
|
+
skip-existing: true
|
|
57
|
+
verbose: true
|
|
58
|
+
|
|
59
|
+
- name: Success message
|
|
60
|
+
run: |
|
|
61
|
+
echo "✓ Package published to TestPyPI"
|
|
62
|
+
echo "View at: https://test.pypi.org/project/putplace/"
|
|
63
|
+
echo ""
|
|
64
|
+
echo "Test installation with:"
|
|
65
|
+
echo " pip install --index-url https://test.pypi.org/simple/ putplace"
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
pip-wheel-metadata/
|
|
20
|
+
share/python-wheels/
|
|
21
|
+
*.egg-info/
|
|
22
|
+
.installed.cfg
|
|
23
|
+
*.egg
|
|
24
|
+
MANIFEST
|
|
25
|
+
|
|
26
|
+
# Virtual environments
|
|
27
|
+
.env
|
|
28
|
+
.venv
|
|
29
|
+
env/
|
|
30
|
+
venv/
|
|
31
|
+
ENV/
|
|
32
|
+
env.bak/
|
|
33
|
+
venv.bak/
|
|
34
|
+
|
|
35
|
+
# uv
|
|
36
|
+
.python-version
|
|
37
|
+
uv.lock
|
|
38
|
+
|
|
39
|
+
# Testing
|
|
40
|
+
.pytest_cache/
|
|
41
|
+
.coverage
|
|
42
|
+
.coverage.*
|
|
43
|
+
htmlcov/
|
|
44
|
+
.tox/
|
|
45
|
+
.nox/
|
|
46
|
+
coverage.xml
|
|
47
|
+
*.cover
|
|
48
|
+
.hypothesis/
|
|
49
|
+
|
|
50
|
+
# Type checking
|
|
51
|
+
.mypy_cache/
|
|
52
|
+
.dmypy.json
|
|
53
|
+
dmypy.json
|
|
54
|
+
.pyre/
|
|
55
|
+
.pytype/
|
|
56
|
+
|
|
57
|
+
# Linting
|
|
58
|
+
.ruff_cache/
|
|
59
|
+
|
|
60
|
+
# IDEs
|
|
61
|
+
.vscode/
|
|
62
|
+
.idea/
|
|
63
|
+
*.swp
|
|
64
|
+
*.swo
|
|
65
|
+
*~
|
|
66
|
+
.DS_Store
|
|
67
|
+
|
|
68
|
+
# Jupyter Notebook
|
|
69
|
+
.ipynb_checkpoints
|
|
70
|
+
|
|
71
|
+
# Environment variables
|
|
72
|
+
.env.local
|
|
73
|
+
.env.*.local
|
|
74
|
+
|
|
75
|
+
# Configuration files (templates are tracked)
|
|
76
|
+
ppserver.toml
|
|
77
|
+
|
|
78
|
+
# Client configuration
|
|
79
|
+
ppclient.conf
|
|
80
|
+
|
|
81
|
+
# Documentation
|
|
82
|
+
docs/_build/
|
|
83
|
+
|
|
84
|
+
# Storage
|
|
85
|
+
storage/
|
|
86
|
+
.storage/
|
|
87
|
+
|
|
88
|
+
# PutPlace server runtime files
|
|
89
|
+
.ppserver.pid
|
|
90
|
+
ppserver.log
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Read the Docs configuration file for PutPlace
|
|
2
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
3
|
+
|
|
4
|
+
version: 2
|
|
5
|
+
|
|
6
|
+
# Build documentation in the "docs/" directory with Sphinx
|
|
7
|
+
sphinx:
|
|
8
|
+
configuration: docs/conf.py
|
|
9
|
+
fail_on_warning: false
|
|
10
|
+
|
|
11
|
+
# Build documentation with Python 3.11
|
|
12
|
+
# The "latest" version will automatically track the default branch (main)
|
|
13
|
+
build:
|
|
14
|
+
os: ubuntu-22.04
|
|
15
|
+
tools:
|
|
16
|
+
python: "3.11"
|
|
17
|
+
|
|
18
|
+
# Install Python dependencies
|
|
19
|
+
python:
|
|
20
|
+
install:
|
|
21
|
+
- method: pip
|
|
22
|
+
path: .
|
|
23
|
+
extra_requirements:
|
|
24
|
+
- docs
|
|
25
|
+
- requirements: docs/requirements.txt
|
|
26
|
+
|
|
27
|
+
# Output formats
|
|
28
|
+
formats:
|
|
29
|
+
- pdf
|
|
30
|
+
- epub
|