Skip to content

Commit eb41127

Browse files
authored
Merge pull request #132 from davidmeunier79/modif_github_actions
Modif GitHub actions
2 parents ca54d10 + a5b7937 commit eb41127

File tree

5 files changed

+81
-7
lines changed

5 files changed

+81
-7
lines changed

.github/workflows/build_doc.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: "Test and deploy"
2+
3+
on:
4+
push:
5+
branches:
6+
[ master ]
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@master
15+
- name: Set up Python 3.10.5
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: 3.10.5
19+
20+
- name: Install dependencies
21+
run: |
22+
pip install -e .[doc]
23+
sudo apt-get install build-essential graphviz libgraphviz-dev
24+
pip install --upgrade pygraphviz graphviz
25+
26+
- name: Test with pytest
27+
run:
28+
py.test --cov macapype --ignore=examples/ --ignore=run_examples/
29+
30+
- name: Build the Doc 🔧
31+
run: |
32+
cd docs
33+
make clean
34+
make html
35+
touch _build/html/.nojekyll
36+
37+
- name: Deploy Github Pages 🚀
38+
uses: JamesIves/[email protected]
39+
with:
40+
branch: gh-pages
41+
folder: docs/_build/html/
42+
clean: true
43+
ssh-key: ${{ secrets.DEPLOY_KEY }}

.github/workflows/continuous_integration.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Python package
2-
on: [push, pull_request]
2+
on: [pull_request]
33

44
jobs:
55
build:
@@ -22,7 +22,7 @@ jobs:
2222
python -m venv slam-env
2323
source slam-env/bin/activate
2424
- name: Linting
25-
run: |
25+
run: |
2626
pip install flake8
2727
flake8 --ignore=E501,W503,W504 slam/
2828
flake8 --ignore=E501,W503,W504 tests/
@@ -33,6 +33,6 @@ jobs:
3333
run: |
3434
pip install pytest pytest-cov coveralls
3535
pytest -W default --cov=slam/
36-
37-
36+
37+
3838

doc/conf.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,14 @@
7676
# |version| and |release|, also used in various other places throughout the
7777
# built documents.
7878
#
79+
80+
import slam
7981
# The short X.Y version.
80-
version = "0.0.1"
82+
version = slam.__version__
83+
8184
# The full version, including alpha/beta/rc tags.
82-
release = "0.0.1"
85+
release = slam.__version__
86+
8387

8488
# The language for content autogenerated by Sphinx. Refer to documentation
8589
# for a list of supported languages.

setup.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,40 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33

4+
import re
45
from setuptools import setup, find_packages
56

67
BASE_REQUIREMENTS = ["numpy==1.19.5", "scipy", "trimesh", "nibabel>=2.1", "networkx"]
78
TEST_REQUIREMENTS = ["flake8", "autopep8", "pytest", "pytest-cov", "coveralls"]
9+
10+
DOC_REQUIREMENTS = ['sphinx',
11+
'sphinx-gallery',
12+
'sphinx_bootstrap_theme',
13+
'numpydoc',
14+
'six',
15+
'python-dateutil',
16+
'sphinxcontrib-fulltoc',
17+
'matplotlib']
18+
819
DIST = ["tvb-gdist"]
920

21+
# grab version
22+
verstr = "unknown"
23+
try:
24+
verstrline = open('slam/_version.py', "rt").read()
25+
except EnvironmentError:
26+
pass # Okay, there is no version file.
27+
else:
28+
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
29+
mo = re.search(VSRE, verstrline, re.M)
30+
if mo:
31+
verstr = mo.group(1)
32+
else:
33+
raise RuntimeError("unable to find version in yourpackage/_version.py")
34+
1035
setup(
1136
name="brain-slam",
12-
version="0.0.5",
37+
version=verstr,
1338
packages=find_packages(),
1439
author="Guillaume Auzias",
1540
description="Surface anaLysis And Modeling",
@@ -22,6 +47,7 @@
2247
extras_require={
2348
"full": DIST,
2449
"dev": DIST + TEST_REQUIREMENTS,
50+
"doc": DIST + TEST_REQUIREMENTS + DOC_REQUIREMENTS,
2551
},
2652
classifiers=[
2753
"Programming Language :: Python :: 3",

slam/_version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = '0.0.5'

0 commit comments

Comments
 (0)