Skip to content

Commit

Permalink
Include doc
Browse files Browse the repository at this point in the history
  • Loading branch information
kif committed Nov 29, 2023
1 parent 8c76977 commit 3d752bf
Show file tree
Hide file tree
Showing 17 changed files with 208 additions and 25 deletions.
56 changes: 39 additions & 17 deletions build-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Project: FreeSaS
# https://github.com/kif/freesas
#
# Copyright (C) 2015-2020 European Synchrotron Radiation Facility, Grenoble, France
# Copyright (C) 2015-2023 European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: Jérôme Kieffer ([email protected])
#
Expand Down Expand Up @@ -56,12 +56,15 @@ then
stretch)
debian_version=9
;;
buster)
buster)
debian_version=10
;;
bullseye)
debian_version=11
;;
bookworm)
debian_version=12
;;
esac
fi

Expand All @@ -78,21 +81,25 @@ build_directory=${project_directory}/build/${target_system}
if [ -d /usr/lib/ccache ];
then
export PATH=/usr/lib/ccache:$PATH
export CCACHE_DIR=${HOME}/.ccache
fi

usage="usage: $(basename "$0") [options]
Build the Debian ${debian_version} package of the ${project} library.
If the build succeed the directory dist/debian${debian_version} will
contains the packages.
optional arguments:
--help Show this help text
--install Install the packages generated at the end of
the process using 'sudo dpkg'
--stdeb-py3 Build using stdeb for python3
--stdeb-py2.py3 Build using stdeb for python2 and python3
--debian9 Simulate a debian 9 Stretch system
--debian10 Simulate a debian 10 Buster system
--debian11 Simulate a debian 11 Bullseye system
--debian12 Simulate a debian 12 Bookworm system
"

install=0
Expand Down Expand Up @@ -141,6 +148,13 @@ do
build_directory=${project_directory}/build/${target_system}
shift
;;
--debian12)
debian_version=12
target_system=debian${debian_version}
dist_directory=${project_directory}/dist/${target_system}
build_directory=${project_directory}/build/${target_system}
shift
;;
-*)
echo "Error: Unknown option: $1" >&2
echo "$usage"
Expand All @@ -164,20 +178,27 @@ clean_up()
build_deb() {
tarname=${project}_${debianversion}.orig.tar.gz
clean_up
python3 setup.py debian_src
python3 setup.py testdata
if [ $debian_version -le 11 ]
then
python3 setup.py debian_src
directory=${project}-${strictversion}
else
python3 -m build -s
ln -s ${source_project}-${strictversion}.tar.gz dist/${tarname}
directory=${source_project}-${strictversion}
fi
cp -f dist/${tarname} ${build_directory}
if [ -f dist/${project}-testimages.tar.gz ]
then
cp -f dist/${project}-testimages.tar.gz ${build_directory}
fi

cd ${build_directory}
tar -xzf ${tarname}
directory=${project}-${strictversion}


newname=${deb_name}_${debianversion}.orig.tar.gz

#echo tarname $tarname newname $newname
if [ $tarname != $newname ]
then
Expand All @@ -187,19 +208,19 @@ build_deb() {
fi
ln -s ${tarname} ${newname}
fi

if [ -f ${project}-testimages.tar.gz ]
then
if [ ! -h ${deb_name}_${debianversion}.orig-testimages.tar.gz ]
then
ln -s ${project}-testimages.tar.gz ${deb_name}_${debianversion}.orig-testimages.tar.gz
fi
fi

cd ${directory}
cp -r ${project_directory}/package/${target_system} debian
cp ${project_directory}/copyright debian

#handle test images
if [ -f ../${deb_name}_${debianversion}.orig-testimages.tar.gz ]
then
Expand All @@ -208,7 +229,7 @@ build_deb() {
mkdir testimages
fi
cd testimages
tar -xzf ../../${deb_name}_${debianversion}.orig-testimages.tar.gz
tar -xzf ../${deb_name}_${debianversion}.orig-testimages.tar.gz
cd ..
else
# Disable to skip tests during build
Expand All @@ -230,12 +251,12 @@ build_deb() {
;;
esac

dch --force-distribution -v ${debianversion}-1 "upstream development build of ${project} ${version}"
dch --force-distribution -v ${debianversion}-1 "upstream development build of ${project} ${version}"
dch --force-distribution -D ${debian_name}-backports -l~bpo${debian_version}+ "${project} snapshot ${version} built for ${target_system}"
#dch --bpo "${project} snapshot ${version} built for ${target_system}"
dpkg-buildpackage -r
rc=$?

if [ $rc -eq 0 ]; then
# move packages to dist directory
echo Build succeeded...
Expand Down Expand Up @@ -264,7 +285,8 @@ build_stdeb () {
tar -xzf ${tarname}
cd ${project}-${strictversion}

if [ $stdeb_all_python -eq 1 ]; then
if [ $stdeb_all_python -eq 1 ]
then
echo Using Python 2+3
python3 setup.py --command-packages=stdeb.command sdist_dsc --with-python2=True --with-python3=True --no-python3-scripts=True build --no-cython bdist_deb
rc=$?
Expand Down Expand Up @@ -293,7 +315,7 @@ fi


if [ $install -eq 1 ]; then
sudo -- su -c "dpkg -i ${dist_directory}/*.deb"
sudo su -c "dpkg -i ${dist_directory}/*.deb"
fi

exit "$rc"
23 changes: 23 additions & 0 deletions build-doc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
import os
import sys
import logging
import bootstrap
from sphinx.cmd.build import main
logger = logging.getLogger(__name__)
PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
PROJECT_NAME = bootstrap.get_project_name(PROJECT_DIR)
logger.info("Project name: %s", PROJECT_NAME)
LIBPATH = bootstrap.build_project(PROJECT_NAME, PROJECT_DIR)
if __name__ == '__main__':
sys.path.insert(0, LIBPATH)
os.environ["PYTHONPATH"]=os.pathsep.join(sys.path)
print(os.environ["PYTHONPATH"])
dest_dir = os.path.join(PROJECT_DIR, "build", "sphinx")
if not os.path.isdir(dest_dir):
os.makedirs(dest_dir)
argv = ["-b", "html",
os.path.join(PROJECT_DIR,"doc","source"),
dest_dir ]
print(f"run sphinx with those arguments {argv}")
sys.exit(main(argv))
1 change: 1 addition & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
'sphinx.ext.viewcode',
'sphinx.ext.doctest',
# 'sphinxext-archive',
'sphinxcontrib.programoutput',
'nbsphinx'

]
Expand Down
4 changes: 2 additions & 2 deletions e2etest/e2etest_bift.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__authors__ = ["Martha Brennich"]
__license__ = "MIT"
__date__ = "16/07/2021"
__date__ = "29/11/2023"

import unittest
import pathlib
Expand All @@ -14,7 +14,7 @@
import codecs
import parse
from numpy import loadtxt
from freesas.test.utilstests import get_datafile
from freesas.test.utilstest import get_datafile

logger = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions e2etest/e2etest_cormap.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__authors__ = ["Martha Brennich"]
__license__ = "MIT"
__date__ = "02/04/2022"
__date__ = "29/11/2023"

import unittest
import pathlib
Expand All @@ -11,7 +11,7 @@
from subprocess import run, PIPE, STDOUT
from os import linesep
from os.path import normpath
from freesas.test.utilstests import get_datafile
from freesas.test.utilstest import get_datafile

logger = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions e2etest/e2etest_freesas.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

__authors__ = ["Martha Brennich"]
__license__ = "MIT"
__date__ = "16/07/2021"
__date__ = "29/11/2023"

import unittest
import pathlib
Expand All @@ -34,7 +34,7 @@
from subprocess import run, Popen, PIPE, STDOUT
from os import linesep
import PyPDF2
from freesas.test.utilstests import get_datafile
from freesas.test.utilstest import get_datafile

logger = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions e2etest/e2etest_guinier_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__authors__ = ["Martha Brennich"]
__license__ = "MIT"
__date__ = "16/07/2021"
__date__ = "29/11/2023"

import unittest
import pathlib
Expand All @@ -11,7 +11,7 @@
from os import linesep
from os.path import normpath
from platform import system
from freesas.test.utilstests import get_datafile
from freesas.test.utilstest import get_datafile
logger = logging.getLogger(__name__)


Expand Down
5 changes: 5 additions & 0 deletions package/debian12/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
freesas (0.7.0-1) unstable; urgency=low

* Initial release (Closes: #??????)

-- Jerome Kieffer <[email protected]> Fri, 31 Aug 2017 11:00:20 +0100
1 change: 1 addition & 0 deletions package/debian12/clean
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.egg-info/*
1 change: 1 addition & 0 deletions package/debian12/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
66 changes: 66 additions & 0 deletions package/debian12/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Source: freesas
Maintainer: Debian Science Maintainers <[email protected]>
Uploaders: Jerome Kieffer <[email protected]>,
Picca Frédéric-Emmanuel <[email protected]>
Section: science
Priority: extra
Build-Depends: cython3,
debhelper (>=9.20150101+deb8u2),
python3-all-dev,
python3-setuptools,
python3-numpy,
python3-matplotlib,
python3-scipy,
python3-sphinx,
python3-sphinxcontrib.programoutput,
python3-nbsphinx,
python3-silx,
python3-pyfai,
openstack-pkg-tools,
help2man,
dh-python,
python3-sphinx-rtd-theme
Standards-Version: 3.9.8
Vcs-Browser: https://anonscm.debian.org/cgit/debian-science/packages/freesas.git
Vcs-Git: git://anonscm.debian.org/debian-science/packages/freesas.git
Homepage: https://github.com/kif/freesas
X-Python3-Version: >= 3.6

Package: freesas
Architecture: all
Depends: ${misc:Depends},
${python:Depends},
${shlibs:Depends},
python3-pkg-resources,
python3-freesas (>= ${source:Version})
Description: Free tools for small angle scattering analysis - Executables
.
This uses the Python 3 version of the package.


Package: python3-freesas
Architecture: any
Section: python
Depends: ${misc:Depends},
${python3:Depends},
${shlibs:Depends},
python3-numpy,
python3-matplotlib,
python3-scipy,
python3-six,
python3-pyfai
# Recommends:
# Suggests: python3-rfoo
Description: Free tools for small angle scattering analysis - Python3
.
This is the Python 3 version of the package.


Package: python-freesas-doc
Architecture: all
Section: doc
Depends: ${misc:Depends},
${sphinxdoc:Depends}
Description: Free tools for small angle scattering analysis - Documentation
.
This is the common documentation package.
2 changes: 2 additions & 0 deletions package/debian12/gbp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[DEFAULT]
debian-branch = master
9 changes: 9 additions & 0 deletions package/debian12/python-freesas-doc.doc-base
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Document: freesas-manual
Title: freesas documentation manual
Author: Jérôme Kieffer <[email protected]>
Abstract: Toolbox for X-Ray data analysis
Section: Science/Data Analysis

Format: HTML
Index: /usr/share/doc/python-freesas-doc/html/index.html
Files: /usr/share/doc/python-freesas-doc/html/*
Loading

0 comments on commit 3d752bf

Please sign in to comment.