Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# .github/dependabot.yml
version: 2
updates:
- package-ecosystem: "pip"
directory: "/" # location of requirements.txt or pyproject.toml
target-branch: "staging" # open PRs against staging instead of main
schedule:
interval: "weekly" # check for updates once a week
open-pull-requests-limit: 5 # max concurrent Dependabot PRs
rebase-strategy: "auto" # auto-rebase PRs when they fall out of date
109 changes: 109 additions & 0 deletions .github/workflows/conda-forge-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Publish to conda-forge

on:
release:
types: [published]
push:
branches: [refactor]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
outputs:
pkg_paths: ${{ steps.build.outputs.paths }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
auto-update-conda: true
auto-activate-base: true

- name: Create & activate build env
shell: bash -l {0}
run: |
conda create -n build python=3.11 'conda-build>=3.21' -c conda-forge -y
conda activate build

- id: build
name: Build conda package
shell: bash -l {0}
env:
GITHUB_RUN_NUMBER: ${{ github.run_number }}
run: |
conda activate build
rm -rf conda-bld && mkdir conda-bld

conda-build recipe --output-folder ./conda-bld

echo "DEBUG: Built files:"
find conda-bld -type f \( -name "*.conda" -o -name "*.tar.bz2" \) -print

files=$(find conda-bld -type f \( -name "*.conda" -o -name "*.tar.bz2" \) -print | tr '\n' ' ')
echo "paths=$files" >> $GITHUB_OUTPUT

- name: Upload built packages as artifact
uses: actions/upload-artifact@v4
with:
name: conda-packages
path: conda-bld/

publish_release:
needs: build
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- name: Download built packages
uses: actions/download-artifact@v4
with:
name: conda-packages
path: conda-bld

- name: Install Anaconda Client
run: python3 -m pip install --upgrade anaconda-client

- name: Upload to conda-forge / main
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
for pkg in ${{ needs.build.outputs.pkg_paths }}; do
anaconda -t "$ANACONDA_TOKEN" upload \
--user tieulongphan \
--label main \
--no-progress \
"$pkg"
done

publish_beta:
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/refactor'
runs-on: ubuntu-latest
steps:
- name: Download built packages
uses: actions/download-artifact@v4
with:
name: conda-packages
path: conda-bld

- name: Install Anaconda Client
run: python3 -m pip install --upgrade anaconda-client

- name: Upload to conda-forge / beta
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
for pkg in ${{ needs.build.outputs.pkg_paths }}; do
anaconda -t "$ANACONDA_TOKEN" upload \
--user tieulongphan \
--label beta \
--no-progress \
"$pkg"
done
46 changes: 46 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# .github/workflows/docker-publish.yml
name: Publish SynKit Docker Package

on:
push:
# Fire on semver tags for real releases…
tags:
- 'v*.*.*'
# …and on any push to the refractor branch for testing
branches:
- 'staging'

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write

steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Set up QEMU (optional, for multi‑arch)
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
tieulongphan/synkit:${{ github.ref_name }}
tieulongphan/synkit:latest
2 changes: 1 addition & 1 deletion .github/workflows/test-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Test & Lint

on:
push:
branches: [ "main", "dev", "maintain", "refractor" ]
branches: [ "main", "dev", "staging", "refractor" ]
pull_request:
branches: [ "main" ]

Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/verify-pypi-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# .github/workflows/verify-synkit-pypi-install.yml
name: Verify SynKit PyPI install

on:
workflow_dispatch:
inputs:
branches:
type: string
required: true
default: refractor

# Scheduled test every Monday at 03:00 UTC
schedule:
- cron: '0 3 * * 1'

jobs:
verify:
runs-on: ubuntu-latest

steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Create & activate virtualenv, upgrade pip, install SynKit
run: |
python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
pip install synkit[all]

- name: Show installed SynKit version
run: |
source venv/bin/activate
python -c "import importlib.metadata as m; print('SynKit version:', m.version('synkit'))"

- name: Write smoke-test script
run: |
cat << 'EOF' > test_synkit.py
from synkit.IO import rsmi_to_rsmarts

template = (
'[C:2]=[O:3].[C:4]([H:7])[H:8]'
'>>'
'[C:2]=[C:4].[O:3]([H:7])[H:8]'
)

smart = rsmi_to_rsmarts(template)
print("Reaction SMARTS:", smart)
EOF

- name: Run smoke-test
run: |
source venv/bin/activate
python test_synkit.py

- name: Success message
run: echo "✅ synkit[all] installed and smoke-test passed"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ Data/Benchmark/*
run.sh
docs/*
run_rdcanon.py
Data/Fragment/*
45 changes: 45 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
############################################
# STAGE 1: Build your package wheel
############################################
FROM python:3.11-slim AS builder

# 1. Install system build tools (for any C extensions)
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential \
&& rm -rf /var/lib/apt/lists/*

# 2. Upgrade pip/setuptools/wheel and install PEP 517 tooling + Hatchling backend
RUN pip install --upgrade pip setuptools wheel \
&& pip install --no-cache-dir build hatchling

# 3. Set working directory inside builder
WORKDIR /build

# 4. Copy project metadata (including README so Hatchling can find it)
COPY pyproject.toml README.md ./
# If you have a lockfile, uncomment:
# COPY poetry.lock ./

# 5. Copy your library source
COPY synkit/ ./synkit

# 6. Build the wheel
RUN python -m build --wheel --no-isolation

############################################
# STAGE 2: Create the “release” image
############################################
FROM python:3.11-slim

# 7. Set a clean workdir
WORKDIR /opt/synkit

# 8. Copy in the built wheel from the builder stage
COPY --from=builder /build/dist/*.whl ./

# 9. Install your package (and its dependencies), then remove the wheel
RUN pip install --no-cache-dir *.whl \
&& rm *.whl

# 10. Sanity check: print the installed synkit version
CMD ["python", "-c", "import importlib.metadata as m; print(m.version('synkit'))"]
20 changes: 0 additions & 20 deletions Makefile

This file was deleted.

34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ Our tools are tailored to assist researchers and chemists in navigating complex

For more details on each utility within the repository, please refer to the documentation provided in the respective folders.

## Step-by-Step Installation Guide
## Table of Contents
- [Installation](#installation)
- [Contribute to `SynKit`](#contribute)
- [Contributing](#contributing)
- [License](#license)
- [Acknowledgments](#acknowledgments)

## Installation

1. **Python Installation:**
Ensure that Python 3.11 or later is installed on your system. You can download it from [python.org](https://www.python.org/downloads/).
Expand Down Expand Up @@ -41,7 +48,20 @@ For more details on each utility within the repository, please refer to the docu
pip install synkit[all]
```

## For contributors
4. **Install via Docker**
Pull the image:

```bash
docker pull tieulongphan/synkit:latest
# or a specific version:
docker pull tieulongphan/synkit:0.1.0
```
Run a container (sanity check):
```
docker run --rm tieulongphan/synkit:latest
```

## Contribute

We're welcoming new contributors to build this project better. Please not hesitate to inquire me via [email][tieu@bioinf.uni-leipzig.de].

Expand All @@ -52,7 +72,7 @@ git checkout main
git pull
```

## Working on New Features
### Working on New Features

1. **Create a New Branch**:
For every new feature or bug fix, create a new branch from the `main` branch. Name your branch meaningfully, related to the feature or fix you are working on.
Expand All @@ -78,7 +98,7 @@ git pull

Fix any issues or errors highlighted by these checks.

## Integrating Changes
### Integrating Changes

1. **Rebase onto Staging**:
Once your feature is complete and tests pass, rebase your changes onto the `staging` branch to prepare for integration.
Expand All @@ -98,16 +118,16 @@ git pull
```

3. **Create a Pull Request**:
Open a pull request from your feature branch to the `stagging` branch. Ensure the pull request description clearly describes the changes and any additional context necessary for review.
Open a pull request from your feature branch to the `staging` branch. Ensure the pull request description clearly describes the changes and any additional context necessary for review.

## Contributing
- [Tieu-Long Phan](https://tieulongphan.github.io/)
- [Klaus Weinbauer](https://github.com/klausweinbauer)
- [Phuoc-Chung Nguyen Van](https://github.com/phuocchung123)

## Deployment timeline
## Publication

We plan to update new version quarterly.
[**SynKit**: An Advanced Cheminformatics Python Library for Efficient Manipulation and Analysis of Chemical Reaction Data]()


## License
Expand Down
Loading
Loading