Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit 690f83e

Browse files
authored
[2023.10.1] Release (#113)
2 parents b2f2737 + 3777afc commit 690f83e

36 files changed

+1139
-789
lines changed

.github/workflows/linter.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Linter check
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
- devel
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up Python 3.10
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: "3.10"
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install tox tox-gh-actions
26+
- name: Run tox
27+
run: tox -e pylint

.github/workflows/run_tests.yml renamed to .github/workflows/pytest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run tests, checkers and linters with Tox
1+
name: Tests
22

33
on:
44
push:
@@ -28,4 +28,4 @@ jobs:
2828
python -m pip install --upgrade pip
2929
pip install tox tox-gh-actions
3030
- name: Run tox
31-
run: tox
31+
run: tox -e py

.github/workflows/sonarcloud.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Collect coverage report for SonarCloud
1+
name: SonarCloud check
22

33
on:
44
push:
@@ -47,7 +47,7 @@ jobs:
4747
-Dsonar.projectKey=edu-python-course_problem-sets
4848
-Dsonar.organization=edu-python-course
4949
-Dsonar.python.coverage.reportPaths=coverage.xml -X
50-
-Dsonar.coverage.exclusions=**/scripts/**,**/__init__,**/__main__,**/tests/** -X
50+
-Dsonar.coverage.exclusions=**/scripts/**,**/__init__*,**/__main__*,**/tests/** -X
5151
env:
5252
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
5353
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/type_check.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Types checker
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
- devel
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up Python 3.10
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: "3.10"
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install tox tox-gh-actions
26+
- name: Run tox
27+
run: tox -e mypy

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Python training course authors and contributors
3+
Copyright (c) 2023 Python training course authors and contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
.. |pytest| image:: https://github.com/edu-python-course/problem-sets/actions/workflows/pytest.yml/badge.svg
2+
.. |pylint| image:: https://github.com/edu-python-course/problem-sets/actions/workflows/linter.yml/badge.svg
3+
.. |mypy| image:: https://github.com/edu-python-course/problem-sets/actions/workflows/type_check.yml/badge.svg
4+
.. |sonarcloud| image:: https://github.com/edu-python-course/problem-sets/actions/workflows/sonarcloud.yml/badge.svg
5+
16
###############################################################################
27
PYTHON TRAINING COURSE: PROBLEM SETS
38
###############################################################################
49

5-
.. image:: https://github.com/edu-python-course/problem-sets/actions/workflows/tests.yml/badge.svg
10+
|pytest| |sonarcloud|
611

712
This repository contains various problem sets (aka tasks or challenges) for
813
the `Python training course`_. These challenges will help you to improve your
@@ -103,3 +108,8 @@ There are two major directories: **src** and **tests**. Any useful code should
103108
be included to the source (src). Test cases for functions, classes etc. should
104109
lie inside of tests directory. It's ok to created nested packages within these
105110
directories if needed.
111+
112+
Contributing
113+
============
114+
115+
For more details refer to `contributing guide <./.github/CONTRIBUTING.md>`_.

poetry.lock

Lines changed: 255 additions & 255 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "problem-sets"
7-
version = "2023.09.1"
7+
version = "2023.10.1"
88
description = "Challenges and solutions for the Python training course"
99
license = "MIT"
1010
authors = [
@@ -43,8 +43,8 @@ packages = [
4343
{ include = "conv_store", from = "src" },
4444
{ include = "datasets", from = "src" },
4545
{ include = "dynamic", from = "src" },
46-
{ include = "geom", from = "src" },
4746
{ include = "primes", from = "src" },
47+
{ include = "quiz", from = "src" },
4848
{ include = "sequences", from = "src" },
4949
{ include = "sorting", from = "src" },
5050
{ include = "wtk", from = "src" },
@@ -71,9 +71,8 @@ relative_files = true
7171
branch = true
7272
source = ["src"]
7373
omit = [
74-
"**/__init__",
75-
"**/__main__",
76-
"**/scripts/**",
74+
"**/__init__.py",
75+
"**/__main__.py",
7776
"**/tests/**",
7877
]
7978

@@ -85,11 +84,10 @@ exclude_lines = [
8584

8685
[tool.mypy]
8786
files = "src,tests"
88-
exclude = "scripts"
8987

9088
[tool.pylint."MASTER"]
9189
fail-under = 8
92-
ignore = ["tests", "scripts"]
90+
ignore = ["tests"]
9391
persistent = true
9492

9593
[tool.pylint."MESSAGES CONTROL"]

requirements.txt

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
1-
astroid==2.13.3; python_full_version >= "3.7.2"
2-
attrs==22.2.0; python_version >= "3.7"
3-
cachetools==5.3.0; python_version >= "3.7" and python_version < "4.0"
4-
chardet==5.1.0; python_version >= "3.7"
5-
colorama==0.4.6; sys_platform == "win32" and python_full_version >= "3.7.2" and (python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.7.0" and python_version >= "3.7") and (python_version >= "3.7" and python_full_version < "3.0.0" and sys_platform == "win32" or sys_platform == "win32" and python_version >= "3.7" and python_full_version >= "3.7.0")
6-
coverage==7.1.0; python_version >= "3.7"
7-
dill==0.3.6
8-
distlib==0.3.6; python_version >= "3.7"
9-
exceptiongroup==1.1.0; python_version < "3.11" and python_version >= "3.7"
10-
filelock==3.9.0; python_version >= "3.7"
11-
iniconfig==2.0.0; python_version >= "3.7"
12-
isort==5.12.0; python_full_version >= "3.8.0"
13-
lazy-object-proxy==1.9.0; python_version >= "3.7" and python_full_version >= "3.7.2"
14-
mccabe==0.7.0; python_version >= "3.6" and python_full_version >= "3.7.2"
15-
mypy-extensions==0.4.3; python_version >= "3.7"
16-
mypy==0.991; python_version >= "3.7"
17-
packaging==23.0; python_version >= "3.7"
18-
platformdirs==2.6.2; python_version >= "3.7" and python_full_version >= "3.7.2"
19-
pluggy==1.0.0; python_version >= "3.7"
20-
pylint==2.15.10; python_full_version >= "3.7.2"
21-
pyproject-api==1.5.0; python_version >= "3.7"
22-
pytest-cov==4.0.0; python_version >= "3.6"
23-
pytest==7.2.1; python_version >= "3.7"
24-
tomli==2.0.1; python_version < "3.11" and python_version >= "3.7" and python_full_version >= "3.7.2" and python_full_version <= "3.11.0a6"
25-
tomlkit==0.11.6; python_version >= "3.6" and python_full_version >= "3.7.2"
26-
tox==4.4.3; python_version >= "3.7"
27-
typing-extensions==4.4.0; python_version < "3.10" and python_full_version >= "3.7.2" and python_version >= "3.7"
28-
virtualenv==20.17.1; python_version >= "3.7"
29-
wrapt==1.14.1
1+
astroid==2.15.8
2+
cachetools==5.3.1
3+
chardet==5.2.0
4+
colorama==0.4.6
5+
coverage==7.3.2
6+
dill==0.3.7
7+
distlib==0.3.7
8+
exceptiongroup==1.1.3
9+
filelock==3.12.4
10+
iniconfig==2.0.0
11+
isort==5.12.0
12+
lazy-object-proxy==1.9.0
13+
mccabe==0.7.0
14+
mypy==1.6.0
15+
mypy-extensions==1.0.0
16+
packaging==23.2
17+
platformdirs==3.11.0
18+
pluggy==1.3.0
19+
pylint==2.17.7
20+
pyproject-api==1.6.1
21+
pytest==7.4.2
22+
pytest-cov==4.1.0
23+
tomli==2.0.1
24+
tomlkit==0.12.1
25+
tox==4.11.3
26+
typing_extensions==4.8.0
27+
virtualenv==20.24.5
28+
wrapt==1.15.0

src/atm/func.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ def withdraw_rev(target: int,
7979
limited with ``limit`` argument).
8080
8181
Usage:
82-
83-
>>> assert withdraw_rev(0) == []
84-
>>> assert withdraw_rev(14) == [(10, 1), (2, 2)]
85-
>>> assert withdraw_rev(17) == [(9, 1), (4, 2)]
82+
#
83+
# >>> assert withdraw_rev(0) == []
84+
# >>> assert withdraw_rev(14) == [(10, 1), (2, 2)]
85+
# >>> assert withdraw_rev(17) == [(9, 1), (4, 2)]
8686
8787
"""
8888

@@ -103,8 +103,8 @@ def get_total(values: Iterable[Tuple[int, int]]) -> int:
103103
104104
Usage:
105105
106-
>>> assert get_total([(1, 50), (1, 500), (2, 2000), (2, 10000)]) == 24500
107-
>>> assert get_total([(1, 500), (1, 2000), (1, 5000), (1, 10000)]) == 17545
106+
>>> assert get_total([(1, 50), (1, 500), (2, 2000), (2, 10000)]) == 24550
107+
>>> assert get_total([(1, 10000), (1, 5000), (1, 2000), (1, 500)]) == 17500
108108
>>> assert get_total([(1, 2000)]) == 2000
109109
110110
"""

0 commit comments

Comments
 (0)