From d1b4c0b0b24f95493142783772e22b052573c3b3 Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Sat, 17 Aug 2024 09:13:53 -0700 Subject: [PATCH 1/3] add docs --- .github/workflows/docs.yml | 40 ++++++++++++++++++++++++++++++++++++++ py/dnadesign/__init__.py | 8 ++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..4fffd8a2 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,40 @@ +name: website + +# build the documentation whenever there are new commits on main +on: + push: + branches: + - main + # Alternative: only build for tags. + # tags: + # - '*' + +jobs: + build-docs: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' # Specify the Python version you're using + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install cffi + pip install pdoc3 # Install pdoc3 + pip install -e ./py # Install your package in editable mode + + - name: Generate documentation + run: | + pdoc --html --output-dir docs ./py/dnadesign + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + if: github.ref == 'refs/heads/main' # Only deploy on the main branch + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/dnadesign diff --git a/py/dnadesign/__init__.py b/py/dnadesign/__init__.py index e69de29b..e5e1acfc 100644 --- a/py/dnadesign/__init__.py +++ b/py/dnadesign/__init__.py @@ -0,0 +1,8 @@ +r''' +# What is dnadesign + +dnadesign is a batteries-included software suite for engineering biology. + +We're building a practical, modern, and ambitious library for engineering biology. While the library itself is written in Go, specifically for its simplicity and maintainability, it is accessible using Python, the programming language that biologists would be most familiar with. + +''' From f111162a1e303c1dfa7933788391786df0aa677d Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Sat, 17 Aug 2024 09:14:24 -0700 Subject: [PATCH 2/3] docs --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 538de42d..2ea0a57a 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +- Adds automatic python documentation generation. [#88](https://github.com/Koeng101/dnadesign/pull/88) - Adds genbank parsing to python package. Release version 0.1.5 of dnadesign python. [#87](https://github.com/Koeng101/dnadesign/pull/87) - Adds fastq parsing to python package. Releases version 0.1.4 of dnadesign python. [#86](https://github.com/Koeng101/dnadesign/pull/86) - Integrated errgroup into source tree [#84](https://github.com/Koeng101/dnadesign/pull/84) From 9c5f20a6430bc029ccef4cac9646ccaed7cdbb08 Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Sat, 17 Aug 2024 09:18:17 -0700 Subject: [PATCH 3/3] add build steps --- .github/workflows/docs.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 4fffd8a2..fbcfa190 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -16,6 +16,21 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: '1.22' + + - name: Install Zig + uses: goto-bus-stop/setup-zig@v2 + with: + version: 0.11.0 + + - name: Build Go shared library + working-directory: ./py + run: + CC="zig cc -target x86_64-linux-gnu" CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o dnadesign/libdnadesign.so -buildmode=c-shared lib.go + - name: Set up Python uses: actions/setup-python@v2 with: