Skip to content

Commit 6f70a0c

Browse files
committed
Initial package release v0.1.0
1 parent 2481581 commit 6f70a0c

File tree

2 files changed

+157
-0
lines changed

2 files changed

+157
-0
lines changed

.github/workflows/ci.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
test:
11+
name: Test Python ${{ matrix.python-version }}
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
cache: 'pip'
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install -e ".[dev]"
31+
32+
- name: Lint with ruff
33+
run: |
34+
ruff check haystack_brightdata/
35+
36+
- name: Check formatting with black
37+
run: |
38+
black --check haystack_brightdata/
39+
40+
- name: Type check with mypy
41+
run: |
42+
mypy haystack_brightdata/ --ignore-missing-imports
43+
continue-on-error: true # Don't fail on type errors initially
44+
45+
- name: Test with pytest
46+
run: |
47+
pytest tests/ -v --tb=short
48+
env:
49+
BRIGHT_DATA_API_KEY: ${{ secrets.BRIGHT_DATA_API_KEY }}
50+
51+
lint:
52+
name: Lint and Format Check
53+
runs-on: ubuntu-latest
54+
55+
steps:
56+
- uses: actions/checkout@v4
57+
58+
- name: Set up Python
59+
uses: actions/setup-python@v5
60+
with:
61+
python-version: "3.11"
62+
cache: 'pip'
63+
64+
- name: Install dependencies
65+
run: |
66+
python -m pip install --upgrade pip
67+
pip install ruff black
68+
69+
- name: Run ruff
70+
run: |
71+
ruff check haystack_brightdata/ --output-format=github
72+
73+
- name: Run black
74+
run: |
75+
black --check --diff haystack_brightdata/
76+
77+
build:
78+
name: Build Package
79+
runs-on: ubuntu-latest
80+
needs: [test, lint]
81+
82+
steps:
83+
- uses: actions/checkout@v4
84+
85+
- name: Set up Python
86+
uses: actions/setup-python@v5
87+
with:
88+
python-version: "3.11"
89+
90+
- name: Install build dependencies
91+
run: |
92+
python -m pip install --upgrade pip
93+
pip install build twine
94+
95+
- name: Build package
96+
run: |
97+
python -m build
98+
99+
- name: Check package
100+
run: |
101+
twine check dist/*
102+
103+
- name: Upload artifacts
104+
uses: actions/upload-artifact@v4
105+
with:
106+
name: dist-packages
107+
path: dist/
108+
retention-days: 7

.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+
workflow_dispatch:
7+
8+
jobs:
9+
build-and-publish:
10+
name: Build and Publish to PyPI
11+
runs-on: ubuntu-latest
12+
permissions:
13+
id-token: write
14+
contents: read
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.11"
23+
24+
- name: Install build dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install build twine
28+
29+
- name: Build package
30+
run: |
31+
python -m build
32+
33+
- name: Check package
34+
run: |
35+
twine check dist/*
36+
37+
- name: Publish to Test PyPI
38+
if: github.event_name == 'workflow_dispatch'
39+
uses: pypa/gh-action-pypi-publish@release/v1
40+
with:
41+
repository-url: https://test.pypi.org/legacy/
42+
skip-existing: true
43+
verbose: true
44+
45+
- name: Publish to PyPI
46+
if: github.event_name == 'release'
47+
uses: pypa/gh-action-pypi-publish@release/v1
48+
with:
49+
verbose: true

0 commit comments

Comments
 (0)