Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved github actions #14

Merged
merged 5 commits into from
Jun 28, 2024
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
99 changes: 45 additions & 54 deletions .github/workflows/sphinx_autodoc.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,48 @@
name: Sphinx build docs on push
name: Build and Deploy Documentation
on:
- push
push:
branches:
- main # or your default branch name

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out main
uses: actions/checkout@main
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.10.13
- name: Install pandoc
run: sudo apt-get install -y pandoc
- name: Load cached Poetry installation
uses: actions/cache@v2
with:
path: ~/.local
key: poetry-0
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Poetry disable modern-installation
run: poetry config installer.modern-installation false
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install library
run: poetry install --no-interaction
- name: Build documentation
run: poetry run make html --directory docs/
- name: Commit files
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
touch docs/_build/html/.nojekyll
git add -f docs/_build/
git commit -m "Update autodoc" -a
# using https://github.com/marketplace/actions/push-git-subdirectory-as-branch
- name: Deploy
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: gh-pages
FOLDER: docs/_build/html
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.10.13
- name: Install pandoc
run: sudo apt-get install -y pandoc
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: |
poetry config virtualenvs.create false
poetry install --no-interaction
- name: Build documentation
run: |
cd docs
poetry run make html
- name: Debug information
run: |
echo "Current directory:"
pwd
echo "Directory contents:"
ls -R
echo "Docs directory contents:"
ls -R docs

- name: List contents of build directory
run: ls -R docs/_build/html

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
force_orphan: true
83 changes: 36 additions & 47 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,46 @@
name: Test

on:
push:
branches: [main]
pull_request:
branches: [main]
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10']
os: [ubuntu-latest, macos-latest]

test:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -e {0}
steps:
- uses: actions/checkout@v2

strategy:
fail-fast: false
matrix:
python: [3.8, 3.9, 3.10]
os: [ubuntu-latest, macos-latest]
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev,test]
pip install pytest pytest-cov codecov

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: '**/pyproject.toml'
- name: Run tests
env:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
run: |
pytest -v --cov=./ --cov-report=xml

- name: Install test dependencies
run: |
python -m pip install --upgrade pip wheel
pip install codecov
- name: Install dependencies
run: |
pip install ".[dev,test]"
- name: Install pip dependencies
run: |
python -m pip install --upgrade pip
- name: Test
env:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
run: |
pytest -v --cov --color=yes
- name: Upload coverage
env:
CODECOV_NAME: ${{ matrix.python }}-${{ matrix.os }}
run: |
codecov --no-color --required --flags unittests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: true
3 changes: 3 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ python:
- method: pip
path: .
- requirements: docs/src/requirements.txt
formats:
- pdf
- epub
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ All the dependencies are listed in the pyproject.toml file. To install the packa

CURRENT FEATURES:

version 0.9.0
version 0.9.1
--------------

- Network creation and manipulation: The package allows for the creation of a network of nodes and edges, with various methods for enrichment analysis. This includes adding and removing nodes and edges, loading a network from a SIF (Simple Interaction Format) file, and adding paths to the edge list of the network.
Expand Down
29 changes: 24 additions & 5 deletions docs/src/api.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
API
===
API Reference
=============

Import Neko as::
This page contains the API reference for the Neko package.

Network Class
-------------

The main class in Neko is the ``Network`` class. You can import it as follows:

.. code-block:: python

from neko.core.network import Network

Network
-------
Below is a summary of the methods available in the ``Network`` class:

.. autoclass:: neko.core.network.Network
:members:
:undoc-members:
:show-inheritance:

Method Details
--------------

.. autosummary::
:toctree: _autosummary
Expand All @@ -26,3 +40,8 @@ Network
neko.core.network.Network.convert_edgelist_into_genesymbol
neko.core.network.Network.filter_unsigned_paths
neko.core.network.Network.is_connected

Other Modules
-------------

.. Add other modules and classes here as your project grows
2 changes: 1 addition & 1 deletion docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ['../src/_static']

html_show_sphinx = False
html_logo = 'neko_logo.png'
Expand Down
25 changes: 19 additions & 6 deletions docs/src/contents.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
========
Contents
========

.. toctree::
:maxdepth: 3

index
api
:maxdepth: 2
:caption: User Guide

Notebooks
=========
installation
quickstart
tutorials

.. toctree::
:maxdepth: 2
:caption: API Reference

api

.. toctree::
:maxdepth: 1
:caption: Notebooks

notebooks/1_network_building
Expand All @@ -20,3 +26,10 @@ Notebooks
notebooks/4_Connect_upstream
notebooks/5_ontology
notebooks/6_tissue_mapping

.. toctree::
:maxdepth: 1
:caption: Development

contributing
changelog
2 changes: 1 addition & 1 deletion docs/src/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ All the dependencies are listed in the pyproject.toml file. To install the packa

CURRENT FEATURES:

version 0.9.0
version 0.9.1
--------------

- Network creation and manipulation: The package allows for the creation of a network of nodes and edges, with various methods for enrichment analysis. This includes adding and removing nodes and edges, loading a network from a SIF (Simple Interaction Format) file, and adding paths to the edge list of the network.
Expand Down
3 changes: 2 additions & 1 deletion docs/src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
numpydoc
sphinx
nbsphinx
ipython
scikit-learn
skranger
sphinx_rtd_theme
pandoc
ipykernel
Loading