diff options
author | Rémi Flamary <remi.flamary@gmail.com> | 2021-04-22 10:54:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-22 10:54:26 +0200 |
commit | d06eee87155cdc6702c0dc8fe933dc02d9efdada (patch) | |
tree | 99c35c70fcd193cd463d01c0c33aabd189035f16 | |
parent | 0d995011b19b243bc980588cd98786b7c41a0509 (diff) |
[WIP] Build doc in master and stable separately and have both versions on the website (#243)
* add bild doc action workflow
* new build
* build full doc
* remove github action and update circleci builder
* add versions in doc and change dev number
-rw-r--r-- | .circleci/config.yml | 52 | ||||
-rw-r--r-- | docs/source/_templates/versions.html | 43 | ||||
-rw-r--r-- | docs/source/conf.py | 4 | ||||
-rw-r--r-- | ot/__init__.py | 2 |
4 files changed, 96 insertions, 5 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml index 9701ad1..29c9a07 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,7 +83,7 @@ jobs: paths: - html - deploy: + deploy_master: docker: - image: circleci/python:3.6-jessie steps: @@ -113,6 +113,7 @@ jobs: git reset --hard origin/master git clean -xdf echo "Deploying dev docs for ${CIRCLE_BRANCH}."; + cd master cp -a /tmp/build/html/* .; touch .nojekyll; git add -A; @@ -122,16 +123,63 @@ jobs: echo "No deployment (build: ${CIRCLE_BRANCH})."; fi + deploy_tag: + docker: + - image: circleci/python:3.6-jessie + steps: + - attach_workspace: + at: /tmp/build + - run: + name: Fetch docs + command: | + set -e + mkdir -p ~/.ssh + echo -e "Host *\nStrictHostKeyChecking no" > ~/.ssh/config + chmod og= ~/.ssh/config + if [ ! -d ~/PythonOT.github.io ]; then + git clone git@github.com:/PythonOT/PythonOT.github.io.git ~/PythonOT.github.io --depth=1 + fi + - run: + name: Deploy docs + command: | + set -e; + if [ "${CIRCLE_BRANCH}" == "master" ]; then + git config --global user.email "circle@PythonOT.com"; + git config --global user.name "Circle CI"; + cd ~/PythonOT.github.io; + git checkout master + git remote -v + git fetch origin + git reset --hard origin/master + git clean -xdf + echo "Deploying dev docs for ${CIRCLE_BRANCH}."; + cp -a /tmp/build/html/* .; + touch .nojekyll; + git add -A; + git commit -m "CircleCI update of dev docs (${CIRCLE_BUILD_NUM})."; + git push origin master; + else + echo "No deployment (build: ${CIRCLE_BRANCH})."; + fi + + workflows: version: 2 default: + jobs: - build_docs - - deploy: + - deploy_master: requires: - build_docs filters: branches: only: - master + - deploy_tag: + filters: + branches: + ignore: /.*/ + tags: + only: /[0-9]+(\.[0-9]+)*$/
\ No newline at end of file diff --git a/docs/source/_templates/versions.html b/docs/source/_templates/versions.html new file mode 100644 index 0000000..10d60d7 --- /dev/null +++ b/docs/source/_templates/versions.html @@ -0,0 +1,43 @@ +<div class="rst-versions shift-up" data-toggle="rst-versions" role="note" aria-label="versions"> + <span class="rst-current-version" data-toggle="rst-current-version"> + <span class="fa fa-book"> Python Optimal Transport</span> + versions + <span class="fa fa-caret-down"></span> + </span> + <div class="rst-other-versions"><!-- Inserted RTD Footer --> + +<div class="injected"> + + + + <dl> + <dt>Versions</dt> + + <dd><a href="https://pythonot.github.io/master">latest</a></dd> + + <dd><a href="https://pythonot.github.io/">stable</a></dd> + + </dl> + + + + + <dl> + <dt>On GitHub</dt> + <dd> + <a href="https://github.com/PythonOT/POT">Code on Github</a> + </dd> + + </dl> + + + + + + <hr> + + + +</div> +</div> + </div>
\ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 384bf40..3a11798 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -92,7 +92,7 @@ master_doc = 'index' # General information about the project. project = u'POT Python Optimal Transport' -copyright = u'2016-2020, Rémi Flamary, Nicolas Courty' +copyright = u'2016-2021, Rémi Flamary, Nicolas Courty' author = u'Rémi Flamary, Nicolas Courty' # The version info for the project you're documenting, acts as replacement for @@ -162,7 +162,7 @@ html_theme = 'sphinx_rtd_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -#html_theme_options = {} +html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] diff --git a/ot/__init__.py b/ot/__init__.py index 0116d33..5a8a415 100644 --- a/ot/__init__.py +++ b/ot/__init__.py @@ -45,7 +45,7 @@ from .sliced import sliced_wasserstein_distance # utils functions from .utils import dist, unif, tic, toc, toq -__version__ = "0.7.0" +__version__ = "0.8.0dev" __all__ = ['emd', 'emd2', 'emd_1d', 'sinkhorn', 'sinkhorn2', 'utils', 'datasets', 'bregman', 'lp', 'tic', 'toc', 'toq', 'gromov', |