Skip to content

Commit

Permalink
pypi: scarf-sdk name, CI step on tag, probably not working
Browse files Browse the repository at this point in the history
  • Loading branch information
aviaviavi committed Dec 29, 2024
1 parent c3d56ba commit eb7f055
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 5 deletions.
32 changes: 31 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: CI
on:
push:
branches: [ master ]
tags: [ 'v*' ]
pull_request:
branches: [ master ]

Expand Down Expand Up @@ -31,4 +32,33 @@ jobs:
. .venv/bin/activate
uv pip install -r requirements-dev.txt
ruff check .
pytest
pytest
publish:
needs: test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build

- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine check dist/*
twine upload dist/*
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A Python client for sending telemetry events to Scarf.
## Installation

```bash
pip install scarf
pip install scarf-sdk
```

## Usage
Expand Down Expand Up @@ -42,13 +42,17 @@ The client can be configured through environment variables:

- `DO_NOT_TRACK=1`: Disable analytics
- `SCARF_NO_ANALYTICS=1`: Disable analytics (alternative)
- `SCARF_VERBOSE=1`: Enable verbose logging

## Features

- Simple API for sending telemetry events
- Environment variable configuration
- Configurable timeouts (default: 3 seconds)
- Automatically reespects Do Not Track settings
- Support for empty payloads
- Automatic User-Agent header (`scarf-sdk/VERSION`)
- Respects Do Not Track settings
- Verbose logging mode for debugging

## Development

Expand All @@ -62,6 +66,19 @@ The client can be configured through environment variables:
pytest
```

## Publishing

To publish a new version:

1. Update version in `setup.py`
2. Create and push a new tag:
```bash
git tag v0.1.0
git push origin v0.1.0
```

The CI workflow will automatically build and publish to PyPI when a new version tag is pushed.

## License

Apache 2.0
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "scarf"
name = "scarf-sdk"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
long_description = fh.read()

setup(
name="scarf",
name="scarf-sdk",
version="0.1.0",
author="Scarf",
author_email="[email protected]",
Expand Down

0 comments on commit eb7f055

Please sign in to comment.