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
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
name: Build Documentation
name: Publish Documentation

on:
push:
branches:
- main
workflow_call:

jobs:
build:

publish-documentation:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.x'
- name: Upgrade pip, install package, install requirements, build docs
run: |
pip install --upgrade pip
pip install -r ./docs/requirements.txt
pip install .
if [ -f ./docs/requirements.txt ]; then pip install -r ./docs/requirements.txt; fi
pip install sphinx
sphinx-build docs ./docs/_build/html/
# Create an artifact of the html output.
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: DocumentationHTML
path: docs/_build/html/
Expand All @@ -35,9 +32,8 @@ jobs:
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git clone "https://token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" --branch gh-pages --single-branch gh-pages
cd gh-pages/
git rm -r .
cp -r ../docs/_build/html/* .
cp -r docs/_build/html/* gh-pages/
cd gh-pages
touch .nojekyll
git add .
git commit -m "Update documentation." -a || true
Expand All @@ -49,4 +45,4 @@ jobs:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
# ===============================
# ===============================
34 changes: 0 additions & 34 deletions .github/workflows/main.yml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/workflows/package_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Package and Documentation Release

on:
release:
types: [published]

jobs:
release-version:
runs-on: ubuntu-latest
steps:
- id: parse-version
name: Parse release version
run: |
echo "version=${RELEASE_VERSION/v/}" >> "$GITHUB_OUTPUT"
env:
RELEASE_VERSION: ${{ github.event.release.tag_name }}
outputs:
version: ${{ steps.parse-version.outputs.version }}
publish-test-pypi:
uses: ./.github/workflows/pypi.yml
with:
repository_url: https://test.pypi.org/legacy/
secrets:
API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
test-test-pypi:
needs: [release-version, publish-test-pypi]
uses: ./.github/workflows/tests.yml
with:
install_command: "python3 -m pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple kegg-pull==${{ needs.release-version.outputs.version }}"
publish-pypi:
needs: test-test-pypi
uses: ./.github/workflows/pypi.yml
with:
repository_url: https://upload.pypi.org/legacy/
secrets:
API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
test-pypi:
needs: [release-version, publish-pypi]
uses: ./.github/workflows/tests.yml
with:
install_command: "python3 -m pip install kegg-pull==${{ needs.release-version.outputs.version }}"
publish-documentation:
needs: test-pypi
uses: ./.github/workflows/documentation.yml
16 changes: 16 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Pull request

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
pull-request:
uses: ./.github/workflows/tests.yml
with:
install_command: "python3 -m pip install -e ."
32 changes: 32 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish package

on:
workflow_call:
inputs:
repository_url:
description: The URL of the PyPi distribution
required: true
type: string
secrets:
API_TOKEN:
required: true

jobs:
publish-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install build
- name: Build package
run: python3 -m build
- name: Publish package to a PyPi distribution
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.API_TOKEN }}
repository-url: ${{ inputs.repository_url }}
40 changes: 40 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Run Tests

on:
workflow_call:
inputs:
install_command:
description: The command for installing the package to test.
required: true
type: string

jobs:
run-tests:
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
os: [ ubuntu-latest, windows-latest, macOS-latest ]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install testing environment
run: |
python3 -m pip install --upgrade pip
python3 -m pip install pytest pytest-mock pytest-cov deepdiff
- name: Install package
uses: Wandalen/wretry.action@master
with:
command: ${{ inputs.install_command }}
attempt_limit: 10
attempt_delay: 10000
- name: Run tests on package
run: python3 -m pytest dev --cov --cov-branch --cov-report=term-missing -x
- name: Debug with tmate on failure
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ docs/_build
docs/notebook/.ipynb_checkpoints/
docs/notebook/tutorial.ipynb
dist/
src/kegg_pull/_version.py
40 changes: 40 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[build-system]
requires = ["setuptools", "wheel", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[project]
name = "kegg-pull"
description = "Pulls any and all entries from any and all KEGG databases, pulls KEGG entry IDs, and wraps all the KEGG REST API operations in both Python API and the command line."
readme = "README.rst"
requires-python = ">=3.10"
keywords = ["kegg", "rest", "sdk", "api", "cli"]
license = {file = "LICENSE"}
classifiers = [
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.10',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Scientific/Engineering :: Medical Science Apps',
'Topic :: Scientific/Engineering :: Chemistry',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Typing :: Typed'

]
dynamic = ["version", "dependencies"]

[project.urls]
"Homepage" = "https://github.com/MoseleyBioinformaticsLab/kegg_pull"
"Documentation" = "https://moseleybioinformaticslab.github.io/kegg_pull/"
"GitHub" = "https://github.com/MoseleyBioinformaticsLab/kegg_pull"
"Issues" = "https://github.com/MoseleyBioinformaticsLab/kegg_pull/issues"

[tool.setuptools.dynamic]
dependencies = {file = "requirements.txt"}

[tool.setuptools_scm]
write_to = "src/kegg_pull/_version.py"

[project.scripts]
kegg_pull = "kegg_pull.__main__:main"
38 changes: 0 additions & 38 deletions setup.py

This file was deleted.

Loading