8000 Update docs to latest practices (#40) · realpython/codetiming@1785001 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1785001

Browse files
authored
Update docs to latest practices (#40)
* Update changelog with project changes * Update contributing guidelines to include flake8 and isort
1 parent d859e48 commit 1785001

File tree

5 files changed

+32
-12
lines changed

5 files changed

+32
-12
lines changed

AUTHORS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Authors and Contributors
22

3-
`codetiming` is written and maintained by the [_Real Python_ team](https://realpython.com/team/).
3+
`codetiming` is written and maintained by the [Real Python team](https://realpython.com/team/).
44

55

66
## Author and Maintainer

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1111

1212
- A `py.typed` file to mark `codetiming` as typed as specified in [PEP 561](https://peps.python.org/pep-0561/#packaging-type-information) (by [@alkatar21](https://github.com/alkatar21) in [#38])
1313

14+
### Changed
15+
16+
- Use GitHub Actions instead of CircleCI for CI ([#33])
17+
- Explicitly support Python 3.10 and 3.11 ([#32], [#34], [#35])
1418

1519
## [1.3.0] - 2021-02-09
1620

@@ -61,4 +65,8 @@ Initial version of `codetiming`. Version 1.0.0 corresponds to the code in the tu
6165
[#27]: https://github.com/realpython/codetiming/pull/27
6266
[#29]: https://github.com/realpython/codetiming/issues/29
6367
[#30]: https://github.com/realpython/codetiming/pull/30
68+
[#32]: https://github.com/realpython/codetiming/pull/32
69+
[#33]: https://github.com/realpython/codetiming/pull/33
70+
[#34]: https://github.com/realpython/codetiming/pull/34
71+
[#35]: https://github.com/realpython/codetiming/pull/35
6472
[#38]: https://github.com/realpython/codetiming/pull/38

CONTRIBUTING.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,27 +47,39 @@ Run tests using [`tox`](https://tox.readthedocs.io/). `tox` helps to enforce the
4747

4848
- Consistent code style using [`black`](https://black.readthedocs.io). You can automatically format your code as follows:
4949

50-
```
51-
$ black codetiming/
50+
```console
51+
$ python -m black codetiming/ tests/
5252
```
5353

5454
- Static type hinting using [`mypy`](http://mypy-lang.org/). Test your type hints as follows:
5555

56-
```
56+
```console
5757
$ mypy --strict codetiming/
5858
```
5959

6060
See Real Python's [Python Type Checking guide](https://realpython.com/python-type-checking/) for more information.
6161

6262
- Unit testing using [`pytest`](https://docs.pytest.org/). You can run your tests and see a coverage report as follows:
6363

64-
```
64+
```console
6565
$ pytest --cov=codetiming --cov-report=term-missing
6666
```
6767

68-
- All modules, functions, classes, and methods must have docstrings. This is enforced by [Interrogation](https://interrogate.readthedocs.io/). You can test compliance as follows:
68+
- Code issues are checked with the [flake8]() linter. You can run flake8 manually as follows:
69+
70+
```console
71+
$ python -m flake8 codetiming/ tests/
72+
```
73+
74+
- Imports are sorted consistently using [isort](https://pycqa.github.io/isort/). You can automatically sort your imports as follows:
6975

76+
```console
77+
$ python -m isort codetiming/ tests/
7078
```
79+
80+
- All modules, functions, classes, and methods must have docstrings. This is enforced by [Interrogation](https://interrogate.readthedocs.io/). You can test compliance as follows:
81+
82+
```console
7183
$ interrogate -c pyproject.toml -vv
7284
```
7385

tests/test_codetiming.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@
2323

2424
def waste_time(num=1000):
2525
"""Just waste a little bit of time"""
26-
sum(n ** 2 for n in range(num))
26+
sum(n**2 for n in range(num))
2727

2828

2929
@Timer(text=TIME_MESSAGE)
3030
def decorated_timewaste(num=1000):
3131
"""Just waste a little bit of time"""
32-
sum(n ** 2 for n in range(num))
32+
sum(n**2 for n in range(num))
3333

3434

3535
@Timer(name="accumulator", text=TIME_MESSAGE)
3636
def accumulated_timewaste(num=1000):
3737
"""Just waste a little bit of time"""
38-
sum(n ** 2 for n in range(num))
38+
sum(n**2 for n in range(num))
3939

4040

4141
class CustomLogger:

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ deps =
2020
isort
2121
mypy
2222
commands =
23-
{envpython} -m black --check --quiet codetiming/
24-
{envpython} -m flake8 codetiming/
23+
{envpython} -m black --check --quiet codetiming/ tests/
24+
{envpython} -m flake8 codetiming/ tests/
2525
{envpython} -m interrogate --quiet --config=pyproject.toml
26-
{envpython} -m isort --check codetiming/
26+
{envpython} -m isort --check codetiming/ tests/
2727
{envpython} -m mypy --strict codetiming/

0 commit comments

Comments
 (0)
0