Skip to content

Commit

Permalink
🎉 Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
Freed-Wu committed Dec 3, 2022
0 parents commit d410c5d
Show file tree
Hide file tree
Showing 103 changed files with 5,451 additions and 0 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
"on":
push:
paths-ignore:
- "**.md"
- docs/*
pull_request:
paths-ignore:
- "**.md"
- docs/*
workflow_dispatch:

env:
path: dist/*
python-version: 3.x
cache: pip

jobs:
test:
strategy:
fail-fast: false
matrix:
runs-on:
- ubuntu-latest
- macos-latest
# - windows-latest
neovim:
- true
- false
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: thinca/vim-themis
path: vim-themis
- uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}
cache: ${{ env.cache }}
- uses: rhysd/action-setup-vim@v1
id: vim
with:
neovim: ${{ matrix.neovim }}
- name: Install dependencies
run: |
pip install -e '.[dev]'
- name: Test
env:
THEMIS_VIM: ${{ steps.vim.outputs.executable }}
run: |
make THEMIS=vim-themis/bin/themis test
- uses: codecov/codecov-action@v3
build:
needs: test
strategy:
fail-fast: false
matrix:
runs-on:
- ubuntu-latest
- macos-latest
# - windows-latest
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}
cache: ${{ env.cache }}
- name: Install dependencies
run: |
pip install build
- name: Build
run: |
python -m build
- uses: actions/upload-artifact@v3
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
with:
path: |
${{ env.path }}
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ env.path }}
- uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags/') && runner.os == 'Linux'
with:
password: ${{ secrets.PYPI_API_TOKEN }}
128 changes: 128 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
_version.py

# create by https://github.com/iamcco/coc-gitignore (Sat Nov 26 2022 21:11:16 GMT+0800 (China Standard Time))
# Python.gitignore:
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# 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/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
4 changes: 4 additions & 0 deletions .gitlint
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[ignore-by-title]
regex=.*
ignore=body-is-missing
# ex: filetype=dosini
112 changes: 112 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
exclude: ^assets/txt/.*\.txt$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
- id: fix-byte-order-marker
- id: check-case-conflict
- id: check-shebang-scripts-are-executable
- id: check-merge-conflict
- id: trailing-whitespace
- id: mixed-line-ending
- id: end-of-file-fixer
- id: detect-private-key
- id: check-symlinks
- id: check-ast
- id: debug-statements
- id: requirements-txt-fixer
- id: check-xml
- id: check-yaml
- id: check-toml
- id: check-json
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.3.1
hooks:
- id: remove-crlf
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
- id: codespell
additional_dependencies:
- tomli
- repo: https://github.com/jorisroovers/gitlint
rev: v0.17.0
hooks:
- id: gitlint
args:
- --msg-filename
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2.6.1
hooks:
- id: editorconfig-checker
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: check-mailmap
- repo: https://github.com/adrienverge/yamllint
rev: v1.28.0
hooks:
- id: yamllint
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
hooks:
- id: mdformat
args:
- --number
additional_dependencies:
- mdformat-gfm
- mdformat-myst
- mdformat-tables
- mdformat-toc
- mdformat-footnote
- mdformat-frontmatter
- mdformat-deflist
- mdformat-beautysh
- mdformat-black
- mdformat-config
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.5.1
hooks:
- id: markdownlint-cli2
additional_dependencies:
- markdown-it-texmath@0.9.1
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/pycqa/pydocstyle
rev: 6.1.1
hooks:
- id: pydocstyle
additional_dependencies:
- toml
- repo: https://github.com/kumaraditya303/mirrors-pyright
rev: v1.1.278
hooks:
- id: pyright
- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
hooks:
- id: bandit
args:
- -cpyproject.toml
additional_dependencies:
- toml
- repo: https://github.com/vimjas/vint
rev: v0.4a4
hooks:
- id: vint
- repo: https://github.com/google/vimdoc
rev: v0.7.1
hooks:
- id: vimdoc

ci:
skip:
- pyright
28 changes: 28 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# https://docs.readthedocs.io/en/stable/config-file/v2.html
---
version: 2

build:
os: ubuntu-22.04
apt_packages:
- help2man
- pandoc
- perl
- make
tools:
python: "3"
jobs:
pre_build:
- pip install build
- pip install -e .
- make build

sphinx:
configuration: docs/conf.py

formats:
- pdf

python:
install:
- requirements: docs/requirements.txt
7 changes: 7 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
extends: default

rules:
comments:
# https://github.com/prettier/prettier/issues/6780
min-spaces-from-content: 1

0 comments on commit d410c5d

Please sign in to comment.