Skip to content

Commit e762701

Browse files
authored
Merge pull request #14 from pymor/pyproject.toml
add pyproject and extend ci scripts to build a wheel
2 parents 1bf9302 + adbba3e commit e762701

File tree

7 files changed

+40
-12
lines changed

7 files changed

+40
-12
lines changed

.ci/azure-pipelines.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ strategy:
1313
container: $[ variables['containerImage'] ]
1414

1515
steps:
16-
- script: ./.ci/travis.script.bash
16+
- script: ./.ci/pytest.bash
17+
- script: ./.ci/wheel.bash
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ git submodule update --init
1717

1818
python -m venv ~/venv
1919
source ~/venv/bin/activate
20-
pip install -U pip pytest
20+
python -m pip install -U pip pytest wheel build
2121

22-
pip install git+https://github.com/pymor/pymor.git#egg=pymor
23-
# if we're in a versioned branch pip will downgrade pymor here from pypi
24-
pip install .
25-
26-
cd ${BASE_DIR}/src/
27-
xvfb-run -a pytest -s -r sxX test/demo.py
22+
python -m pip install git+https://github.com/pymor/pymor.git#egg=pymor

.ci/pytest.bash

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
BASE_DIR="$(cd "$(dirname ${BASH_SOURCE[0]})" ; cd ../ ; pwd -P )"
7+
8+
source ${BASE_DIR}/.ci/common_setup.bash
9+
10+
# if we're in a versioned branch pip will downgrade pymor here from pypi
11+
python -m pip install .
12+
13+
cd ${BASE_DIR}/src/
14+
xvfb-run -a pytest -s -r sxX test/demo.py

.ci/wheel.bash

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
BASE_DIR="$(cd "$(dirname ${BASH_SOURCE[0]})" ; cd ../ ; pwd -P )"
7+
8+
source ${BASE_DIR}/.ci/common_setup.bash
9+
10+
python -m build

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
cmake_minimum_required(VERSION 2.8.12)
1+
cmake_minimum_required(VERSION 3.2)
22

33
# this should only be necessary while the deal setup macro is copied
4-
set(CMAKE_CXX_STANDARD 14 CACHE STRING "")
4+
set(CMAKE_CXX_STANDARD 17 CACHE STRING "")
55

66
project(pymor_dealii)
77

@@ -10,7 +10,7 @@ INCLUDE(dealii_macro)
1010
# Set a default build configuration if none is specified. 'MinSizeRel' produces the smallest binaries
1111
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
1212
message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.")
13-
set(CMAKE_BUILD_TYPE RelWithDebInfo STRING "Choose the type of build." FORCE)
13+
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE)
1414
endif()
1515
# Add a CMake parameter for choosing a desired Python version
1616
set(PYBIND11_PYTHON_VERSION "3" CACHE STRING "Python version to use for compiling the example library")

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# This file is autogenerated. Edit dependencies.py instead
2+
[build-system]
3+
requires = ['setuptools>=49.1', 'wheel', 'packaging']
4+
build-backend = "setuptools.build_meta"

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
import os
44
import pathlib
5-
import versioneer
5+
import sys
6+
# versioneer (+dependencies) does not work in a pep518/7 context w/o modification here
7+
sys.path.append(os.path.dirname(__file__))
8+
import versioneer # noqa
69

710
from setuptools import setup, Extension
811
from setuptools import find_packages
@@ -60,6 +63,7 @@ def build_cmake(self, ext):
6063
name='pymor_dealii',
6164
author='pyMOR developers',
6265
author_email='[email protected]',
66+
python_requires='>=3.7',
6367
maintainer='Rene Fritze',
6468
maintainer_email='[email protected]',
6569
install_requires=[],

0 commit comments

Comments
 (0)