generated from ThalesGroup/template-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce95db2
commit 0d21486
Showing
61 changed files
with
5,927 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# .coveragerc to control coverage.py | ||
[run] | ||
branch = True | ||
source = matbexp | ||
# omit = bad_file.py | ||
|
||
[paths] | ||
source = | ||
src/ | ||
*/site-packages/ | ||
|
||
[report] | ||
# Regexes for lines to exclude from consideration | ||
exclude_lines = | ||
# Have to re-enable the standard pragma | ||
pragma: no cover | ||
|
||
# Don't complain about missing debug-only code: | ||
def __repr__ | ||
if self\.debug | ||
|
||
# Don't complain if tests don't hit defensive assertion code: | ||
raise AssertionError | ||
raise NotImplementedError | ||
|
||
# Don't complain if non-runnable code isn't run: | ||
if 0: | ||
if __name__ == .__main__.: |
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,26 @@ | ||
version: 2 | ||
updates: | ||
|
||
- package-ecosystem: pip | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
time: "10:00" | ||
open-pull-requests-limit: 10 | ||
|
||
- package-ecosystem: docker | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
open-pull-requests-limit: 10 | ||
ignore: | ||
# Only send PRs for patch versions of Python. | ||
- dependency-name: "python" | ||
update-types: [ "version-update:semver-major", "version-update:semver-minor" ] | ||
|
||
- package-ecosystem: npm | ||
directory: "/" | ||
schedule: | ||
interval: monthly | ||
time: "10:00" | ||
open-pull-requests-limit: 10 |
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,83 @@ | ||
# Reference: https://docs.github.com/en/actions | ||
|
||
name: tests | ||
|
||
on: | ||
push: | ||
# Avoid using all the resources/limits available by checking only | ||
# relevant branches and tags. Other branches can be checked via PRs. | ||
branches: [main] | ||
tags: ['v[0-9]*', '[0-9]+.[0-9]+*'] # Match tags that resemble a version | ||
pull_request: # Run in every PR | ||
workflow_dispatch: # Allow manually triggering the workflow | ||
schedule: | ||
# Run roughly every 15 days at 00:00 UTC | ||
# (useful to check if updates on dependencies break the package) | ||
- cron: '0 0 1,16 * *' | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: >- | ||
${{ github.workflow }}-${{ github.ref_type }}- | ||
${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
prepare: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
wheel-distribution: ${{ steps.wheel-distribution.outputs.path }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: {fetch-depth: 0} # deep clone for setuptools-scm | ||
- uses: actions/setup-python@v4 | ||
id: setup-python | ||
with: {python-version: "3.11"} | ||
- name: Run static analysis and format checkers | ||
run: pipx run pre-commit run --all-files --show-diff-on-failure | ||
- name: Build package distribution files | ||
run: >- | ||
pipx run --python '${{ steps.setup-python.outputs.python-path }}' | ||
tox -e clean,build | ||
- name: Record the path of wheel distribution | ||
id: wheel-distribution | ||
run: echo "path=$(ls dist/*.whl)" >> $GITHUB_OUTPUT | ||
- name: Store the distribution files for use in other stages | ||
# `tests` and `publish` will use the same pre-built distributions, | ||
# so we make sure to release the exact same package that was tested | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: python-distribution-files | ||
path: dist/ | ||
retention-days: 1 | ||
|
||
test: | ||
needs: prepare | ||
strategy: | ||
matrix: | ||
python: | ||
- "3.7" # oldest Python supported by PSF | ||
- "3.11" # newest Python that is stable | ||
platform: | ||
- ubuntu-latest | ||
- macos-latest | ||
- windows-latest | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
id: setup-python | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Retrieve pre-built distribution files | ||
uses: actions/download-artifact@v3 | ||
with: {name: python-distribution-files, path: dist/} | ||
- name: Run tests | ||
run: >- | ||
pipx run --python '${{ steps.setup-python.outputs.python-path }}' | ||
tox --installpkg '${{ needs.prepare.outputs.wheel-distribution }}' | ||
-- -rFEx --durations 10 --color yes # pytest args | ||
- name: Generate coverage report | ||
run: pipx run coverage lcov -o coverage.lcov |
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,54 @@ | ||
# Temporary and binary files | ||
*~ | ||
*.py[cod] | ||
*.so | ||
*.cfg | ||
!.isort.cfg | ||
!setup.cfg | ||
*.orig | ||
*.log | ||
*.pot | ||
__pycache__/* | ||
.cache/* | ||
.*.swp | ||
*/.ipynb_checkpoints/* | ||
.DS_Store | ||
|
||
# Project files | ||
.ropeproject | ||
.project | ||
.pydevproject | ||
.settings | ||
.idea | ||
.vscode | ||
tags | ||
|
||
# Package files | ||
*.egg | ||
*.eggs/ | ||
.installed.cfg | ||
*.egg-info | ||
|
||
# Unittest and coverage | ||
htmlcov/* | ||
.coverage | ||
.coverage.* | ||
.tox | ||
junit*.xml | ||
coverage.xml | ||
.pytest_cache/ | ||
|
||
# Build and docs folder/files | ||
build/* | ||
dist/* | ||
sdist/* | ||
docs/api/* | ||
docs/_rst/* | ||
docs/_build/* | ||
cover/* | ||
MANIFEST | ||
|
||
# Per-project virtualenvs | ||
.venv*/ | ||
.conda*/ | ||
.python-version |
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 @@ | ||
[settings] | ||
profile = black | ||
known_first_party = matbexp |
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,67 @@ | ||
exclude: '^docs/conf.py' | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: check-added-large-files | ||
- id: check-ast | ||
- id: check-json | ||
- id: check-merge-conflict | ||
- id: check-xml | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: requirements-txt-fixer | ||
- id: mixed-line-ending | ||
args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows | ||
|
||
## If you want to automatically "modernize" your Python code: | ||
# - repo: https://github.com/asottile/pyupgrade | ||
# rev: v3.7.0 | ||
# hooks: | ||
# - id: pyupgrade | ||
# args: ['--py37-plus'] | ||
|
||
## If you want to avoid flake8 errors due to unused vars or imports: | ||
# - repo: https://github.com/PyCQA/autoflake | ||
# rev: v2.1.1 | ||
# hooks: | ||
# - id: autoflake | ||
# args: [ | ||
# --in-place, | ||
# --remove-all-unused-imports, | ||
# --remove-unused-variables, | ||
# ] | ||
|
||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 24.2.0 | ||
hooks: | ||
- id: black | ||
language_version: python3 | ||
|
||
## If like to embrace black styles even in the docs: | ||
# - repo: https://github.com/asottile/blacken-docs | ||
# rev: v1.13.0 | ||
# hooks: | ||
# - id: blacken-docs | ||
# additional_dependencies: [black] | ||
|
||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 7.0.0 | ||
hooks: | ||
- id: flake8 | ||
## You can add flake8 plugins via `additional_dependencies`: | ||
# additional_dependencies: [flake8-bugbear] | ||
|
||
## Check for misspells in documentation files: | ||
# - repo: https://github.com/codespell-project/codespell | ||
# rev: v2.2.5 | ||
# hooks: | ||
# - id: codespell |
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,27 @@ | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Build documentation in the docs/ directory with Sphinx | ||
sphinx: | ||
configuration: docs/conf.py | ||
|
||
# Build documentation with MkDocs | ||
#mkdocs: | ||
# configuration: mkdocs.yml | ||
|
||
# Optionally build your docs in additional formats such as PDF | ||
formats: | ||
|
||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.11" | ||
|
||
python: | ||
install: | ||
- requirements: docs/requirements.txt | ||
- {path: ., method: pip} |
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 @@ | ||
# Contributors | ||
|
||
* Danielle Benesch [[email protected]](mailto:[email protected]) |
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,17 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
|
||
### Added | ||
### Removed | ||
### Changed | ||
### Fixed | ||
|
||
## [0.1.0] - 2024-03-01 | ||
|
||
### Added | ||
- Add initial version to GitHub |
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,53 @@ | ||
clean: clean-build clean-pyc clean-test ## remove all build, docs, test, coverage and Python artifacts | ||
|
||
clean-build: ## remove build artifacts | ||
@echo "> Clean Build Artifacts" | ||
@rm -fr build/ | ||
@rm -fr dist/ | ||
@rm -fr .eggs/ | ||
@find . \( -path ./env -o -path ./venv -o -path ./.env -o -path ./.venv \) -prune -o -name '*.egg-info' -exec rm -fr {} + | ||
@find . \( -path ./env -o -path ./venv -o -path ./.env -o -path ./.venv \) -prune -o -name '*.egg' -exec rm -f {} + | ||
|
||
clean-pyc: ## remove Python file artifacts | ||
@echo "> Clean Python Artifacts" | ||
@find . -name '*.pyc' -exec rm -f {} + | ||
@find . -name '*.pyo' -exec rm -f {} + | ||
@find . -name '*~' -exec rm -f {} + | ||
@find . -name '__pycache__' -exec rm -fr {} + | ||
|
||
clean-test: ## remove test and coverage artifacts | ||
@echo "> Clean Tests" | ||
@rm -f .coverage | ||
@rm -fr htmlcov/ | ||
@rm -fr .pytest_cache | ||
@rm -fr .mypy_cache | ||
|
||
format: # Format code with black and isort | ||
@echo ">> Formatting with black" | ||
@black . | ||
@echo ">> Formatting with isort" | ||
@isort src | ||
@isort tests | ||
|
||
lint: # Linting with flake8 and type checking with mypy | ||
@echo ">> Linting with flake8" | ||
@flake8 src | ||
@flake8 tests | ||
@echo ">> Type Checking with mypy" | ||
@mypy --install-types --non-interactive --ignore-missing-imports --disallow-untyped-defs src | ||
@mypy --install-types --non-interactive --ignore-missing-imports --disallow-untyped-defs tests | ||
|
||
notice: | ||
@echo "> Fill NOTICE" | ||
@pigar generate | ||
@liccheck -s liccheck_strategy.ini | ||
@pip-licenses --from=mixed > NOTICE | ||
|
||
security: | ||
@echo "> Check Security" | ||
@pip-audit -s osv --local --desc=on | ||
|
||
test: clean | ||
@echo "> Pass Tests" | ||
@pytest . --junitxml=build/reports/tests.xml --cov=src/matbexp --cov-report=term-missing --cov-report=xml:build/reports/coverage.xml --cov-report=html:build/reports/cov --cov-branch -rsx | ||
@xdoctest matbexp |
Oops, something went wrong.