Skip to content

Commit 083d6d9

Browse files
committed
Adapt README 'Getting started' section to new envs
1 parent febcf10 commit 083d6d9

1 file changed

Lines changed: 38 additions & 9 deletions

File tree

README.md

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,44 @@ With FineCode you can:
1414

1515
## Getting started: example how to setup linting and formatting in your project
1616

17-
1.1 Install FineCode. The exact command depends on the package manager you are using.
17+
1.1 Install FineCode. We recommend using dependency groups ([PEP-735](https://peps.python.org/pep-0735/)) but not all package managers support them. We will show a recommended way with which you don't need package manager at all, only `pip`, but you can adapt it also for package manager used in your project.
1818

19-
`pip install finecode`
19+
1.1.1 Add `dev_workspace` dependency group to `pyproject.toml`:
2020

21-
1.2 Create `finecode.sh` in root of your project with path to python executable from virtualenv of the project. We recommend also to add it to .gitignore. Example:
21+
```toml
22+
[dependency-groups]
23+
dev_workspace = ["finecode==0.2.*"]
24+
```
2225

23-
`.venv/bin/python`
26+
1.1.2 Create dev_workspace venv: `python -m venv .venvs/dev_workspace` (https://docs.python.org/3/library/venv.html#creating-virtual-environments )
2427

25-
1.3 Using existing preset
28+
1.1.3 Activate this venv and install dependencies from `dev_workspace` group:
29+
```
30+
source .venvs/dev_workspace/bin/activate
31+
python -m pip install --group="dev_workspace"
32+
```
2633

27-
Install package with the preset, for example:
34+
NOTE: `pip install` supports `--group` parameter since pip 25.1. Make sure you have new enough version, otherwise update it: `python -m pip install --upgrade pip`.
2835

29-
`pip install fine_python_recommended`
36+
1.2 Using existing preset
37+
38+
1.2.1 Add `dev_no_runtime` dependency group and put `fine_python_recommended` dependency in it:
39+
40+
```toml
41+
[dependency-groups]
42+
dev_workspace = ["finecode==0.2.*"]
43+
dev_no_runtime = ["fine_python_recommended==0.1.*"]
44+
```
3045

3146
For list of presets from FineCode authors see 'Presets' section below.
3247

33-
1.4 Enable finecode and preset
48+
1.2.1 Run `prepare_env` finecode action:
49+
50+
```bash
51+
python -m finecode run prepare_env
52+
```
53+
54+
1.3 Enable finecode and preset
3455

3556
```toml
3657
[tool.finecode]
@@ -39,7 +60,15 @@ presets = [
3960
]
4061
```
4162

42-
1.5 For integration with VSCode, install [FineCode extension](https://github.com/finecode-dev/finecode-vscode)
63+
1.4 That's it! Now you can lint and format your codebase by running `lint` and `format` actions(see 'IDE Integration' and 'CLI' sections for more details).
64+
65+
You can customize preset, create your own, implement own actions, action handlers and more. All these possibilities are explained in details below.
66+
67+
## IDE Integration
68+
69+
### VSCode
70+
71+
For integration with VSCode, install [FineCode extension](https://github.com/finecode-dev/finecode-vscode)
4372

4473
## CLI
4574

0 commit comments

Comments
 (0)