Skip to content

Commit 92a66c4

Browse files
authored
Update readme (#9)
* Install optional pyenv * Improve readability * Improve wordings
1 parent 975c370 commit 92a66c4

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

README.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,30 +46,36 @@ This will resolve package dependencies and install it in poetry managed virtual
4646
$ poetry install
4747
```
4848

49+
### (Optional) Install Pyenv
50+
> pyenv lets you easily switch between multiple versions of Python.
51+
It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well.
52+
53+
As quoted pyenv readme demonstrates, It provide us handy python version management.
54+
4955
### Configuration
5056

5157
#### pyproject.toml
5258
This file contains build system requirements and information, which are used by poetry to build the package.
5359
We tried to gather every package related settings as much as possible here.
54-
Through this design decision, project could keep configuration files as little as possible.
60+
Through this design decision, project could remove package dependant configuration files like `.isort.cfg`, `pytest.ini`, etc.
5561

5662
- **[tool.poetry]**: Describe package's metadata. Including package name, versions, dscription, authors etc.
5763
- **[tool.poetry.dependencies]**, **[tool.poetry.dev-dependencies]**: Manage package's dependencies. Poetry will check this section to resolve requirements version.
5864
- **[build-system]**: Define how to build package. Generally no need to edit this section.
5965
- **[tool.isort]**, **[tool.black]**: By Editing this part, you can set how linting library should work.
6066
- **[tool.pytest.ini_options]**: pytest configuration.
6167

62-
We suggest edit every setting above to represent your project better except **[build-system]**.
68+
Except **[build-system]**, We suggest you to update every settings above.
6369

6470
#### .github/workflows/ci.yml
65-
We choose GitHub action as Continuous Integration tool. It consists package-build, unittest, and lint.
66-
Each jobs works concurrently at different virtual machines.
71+
We choose GitHub action as Continuous Integration tool. It contains package-build, unittest, and lint job.
72+
Each job works concurrently on different virtual machines.
6773

68-
- **package-build**: Utilizes tox to test package against multiple python versions.
74+
- **package-build**: Use tox to test package against multiple python versions.
6975
- **unittest**: Test code and report coverage using pytest and codecov.
7076
- **lint**: Lint code using flake, isort, black.
7177

72-
Change `python-version` value in this file according to package compatible python versions. Versions should be same as pyproject.toml.
78+
Change `python-version` value in this file according to package compatible python versions which configured at `pyproject.toml`.
7379

7480
#### tox.ini
7581
Tox runs test against packages which built in isolated virtual environment.
@@ -83,17 +89,17 @@ According to package's python compatible versions, **[tox.envlist]** and **[gh-a
8389
#### Source code
8490
Make your own named package in src directory.
8591

86-
NOTE: package setting in pyproject.toml should be changed as you create your own package.
92+
**NOTE**: package setting in `pyproject.toml` should be changed as you set up your own package.
8793
```
8894
packages = [
8995
{ include = "{your-python-package-name}", from = "src" },
9096
]
9197
```
9298

9399
#### Test Code
94-
Every test code should reside in `tests` package at project root.
100+
Every test code should resides in `tests` package at project root.
95101

96-
Test your code in local machine. you can just simply use 'pytest' or 'tox'.
102+
To test your source code, simply use 'pytest' or 'tox'.
97103
```
98104
# Use pytest
99105
$ pytest tests/
@@ -111,7 +117,7 @@ Detailed explanation about stacks used in this template is covered in this secti
111117
This template repository follows src layout style. As the name suggests, its distinctive feature is subdirectory named `src`.
112118
Main python packages lives inside `src` directory.
113119

114-
To tests python package strictly. Testing should be done against built package. not from the source code itself.
120+
To tests python built package. Testing should be done against built package. not from the source code itself.
115121
Src layout helps to achieve this condition. By separating source code from project root, It prevents test code to import source code.
116122

117123
This layout is better explained in this [blog post by Ionel Cristian Mărieș](https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure).
@@ -141,13 +147,13 @@ It demonstrates how draft should be presented.
141147
[Pytest](https://github.com/pytest-dev/pytest/) is our main test runner.
142148

143149
### Linting
144-
Code is double-checked while development process. One at commit time, and the other at CI process.
150+
Code is double-checked during development process. One at commit phase, and the other at CI process.
145151

146152
[pre-commit](https://pre-commit.com/) is help us to check at commit time. By executing installation command `pre-commit install`,
147153
It automatically adds pre commit hooks. Types of hook are managed using `.pre-commit-config.yaml`.
148154

149155
### Coverage
150-
Coverage of test functions is one of important metrics deciding code quality.
156+
Coverage of test functions is one of important metrics which decides code quality.
151157
GitHub actions `ci.yml` workflow's unittest job is control coverage report.
152158

153159
We suggest to install Codecov GitHub App which can manage coverage of repository.

0 commit comments

Comments
 (0)