Skip to content

Commit 91a81b9

Browse files
committed
🎉 Initial
0 parents  commit 91a81b9

22 files changed

+758
-0
lines changed

.github/workflows/main.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
"on":
3+
push:
4+
paths-ignore:
5+
- "**.md"
6+
- docs/*
7+
pull_request:
8+
paths-ignore:
9+
- "**.md"
10+
- docs/*
11+
workflow_dispatch:
12+
13+
# https://github.com/softprops/action-gh-release/issues/236
14+
permissions:
15+
contents: write
16+
17+
env:
18+
python-version: 3.x
19+
cache: pip
20+
21+
jobs:
22+
test:
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
runs-on:
27+
- ubuntu-latest
28+
- macos-latest
29+
# - windows-latest
30+
runs-on: ${{ matrix.runs-on }}
31+
steps:
32+
- uses: actions/checkout@v3
33+
- uses: actions/setup-python@v4
34+
with:
35+
python-version: ${{ env.python-version }}
36+
cache: ${{ env.cache }}
37+
cache-dependency-path: |-
38+
requirements/dev.txt
39+
- name: Install dependencies
40+
run: |
41+
pip install -e '.[dev]'
42+
- name: Test for Linux and macOS
43+
if: runner.os != 'Windows'
44+
run: |
45+
pre-commit run -a
46+
build:
47+
needs: test
48+
strategy:
49+
fail-fast: false
50+
matrix:
51+
runs-on:
52+
- ubuntu-latest
53+
- macos-latest
54+
- windows-latest
55+
runs-on: ${{ matrix.runs-on }}
56+
steps:
57+
- uses: actions/checkout@v3
58+
- uses: actions/setup-python@v4
59+
with:
60+
python-version: ${{ env.python-version }}
61+
cache: ${{ env.cache }}
62+
cache-dependency-path: |-
63+
requirements/dev.txt
64+
- name: Install dependencies
65+
run: |
66+
pip install build
67+
- name: Build
68+
run: |
69+
python -m build
70+
- uses: actions/upload-artifact@v3
71+
if: runner.os == 'Linux' && ! startsWith(github.ref, 'refs/tags/')
72+
with:
73+
path: |
74+
dist/*
75+
build/resources/*
76+
- uses: softprops/action-gh-release@v1
77+
if: runner.os == 'Linux' && startsWith(github.ref, 'refs/tags/')
78+
with:
79+
files: |
80+
dist/*
81+
build/resources/*
82+
- uses: pypa/gh-action-pypi-publish@release/v1
83+
if: runner.os == 'Linux' && startsWith(github.ref, 'refs/tags/')
84+
with:
85+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
_version.py
2+
_metainfo.py
3+
4+
# create by https://github.com/iamcco/coc-gitignore (Thu Jan 12 2023 03:10:56 GMT+0800 (China Standard Time))
5+
# Python.gitignore:
6+
# Byte-compiled / optimized / DLL files
7+
__pycache__/
8+
*.py[cod]
9+
*$py.class
10+
11+
# C extensions
12+
*.so
13+
14+
# Distribution / packaging
15+
.Python
16+
build/
17+
develop-eggs/
18+
dist/
19+
downloads/
20+
eggs/
21+
.eggs/
22+
lib/
23+
lib64/
24+
parts/
25+
sdist/
26+
var/
27+
wheels/
28+
pip-wheel-metadata/
29+
share/python-wheels/
30+
*.egg-info/
31+
.installed.cfg
32+
*.egg
33+
MANIFEST
34+
35+
# PyInstaller
36+
# Usually these files are written by a python script from a template
37+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
38+
*.manifest
39+
*.spec
40+
41+
# Installer logs
42+
pip-log.txt
43+
pip-delete-this-directory.txt
44+
45+
# Unit test / coverage reports
46+
htmlcov/
47+
.tox/
48+
.nox/
49+
.coverage
50+
.coverage.*
51+
.cache
52+
nosetests.xml
53+
coverage.xml
54+
*.cover
55+
.hypothesis/
56+
.pytest_cache/
57+
58+
# Translations
59+
*.mo
60+
*.pot
61+
62+
# Django stuff:
63+
*.log
64+
local_settings.py
65+
db.sqlite3
66+
db.sqlite3-journal
67+
68+
# Flask stuff:
69+
instance/
70+
.webassets-cache
71+
72+
# Scrapy stuff:
73+
.scrapy
74+
75+
# Sphinx documentation
76+
docs/_build/
77+
78+
# PyBuilder
79+
target/
80+
81+
# Jupyter Notebook
82+
.ipynb_checkpoints
83+
84+
# IPython
85+
profile_default/
86+
ipython_config.py
87+
88+
# pyenv
89+
.python-version
90+
91+
# pipenv
92+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
94+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
95+
# install all needed dependencies.
96+
#Pipfile.lock
97+
98+
# celery beat schedule file
99+
celerybeat-schedule
100+
101+
# SageMath parsed files
102+
*.sage.py
103+
104+
# Environments
105+
.env
106+
.venv
107+
env/
108+
venv/
109+
ENV/
110+
env.bak/
111+
venv.bak/
112+
113+
# Spyder project settings
114+
.spyderproject
115+
.spyproject
116+
117+
# Rope project settings
118+
.ropeproject
119+
120+
# mkdocs documentation
121+
/site
122+
123+
# mypy
124+
.mypy_cache/
125+
.dmypy.json
126+
dmypy.json
127+
128+
# Pyre type checker
129+
.pyre/

.gitlint

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env -S gitlint -C
2+
[ignore-by-title]
3+
regex=.*
4+
ignore=body-is-missing
5+
# ex: filetype=dosini

.pre-commit-config.yaml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
#!/usr/bin/env -S pre-commit run -ac
2+
---
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.4.0
6+
hooks:
7+
- id: check-added-large-files
8+
- id: fix-byte-order-marker
9+
- id: check-case-conflict
10+
- id: check-shebang-scripts-are-executable
11+
- id: check-merge-conflict
12+
- id: trailing-whitespace
13+
- id: mixed-line-ending
14+
- id: end-of-file-fixer
15+
exclude: ^templates/class\.txt$
16+
- id: detect-private-key
17+
- id: check-symlinks
18+
- id: check-ast
19+
- id: debug-statements
20+
- id: requirements-txt-fixer
21+
- id: check-xml
22+
- id: check-yaml
23+
- id: check-toml
24+
- id: check-json
25+
- repo: https://github.com/Lucas-C/pre-commit-hooks
26+
rev: v1.3.1
27+
hooks:
28+
- id: remove-crlf
29+
- repo: https://github.com/codespell-project/codespell
30+
rev: v2.2.2
31+
hooks:
32+
- id: codespell
33+
additional_dependencies:
34+
- tomli
35+
- repo: https://github.com/jorisroovers/gitlint
36+
rev: v0.18.0
37+
hooks:
38+
- id: gitlint
39+
args:
40+
- --msg-filename
41+
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
42+
rev: 2.6.2
43+
hooks:
44+
- id: editorconfig-checker
45+
- repo: https://github.com/jumanjihouse/pre-commit-hooks
46+
rev: 3.0.0
47+
hooks:
48+
- id: check-mailmap
49+
- repo: https://github.com/adrienverge/yamllint
50+
rev: v1.28.0
51+
hooks:
52+
- id: yamllint
53+
- repo: https://github.com/executablebooks/mdformat
54+
rev: 0.7.16
55+
hooks:
56+
- id: mdformat
57+
args:
58+
- --number
59+
additional_dependencies:
60+
- mdformat-myst
61+
- mdformat-toc
62+
- mdformat-deflist
63+
- mdformat-beautysh
64+
- mdformat-black
65+
- mdformat-config
66+
- repo: https://github.com/DavidAnson/markdownlint-cli2
67+
rev: v0.6.0
68+
hooks:
69+
- id: markdownlint-cli2
70+
additional_dependencies:
71+
72+
- repo: https://github.com/psf/black
73+
rev: 22.12.0
74+
hooks:
75+
- id: black
76+
- repo: https://github.com/PyCQA/isort
77+
rev: 5.11.4
78+
hooks:
79+
- id: isort
80+
- repo: https://github.com/pycqa/pydocstyle
81+
rev: 6.1.1
82+
hooks:
83+
- id: pydocstyle
84+
additional_dependencies:
85+
- toml
86+
- repo: https://github.com/kumaraditya303/mirrors-pyright
87+
rev: v1.1.286
88+
hooks:
89+
- id: pyright
90+
- repo: https://github.com/PyCQA/bandit
91+
rev: 1.7.4
92+
hooks:
93+
- id: bandit
94+
args:
95+
- -cpyproject.toml
96+
additional_dependencies:
97+
- toml
98+
ci:
99+
skip:
100+
- pyright

.readthedocs.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# https://docs.readthedocs.io/en/stable/config-file/v2.html
2+
---
3+
version: 2
4+
5+
build:
6+
os: ubuntu-22.04
7+
tools:
8+
python: "3"
9+
jobs:
10+
pre_build:
11+
- pip install .
12+
13+
sphinx:
14+
configuration: docs/conf.py
15+
16+
formats:
17+
- pdf
18+
19+
python:
20+
install:
21+
- requirements: docs/requirements.txt

.yamlint.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env -S yamllint -c
2+
---
3+
extends: default
4+
5+
rules:
6+
comments:
7+
# https://github.com/prettier/prettier/issues/6780
8+
min-spaces-from-content: 1

CITATION.cff

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env -S scripts/generate-CITATION.cff.pl pyproject.toml
2+
---
3+
cff-version: 1.2.0
4+
message: If you use this software, please cite it as below.
5+
authors:
6+
- family-names: Wu
7+
given-names: Zhenyu
8+
orcid: https://orcid.org/0000-0001-6478-9993
9+
title: "python-wakatime: wakatime plugin for python"
10+
date-released: 2023-01-12
11+
url: https://github.com/Freed-Wu/python-wakatime

0 commit comments

Comments
 (0)