Skip to content

Commit aabc7e1

Browse files
author
Martin Urban
committed
Add numpy headers and github actions
1 parent 27c28cb commit aabc7e1

Some content is hidden

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

85 files changed

+28427
-52
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#A* -------------------------------------------------------------------
2+
#B* This file contains source code for running a GitHub automation
3+
#-* related to the build process of the PyMOL computer program
4+
#C* Copyright 2025 by Martin Urban.
5+
#D* -------------------------------------------------------------------
6+
#E* It is unlawful to modify or remove this copyright notice.
7+
#F* -------------------------------------------------------------------
8+
#G* Please see the accompanying LICENSE file for further information.
9+
#H* -------------------------------------------------------------------
10+
#I* Additional authors of this source file include:
11+
#-*
12+
#-*
13+
#-*
14+
#Z* -------------------------------------------------------------------
15+
name: Build wheel files for all UNIX like operating systems
16+
17+
on: [push]
18+
19+
env:
20+
VCPKG_ROOT: ${{ github.workspace }}/vendor/vcpkg
21+
22+
jobs:
23+
build:
24+
strategy:
25+
matrix:
26+
os: [ubuntu-latest, macos-13, macos-14]
27+
python-version: ["3.11", "3.12"]
28+
runs-on: ${{ matrix.os }}
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
with:
33+
submodules: recursive
34+
35+
- name: Initialize vcpkg
36+
run: |
37+
git clone https://github.com/Microsoft/vcpkg.git vendor/vcpkg
38+
39+
- name: Setup Python ${{ matrix.python-version }}
40+
uses: actions/setup-python@v5
41+
with:
42+
python-version: ${{ matrix.python-version }}
43+
44+
- name: Create virtual environment
45+
run: |
46+
python -m venv .venv
47+
source .venv/bin/activate
48+
python -m pip install wheel setuptools # setuptools needed for Python >=3.12
49+
python -m pip install -r requirements.txt
50+
51+
- name: Bootstrap vcpkg
52+
run: ${{ env.VCPKG_ROOT }}/bootstrap-vcpkg.sh -disableMetrics
53+
54+
- name: Install vcpkg dependencies
55+
run: |
56+
${{ env.VCPKG_ROOT }}/vcpkg install
57+
58+
- name: Build extension
59+
run: |
60+
source .venv/bin/activate
61+
python automations/my_automator.py setup dev-env
62+
export ARCH=$(uname -m)
63+
python -m build
64+
pip install dist/*.whl
65+
66+
- name: Run pytest
67+
run: |
68+
source .venv/bin/activate
69+
pip install pytest
70+
cd tests/
71+
pytest
72+
73+
- name: Upload artifact
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: PyMOL-wheel-${{ matrix.os }}-${{ matrix.python-version }}
77+
path: dist/*.whl
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#A* -------------------------------------------------------------------
2+
#B* This file contains source code for running a GitHub automation
3+
#-* related to the build process of the PyMOL computer program
4+
#C* Copyright 2025 by Martin Urban.
5+
#D* -------------------------------------------------------------------
6+
#E* It is unlawful to modify or remove this copyright notice.
7+
#F* -------------------------------------------------------------------
8+
#G* Please see the accompanying LICENSE file for further information.
9+
#H* -------------------------------------------------------------------
10+
#I* Additional authors of this source file include:
11+
#-*
12+
#-*
13+
#-*
14+
#Z* -------------------------------------------------------------------
15+
name: Build wheel files for the Windows operating system
16+
17+
on: [push]
18+
19+
env:
20+
VCPKG_ROOT: ${{ github.workspace }}/vendor/vcpkg
21+
22+
jobs:
23+
build:
24+
strategy:
25+
matrix:
26+
os: [windows-latest]
27+
python-version: ["3.11", "3.12"]
28+
runs-on: ${{ matrix.os }}
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
with:
33+
submodules: recursive
34+
35+
- name: Initialize vcpkg
36+
run: |
37+
git clone https://github.com/Microsoft/vcpkg.git vendor/vcpkg
38+
39+
- name: Setup Python ${{ matrix.python-version }}
40+
uses: actions/setup-python@v5
41+
with:
42+
python-version: ${{ matrix.python-version }}
43+
44+
- name: Create virtual environment
45+
run: |
46+
python -m venv .venv
47+
call .venv\Scripts\activate.bat
48+
python -m pip install wheel setuptools # setuptools needed for Python >=3.12
49+
python -m pip install -r requirements.txt
50+
shell: cmd
51+
52+
- name: Bootstrap vcpkg
53+
run: ${{ env.VCPKG_ROOT }}/bootstrap-vcpkg.bat -disableMetrics
54+
55+
- name: Install vcpkg dependencies
56+
run: |
57+
${{ env.VCPKG_ROOT }}/vcpkg install --triplet=x64-windows-static
58+
59+
- name: Build extension
60+
run: |
61+
call .venv\Scripts\activate.bat
62+
python automations/my_automator.py setup dev-env
63+
python -m build
64+
pip install dist/*.whl
65+
shell: cmd
66+
67+
- name: Run pytest
68+
run: |
69+
call .venv\Scripts\activate.bat
70+
pip install pytest
71+
cd tests/
72+
pytest
73+
shell: cmd
74+
75+
- name: Upload artifact
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: PyMOL-wheel-${{ matrix.os }}-${{ matrix.python-version }}
79+
path: dist/*.whl

.gitignore

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
*.pyc
22
*.d
33
generated
4-
build
5-
.vscode
4+
/build/
5+
/.vscode/
6+
# Custom excludes
7+
/.idea/
8+
/.venv/
9+
/cmake-build-debug/
10+
/cmake-build-release/
11+
/vcpkg_installed/
12+
/vendor/
13+
/dist/

0 commit comments

Comments
 (0)