Skip to content

Commit ff470ed

Browse files
committed
initial commit
0 parents  commit ff470ed

73 files changed

Lines changed: 16674 additions & 0 deletions

Some content is hidden

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

‎.github/workflows/ci.yml‎

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ['3.12', '3.13']
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v4
27+
28+
- name: Install dependencies
29+
run: uv sync --all-extras
30+
31+
- name: Run tests with coverage
32+
run: uv run pytest tests/ -v --cov=parallel_web_tools --cov-report=xml --cov-report=term
33+
34+
- name: Upload coverage to Codecov
35+
if: matrix.python-version == '3.12'
36+
uses: codecov/codecov-action@v4
37+
with:
38+
file: ./coverage.xml
39+
fail_ci_if_error: false
40+
continue-on-error: true
41+
42+
lint:
43+
runs-on: ubuntu-latest
44+
45+
steps:
46+
- name: Checkout code
47+
uses: actions/checkout@v4
48+
49+
- name: Set up Python
50+
uses: actions/setup-python@v5
51+
with:
52+
python-version: '3.12'
53+
54+
- name: Install uv
55+
uses: astral-sh/setup-uv@v4
56+
57+
- name: Install dependencies
58+
run: uv sync --all-extras
59+
60+
- name: Lint with ruff
61+
run: uv run ruff check parallel_web_tools/ tests/
62+
63+
- name: Check formatting with ruff
64+
run: uv run ruff format --check parallel_web_tools/ tests/
65+
66+
- name: Type check with pyrefly
67+
run: uv run pyrefly check parallel_web_tools/
68+
continue-on-error: true
69+
70+
cli-test:
71+
runs-on: ubuntu-latest
72+
73+
steps:
74+
- name: Checkout code
75+
uses: actions/checkout@v4
76+
77+
- name: Set up Python
78+
uses: actions/setup-python@v5
79+
with:
80+
python-version: '3.12'
81+
82+
- name: Install uv
83+
uses: astral-sh/setup-uv@v4
84+
85+
- name: Install package with CLI
86+
run: uv sync --all-extras
87+
88+
- name: Test CLI help commands
89+
run: |
90+
uv run parallel-cli --help
91+
uv run parallel-cli auth --help
92+
uv run parallel-cli search --help
93+
uv run parallel-cli extract --help
94+
uv run parallel-cli enrich --help
95+
uv run parallel-cli enrich run --help
96+
uv run parallel-cli enrich plan --help
97+
uv run parallel-cli enrich suggest --help
98+
uv run parallel-cli enrich deploy --help
99+
100+
- name: Test CLI version
101+
run: uv run parallel-cli --version
102+
103+
- name: Test Python imports
104+
run: |
105+
uv run python -c "from parallel_web_tools import run_enrichment, get_api_key, enrich_batch"
106+
uv run python -c "from parallel_web_tools.core import auth, schema, batch"
107+
uv run python -c "from parallel_web_tools.cli import main"
108+
uv run python -c "from parallel_web_tools.integrations.polars import parallel_enrich"
109+
uv run python -c "from parallel_web_tools.integrations.duckdb import enrich_table"

‎.github/workflows/publish.yml‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
name: Build distribution
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.12"
18+
19+
- name: Install build dependencies
20+
run: python -m pip install --upgrade pip build
21+
22+
- name: Build package
23+
run: python -m build
24+
25+
- name: Store distribution packages
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: python-package-distributions
29+
path: dist/
30+
31+
publish-to-pypi:
32+
name: Publish to PyPI
33+
needs: build
34+
runs-on: ubuntu-latest
35+
environment:
36+
name: pypi
37+
url: https://pypi.org/p/parallel-web-tools
38+
permissions:
39+
id-token: write # Required for trusted publishing
40+
41+
steps:
42+
- name: Download distributions
43+
uses: actions/download-artifact@v4
44+
with:
45+
name: python-package-distributions
46+
path: dist/
47+
48+
- name: Publish to PyPI
49+
uses: pypa/gh-action-pypi-publish@release/v1

‎.github/workflows/release.yml‎

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Build Release Binaries
2+
3+
on:
4+
release:
5+
types: [created]
6+
workflow_dispatch:
7+
inputs:
8+
tag:
9+
description: 'Release tag (e.g., v0.0.1)'
10+
required: true
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
build:
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
include:
21+
- os: macos-15
22+
platform: darwin-arm64
23+
- os: macos-15-large
24+
platform: darwin-x64
25+
- os: ubuntu-latest
26+
platform: linux-x64
27+
- os: windows-latest
28+
platform: windows-x64
29+
30+
runs-on: ${{ matrix.os }}
31+
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v4
35+
36+
- name: Set up Python
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: '3.12'
40+
41+
- name: Install uv
42+
uses: astral-sh/setup-uv@v4
43+
44+
- name: Install dependencies
45+
run: uv sync --all-extras
46+
47+
- name: Build binary
48+
run: uv run python scripts/build.py --skip-deps
49+
50+
- name: Get version
51+
id: version
52+
shell: bash
53+
run: |
54+
VERSION=$(grep '^version' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
55+
echo "version=$VERSION" >> $GITHUB_OUTPUT
56+
57+
- name: Rename binary (Unix)
58+
if: runner.os != 'Windows'
59+
run: |
60+
mv dist/parallel-cli dist/parallel-cli-${{ matrix.platform }}
61+
62+
- name: Rename binary (Windows)
63+
if: runner.os == 'Windows'
64+
run: |
65+
mv dist/parallel-cli.exe dist/parallel-cli-${{ matrix.platform }}.exe
66+
67+
- name: Generate checksum (Unix)
68+
if: runner.os != 'Windows'
69+
run: |
70+
cd dist
71+
shasum -a 256 parallel-cli-${{ matrix.platform }} | cut -d' ' -f1 > parallel-cli-${{ matrix.platform }}.sha256
72+
73+
- name: Generate checksum (Windows)
74+
if: runner.os == 'Windows'
75+
shell: pwsh
76+
run: |
77+
cd dist
78+
$hash = (Get-FileHash -Algorithm SHA256 parallel-cli-${{ matrix.platform }}.exe).Hash.ToLower()
79+
"$hash" | Out-File -FilePath parallel-cli-${{ matrix.platform }}.exe.sha256 -NoNewline
80+
81+
- name: Upload artifacts
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: binary-${{ matrix.platform }}
85+
path: |
86+
dist/parallel-cli-${{ matrix.platform }}*
87+
retention-days: 1
88+
89+
release:
90+
needs: build
91+
runs-on: ubuntu-latest
92+
93+
steps:
94+
- name: Download all artifacts
95+
uses: actions/download-artifact@v4
96+
with:
97+
path: artifacts
98+
pattern: binary-*
99+
merge-multiple: true
100+
101+
- name: List artifacts
102+
run: ls -la artifacts/
103+
104+
- name: Upload to Release
105+
uses: softprops/action-gh-release@v2
106+
with:
107+
files: artifacts/*
108+
tag_name: ${{ github.event.release.tag_name || github.event.inputs.tag }}

‎.gitignore‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Python-generated files
2+
__pycache__/
3+
*.py[oc]
4+
build/
5+
dist/
6+
wheels/
7+
*.egg-info
8+
9+
# Virtual environments
10+
.venv
11+
12+
# Environment files
13+
.env.local
14+
.env
15+
16+
# Data files
17+
data/
18+
configs/
19+
*.db
20+
output_*.csv
21+
notebooks/debug_enrichment.ipynb

‎.pre-commit-config.yaml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: check-merge-conflict
6+
- id: debug-statements
7+
- id: end-of-file-fixer
8+
- id: detect-private-key
9+
- id: trailing-whitespace
10+
- repo: https://github.com/astral-sh/ruff-pre-commit
11+
rev: v0.14.14
12+
hooks:
13+
# Run the linter.
14+
- id: ruff-check
15+
# Run the formatter.
16+
- id: ruff-format

‎.python-version‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

0 commit comments

Comments
 (0)