You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-27Lines changed: 13 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ Inspired by an [**R** package of the same name](https://usethis.r-lib.org/index.
31
31
- 📢 Fully declarative project configuration.
32
32
- ⚡ Get started on a new Python project or a new workflow in seconds.
33
33
34
-
## 🧭 Getting Started
34
+
## 🧭 Installation
35
35
36
36
First, it is strongly recommended you [install the uv package manager](https://docs.astral.sh/uv/getting-started/installation/): this is a simple, documented process. If you're already using uv, make sure you're using at least
37
37
version v0.6.8 (run `uv --version` to check, and `uv self update` to upgrade).
@@ -110,32 +110,14 @@ Additionally, the command line reference documentation can be viewed with `useth
110
110
111
111
## 💡 Example Usage
112
112
113
-
To start a new project from scratch with a complete set of recommended tooling, run:
113
+
### Starting a new project
114
114
115
-
```console
116
-
$ uvx usethis init
117
-
✔ Writing 'pyproject.toml' and initializing project.
118
-
✔ Writing 'README.md'.
119
-
☐ Populate 'README.md' to help users understand the project.
120
-
✔ Adding recommended documentation tools.
121
-
☐ Run 'uv run mkdocs build' to build the documentation.
122
-
☐ Run 'uv run mkdocs serve' to serve the documentation locally.
123
-
✔ Adding recommended linters.
124
-
☐ Run 'uv run ruff check --fix' to run the Ruff linter with autofixes.
125
-
☐ Run 'uv run deptry src' to run deptry.
126
-
✔ Adding recommended formatters.
127
-
☐ Run 'uv run ruff format' to run the Ruff formatter.
128
-
☐ Run 'uv run pyproject-fmt pyproject.toml' to run pyproject-fmt.
129
-
✔ Adding recommended spellcheckers.
130
-
☐ Run 'uv run codespell' to run the Codespell spellchecker.
131
-
✔ Adding recommended test frameworks.
132
-
☐ Add test files to the '/tests' directory with the format 'test_*.py'.
133
-
☐ Add test functions with the format 'test_*()'.
134
-
☐ Run 'uv run pytest' to run the tests.
135
-
☐ Run 'uv run pytest --cov' to run your tests with Coverage.py.
136
-
```
115
+
To start a new project from scratch with a complete set of recommended tooling, simply run
116
+
the `uvx usethis init` command.
117
+
118
+
### Configuring individual tools
137
119
138
-
To use Ruff on an existing project, run:
120
+
You can also configure individual tools one-by-one. For example, to add Ruff on an existing project, run:
139
121
140
122
```console
141
123
$ uvx usethis tool ruff
@@ -147,7 +129,9 @@ $ uvx usethis tool ruff
147
129
☐ Run 'uv run ruff format' to run the Ruff formatter.
148
130
```
149
131
150
-
To use pytest, run:
132
+
For a detailed breakdown of what each line of the output means, [there is a detailed explanation available](https://usethis.readthedocs.io/en/stable/start/detailed-example).
133
+
134
+
As another example, to use pytest, run:
151
135
152
136
```console
153
137
$ uvx usethis tool pytest
@@ -161,7 +145,7 @@ $ uvx usethis tool pytest
161
145
☐ Run 'uv run pytest' to run the tests.
162
146
```
163
147
164
-
To configure Bitbucket Pipelines, run:
148
+
There are also commands to configure aspects other than tools. For example, to configure [Bitbucket Pipelines](https://www.atlassian.com/software/bitbucket/features/pipelines), run:
165
149
166
150
```console
167
151
$ uvx usethis ci bitbucket
@@ -173,6 +157,8 @@ $ uvx usethis ci bitbucket
173
157
☐ Run your pipeline via the Bitbucket website.
174
158
```
175
159
160
+
See the [CLI Reference](https://usethis.readthedocs.io/en/stable/cli/reference) for a full list of available commands.
161
+
176
162
## 📚 Similar Projects
177
163
178
164
Not sure if usethis is the exact fit for your project?
The output from usethis is chatty. If you know what you're doing, you can suppress it with the `--quiet` option, but usually it's worth paying close attention. For example, when adding the Ruff linting and formatting tool with the command `usethis tool ruff`, this is the output:
4
+
5
+
```console
6
+
$ uvx usethis tool ruff
7
+
✔ Adding dependency 'ruff' to the 'dev' group in 'pyproject.toml'.
✔ Ignoring Ruff rules 'PLR2004', 'SIM108' in 'pyproject.toml'.
11
+
☐ Run 'uv run ruff check --fix' to run the Ruff linter with autofixes.
12
+
☐ Run 'uv run ruff format' to run the Ruff formatter.
13
+
```
14
+
15
+
Let's run through what each line of the output means:
16
+
17
+
1.`✔ Adding dependency 'ruff' to the 'dev' group in 'pyproject.toml'.`
18
+
This line indicates that the `ruff` package has been added as a development dependency in the `pyproject.toml` file. This means that `ruff` has been installed automatically via `uv`, but also that it is recorded in the project's dependency list for others when they start working on the project (e.g. with `uv sync`).
19
+
2.`✔ Adding Ruff config to 'pyproject.toml'.`
20
+
This line indicates that a configuration section for Ruff has been added to the `pyproject.toml` file. This section contains settings that control how Ruff behaves when it is run. The settings adopted by usethis are "context aware" - based on the structure of your project, other tools you are using, etc., and so they are more likely to be appropriate for your project than the default settings.
This line indicates that a set of recommended Ruff rule sets has been selected and added to the `pyproject.toml` configuration. These rules determine what kinds of issues Ruff will check for in your code. The selected rules are based on best practices and are intended to help you maintain high code quality. Most of them have auto-fixes available. You can learn more about the specific rules in the [Ruff documentation](https://docs.astral.sh/ruff/rules).
23
+
4.`✔ Ignoring Ruff rules 'PLR2004', 'SIM108' in 'pyproject.toml'.`
24
+
This line indicates that certain Ruff rules have been explicitly ignored in the configuration. These rules were deemed less useful or potentially problematic for most projects, so usethis has chosen to disable them by default. You can always modify this list later if you find that you want to enable or disable additional rules.
25
+
5.`☐ Run 'uv run ruff check --fix' to run the Ruff linter with autofixes.`
26
+
This line is an instruction for you to run the Ruff linter on your codebase. It helps teach you how to use the tool which has just been installed and configured. You're ready to go and explore!
27
+
6.`☐ Run 'uv run ruff format' to run the Ruff formatter.`
28
+
Ruff is also a code formatter. Similar to the previous line, this is an instruction for you to run the Ruff formatter on your codebase. This will help ensure that your code adheres to consistent formatting standards.
29
+
30
+
The key idea is that lines beginning with a check mark (✔) indicate actions that have been successfully completed by usethis, while lines beginning with an empty box (☐) are instructions for you to follow up on.
To start a new project from scratch with a complete set of recommended tooling, run:
3
+
## Starting a new project
4
4
5
-
```console
6
-
$ uvx usethis init
7
-
✔ Writing 'pyproject.toml' and initializing project.
8
-
✔ Writing 'README.md'.
9
-
☐ Populate 'README.md' to help users understand the project.
10
-
✔ Adding recommended documentation tools.
11
-
☐ Run 'uv run mkdocs build' to build the documentation.
12
-
☐ Run 'uv run mkdocs serve' to serve the documentation locally.
13
-
✔ Adding recommended linters.
14
-
☐ Run 'uv run ruff check --fix' to run the Ruff linter with autofixes.
15
-
☐ Run 'uv run deptry src' to run deptry.
16
-
✔ Adding recommended formatters.
17
-
☐ Run 'uv run ruff format' to run the Ruff formatter.
18
-
☐ Run 'uv run pyproject-fmt pyproject.toml' to run pyproject-fmt.
19
-
✔ Adding recommended spellcheckers.
20
-
☐ Run 'uv run codespell' to run the Codespell spellchecker.
21
-
✔ Adding recommended test frameworks.
22
-
☐ Add test files to the '/tests' directory with the format 'test_*.py'.
23
-
☐ Add test functions with the format 'test_*()'.
24
-
☐ Run 'uv run pytest' to run the tests.
25
-
☐ Run 'uv run pytest --cov' to run your tests with Coverage.py.
26
-
```
5
+
To start a new project from scratch with a complete set of recommended tooling, simply run
6
+
the `uvx usethis init` command.
7
+
8
+
## Configuring individual tools
27
9
28
-
To use Ruff on an existing project, run:
10
+
You can also configure individual tools one-by-one. For example, to add Ruff on an existing project, run:
29
11
30
12
```console
31
13
$ uvx usethis tool ruff
@@ -37,7 +19,9 @@ $ uvx usethis tool ruff
37
19
☐ Run 'uv run ruff format' to run the Ruff formatter.
38
20
```
39
21
40
-
To use pytest, run:
22
+
For a detailed breakdown of what each line of the output means, [there is a detailed explanation available](start/detailed-example.md).
23
+
24
+
As another example, to use pytest, run:
41
25
42
26
```console
43
27
$ uvx usethis tool pytest
@@ -51,7 +35,7 @@ $ uvx usethis tool pytest
51
35
☐ Run 'uv run pytest' to run the tests.
52
36
```
53
37
54
-
To configure Bitbucket Pipelines, run:
38
+
There are also commands to configure aspects other than tools. For example, to configure [Bitbucket Pipelines](https://www.atlassian.com/software/bitbucket/features/pipelines), run:
55
39
56
40
```console
57
41
$ uvx usethis ci bitbucket
@@ -62,3 +46,5 @@ $ uvx usethis ci bitbucket
62
46
✔ Adding 'Test on 3.14' to default pipeline in 'bitbucket-pipelines.yml'.
63
47
☐ Run your pipeline via the Bitbucket website.
64
48
```
49
+
50
+
See the [CLI Reference](cli/reference.md) for a full list of available commands.
Copy file name to clipboardExpand all lines: docs/start/installation.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# 🧭 Getting Started
1
+
# 🧭 Installation
2
2
3
3
First, it is strongly recommended you [install the uv package manager](https://docs.astral.sh/uv/getting-started/installation/): this is a simple, documented process. If you're already using uv, make sure you're using at least
4
4
version v0.6.8 (run `uv --version` to check, and `uv self update` to upgrade).
0 commit comments