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: docs/docs/basic-usage.md
+21-21
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ Poetry uses this information to search for the right set of files in package "re
56
56
in the `tool.poetry.repositories` section, or on [PyPI](https://pypi.org) by default.
57
57
58
58
Also, instead of modifying the `pyproject.toml` file by hand, you can use the `add` command.
59
-
59
+
60
60
```bash
61
61
$ poetry add pendulum
62
62
```
@@ -75,50 +75,50 @@ Please read [versions](/versions/) for more in-depth information on versions, ho
75
75
!!!note
76
76
77
77
**How does Poetry download the right files?**
78
-
78
+
79
79
When you specify a dependency in `pyproject.toml`, Poetry first take the name of the package
80
80
that you have requested and searches for it in any repository you have registered using the `repositories` key.
81
81
If you have not registered any extra repositories, or it does not find a package with that name in the
82
82
repositories you have specified, it falls back on PyPI.
83
-
83
+
84
84
When Poetry finds the right package, it then attempts to find the best match
85
85
for the version constraint you have specified.
86
-
86
+
87
87
88
88
## Installing dependencies
89
89
90
90
To install the defined dependencies for your project, just run the `install` command.
91
-
91
+
92
92
```bash
93
93
poetry install
94
94
```
95
95
96
96
When you run this command, one of two things may happen:
97
97
98
-
### Installing without `pyproject.lock`
98
+
### Installing without `poetry.lock`
99
99
100
-
If you have never run the command before and there is also no `pyproject.lock` file present,
100
+
If you have never run the command before and there is also no `poetry.lock` file present,
101
101
Poetry simply resolves all dependencies listed in your `pyproject.toml` file and downloads the latest version of their files.
102
102
103
-
When Poetry has finished installing, it writes all of the packages and the exact versions of them that it downloaded to the `pyproject.lock` file,
103
+
When Poetry has finished installing, it writes all of the packages and the exact versions of them that it downloaded to the `poetry.lock` file,
104
104
locking the project to those specific versions.
105
-
You should commit the `pyproject.lock` file to your project repo so that all people working on the project are locked to the same versions of dependencies (more below).
105
+
You should commit the `poetry.lock` file to your project repo so that all people working on the project are locked to the same versions of dependencies (more below).
106
106
107
107
108
-
### Installing with `pyproject.lock`
108
+
### Installing with `poetry.lock`
109
109
110
-
This brings us to the second scenario. If there is already a `pyproject.lock` file as well as a `pyproject.toml` file
110
+
This brings us to the second scenario. If there is already a `poetry.lock` file as well as a `pyproject.toml` file
111
111
when you run `poetry install`, it means either you ran the `install` command before,
112
-
or someone else on the project ran the `install` command and committed the `pyproject.lock` file to the project (which is good).
112
+
or someone else on the project ran the `install` command and committed the `poetry.lock` file to the project (which is good).
113
113
114
-
Either way, running `install` when a `pyproject.lock` file is present resolves and installs all dependencies that you listed in `pyproject.toml`,
115
-
but Poetry uses the exact versions listed in `pyproject.lock` to ensure that the package versions are consistent for everyone working on your project.
114
+
Either way, running `install` when a `poetry.lock` file is present resolves and installs all dependencies that you listed in `pyproject.toml`,
115
+
but Poetry uses the exact versions listed in `poetry.lock` to ensure that the package versions are consistent for everyone working on your project.
116
116
As a result you will have all dependencies requested by your `pyproject.toml` file,
117
117
but they may not all be at the very latest available versions
118
-
(some of the dependencies listed in the `pyproject.lock` file may have released newer versions since the file was created).
118
+
(some of the dependencies listed in the `poetry.lock` file may have released newer versions since the file was created).
119
119
This is by design, it ensures that your project does not break because of unexpected changes in dependencies.
120
120
121
-
### Commit your `pyproject.lock` file to version control
121
+
### Commit your `poetry.lock` file to version control
122
122
123
123
Committing this file to VC is important because it will cause anyone who sets up the project
124
124
to use the exact same versions of the dependencies that you are using.
@@ -132,20 +132,20 @@ the dependencies installed are still working even if your dependencies released
132
132
!!!note
133
133
134
134
For libraries it is not necessary to commit the lock file.
135
-
135
+
136
136
137
137
## Updating dependencies to their latest versions
138
138
139
-
As mentioned above, the `pyproject.lock` file prevents you from automatically getting the latest versions
139
+
As mentioned above, the `poetry.lock` file prevents you from automatically getting the latest versions
140
140
of your dependencies.
141
141
To update to the latest versions, use the `update` command.
142
142
This will fetch the latest matching versions (according to your `pyproject.toml` file)
143
143
and update the lock file with the new versions.
144
-
(This is equivalent to deleting the `pyproject.lock` file and running `install` again.)
144
+
(This is equivalent to deleting the `poetry.lock` file and running `install` again.)
145
145
146
146
!!!note
147
147
148
-
Poetry will display a **Warning** when executing an install command if `pyproject.lock` and `pyproject.toml`
148
+
Poetry will display a **Warning** when executing an install command if `poetry.lock` and `pyproject.toml`
149
149
are not synchronized.
150
150
151
151
@@ -159,7 +159,7 @@ or create a brand new one for you to always work isolated from your global Pytho
159
159
160
160
The created virtualenv will use the Python executable for which
161
161
`poetry` has been installed.
162
-
162
+
163
163
What this means is if you project is Python 2.7 only you should
164
164
install `poetry` for your global Python 2.7 executable and use
0 commit comments