Skip to content

Commit a08b7bb

Browse files
Евгений БлиновЕвгений Блинов
authored andcommitted
Basic template of the project
1 parent 30e762a commit a08b7bb

File tree

19 files changed

+440
-0
lines changed

19 files changed

+440
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: pomponchik
7+
8+
---
9+
10+
## Short description
11+
12+
Replace this text with a short description of the error and the behavior that you expected to see instead.
13+
14+
15+
## Describe the bug in detail
16+
17+
Please add a test that reproduces the bug (i.e., currently fails):
18+
19+
```python
20+
def test_your_bug():
21+
...
22+
```
23+
24+
When writing the test, please ensure compatibility with the [`pytest`](https://docs.pytest.org/) framework.
25+
26+
If for some reason you cannot describe the error in the test format, describe the steps to reproduce it here.
27+
28+
29+
## Environment
30+
- OS: ...
31+
- Python version (the output of the `python --version` command): ...
32+
- Version of this package: ...
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Documentation fix
3+
about: Add something to the documentation, delete it, or change it
4+
title: ''
5+
labels: documentation
6+
assignees: pomponchik
7+
---
8+
9+
## It's cool that you're here!
10+
11+
Documentation is an important part of the project; we strive to make it high-quality and keep it up to date. Please adjust this template by outlining your proposal.
12+
13+
14+
## Type of action
15+
16+
What do you want to do: remove something, add something, or change something?
17+
18+
19+
## Where?
20+
21+
Specify which part of the documentation you want to change. For example, the name of an existing documentation section or a line number in `README.md`.
22+
23+
24+
## The essence
25+
26+
Please describe the essence of the proposed change.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: pomponchik
7+
8+
---
9+
10+
## Short description
11+
12+
What do you propose and why do you consider it important?
13+
14+
15+
## Some details
16+
17+
If you can, provide code examples that will show how your proposal will work. Also, if you can, indicate which alternative approaches you have considered. And finally, describe how you propose to verify that your idea is implemented correctly, if at all possible.

.github/ISSUE_TEMPLATE/question.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: Question or consultation
3+
about: Ask anything about this project
4+
title: ''
5+
labels: question
6+
assignees: pomponchik
7+
8+
---
9+
10+
## Your question
11+
12+
Here you can freely describe your question about the project. Please read the documentation provided before doing this, and ask the question only if it is not answered there. In addition, please keep in mind that this is a free non-commercial project and user support is optional for its author. Response times are not guaranteed.

.github/workflows/lint.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Lint
2+
3+
on:
4+
push
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 20
15+
strategy:
16+
matrix:
17+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', '3.15.0-alpha.1']
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Set up uv
28+
uses: astral-sh/setup-uv@v7
29+
with:
30+
enable-cache: true
31+
32+
- name: Install dependencies
33+
shell: bash
34+
run: uv pip install --system -r requirements_dev.txt
35+
36+
- name: Install the library
37+
shell: bash
38+
run: uv pip install --system .
39+
40+
- name: Run ruff
41+
shell: bash
42+
run: ruff check microbenchmark
43+
44+
- name: Run ruff for tests
45+
shell: bash
46+
run: ruff check tests
47+
48+
- name: Run mypy
49+
shell: bash
50+
run: >-
51+
mypy
52+
--show-error-codes
53+
--strict
54+
--disallow-any-decorated
55+
--disallow-any-explicit
56+
--disallow-any-expr
57+
--disallow-any-generics
58+
--disallow-any-unimported
59+
--disallow-subclassing-any
60+
--warn-return-any
61+
microbenchmark
62+
63+
- name: Run mypy for tests
64+
shell: bash
65+
run: mypy --exclude '^tests/typing/' tests

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
pypi-publish:
10+
name: upload release to PyPI
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 15
13+
# Specifying a GitHub environment is optional, but strongly encouraged
14+
environment: release
15+
permissions:
16+
# IMPORTANT: this permission is mandatory for trusted publishing
17+
id-token: write
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up Python 3.13
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.13'
25+
26+
- name: Set up uv
27+
uses: astral-sh/setup-uv@v7
28+
with:
29+
enable-cache: true
30+
31+
- name: Install dependencies
32+
shell: bash
33+
run: uv pip install --system -r requirements_dev.txt
34+
35+
- name: Build the project
36+
shell: bash
37+
run: python -m build .
38+
39+
- name: Publish package distributions to PyPI
40+
uses: pypa/gh-action-pypi-publish@release/v1
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Tests
2+
3+
on:
4+
push
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ${{ matrix.os }}
14+
timeout-minutes: 30
15+
strategy:
16+
matrix:
17+
os: [macos-latest, ubuntu-latest, windows-latest]
18+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', '3.15.0-alpha.1']
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Set up uv
28+
uses: astral-sh/setup-uv@v7
29+
with:
30+
enable-cache: true
31+
32+
- name: Install dependencies
33+
shell: bash
34+
run: uv pip install --system -r requirements_dev.txt
35+
36+
- name: Install the library
37+
shell: bash
38+
run: uv pip install --system .
39+
40+
- name: Print all libs
41+
shell: bash
42+
run: uv pip list --system
43+
44+
- name: Run tests and show the branch coverage on the command line
45+
shell: bash
46+
run: |
47+
pth_file="$(python -c 'import sysconfig; print(sysconfig.get_path("purelib"))')/microbenchmark_coverage_process_startup.pth"
48+
printf "import os; os.getenv('COVERAGE_PROCESS_START') and __import__('coverage').process_startup()\n" > "$pth_file"
49+
coverage erase
50+
COVERAGE_PROCESS_START="$PWD/pyproject.toml" coverage run -m pytest -n auto --cache-clear --assert=plain
51+
coverage combine
52+
coverage report -m --fail-under=100 --omit='*tests*'
53+
coverage xml --omit='*tests*'
54+
55+
- name: Upload coverage to Coveralls
56+
if: runner.os == 'Linux' && matrix.python-version == '3.13'
57+
env:
58+
COVERALLS_REPO_TOKEN: ${{secrets.COVERALLS_REPO_TOKEN}}
59+
uses: coverallsapp/github-action@v2
60+
with:
61+
format: cobertura
62+
file: coverage.xml
63+
flag-name: ubuntu-python-3.13-branch
64+
continue-on-error: true

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.DS_Store
2+
__pycache__
3+
venv
4+
.pytest_cache
5+
build
6+
dist
7+
*.egg-info
8+
test.py
9+
.coverage
10+
.coverage.*
11+
.idea
12+
.ruff_cache
13+
.mutmut-cache
14+
.mypy_cache
15+
html
16+
CLAUDE.md
17+
.claude
18+
mutants
19+
planning_features.md
20+
coverage.xml
21+
.qwen
22+
uv.lock

microbenchmark/__init__.py

Whitespace-only changes.

microbenchmark/py.typed

Whitespace-only changes.

0 commit comments

Comments
 (0)