Skip to content

Commit 0a72aa9

Browse files
Merge pull request #4 from esa/fix/pipeline2
Fixed pipeline and added Python 3.11 compatibility
2 parents 2defa59 + 4ad439d commit 0a72aa9

File tree

10 files changed

+156
-124
lines changed

10 files changed

+156
-124
lines changed

.github/workflows/deployment.yaml

+17-17
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ jobs:
44
build-and-deploy-documentation:
55
runs-on: ubuntu-latest
66
steps:
7-
- name: Set up Python
8-
uses: actions/setup-python@v2
9-
with:
10-
python-version: 3.8
11-
- uses: actions/checkout@v2
12-
- run: sudo apt update && sudo apt install gfortran doxygen --yes
13-
- run: pip install sphinx breathe sphinx-rtd-theme
14-
- run: python -m pip install .
15-
- run: doxygen Doxyfile
16-
working-directory: doc/doxygen
17-
- run: make html
18-
working-directory: doc/sphinx
19-
- run: bash tools/deploy-docs-to-gh-pages.sh
20-
env:
21-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22-
GITHUB_SHA: ${{github.sha}}
23-
7+
- name: Set up Python
8+
uses: actions/setup-python@v2
9+
with:
10+
python-version: 3.9
11+
- uses: actions/checkout@v2
12+
- run: sudo apt update && sudo apt install gfortran doxygen --yes
13+
- run: git submodule update --init --recursive # Ensure submodules are updated
14+
- run: pip install sphinx breathe sphinx-rtd-theme
15+
- run: python -m pip install .
16+
- run: doxygen Doxyfile
17+
working-directory: doc/doxygen
18+
- run: make html
19+
working-directory: doc/sphinx
20+
- run: bash tools/deploy-docs-to-gh-pages.sh
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
GITHUB_SHA: ${{github.sha}}

.github/workflows/workflow.yaml

+26-23
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
python-version: 3.9
4040
- uses: actions/checkout@v2
4141
- run: sudo apt update && sudo apt install gfortran --yes
42+
- run: git submodule update --init --recursive # Ensure submodules are updated
4243
- run: python -m pip install .
4344
- run: pip install pytest-cov coverage
4445
- run: pytest --cov pyoptgra --cov-report term-missing test.py
@@ -49,30 +50,32 @@ jobs:
4950
doctest:
5051
runs-on: ubuntu-latest
5152
steps:
52-
- name: Set up Python
53-
uses: actions/setup-python@v2
54-
with:
55-
python-version: 3.9
56-
- uses: actions/checkout@v2
57-
- run: sudo apt update && sudo apt install gfortran --yes
58-
- run: pip install sphinx breathe
59-
- run: python -m pip install .
60-
- run: make doctest
61-
working-directory: doc/sphinx
53+
- name: Set up Python
54+
uses: actions/setup-python@v2
55+
with:
56+
python-version: 3.9
57+
- uses: actions/checkout@v2
58+
- run: sudo apt update && sudo apt install gfortran --yes
59+
- run: git submodule update --init --recursive # Ensure submodules are updated
60+
- run: pip install sphinx breathe
61+
- run: python -m pip install .
62+
- run: make doctest
63+
working-directory: doc/sphinx
6264

6365
documentation:
6466
runs-on: ubuntu-latest
6567
steps:
66-
- name: Set up Python
67-
uses: actions/setup-python@v2
68-
with:
69-
python-version: 3.9
70-
- uses: actions/checkout@v2
71-
- run: sudo apt update && sudo apt install gfortran doxygen --yes
72-
- run: pip install sphinx breathe sphinx-rtd-theme
73-
- run: python -m pip install .
74-
- run: cd doc/doxygen
75-
- run: doxygen Doxyfile
76-
working-directory: doc/doxygen
77-
- run: make html
78-
working-directory: doc/sphinx
68+
- name: Set up Python
69+
uses: actions/setup-python@v2
70+
with:
71+
python-version: 3.9
72+
- uses: actions/checkout@v2
73+
- run: sudo apt update && sudo apt install gfortran doxygen --yes
74+
- run: git submodule update --init --recursive # Ensure submodules are updated
75+
- run: pip install sphinx breathe sphinx-rtd-theme
76+
- run: python -m pip install .
77+
- run: cd doc/doxygen
78+
- run: doxygen Doxyfile
79+
working-directory: doc/doxygen
80+
- run: make html
81+
working-directory: doc/sphinx

.gitlab-ci.yml

+86-25
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ stages:
33
- package
44
- test-package
55
- deploy
6-
6+
77
# check the code adheres to the coding standards
88
static:
99
stage: test
@@ -21,7 +21,7 @@ c++-test:
2121
stage: test
2222
image: python:3.9
2323
allow_failure: false
24-
before_script: # install this project's dependencies
24+
before_script: # install this project's dependencies
2525
- apt update && apt install gfortran g++ cmake --yes
2626
script:
2727
- mkdir build && cd build
@@ -33,25 +33,69 @@ c++-test:
3333
- ./optgra-test
3434

3535
# check the python code compiles and the tests run
36-
test:
36+
test-py3.9:
3737
stage: test
3838
image: python:3.9
3939
allow_failure: false
40-
before_script: # install this project's dependencies
40+
before_script: # install this project's dependencies
4141
- apt update && apt install gfortran --yes
42+
- git submodule update --init --recursive # Ensure submodules are updated
4243
script:
4344
- python -m pip install .
4445
- pip install pytest-cov coverage
4546
- cd tests/python # move into test directory to ensure that the installed package is tested, not the source
4647
- pytest --cov pyoptgra --cov-report term-missing test.py
4748
- coverage report --fail-under=95
4849

50+
test-py3.10:
51+
stage: test
52+
image: python:3.10
53+
allow_failure: false
54+
before_script: # install this project's dependencies
55+
- apt update && apt install gfortran --yes
56+
- git submodule update --init --recursive # Ensure submodules are updated
57+
script:
58+
- python -m pip install .
59+
- pip install pytest-cov coverage
60+
- cd tests/python # move into test directory to ensure that the installed package is tested, not the source
61+
- pytest --cov pyoptgra --cov-report term-missing test.py
62+
- coverage report --fail-under=95
63+
64+
test-py3.11:
65+
stage: test
66+
image: python:3.11
67+
allow_failure: false
68+
before_script: # install this project's dependencies
69+
- apt update && apt install gfortran --yes
70+
- git submodule update --init --recursive # Ensure submodules are updated
71+
script:
72+
- python -m pip install .
73+
- pip install pytest-cov coverage
74+
- cd tests/python # move into test directory to ensure that the installed package is tested, not the source
75+
- pytest --cov pyoptgra --cov-report term-missing test.py
76+
- coverage report --fail-under=95
77+
78+
# test-py3.12:
79+
# stage: test
80+
# image: python:3.12
81+
# allow_failure: false
82+
# before_script: # install this project's dependencies
83+
# - apt update && apt install gfortran --yes
84+
# - git submodule update --init --recursive # Ensure submodules are updated
85+
# script:
86+
# - python -m pip install .
87+
# - pip install pytest-cov coverage
88+
# - cd tests/python # move into test directory to ensure that the installed package is tested, not the source
89+
# - pytest --cov pyoptgra --cov-report term-missing test.py
90+
# - coverage report --fail-under=95
91+
# when: manual # Once Pygmo is available for Python 3.12 on pip, this job should work
92+
4993
# check the documentation examples work
5094
doctest:
5195
stage: test
5296
image: python:3.9
5397
allow_failure: false
54-
before_script: # install this project's dependencies
98+
before_script: # install this project's dependencies
5599
- apt update && apt install gfortran --yes
56100
- pip install sphinx breathe
57101
script:
@@ -64,7 +108,7 @@ documentation:
64108
stage: test
65109
image: python:3.9
66110
allow_failure: false
67-
before_script: # install this project's dependencies
111+
before_script: # install this project's dependencies
68112
- apt update && apt install gfortran doxygen --yes
69113
- pip install sphinx breathe sphinx-rtd-theme
70114
script:
@@ -74,53 +118,52 @@ documentation:
74118
- cd ../sphinx
75119
- make html
76120
artifacts:
77-
paths:
78-
- doc/sphinx/_build
121+
paths:
122+
- doc/sphinx/_build
79123

80124
python-sdist:
81125
stage: package
82126
image: python:3.9
83-
needs: []
84127
before_script:
85128
- apt update && apt install gfortran doxygen --yes
86129
- pip install --upgrade pip
87-
- pip install scikit-build setuptools-scm ninja cmake
130+
- pip install build scikit-build setuptools-scm ninja cmake
88131
script:
89132
- git submodule update --init --recursive
90-
- python3 setup.py sdist
133+
- python -m build --sdist
91134
- mv dist/pyoptgra-*.tar.gz .
92135
artifacts:
93136
name: python-package
94137
paths:
95138
- pyoptgra-*.tar.gz
96139

97-
python-wheels:manylinux2010:
140+
python-wheels:manylinux2014:
98141
stage: package
99-
image: quay.io/pypa/manylinux2010_x86_64:latest
142+
image: quay.io/pypa/manylinux2014_x86_64:latest # Updated to manylinux2014
100143
needs: []
101144
variables:
102145
GIT_SUBMODULE_STRATEGY: recursive
103146
script:
104147
- ./tools/build-manylinux-wheels.sh
105148
- mv /wheelhouse/repaired/*.whl .
106149
artifacts:
107-
name: python-wheels-manylinux2010
150+
name: python-wheels-manylinux2014
108151
paths:
109152
- pyoptgra-*.whl
110153

111154
test-wheels:
112155
stage: test-package
113156
image: python:3.9
114157
script:
115-
- pip install pyoptgra*cp39-cp39*manylinux2010_x86_64.whl
158+
- pip install pyoptgra*cp39-cp39*manylinux2014_x86_64.whl
116159
- mkdir test-install
117160
- cd test-install
118161
- python -c "import pyoptgra"
119162
- cd ..
120163
needs:
121-
- python-wheels:manylinux2010
164+
- python-wheels:manylinux2014
122165

123-
publish:
166+
publish-test:
124167
stage: deploy
125168
image: python:3.9
126169
script:
@@ -132,10 +175,29 @@ publish:
132175
needs:
133176
- python-sdist
134177
- test-wheels
135-
- python-wheels:manylinux2010
178+
- python-wheels:manylinux2014
179+
only:
180+
refs:
181+
- master
182+
when: manual
183+
184+
# Upload to PyPI after successful tests and package creation
185+
publish-pypi:
186+
stage: deploy
187+
image: python:3.9
188+
script:
189+
- pip install twine
190+
# upload to the project pypi (whl) (change testpypi to pypi to upload to PyPi)
191+
- twine upload --non-interactive --disable-progress-bar --verbose --repository pypi -u __token__ -p $PYPI_TOKEN pyoptgra-*.whl
192+
# upload to the project pypi (sdist)
193+
- twine upload --non-interactive --disable-progress-bar --verbose --repository pypi -u __token__ -p $PYPI_TOKEN pyoptgra-*.tar.gz
194+
needs:
195+
- python-sdist
196+
- test-wheels
197+
- python-wheels:manylinux2014
136198
only:
137199
refs:
138-
- master
200+
- master
139201
when: manual
140202

141203
pages:
@@ -145,14 +207,13 @@ pages:
145207
- documentation
146208
- test-wheels
147209
script:
148-
- mkdir -p ./public/html/
149-
- mv ./doc/sphinx/_build/html/* ./public/
210+
- mkdir -p ./public/html/
211+
- mv ./doc/sphinx/_build/html/* ./public/
150212
artifacts:
151213
paths:
152-
- public
153-
- doc/sphinx/_build
214+
- public
215+
- doc/sphinx/_build
154216
only:
155217
refs:
156-
- master
218+
- master
157219
when: manual
158-

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.15)
22

33
set(CMAKE_BUILD_TYPE Release CACHE STRING
44
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)

ext/Catch2

Submodule Catch2 updated 544 files

ext/pybind11

Submodule pybind11 updated 252 files

pyproject.toml

+22-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
11
[project]
2-
name = "pyoptgra"
3-
version = "0.1.9"
4-
description = "A python-wrapped version of OPTGRA, an algorithm for constrained optimization"
52
authors = [
6-
{name="Johannes Schoenmaekers", email="[email protected]"},
7-
{name="Moritz von Looz", email="[email protected]"}
3+
{name = "Johannes Schoenmaekers", email = "[email protected]"},
4+
{name = "Moritz von Looz", email = "[email protected]"},
85
]
9-
license = {text = "GPL-3.0 or ESCL-2.4"}
10-
readme = "README.rst"
11-
126
dependencies = [
13-
"pygmo >= 2.16.0"
7+
"pygmo >=2.16.0",
8+
"numpy<2.0.0",
149
]
10+
description = "A python-wrapped version of OPTGRA, an algorithm for constrained optimization"
11+
license = {text = "GPL-3.0 or ESCL-2.4"}
12+
name = "pyoptgra"
13+
readme = "README.rst"
14+
requires-python = ">=3.9"
15+
version = "0.1.10"
1516

1617
[build-system]
17-
requires = ["setuptools", "wheel", "scikit-build", "cmake", "ninja", "setuptools_scm"]
18-
build-backend = "setuptools.build_meta"
18+
build-backend = "scikit_build_core.build"
19+
requires = ["setuptools", "wheel", "scikit-build-core", "ninja", "setuptools_scm"]
20+
21+
[tool.scikit-build.wheel]
22+
install-dir = "pyoptgra/core"
23+
24+
[tool.setuptools]
25+
packages = ["pyoptgra"]
26+
27+
[tool.setuptools_scm]
28+
local_scheme = "no-local-version"
29+
version_scheme = "post-release"
1930

2031
[tool.black]
2132
line-length = 100

setup.cfg

-12
This file was deleted.

0 commit comments

Comments
 (0)