-
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
0 parents
commit 207a2ed
Showing
27 changed files
with
1,419 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 @@ | ||
kcalc/_version.py export-subst |
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,49 @@ | ||
name: Bug report | ||
description: Create a bug report | ||
labels: ["bug"] | ||
body: | ||
|
||
- type: textarea | ||
id: context | ||
attributes: | ||
label: Context | ||
description: >- | ||
Optional context about what you are / were trying to do when you found this | ||
bug. You can leave this field empty if the context is not relevant. | ||
- type: textarea | ||
id: description | ||
attributes: | ||
label: Description | ||
description: >- | ||
A clear and concise description of what the bug is. | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: reproduction | ||
attributes: | ||
label: Reproduction | ||
description: >- | ||
A minimal runnable example that showcases the bug. | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: output | ||
attributes: | ||
label: Output | ||
description: >- | ||
The logs / error message(s) that you are seeing, if any. The more verbose the better! | ||
validations: | ||
required: false | ||
|
||
- type: textarea | ||
id: version | ||
attributes: | ||
label: Version | ||
description: >- | ||
The version (either a git commit hash or the release version) of the package | ||
that you are using. | ||
validations: | ||
required: true |
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,40 @@ | ||
name: Feature request | ||
description: Request a new feature | ||
labels: ["enhancement"] | ||
body: | ||
|
||
- type: textarea | ||
id: context | ||
attributes: | ||
label: Context | ||
description: >- | ||
Optional context about what you are trying to do. | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: description | ||
attributes: | ||
label: Description | ||
description: >- | ||
A clear and concise description of the feature you would like to see. | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: alternatives | ||
attributes: | ||
label: Alternatives | ||
description: >- | ||
Alternatives or workarounds you've considered. | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: additional-context | ||
attributes: | ||
label: Additional Context | ||
description: >- | ||
Any other context or screenshots about the feature request that might be relevant. | ||
validations: | ||
required: false |
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,6 @@ | ||
## Description | ||
|
||
<!--- Provide a brief description of the PR's purpose here. --> | ||
|
||
## Status | ||
- [ ] Ready to go |
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,35 @@ | ||
name: CI | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: { branches: [ "main" ] } | ||
pull_request: { branches: [ "main" ] } | ||
|
||
jobs: | ||
test: | ||
|
||
runs-on: ubuntu-latest | ||
container: condaforge/mambaforge:latest | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- name: Run CI | ||
run: | | ||
apt update && apt install -y git make | ||
make env | ||
make lint | ||
make test | ||
make docs-build | ||
- name: CodeCov | ||
uses: codecov/[email protected] | ||
with: | ||
file: ./coverage.xml | ||
flags: unittests |
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,47 @@ | ||
name: Publish Documentation | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
tags: ["*"] | ||
|
||
jobs: | ||
deploy-docs: | ||
|
||
runs-on: ubuntu-latest | ||
container: condaforge/mambaforge:latest | ||
|
||
steps: | ||
- name: Prepare container | ||
run: | | ||
apt update && apt install -y git make | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Determine Version | ||
shell: bash | ||
run: | | ||
if [ "$GITHUB_REF" = "refs/heads/main" ]; then | ||
echo "VERSION=latest" >> $GITHUB_ENV | ||
elif [ "${GITHUB_REF#refs/tags/}" != "$GITHUB_REF" ]; then | ||
VERSION=$(echo $GITHUB_REF | sed 's/refs\/tags\///') | ||
echo "VERSION=$VERSION stable" >> $GITHUB_ENV | ||
else | ||
echo "Invalid ref: $GITHUB_REF" | ||
exit 1 | ||
fi | ||
- name: Build and Deploy Documentation | ||
env: | ||
INSIDER_DOCS_TOKEN: ${{ secrets.INSIDER_DOCS_TOKEN }} | ||
run: | | ||
git config --global user.name 'GitHub Actions' | ||
git config --global user.email '[email protected]' | ||
git config --global --add safe.directory "$PWD" | ||
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | ||
git fetch --all --prune | ||
make env | ||
make docs-deploy VERSION="$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,115 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
.pytest_cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# dotenv | ||
.env | ||
|
||
# virtualenv | ||
.venv | ||
venv/ | ||
ENV/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
# profraw files from LLVM? Unclear exactly what triggers this | ||
# There are reports this comes from LLVM profiling, but also Xcode 9. | ||
*profraw | ||
|
||
# PyCharm | ||
.idea | ||
|
||
# OSX | ||
.DS_Store | ||
|
||
# Linters | ||
.ruff_cache |
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,15 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.2.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
|
||
- repo: local | ||
hooks: | ||
- id: ruff | ||
name: Autoformat python code | ||
language: system | ||
entry: ruff | ||
args: [check] | ||
files: \.py$ |
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 @@ | ||
|
||
MIT License | ||
|
||
Copyright (c) 2024 Julien | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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 @@ | ||
global-exclude *.py[cod] __pycache__ *.so |
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,35 @@ | ||
PACKAGE_NAME := kcalc | ||
PACKAGE_DIR := kcalc | ||
|
||
CONDA_ENV_RUN = conda run --no-capture-output --name $(PACKAGE_NAME) | ||
|
||
TEST_ARGS := -v --cov=$(PACKAGE_NAME) --cov-report=term --cov-report=xml --junitxml=unit.xml --color=yes | ||
|
||
.PHONY: env lint format test docs-build docs-deploy | ||
|
||
env: | ||
mamba create --name $(PACKAGE_NAME) | ||
mamba env update --name $(PACKAGE_NAME) --file devtools/envs/base.yaml | ||
$(CONDA_ENV_RUN) pip install --no-deps -e . | ||
$(CONDA_ENV_RUN) pre-commit install || true | ||
|
||
lint: | ||
$(CONDA_ENV_RUN) ruff check $(PACKAGE_DIR) | ||
|
||
format: | ||
$(CONDA_ENV_RUN) ruff format $(PACKAGE_DIR) | ||
$(CONDA_ENV_RUN) ruff check --fix --select I $(PACKAGE_DIR) | ||
|
||
test: | ||
$(CONDA_ENV_RUN) pytest -v $(TEST_ARGS) $(PACKAGE_DIR)/tests/ | ||
|
||
docs-build: | ||
$(CONDA_ENV_RUN) mkdocs build | ||
|
||
docs-deploy: | ||
ifndef VERSION | ||
$(error VERSION is not set) | ||
endif | ||
$(CONDA_ENV_RUN) mike deploy --push --update-aliases $(VERSION) | ||
|
||
|
Oops, something went wrong.