Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
Merge GenConfig master branch
Browse files Browse the repository at this point in the history
Combine the history of the GenConfig repo into this repo under a `wip`
directory.
  • Loading branch information
jmgate committed Sep 18, 2023
2 parents 4c3ecca + 01f5e94 commit 86ecfda
Show file tree
Hide file tree
Showing 30 changed files with 4,302 additions and 0 deletions.
4 changes: 4 additions & 0 deletions wip/genconfig/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[run]
omit =
tests/*
deps/*
66 changes: 66 additions & 0 deletions wip/genconfig/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
stages:
- test
- deploy

before_script:
# display centos version
- cat /etc/issue

# Pull required packages
# See https://pip.pypa.io/en/stable/reference/pip_install/#git : useful data on how to format this link
# https://stackoverflow.com/a/35998253/2059999 : also useful for some info on how to write the target
- python3 -m pip install --user -U py pytest pytest-cov
- mkdir deps; cd deps
- git clone https://gitlab+deploy-token-CI:${CI_GROUP_READ_TOKEN}@internal.gitlab.server/trilinos-devops-consolidation/code/ConfigParserEnhanced.git
- git clone https://gitlab+deploy-token-CI:${CI_GROUP_READ_TOKEN}@internal.gitlab.server/trilinos-devops-consolidation/code/SetEnvironment.git
- git clone https://gitlab+deploy-token-CI:${CI_GROUP_READ_TOKEN}@internal.gitlab.server/trilinos-devops-consolidation/code/DetermineSystem.git
- git clone https://gitlab+deploy-token-CI:${CI_GROUP_READ_TOKEN}@internal.gitlab.server/trilinos-devops-consolidation/code/KeywordParser.git
- git clone https://gitlab+deploy-token-CI:${CI_GROUP_READ_TOKEN}@internal.gitlab.server/trilinos-devops-consolidation/code/LoadEnv.git LoadEnv
- git clone https://gitlab+deploy-token-CI:${CI_GROUP_READ_TOKEN}@internal.gitlab.server/trilinos-devops-consolidation/code/SetProgramOptions.git
- cd ..
- ln -s deps/ConfigParserEnhanced/src/configparserenhanced/ .
- ln -s deps/SetEnvironment/src/setenvironment/ .
- ln -s deps/DetermineSystem/determinesystem/ .
- ln -s deps/KeywordParser/keywordparser/ .
- ln -s deps/LoadEnv .
- ln -s deps/SetProgramOptions/src/setprogramoptions .

pytest:
stage: test
timeout: 20m
script:
- python3 -m pytest --color=yes -rs -vv --cov=. --cov-report html --cov-report term
coverage: '/TOTAL\s*[0-9]*\s*[0-9]*\s*(\d+%)/'

sphinx:
stage: test
timeout: 20m
script:
- cd doc/
- python3 -s -m pip install -U --user -r requirements.txt
- bash make_html_docs.sh

publish coverage:
stage: deploy
timeout: 20m
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
script:
- python3 -s -m pytest --color=yes -rs -vv --cov=. --cov-report html --cov-report term
- rm -rf /home/josbrau/html_files/GenConfig/coverage
- mkdir -p /home/josbrau/html_files/GenConfig/coverage
- mv htmlcov/* /home/josbrau/html_files/GenConfig/coverage/
coverage: '/TOTAL\s*[0-9]*\s*[0-9]*\s*(\d+%)/'

publish docs:
stage: deploy
timeout: 20m
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
script:
- cd doc/
- python3 -s -m pip install -U --user -r requirements.txt
- bash make_html_docs.sh
- rm -rf /home/josbrau/html_files/GenConfig/doc
- mkdir -p /home/josbrau/html_files/GenConfig/doc
- mv html/* /home/josbrau/html_files/GenConfig/doc/
19 changes: 19 additions & 0 deletions wip/genconfig/.style.yapf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[style]
based_on_style = google
ARITHMETIC_PRECEDENCE_INDICATION=True
blank_lines_around_top_level_definition=3
blank_lines_between_top_level_imports_and_variables=2
blank_line_before_nested_class_or_def=True
COLUMN_LIMIT=100
COALESCE_BRACKETS=False
DEDENT_CLOSING_BRACKETS=True
INDENT_CLOSING_BRACKETS=True
SPACE_BETWEEN_ENDING_COMMA_AND_CLOSING_BRACKET=True
SPACE_INSIDE_BRACKETS=False
SPACES_AROUND_SUBSCRIPT_COLON=True
SPACES_BEFORE_COMMENT=15,30
SPLIT_BEFORE_DOT=True
SPLIT_BEFORE_DICT_SET_GENERATOR=True
SPLIT_COMPLEX_COMPREHENSION=True
SPLIT_ALL_COMMA_SEPARATED_VALUES=False
SPLIT_ALL_TOP_LEVEL_COMMA_SEPARATED_VALUES=True
68 changes: 68 additions & 0 deletions wip/genconfig/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
Contributing
============

When contributing to this repository, please first discuss the change you wish
to make via issue, email, or any other method with the owners of this repository
before making a change.

Code Style
----------
Please adhere to PEP8 style guidelines unless called out in this document.
1. Add 3 lines of machine-name-4space between classes and free functions.
2. Prefer 2 lines of machine-name-4space between methods within classes.
3. Prefer all methods in classes should have an explicit `return` statement.
4. All `pytest` tests shoud `return 0` if the test is successful.
5. Conform to Google-style docstrings except for where it might break Sphinx
formatting.
6. Lines should not exceed 120 columns except in cases where it reduces the
readability of the code.

### Auto-formatting
We can also use the [YAPF][2] tool to perform auto-formatting.
The .style.yapf file provides a formatting scheme that is also good. Using this
breaks (2) above, it will only add 1 line between method definitions so this should
be adjusted manually.

Versioning
----------
This project uses [Semantic Versioning][1].

Merge Request Process
---------------------
1. Ensure any unapproved install or build dependencies are removed before submitting
a merge request.
2. Update the CHANGELOG.md file with details of the changes you are making.
3. Update relevant documentation in the `doc/` folder and any appropriate _docstrings_.
4. Update unit tests to fully test your additions. We aim for 100% coverage on this project.
5. Ensure unit tests and documentation build cleanly by running `exec-tests.sh`, `exec-makedoc.sh`
and the _example_ applications in the repository.

Code of Conduct
===============
In the interest of fostering an open and welcoming environment, we as contributors
and maintainers pledge to making participation in our project and our community a
harassment-free experience for everyone, regardless of age, body size, disability,
ethnicity, gender identity and expression, level of experience, nationality,
personal appearance, race, religion, or sexual identity and orientation.

Standards
---------
Examples of behavior that contributes to creating a positive environment include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:
- The use of sexualized language or imagery and unwelcome sexual attention
or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

[1]: http://semver.org/
[2]: https://github.com/google/yapf
7 changes: 7 additions & 0 deletions wip/genconfig/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[![pipeline status](https://internal.gitlab.server/trilinos-devops-consolidation/code/GenConfig/badges/master/pipeline.svg)](https://internal.gitlab.server/trilinos-devops-consolidation/code/GenConfig/-/commits/master)
[![coverage report](https://internal.gitlab.server/trilinos-devops-consolidation/code/GenConfig/badges/master/coverage.svg)](http://10.202.35.89:8080/GenConfig/coverage/index.html)
[![Generic badge](https://img.shields.io/badge/docs-latest-green.svg)](http://10.202.35.89:8080/GenConfig/doc/index.html)

# GenConfig

A tool for generating the options to pass to CMake when configuring your code.
7 changes: 7 additions & 0 deletions wip/genconfig/doc/make_html_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sphinx-build -W -b html source/ html/
if [ $? -eq 0 ]; then
echo "\nIf you ran this on your local machine, you can open them with\n"
echo " open html/index.html\n"
else
exit 1
fi
3 changes: 3 additions & 0 deletions wip/genconfig/doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sphinx
sphinx-argparse
sphinx-rtd-theme
7 changes: 7 additions & 0 deletions wip/genconfig/doc/source/ConfigKeywordParser.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ConfigKeywordParser
===================

.. automodule:: src.config_keyword_parser
:members:
:undoc-members:
:show-inheritance:
Binary file added wip/genconfig/doc/source/Python_Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions wip/genconfig/doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
from pathlib import Path
import sys
sys.path.append(str(Path.cwd().parent.parent.resolve()))


# -- Project information -----------------------------------------------------

project = 'GenConfig'
copyright = '2021, Josh Braun'
author = 'Josh Braun'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.coverage",
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinxarg.ext",
"sphinx_rtd_theme",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_logo = 'Python_Logo.png'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = []
21 changes: 21 additions & 0 deletions wip/genconfig/doc/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. GenConfig's documentation master file, created by
sphinx-quickstart on Wed Jan 13 15:30:46 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to GenConfig's documentation!
=====================================

.. toctree::
:maxdepth: 2
:caption: Contents:

ConfigKeywordParser


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Loading

0 comments on commit 86ecfda

Please sign in to comment.