Skip to content

Commit 5c01a6a

Browse files
authored
Merge pull request #35 from pomponchik/develop
0.0.24
2 parents 108b08c + 23ec537 commit 5c01a6a

File tree

12 files changed

+153
-10
lines changed

12 files changed

+153
-10
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 this test in such a way that it reproduces the bug you found and does not pass:
18+
19+
```python
20+
def test_your_bug():
21+
...
22+
```
23+
24+
Writing the test, please keep 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 here the steps to reproduce it.
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 it, or change it?
17+
18+
19+
## Where?
20+
21+
Specify which part of the documentation you want to make a change to? For example, the name of an existing documentation section or the line number in a file `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 alternatives to this behavior you have considered. And finally, how do you propose to test the correctness of the implementation of your idea, 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: guestion
6+
assignees: pomponchik
7+
8+
---
9+
10+
## Your question
11+
12+
Here you can freely describe your question about the project. Please, before doing this, read the documentation provided, and ask the question only if the necessary answer is not there. In addition, please keep in mind that this is a free non-commercial project and user support is optional for its author. The response time is not guaranteed in any way.

.github/workflows/lint.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ jobs:
3131
shell: bash
3232
run: mypy cantok --strict
3333

34+
- name: Run mypy for tests
35+
shell: bash
36+
run: mypy tests
37+
3438
- name: Run ruff
3539
shell: bash
3640
run: ruff cantok
41+
42+
- name: Run ruff for tests
43+
shell: bash
44+
run: ruff tests

.github/workflows/tests_and_coverage.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Tests
1+
name: New tests
22

33
on:
44
push
@@ -9,8 +9,8 @@ jobs:
99
runs-on: ${{ matrix.os }}
1010
strategy:
1111
matrix:
12-
os: [macos-13, ubuntu-latest, windows-latest]
13-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
12+
os: [macos-latest, ubuntu-latest, windows-latest]
13+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
1414

1515
steps:
1616
- uses: actions/checkout@v2
@@ -43,3 +43,6 @@ jobs:
4343
find . -iregex "codecov.*"
4444
chmod +x codecov
4545
./codecov -t ${CODECOV_TOKEN}
46+
47+
- name: Run tests and show the branch coverage on the command line
48+
run: coverage run --branch --source=cantok --omit="*tests*" -m pytest --cache-clear --assert=plain && coverage report -m
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Old tests
2+
3+
on:
4+
push
5+
6+
jobs:
7+
build:
8+
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
os: [macos-13, ubuntu-latest, windows-latest]
13+
python-version: ['3.7']
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v3
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Install the library
23+
shell: bash
24+
run: pip install .
25+
26+
- name: Install dependencies
27+
shell: bash
28+
run: pip install -r requirements_dev.txt
29+
30+
- name: Print all libs
31+
shell: bash
32+
run: pip list
33+
34+
- name: Run tests and show coverage on the command line
35+
run: coverage run --source=cantok --omit="*tests*" -m pytest --cache-clear --assert=plain && coverage report -m
36+
37+
- name: Upload reports to codecov
38+
env:
39+
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
40+
if: runner.os == 'Linux'
41+
run: |
42+
curl -Os https://uploader.codecov.io/latest/linux/codecov
43+
find . -iregex "codecov.*"
44+
chmod +x codecov
45+
./codecov -t ${CODECOV_TOKEN}
46+
47+
- name: Run tests and show the branch coverage on the command line
48+
run: coverage run --branch --source=cantok --omit="*tests*" -m pytest --cache-clear --assert=plain && coverage report -m

docs/types_of_tokens/DefaultToken.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
`DefaultToken` is a type of token that cannot be revoked. Otherwise, it behaves like a regular token, but if you try to cancel it, you will get an exception:
1+
`DefaultToken` is a type of token that cannot be cancelled. Otherwise, it behaves like a regular token, but if you try to cancel it, you will get an exception:
22

33
```python
44
from cantok import AbstractToken, DefaultToken

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "cantok"
7-
version = "0.0.23"
7+
version = "0.0.24"
88
authors = [
99
{ name="Evgeniy Blinov", email="zheni-b@yandex.ru" },
1010
]

tests/units/test_errors.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import pytest
2-
3-
from cantok import AbstractToken, SimpleToken, ConditionToken, TimeoutToken, CounterToken, DefaultToken
1+
from cantok import SimpleToken, ConditionToken, TimeoutToken, CounterToken, DefaultToken
42
from cantok import CancellationError, ConditionCancellationError, TimeoutCancellationError, CounterCancellationError, ImpossibleCancelError
53

64

0 commit comments

Comments
 (0)