Skip to content

Commit 9540483

Browse files
committed
first implementation
1 parent 8ccc381 commit 9540483

File tree

13 files changed

+32877
-2
lines changed

13 files changed

+32877
-2
lines changed

.github/workflows/ci.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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.10", "3.11", "3.12"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install poetry
25+
uses: abatilo/actions-poetry@v2
26+
27+
- name: Configure poetry
28+
run: |
29+
poetry config virtualenvs.create true
30+
poetry config virtualenvs.in-project true
31+
32+
- name: Cache poetry dependencies
33+
uses: actions/cache@v3
34+
with:
35+
path: .venv
36+
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
37+
38+
- name: Install dependencies
39+
run: poetry install
40+
41+
- name: Run tests
42+
run: poetry run pytest -v
43+
44+
- name: Run linting
45+
run: |
46+
poetry run black --check .
47+
poetry run isort --check-only .
48+
49+
- name: Test import and basic functionality
50+
run: poetry run python test_warnings_fixed.py
51+
52+
build:
53+
runs-on: ubuntu-latest
54+
needs: test
55+
56+
steps:
57+
- uses: actions/checkout@v4
58+
59+
- name: Set up Python
60+
uses: actions/setup-python@v4
61+
with:
62+
python-version: "3.x"
63+
64+
- name: Install poetry
65+
uses: abatilo/actions-poetry@v2
66+
67+
- name: Build package
68+
run: poetry build
69+
70+
- name: Check build artifacts
71+
run: |
72+
ls -la dist/
73+
poetry run pip install dist/*.whl
74+
poetry run python -c "from structure_align import StructuralAligner; print('✅ Package installed and imports successfully')"

.github/workflows/publish.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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+
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: "3.x"
18+
- name: Install poetry
19+
uses: abatilo/actions-poetry@v2
20+
- name: Configure poetry
21+
run: poetry config virtualenvs.create false
22+
- name: Install dependencies
23+
run: poetry install --only=main
24+
- name: Build package
25+
run: poetry build
26+
- name: Store the distribution packages
27+
uses: actions/upload-artifact@v3
28+
with:
29+
name: python-package-distributions
30+
path: dist/
31+
32+
publish-to-pypi:
33+
name: >-
34+
Publish Python 🐍 distribution 📦 to PyPI
35+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
36+
needs:
37+
- build
38+
runs-on: ubuntu-latest
39+
environment:
40+
name: pypi
41+
url: https://pypi.org/p/structure-align
42+
permissions:
43+
id-token: write
44+
45+
steps:
46+
- name: Download all the dists
47+
uses: actions/download-artifact@v3
48+
with:
49+
name: python-package-distributions
50+
path: dist/
51+
- name: Publish distribution 📦 to PyPI
52+
uses: pypa/gh-action-pypi-publish@release/v1
53+
54+
github-release:
55+
name: >-
56+
Sign the Python 🐍 distribution 📦 with Sigstore
57+
and upload them to GitHub Release
58+
needs:
59+
- publish-to-pypi
60+
runs-on: ubuntu-latest
61+
62+
permissions:
63+
contents: write
64+
id-token: write
65+
66+
steps:
67+
- name: Download all the dists
68+
uses: actions/download-artifact@v3
69+
with:
70+
name: python-package-distributions
71+
path: dist/
72+
- name: Sign the dists with Sigstore
73+
uses: sigstore/[email protected]
74+
with:
75+
inputs: >-
76+
./dist/*.tar.gz
77+
./dist/*.whl
78+
- name: Create GitHub Release
79+
env:
80+
GITHUB_TOKEN: ${{ github.token }}
81+
run: >-
82+
gh release upload
83+
'${{ github.ref_name }}' dist/**
84+
--repo '${{ github.repository }}'

0 commit comments

Comments
 (0)