@@ -288,18 +288,28 @@ poetry will choose a suitable one based on the available package versions.
288
288
poetry add requests pendulum
289
289
```
290
290
291
- You also can specify a constraint when adding a package, like so :
291
+ You can also specify a constraint when adding a package:
292
292
293
293
``` bash
294
+ # Allow >=2.0.5, <3.0.0 versions
294
295
poetry add pendulum@^2.0.5
296
+
297
+ # Allow >=2.0.5, <2.1.0 versions
298
+ poetry add pendulum@~2.0.5
299
+
300
+ # Allow >=2.0.5 versions, without upper bound
295
301
poetry add " pendulum>=2.0.5"
296
- poetry add " pendulum==2.0.5"
302
+
303
+ # Allow only 2.0.5 version
304
+ poetry add pendulum==2.0.5
297
305
```
298
306
299
307
If you try to add a package that is already present, you will get an error.
300
308
However, if you specify a constraint, like above, the dependency will be updated
301
- by using the specified constraint. If you want to get the latest version of an already
302
- present dependency you can use the special ` latest ` constraint:
309
+ by using the specified constraint.
310
+
311
+ If you want to get the latest version of an already
312
+ present dependency, you can use the special ` latest ` constraint:
303
313
304
314
``` bash
305
315
poetry add pendulum@latest
@@ -320,8 +330,7 @@ or use ssh instead of https:
320
330
``` bash
321
331
poetry add git+ssh://
[email protected] /sdispater/pendulum.git
322
332
323
- or alternatively:
324
-
333
+ # or alternatively:
325
334
poetry add git+ssh://
[email protected] :sdispater/pendulum.git
326
335
```
327
336
@@ -332,8 +341,7 @@ you can specify it when using `add`:
332
341
poetry add git+https://github.com/sdispater/pendulum.git#develop
333
342
poetry add git+https://github.com/sdispater/pendulum.git#2.0.5
334
343
335
- or using SSH instead:
336
-
344
+ # or using SSH instead:
337
345
poetry add git+ssh://github.com/sdispater/pendulum.git#develop
338
346
poetry add git+ssh://github.com/sdispater/pendulum.git#2.0.5
339
347
```
0 commit comments