Skip to content

Commit

Permalink
Fix dependencies to create documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
blankjul committed Jun 29, 2022
1 parent 09593a7 commit 5381f2f
Show file tree
Hide file tree
Showing 33 changed files with 545 additions and 640 deletions.
102 changes: 102 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Deploy
on:
push:
branches:
- deploy


jobs:

build:
runs-on: "${{ matrix.os }}"
steps:
-
uses: actions/checkout@v2
-
name: "Set up Python"
uses: actions/setup-python@v2
with:
python-version: "${{ matrix.python-version }}"
-
name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install setuptools wheel numpy cython
-
uses: knicknic/os-specific-run@v1
with:
linux: "python setup.py sdist"
macos: "python setup.py bdist_wheel"
windows: "python setup.py bdist_wheel"
-
uses: actions/upload-artifact@v2
with:
name: dist
path: dist
strategy:
matrix:
exclude:
-
os: ubuntu-latest
python-version: "3.7"
-
os: ubuntu-latest
python-version: "3.8"
-
os: ubuntu-latest
python-version: "3.9"
os:
- ubuntu-latest
- windows-latest
- macos-latest
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
build-manylinux:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v2
-
uses: RalfG/[email protected]_x86_64
with:
build-requirements: "cython numpy"
pip-wheel-args: "-w ./dist --no-deps"
python-versions: "cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310"
-
name: "Remove non-compatible packages"
run: "sudo rm dist/*linux_x86_64.whl\n"
-
uses: actions/upload-artifact@v2
with:
name: dist
path: dist
deploy:
needs:
- build
- build-manylinux
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v2
-
uses: actions/download-artifact@v2
with:
name: dist
path: dist
-
name: "Set up Python"
uses: actions/setup-python@v2
with:
python-version: "3.10"
-
env:
TWINE_PASSWORD: "${{ secrets.PYPI_PASSWORD }}"
TWINE_USERNAME: "${{ secrets.PYPI_USERNAME }}"
name: Publish
run: |
python -m pip install --upgrade pip
pip install twine
twine upload --skip-existing --repository testpypi dist/*
4 changes: 2 additions & 2 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
- name: Install pymoo
run: |
pip install .
rm -rf pymoo
- name: Run Tests
run: |
cd tests
pytest -v -x --no-header -m "not long"
pytest -v --maxfail 1 --no-header -m "not long"
cd ..
38 changes: 38 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release
on:
push:
branches:
- master
- release
- develop
- main

jobs:

testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Python 3
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install Dependencies
run: |
pip install numpy
pip install -r docs/requirements.txt
- name: Create Documentation
run: |
cd docs
make html
- name: Upload Documentation
uses: trendyminds/github-actions-rsync@master
with:
RSYNC_OPTIONS: -avzr --delete --exclude '*.ipynb'
RSYNC_TARGET: /home/blankjul/pymoo.org/${BRANCH_NAME}
RSYNC_SOURCE: build/html/*
env:
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
SSH_USERNAME: ${{secrets.SSH_USERNAME}}
SSH_HOSTNAME: ${{secrets.SSH_HOSTNAME}}

114 changes: 18 additions & 96 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
branches:
- master
- release
- main


jobs:
Expand All @@ -23,102 +24,23 @@ jobs:
- name: Install pymoo
run: |
pip install .
rm -rf pymoo
- name: Run Tests
run: pytest -v --no-header --overwrite

build:
needs: testing
runs-on: "${{ matrix.os }}"
steps:
-
uses: actions/checkout@v2
-
name: "Set up Python"
uses: actions/setup-python@v2
with:
python-version: "${{ matrix.python-version }}"
-
name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install setuptools wheel numpy
-
uses: knicknic/os-specific-run@v1
with:
linux: "python setup.py sdist"
macos: "python setup.py bdist_wheel"
windows: "python setup.py bdist_wheel"
-
uses: actions/upload-artifact@v2
with:
name: dist
path: dist
strategy:
matrix:
exclude:
-
os: ubuntu-latest
python-version: "3.7"
-
os: ubuntu-latest
python-version: "3.8"
-
os: ubuntu-latest
python-version: "3.9"
os:
- ubuntu-latest
- windows-latest
- macos-latest
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
build-manylinux:
needs: testing
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v2
-
uses: RalfG/[email protected]_x86_64
with:
build-requirements: "cython numpy"
pip-wheel-args: "-w ./dist --no-deps"
python-versions: "cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310"
-
name: "Remove non-compatible packages"
run: "sudo rm dist/*linux_x86_64.whl\n"
-
uses: actions/upload-artifact@v2
with:
name: dist
path: dist
deploy:
needs:
- build
- build-manylinux
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v2
-
uses: actions/download-artifact@v2
with:
name: dist
path: dist
-
name: "Set up Python"
uses: actions/setup-python@v2
with:
python-version: "3.10"
-
env:
TWINE_PASSWORD: "${{ secrets.PYPI_PASSWORD }}"
TWINE_USERNAME: "${{ secrets.PYPI_USERNAME }}"
name: Publish
cd tests
pytest -vv --maxfail 1 --overwrite test_docs.py
cd ..
- name: Create Documentation
run: |
python -m pip install --upgrade pip
pip install twine
twine upload --skip-existing --repository testpypi dist/*
cd docs
make html
- name: Upload Documentation
uses: trendyminds/github-actions-rsync@master
with:
RSYNC_OPTIONS: -avzr --delete --exclude '*.ipynb'
RSYNC_TARGET: /home/blankjul/pymoo.org/${BRANCH_NAME}
RSYNC_SOURCE: build/html/*
env:
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
SSH_USERNAME: ${{secrets.SSH_USERNAME}}
SSH_HOSTNAME: ${{secrets.SSH_HOSTNAME}}

6 changes: 3 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
recursive-include pymoo *.py *.cpp
recursive-exclude pymoo *.so *.pyx *.pxd *.pf
recursive-exclude pymoo/cache *
prune .
recursive-include pymoo *.py *.pyx
recursive-include pymoo/cython/vendor *.c *.h
include LICENSE Makefile
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@ clean-ext:
rm -f pymoo/cython/*.html

compile:
python setup.py build_ext --inplace --no-cython

compile-with-cython:
python setup.py build_ext --inplace

compile-without-cython:
python setup.py build_ext --inplace --no-cython

dist:
python setup.py sdist

install:
python setup.py install

test:
gitlab-runner exec shell default
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


.. |python| image:: https://img.shields.io/badge/python-3.9-blue.svg
:alt: python 3.9
.. |python| image:: https://img.shields.io/badge/python-3.10-blue.svg
:alt: python 3.10

.. |license| image:: https://img.shields.io/badge/license-apache-orange.svg
:alt: license apache
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2 changes: 1 addition & 1 deletion docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ goto end
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
popd
13 changes: 6 additions & 7 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
numpy
sphinx<4
matplotlib
jinja2==3
sphinx==3.5.4
pydata-sphinx-theme==0.4.0
sphinxcontrib-bibtex<2.0.0
numpydoc
nbsphinx
sphinxcontrib-bibtex<2.0.0
pydata-sphinx-theme<0.5
ipython
pygments
bs4
pandoc
sphinx_book_theme
pytest
ipykernel
pyrecorder
ipykernel
4 changes: 1 addition & 3 deletions docs/source/_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
import os
from pathlib import Path

from docutils.parsers.rst.languages.en import directives

try:
import importlib.resources as resources
except ImportError:
# python < 3.7
import importlib_resources as resources

from bs4 import BeautifulSoup as bs

from docutils.parsers.rst import directives
from docutils import nodes
from sphinx.application import Sphinx
from sphinx.locale import get_translation
Expand Down
2 changes: 1 addition & 1 deletion docs/source/_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<div class="row m-0 pt-1 px-3">

<div id="main-navbar" class="col-12 col-md-3 bd-sidebar sticky show" role="menu">
{% include "sidebar-search-bs.html" %}
{% include "search-field.html" %}
{% include "sbt-sidebar-nav.html" %}
</div>

Expand Down
2 changes: 1 addition & 1 deletion docs/source/_theme/theme.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[theme]
inherit = pydata_sphinx_theme
pygments_style = tango
sidebars = sidebar-search-bs.html, sbt-sidebar-nav.html, sbt-sidebar-footer.html
sidebars = search-field.html, sbt-sidebar-nav.html, sbt-sidebar-footer.html
stylesheet = sphinx-book-theme.da26317cf37e5c4af2fa3e6253912353.css

[options]
Expand Down
Loading

0 comments on commit 5381f2f

Please sign in to comment.