Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish Python Package

# This workflow is automatically triggered when a GitHub release is created
# by the main.yml workflow. This ensures that the PyPI package is published
# with the same version as the Docker image and GitHub release.
on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Set version from tag
run: |
# Extract version from the GitHub release tag (remove 'v' prefix if present)
# This tag is created by the main.yml workflow
VERSION=${GITHUB_REF#refs/tags/}
VERSION=${VERSION#v}
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
echo "Using version: $VERSION from GitHub release"
- name: Update version in pyproject.toml
run: |
# Use sed to update the version in pyproject.toml to match the GitHub release
sed -i "s/version = \"[0-9]*\.[0-9]*\.[0-9]*\"/version = \"$RELEASE_VERSION\"/" pyproject.toml
cat pyproject.toml | grep version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build
twine check dist/*
twine upload dist/*
10 changes: 10 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
include LICENSE
include README.md
include cloudproxy/providers/user_data.sh
recursive-exclude cloudproxy-ui *
recursive-exclude tests *
recursive-exclude docs *
recursive-exclude .github *
recursive-exclude venv *
recursive-exclude __pycache__ *
recursive-exclude .pytest_cache *
46 changes: 44 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,51 @@ To get a local copy up and running follow these simple steps.

### Prerequisites

All you need is:
* Docker
You can use CloudProxy in two ways:

1. **Docker (recommended for running the service)**
* Docker installed on your system

2. **Python Package (for development or integration)**
* Python 3.9 or higher

### Installation

#### As a Python Package

CloudProxy is available as a Python package that you can install directly from PyPI:

```bash
pip install cloudproxy
```

Or install from source:

```bash
# Clone the repository
git clone https://github.com/claffin/cloudproxy.git
cd cloudproxy

# Install in development mode
pip install -e .

# Or build and install
pip install build
python -m build
pip install dist/cloudproxy-0.1.0-py3-none-any.whl
```

Once installed, you can import and use CloudProxy in your Python applications:

```python
from cloudproxy.providers import manager
import cloudproxy.main as cloudproxy

# Setup your environment variables first
# Start the CloudProxy service
cloudproxy.start()
```

#### Environment variables:

Basic authentication is used for proxy access. Configure via environment variables:
Expand Down Expand Up @@ -157,6 +197,8 @@ proxies = {
my_request = requests.get("https://api.ipify.org", proxies=proxies)
```

For more detailed examples of using CloudProxy as a Python package, see the [Python Package Usage Guide](docs/python-package-usage.md).

## Multi-Account Provider Support

CloudProxy now supports multiple accounts per provider, allowing you to:
Expand Down
5 changes: 5 additions & 0 deletions cloudproxy/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env python
from cloudproxy.main import start

if __name__ == "__main__":
start()
Loading