-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from leaver2000/development
Development
- Loading branch information
Showing
45 changed files
with
66,755 additions
and
1,360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Ignore everything | ||
* | ||
|
||
# Allow files and directories | ||
!pyproject.toml | ||
!setup.py | ||
!/src/nzthermo/ | ||
!/src/include/ | ||
!/src/lib/ | ||
!/tests/ | ||
!/.git/ | ||
# !/src | ||
|
||
# Ignore unnecessary files inside allowed directories | ||
# This should go after the allowed directories | ||
# **/*~ | ||
**/*.pyc | ||
**/_version.py | ||
**/__pycache__/ | ||
**/*.so | ||
# **/.DS_Store | ||
# **/Thumbs.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
cmake_minimum_required(VERSION 3.14) | ||
project(libthermo) | ||
|
||
# # Set the compiler options | ||
# # The --coverage compiler flag is an alternative to -fprofile-arcs -ftest-coverage for recent version of gcc. | ||
# # In versions 3.13 and later of cmake, the target_link_libraries command can be | ||
# # removed and add_link_options("--coverage") added after the add_compile_options command. | ||
# # GoogleTest requires at least C++14 | ||
# set(CMAKE_CXX_STANDARD 20) | ||
# set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_REQUIRED_FLAGS -fconcepts) | ||
# set(CMAKE_CXX_FLAGS "-g -O0 -Wall --coverage") | ||
# set(CMAKE_C_FLAGS --coverage) | ||
|
||
# include(FetchContent) | ||
# FetchContent_Declare( | ||
# googletest | ||
# URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip | ||
# ) | ||
|
||
# # For Windows: Prevent overriding the parent project's compiler/linker settings | ||
# set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) | ||
# FetchContent_MakeAvailable(googletest) | ||
add_compile_options( | ||
"$<$<COMPILE_LANGUAGE:CXX>:-Ofast;-DNDEBUG;-fconcepts;-std=c++2a;-march=native;-fpic;-ftree-vectorize>" | ||
) | ||
# # ------------------------------------------------------------------------------------------------- | ||
# # GTest | ||
# # ------------------------------------------------------------------------------------------------- | ||
# enable_testing() | ||
include_directories(src/include/) | ||
add_executable( | ||
slac_test | ||
# src/lib/_C.cpp | ||
src/lib/functional.cpp | ||
# src/include/_C.hpp | ||
# src/include/common.hpp | ||
src/include/functional.hpp | ||
) | ||
|
||
# # link everything together | ||
# target_link_libraries(slac_test GTest::gtest_main) | ||
|
||
# if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") | ||
# add_test( | ||
# NAME slac_test | ||
# COMMAND slac_test --gtest_output=xml:gtest-output.xml | ||
# ) | ||
# add_test( | ||
# NAME Coverage | ||
# COMMAND gcovr --exclude-directories build/CMakeFiles/slac_test.dir/src/lib/tests --cobertura coverage.cobertura.xml | ||
# WORKING_DIRECTORY .. | ||
# ) | ||
# else() | ||
# add_test( | ||
# NAME slac_test | ||
# COMMAND slac_test --gtest_output=xml:/app/gtest-output.xml | ||
# ) | ||
# add_test( | ||
# NAME Coverage | ||
# COMMAND gcovr --exclude-directories build/CMakeFiles/slac_test.dir/src/lib/tests --cobertura coverage.cobertura.xml | ||
# WORKING_DIRECTORY .. | ||
# ) | ||
# endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
# ................................................................................................. | ||
# FROM python:3.10.14 AS py310 | ||
# USER root | ||
# WORKDIR / | ||
|
||
# ENV PATH="/opt/venv/bin:$PATH" | ||
# RUN python3 -m venv /opt/venv | ||
# COPY tests/requirements.txt . | ||
# RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# COPY . . | ||
# ENV NZTHERMO_BUILD_COVERAGE 1 | ||
# RUN pip install --no-cache-dir --no-deps --upgrade --target src/ . | ||
|
||
# USER 1001 | ||
|
||
# ................................................................................................. | ||
FROM python:3.11.9 AS py311 | ||
USER root | ||
WORKDIR / | ||
|
||
ENV PATH="/opt/venv/bin:$PATH" | ||
RUN python3 -m venv /opt/venv | ||
COPY tests/requirements.txt . | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
COPY . . | ||
ENV NZTHERMO_BUILD_COVERAGE 1 | ||
RUN pip install --no-cache-dir --no-deps --upgrade --target src/ . \ | ||
&& pytest tests | ||
|
||
USER 1001 | ||
|
||
# ................................................................................................. | ||
FROM python:3.12.3 AS py312 | ||
USER root | ||
WORKDIR / | ||
|
||
ENV PATH="/opt/venv/bin:$PATH" | ||
RUN python3 -m venv /opt/venv | ||
COPY tests/requirements.txt . | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
COPY . . | ||
ENV NZTHERMO_BUILD_COVERAGE 1 | ||
RUN pip install --no-cache-dir --no-deps --upgrade --target src/ . \ | ||
&& pytest tests | ||
|
||
USER 1001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
clean: | ||
rm -rf dist/ build/ .pytest_cache/ .coverage *.egg-info/ src/*.egg-info/ src/nzthermo/_version.py src/nzthermo/*.so src/nzthermo/__pycache__/ |
Oops, something went wrong.