Skip to content

Commit

Permalink
Merge branch 'netneurolab:master' into fix-deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
liuzhenqi77 authored Feb 2, 2024
2 parents b5d52d1 + 4fc46fa commit e0f1141
Show file tree
Hide file tree
Showing 19 changed files with 1,149 additions and 918 deletions.
11 changes: 11 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
coverage:
status:
project:
default:
informational: true
patch:
default:
informational: true
comment: false
github_checks:
annotations: false
47 changes: 47 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: publish-docker-image

on:
workflow_dispatch:
push:
branches:
- 'main'
tags:
- '*'

jobs:
push_to_registry:
if: github.repository_owner == 'netneurolab'
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v1.14.1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Log in to the Container registry
uses: docker/login-action@v1.14.1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3.8.0
with:
images: |
${{ secrets.DOCKER_HUB_USERNAME }}/netneurotools
ghcr.io/netneurolab/netneurotools
- name: Build and push Docker image
uses: docker/build-push-action@v2.10.0
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
39 changes: 39 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: netneurotools-docs

on:
workflow_dispatch:
push:
branches:
- main

permissions:
contents: read
pages: write
id-token: write

jobs:
deploy_page:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install -r docs/requirements.txt
- name: Install netneurotools
run: |
pip install .
- name: Build the docs
run: |
cd docs && make clean html
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'docs/_build/html'
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v2
14 changes: 9 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: netneurotools tests
name: netneurotools-tests

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

jobs:
Expand All @@ -22,9 +22,9 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8
python -m pip install ruff
- name: Run style checks
run: flake8 netneurotools
run: ruff .

run_tests:
needs: check_style
Expand All @@ -50,9 +50,13 @@ jobs:
python -m pip install pytest pytest-cov
python -m pip install -r requirements.txt
- name: Install netneurotools
run: python -m pip install -e .
run: python -m pip install .
- name: Print netneurotools version
run: python -c "import netneurotools; print(netneurotools.__version__)"
- name: Test submodule import
run: |
cd ..
python -c "from netneurotools import metrics; from netneurotools.datasets import fetch_cammoun2012"
- name: Run tests
run: pytest --doctest-modules --cov=netneurotools --cov-report=xml --junitxml=junit/test-results.xml --verbose --pyargs netneurotools
- name: Upload coverage
Expand Down
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM python:3.9.7-slim

RUN apt-get update \
&& apt-get install -y \
wget \
unzip \
libgl1-mesa-glx \
libglu1-mesa \
libgomp1 \
libglib2.0-0

COPY . netneurotools

RUN cd netneurotools \
&& python3 -m pip install '.[numba]'

CMD python3
33 changes: 24 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
netneurotools: Tools for network neuroscience
=============================================

|
.. .. image:: https://zenodo.org/badge/375755159.svg
.. :target: https://zenodo.org/badge/latestdoi/375755159
.. :alt: Zenodo record
.. image:: https://img.shields.io/pypi/v/netneurotools
:target: https://pypi.python.org/pypi/netneurotools/
:alt: Latest PyPI version

.. image:: https://img.shields.io/badge/docker-netneurolab/netneurotools-brightgreen.svg?logo=docker&style=flat
:target: https://hub.docker.com/r/netneurolab/netneurotools/tags/
:alt: Latest Docker image

.. image:: https://github.com/netneurolab/netneurotools/actions/workflows/tests.yml/badge.svg
:target: https://github.com/netneurolab/netneurotools/actions/workflows/tests.yml
:alt: run-tests status

.. image:: https://github.com/netneurolab/netneurotools/actions/workflows/docs.yml/badge.svg
:target: https://netneurolab.github.io/netneurotools/
:alt: deploy-docs status

|
This toolbox is a collection of functions written in Python that get frequent
usage in the `Network Neuroscience Lab <netneurolab.github.io/>`_, housed in
the `Brain Imaging Centre <https://www.mcgill.ca/bic/home>`_ at
`McGill University <https://www.mcgill.ca/>`_.

.. image:: https://github.com/netneurolab/netneurotools/actions/workflows/tests.yml/badge.svg
:target: https://github.com/netneurolab/netneurotools/actions
.. image:: https://codecov.io/gh/netneurolab/netneurotools/branch/master/graph/badge.svg
:target: https://codecov.io/gh/netneurolab/netneurotools
.. image:: https://readthedocs.org/projects/netneurotools/badge/?version=latest
:target: https://netneurotools.readthedocs.io/en/latest
.. image:: https://img.shields.io/badge/License-BSD%203--Clause-blue.svg
:target: https://opensource.org/licenses/BSD-3-Clause

.. _installation:

Installation
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# Add project name, copyright holder, and author(s)
project = 'netneurotools'
copyright = '2018-2022, netneurotools developers'
copyright = '2018-2024, netneurotools developers'
author = 'Network Neuroscience Lab'

# Import project to get version info
Expand Down
Loading

0 comments on commit e0f1141

Please sign in to comment.