mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
General cleanups
This commit is contained in:
3
.github/workflows/main.yml
vendored
3
.github/workflows/main.yml
vendored
@@ -377,9 +377,6 @@ jobs:
|
||||
path: dist
|
||||
- name: Upgrade pip
|
||||
run: python3 -m pip install -U pip setuptools wheel
|
||||
- name: Install typing_extensions for Python 3.7
|
||||
if: matrix.python-version == '3.7'
|
||||
run: python3 -m pip install typing-extensions
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
python3 -m pip install numpy ruamel.yaml h5py pandas matplotlib scipy pint
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
# listed in setup.cfg:options.exclude_package_data.
|
||||
|
||||
include cantera/_cantera.cpp
|
||||
include cantera/_cantera.h
|
||||
recursive-include cantera *.pyx
|
||||
include sundials_config.h.in
|
||||
include config.h.in
|
||||
|
||||
@@ -170,8 +170,6 @@ sdist(localenv.RecursiveInstall("cantera",
|
||||
exclude=["__pycache__"]))
|
||||
sdist(localenv.RecursiveInstall("cantera/data",
|
||||
"#build/data"))
|
||||
sdist(localenv.RecursiveInstall("cantera/test/data",
|
||||
"#test/data"))
|
||||
|
||||
# Copy the minimal Sundials configuration template into the sdist so that
|
||||
# it can be filled in at compile time on the user's machine
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
[build-system]
|
||||
requires = ["setuptools>=43.0.0", "wheel", "oldest-supported-numpy", "Cython>=0.29.12"]
|
||||
# These versions are pinned to the latest versions at the time of this commit.
|
||||
# Feel free to update as required.
|
||||
requires = [
|
||||
"setuptools==67.7.1",
|
||||
"wheel",
|
||||
"oldest-supported-numpy",
|
||||
"Cython==0.29.34",
|
||||
]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
@@ -45,15 +45,19 @@ install_requires =
|
||||
packaging
|
||||
python_requires @py_requires_ver_str@
|
||||
packages =
|
||||
cantera
|
||||
cantera.data
|
||||
cantera.examples
|
||||
cantera.test
|
||||
cantera.with_units
|
||||
|
||||
# These options include data in the sdist and wheel if the files are also listed in
|
||||
# MANIFEST.in. Note that only files that are inside the "cantera" packages will be
|
||||
# included in the wheel.
|
||||
[options.package_data]
|
||||
cantera.data = *.*, */*.*
|
||||
cantera = *.pxd, test/*.txt, examples/*.txt
|
||||
cantera = *.pxd
|
||||
cantera.data = *.*
|
||||
cantera.examples = *.txt
|
||||
cantera.test = *.txt
|
||||
|
||||
# These options exclude data from the wheel file but not from the sdist
|
||||
[options.exclude_package_data]
|
||||
|
||||
@@ -8,14 +8,13 @@ from pathlib import Path
|
||||
import numpy
|
||||
import shutil
|
||||
|
||||
HERE = Path(__file__).parent
|
||||
CT_SRC = HERE / "src"
|
||||
EXT_SRC = HERE / "ext"
|
||||
CT_INCLUDE = HERE / "include"
|
||||
CT_SRC = Path("src")
|
||||
EXT_SRC = Path("ext")
|
||||
CT_INCLUDE = Path("include")
|
||||
BOOST_INCLUDE = None
|
||||
FORCE_CYTHON_COMPILE = False
|
||||
|
||||
CYTHON_BUILT_FILES = [HERE / "cantera" / f"_cantera.{ext}" for ext in ("cpp", "h")]
|
||||
CYTHON_BUILT_FILES = [Path("cantera") / f"_cantera.{ext}" for ext in ("cpp", "h")]
|
||||
|
||||
|
||||
class CanteraOptionsMixin:
|
||||
@@ -114,9 +113,6 @@ def configure_build():
|
||||
|
||||
config_h = {}
|
||||
|
||||
def create_config(key, value):
|
||||
config_h[key] = f"#define {key} {value}"
|
||||
|
||||
if not boost_version:
|
||||
raise ValueError(
|
||||
"Could not find Boost headers. Please set an environment variable called "
|
||||
@@ -134,7 +130,7 @@ def configure_build():
|
||||
)
|
||||
|
||||
if sys.platform != "win32":
|
||||
extra_compile_flags = ["-std=c++14", "-g0"]
|
||||
extra_compile_flags = ["-std=c++17", "-g0"]
|
||||
sundials_configh = {
|
||||
"SUNDIALS_USE_GENERIC_MATH": "#define SUNDIALS_USE_GENERIC_MATH 1",
|
||||
"SUNDIALS_BLAS_LAPACK": "/* #undef SUNDIALS_BLAS_LAPACK */"
|
||||
@@ -150,14 +146,14 @@ def configure_build():
|
||||
}
|
||||
sundials_cflags = []
|
||||
|
||||
sun_config_h_in = (HERE / "sundials_config.h.in").read_text()
|
||||
sun_config_h = HERE / "sundials_config.h"
|
||||
sun_config_h_in = Path("sundials_config.h.in").read_text()
|
||||
sun_config_h = Path("sundials_config.h")
|
||||
sun_config_h.write_text(sun_config_h_in.format_map(sundials_configh))
|
||||
shutil.copy2(sun_config_h, EXT_SRC / "sundials" / "sundials")
|
||||
shutil.copy2(sun_config_h, CT_INCLUDE / "cantera" / "ext" / "sundials")
|
||||
|
||||
config_h_in = (HERE / "config.h.in").read_text()
|
||||
ct_config_h = HERE / "include" / "cantera" / "base" / "config.h"
|
||||
config_h_in = Path("config.h.in").read_text()
|
||||
ct_config_h = Path("include") / "cantera" / "base" / "config.h"
|
||||
ct_config_h.write_text(config_h_in.format_map(config_h))
|
||||
|
||||
return extra_compile_flags, sundials_cflags, sundials_macros
|
||||
|
||||
@@ -2,7 +2,6 @@ from __future__ import annotations
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import platform
|
||||
import textwrap
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
Reference in New Issue
Block a user