Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/build-wheels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Build and upload to PyPI

on:
workflow_dispatch:
pull_request:
push:
branches:
- main
release:
types:
- published

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-15-intel, macos-latest]

steps:
- uses: actions/checkout@v5
with:
submodules: recursive # Critical: fetch packmol submodule

- name: Build wheels
uses: pypa/cibuildwheel@v3.3.0
env:
# Set macOS deployment target dynamically based on runner
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=15.0

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: true

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Build SDist
run: uv build --sdist

- name: Upload SDist
uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
environment: pypi
permissions:
id-token: write
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Download all artifacts
uses: actions/download-artifact@v5
with:
pattern: cibw-*
path: dist
merge-multiple: true

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
9 changes: 3 additions & 6 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}

steps:
- uses: actions/checkout@v2

- uses: julia-actions/setup-julia@v2
- uses: actions/checkout@v5
with:
submodules: recursive

- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
Expand All @@ -38,9 +38,6 @@ jobs:
- name: Install the project
run: uv sync --all-extras --dev --all-groups

- name: Install packmol.jl
run: julia -e 'import Pkg; Pkg.add("Packmol")'

- name: Install pandoc
run: |
sudo apt update
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/publish.yaml

This file was deleted.

23 changes: 5 additions & 18 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,21 @@ jobs:
- "3.12"
- "3.11"
- "3.10"
os:
- ubuntu-latest
packmol-version:
- "20.15.1"
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-15-intel, macos-latest]
# windows-11-arm -> rdkit support missing

steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v2
- uses: actions/checkout@v5
with:
submodules: recursive
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install the project
run: uv sync --all-extras --dev
- name: Install packmol
run: |
wget https://github.com/m3g/packmol/archive/refs/tags/v${{ matrix.packmol-version}}.tar.gz
tar -xvf v${{ matrix.packmol-version}}.tar.gz
cd packmol-${{ matrix.packmol-version}}
make
- name: Install packmol.jl
run: |
julia -e 'import Pkg; Pkg.add("Packmol")'
- name: Pytest
run: |
# add packmol to path
export PATH=$PATH:$(pwd)/packmol-${{ matrix.packmol-version}}

uv run python --version
uv run pytest --cov --junitxml=junit.xml -o junit_family=legacy
- name: Upload coverage to Codecov
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "external/packmol"]
path = external/packmol
url = https://github.com/m3g/packmol.git
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ print(atoms)
Given the molecular units, you can build periodic boxes with a given density
using the `molify.pack` function.

If you have [packmol](https://github.com/m3g/packmol) (at least `v20.15.0`) you
can use the molify interface as follows:
The `molify` package ships with an installation of
[packmol](https://github.com/m3g/packmol). If you like packmol, give it a star
on GitHub!

```py
from molify import pack, smiles2conformers
Expand Down
Loading