Skip to content

Commit 2330688

Browse files
committed
Merge branch 'main' of github.com:axonops/async-python-cassandra-client into bulk
2 parents ec60b8e + 480efb8 commit 2330688

File tree

5 files changed

+68
-28
lines changed

5 files changed

+68
-28
lines changed

.github/workflows/ci-monorepo.yml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,19 @@ jobs:
3636

3737
- name: Install dependencies
3838
run: |
39-
cd ${{ env.PACKAGE_DIR }}
39+
echo "=== DEBUG: Installing dependencies ==="
40+
echo "Package: ${{ inputs.package }}"
41+
echo "Install path: ./libs/${{ inputs.package }}"
42+
echo "Current directory: $(pwd)"
43+
echo "Checking if path exists:"
44+
ls -la ./libs/${{ inputs.package }}/
45+
echo "=== Running pip install ==="
4046
python -m pip install --upgrade pip
41-
pip install -e ".[dev]"
47+
pip install -e "./libs/${{ inputs.package }}[dev]"
4248
4349
- name: Run linting checks
50+
working-directory: libs/${{ inputs.package }}
4451
run: |
45-
cd ${{ env.PACKAGE_DIR }}
4652
echo "=== Running ruff ==="
4753
ruff check src/ tests/
4854
echo "=== Running black ==="
@@ -71,8 +77,8 @@ jobs:
7177
pip install bandit[toml] safety pip-audit
7278
7379
- name: Run Bandit security scan
80+
working-directory: libs/${{ inputs.package }}
7481
run: |
75-
cd ${{ env.PACKAGE_DIR }}
7682
echo "=== Running Bandit security scan ==="
7783
# Run bandit with config file and capture exit code
7884
bandit -c ../../.bandit -r src/ -f json -o bandit-report.json || BANDIT_EXIT=$?
@@ -95,9 +101,8 @@ jobs:
95101
96102
- name: Check dependencies with Safety
97103
run: |
98-
cd ${{ env.PACKAGE_DIR }}
99104
echo "=== Checking dependencies with Safety ==="
100-
pip install -e ".[dev,test]"
105+
pip install -e "./libs/${{ inputs.package }}[dev,test]"
101106
# Using the new 'scan' command as 'check' is deprecated
102107
safety scan --json || SAFETY_EXIT=$?
103108
# Safety scan exits with 64 if vulnerabilities found
@@ -108,7 +113,7 @@ jobs:
108113
109114
- name: Run pip-audit
110115
run: |
111-
cd ${{ env.PACKAGE_DIR }}
116+
cd libs/${{ inputs.package }}
112117
echo "=== Running pip-audit ==="
113118
# Skip the local package as it's not on PyPI yet
114119
pip-audit --skip-editable
@@ -136,13 +141,12 @@ jobs:
136141

137142
- name: Install dependencies
138143
run: |
139-
cd ${{ env.PACKAGE_DIR }}
140144
python -m pip install --upgrade pip
141-
pip install -e ".[test]"
145+
pip install -e "./libs/${{ inputs.package }}[test]"
142146
143147
- name: Run unit tests with coverage
144148
run: |
145-
cd ${{ env.PACKAGE_DIR }}
149+
cd libs/${{ inputs.package }}
146150
pytest tests/unit/ -v --cov=${{ inputs.package == 'async-cassandra' && 'async_cassandra' || 'async_cassandra_bulk' }} --cov-report=html --cov-report=xml || echo "No unit tests found (expected for new packages)"
147151
148152
build:
@@ -165,21 +169,21 @@ jobs:
165169
166170
- name: Build package
167171
run: |
168-
cd ${{ env.PACKAGE_DIR }}
172+
cd libs/${{ inputs.package }}
169173
echo "=== Building package ==="
170174
python -m build
171175
echo "=== Package contents ==="
172176
ls -la dist/
173177
174178
- name: Check package with twine
175179
run: |
176-
cd ${{ env.PACKAGE_DIR }}
180+
cd libs/${{ inputs.package }}
177181
echo "=== Checking package metadata ==="
178182
twine check dist/*
179183
180184
- name: Display package info
181185
run: |
182-
cd ${{ env.PACKAGE_DIR }}
186+
cd libs/${{ inputs.package }}
183187
echo "=== Wheel contents ==="
184188
python -m zipfile -l dist/*.whl | head -20
185189
echo "=== Package metadata ==="
@@ -241,9 +245,8 @@ jobs:
241245

242246
- name: Install dependencies
243247
run: |
244-
cd ${{ env.PACKAGE_DIR }}
245248
python -m pip install --upgrade pip
246-
pip install -e ".[test,dev]"
249+
pip install -e "./libs/${{ inputs.package }}[test,dev]"
247250
248251
- name: Verify Cassandra is ready
249252
run: |
@@ -258,7 +261,7 @@ jobs:
258261
CASSANDRA_HOST: localhost
259262
CASSANDRA_PORT: 9042
260263
run: |
261-
cd ${{ env.PACKAGE_DIR }}
264+
cd libs/${{ inputs.package }}
262265
echo "=== Running ${{ matrix.test-suite.name }} ==="
263266
${{ matrix.test-suite.command }}
264267
@@ -305,9 +308,8 @@ jobs:
305308

306309
- name: Install dependencies
307310
run: |
308-
cd ${{ env.PACKAGE_DIR }}
309311
python -m pip install --upgrade pip
310-
pip install -e ".[test,dev]"
312+
pip install -e "./libs/${{ inputs.package }}[test,dev]"
311313
312314
- name: Verify Cassandra is ready
313315
run: |
@@ -322,7 +324,7 @@ jobs:
322324
CASSANDRA_HOST: localhost
323325
CASSANDRA_PORT: 9042
324326
run: |
325-
cd ${{ env.PACKAGE_DIR }}
327+
cd libs/${{ inputs.package }}
326328
echo "=== Running ${{ matrix.test-suite.name }} ==="
327329
${{ matrix.test-suite.command }}
328330

.github/workflows/release-monorepo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ jobs:
162162
needs: [determine-package, build-package]
163163
runs-on: ubuntu-latest
164164
# Only publish stable versions (no pre-release suffix)
165-
if: "!contains(needs.determine-package.outputs.version, '-')"
165+
if: "!contains(needs.determine-package.outputs.version, 'rc') && !contains(needs.determine-package.outputs.version, 'a') && !contains(needs.determine-package.outputs.version, 'b') && !contains(needs.determine-package.outputs.version, 'dev')"
166166

167167
permissions:
168168
id-token: write # Required for trusted publishing

.github/workflows/release.yml

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,55 @@ name: Release CI (Legacy)
33
on:
44
push:
55
tags:
6-
# Legacy tags - redirect to new monorepo release
7-
- 'v[0-9]*'
6+
# Legacy tags only - must start with v followed by version number
7+
- 'v[0-9].*'
8+
- '!async-cassandra-v*'
9+
- '!async-cassandra-bulk-v*'
810

911
jobs:
1012
full-ci:
11-
uses: ./.github/workflows/ci-base.yml
13+
uses: ./.github/workflows/ci-monorepo.yml
1214
with:
15+
package: async-cassandra
1316
run-integration-tests: true
1417
run-full-suite: true
1518

19+
build-package:
20+
needs: full-ci
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: '3.12'
29+
30+
- name: Install build dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install build twine
34+
35+
- name: Build package
36+
run: |
37+
cd libs/async-cassandra
38+
python -m build
39+
40+
- name: Check package
41+
run: |
42+
cd libs/async-cassandra
43+
twine check dist/*
44+
45+
- name: Upload build artifacts
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: python-package-distributions
49+
path: libs/async-cassandra/dist/
50+
retention-days: 7
51+
1652
publish-testpypi:
1753
name: Publish to TestPyPI
18-
needs: full-ci
54+
needs: [full-ci, build-package]
1955
runs-on: ubuntu-latest
2056
# Only publish for proper pre-release versions (PEP 440)
2157
if: contains(github.ref_name, 'rc') || contains(github.ref_name, 'a') || contains(github.ref_name, 'b')
@@ -264,11 +300,11 @@ jobs:
264300
265301
publish-pypi:
266302
name: Publish to PyPI
267-
needs: full-ci
303+
needs: [full-ci, build-package]
268304
runs-on: ubuntu-latest
269305
# Only publish stable versions (no pre-release suffix)
270306
# Match only versions like v0.0.1, v1.2.3, etc (no suffix)
271-
if: "!contains(github.ref_name, '-')"
307+
if: "!contains(github.ref_name, 'rc') && !contains(github.ref_name, 'a') && !contains(github.ref_name, 'b') && !contains(github.ref_name, 'dev')"
272308

273309
permissions:
274310
id-token: write # Required for trusted publishing

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ This is a monorepo containing two related Python packages:
3030
- [📋 Requirements](#-requirements)
3131
- [🔌 CQL Protocol Version Requirement](#-cql-protocol-version-requirement)
3232
- [🔧 Installation](#-installation)
33+
- [async-cassandra (Main Library)](#async-cassandra-main-library)
34+
- [async-cassandra-bulk (Coming Soon)](#async-cassandra-bulk-coming-soon)
3335
- [📚 Quick Start](#-quick-start)
3436
- [🤝 Contributing](#-contributing)
3537
- [📞 Support](#-support)
@@ -38,7 +40,7 @@ This is a monorepo containing two related Python packages:
3840
- [Advanced Topics](#advanced-topics)
3941
- [Examples](#examples)
4042
- [🎯 Running the Examples](#-running-the-examples)
41-
- [Available Examples](#available-examples)
43+
- [Running Examples](#running-examples)
4244
- [Running with External Cassandra](#running-with-external-cassandra)
4345
- [Example Descriptions](#example-descriptions)
4446
- [⚡ Performance](#-performance)

libs/async-cassandra/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,5 +196,5 @@ ignore_missing_imports = true
196196
# - 0.1.0rc7 (from tag async-cassandra-v0.1.0rc7)
197197
# - 0.1.0.dev1+g1234567 (from commits after tag)
198198
root = "../.."
199-
tag_regex = "^async-cassandra-v(?P<version>.+)$"
199+
tag_regex = "^(async-cassandra-)?v(?P<version>.+)$"
200200
fallback_version = "0.1.0.dev0"

0 commit comments

Comments
 (0)