@@ -288,17 +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"
302
+
303
+ # Allow only 2.0.5 version
304
+ poetry add pendulum==2.0.5
296
305
```
297
306
298
307
If you try to add a package that is already present, you will get an error.
299
308
However, if you specify a constraint, like above, the dependency will be updated
300
- by using the specified constraint. If you want to get the latest version of an already
301
- 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:
302
313
303
314
``` bash
304
315
poetry add pendulum@latest
@@ -319,8 +330,7 @@ or use ssh instead of https:
319
330
``` bash
320
331
poetry add git+ssh://
[email protected] /sdispater/pendulum.git
321
332
322
- or alternatively:
323
-
333
+ # or alternatively:
324
334
poetry add git+ssh://
[email protected] :sdispater/pendulum.git
325
335
```
326
336
@@ -331,8 +341,7 @@ you can specify it when using `add`:
331
341
poetry add git+https://github.com/sdispater/pendulum.git#develop
332
342
poetry add git+https://github.com/sdispater/pendulum.git#2.0.5
333
343
334
- or using SSH instead:
335
-
344
+ # or using SSH instead:
336
345
poetry add git+ssh://github.com/sdispater/pendulum.git#develop
337
346
poetry add git+ssh://github.com/sdispater/pendulum.git#2.0.5
338
347
```
0 commit comments