Commit d3919fb3 by Sébastien Eustace

Update README

parent a25519e6
...@@ -3,9 +3,15 @@ ...@@ -3,9 +3,15 @@
Poetry helps you declare, manage and install dependencies of Python projects, Poetry helps you declare, manage and install dependencies of Python projects,
ensuring you have the right stack everywhere. ensuring you have the right stack everywhere.
![Poet Install](https://raw.githubusercontent.com/sdispater/poetry/master/assets/poet-install.gif)
The package is **highly experimental** at the moment so expect things to change and break. The package is **highly experimental** at the moment so expect things to change and break.
However, if you feel adventurous feedback and pull requests are greatly appreciated. However, if you feel adventurous feedback and pull requests are greatly appreciated.
Also, be aware that the features described here are the goal that this library is aiming
for and, as of now, not all of them are implemented. The dependency management is pretty much
done while the packaging and publishin are not done yet.
## Installation ## Installation
```bash ```bash
...@@ -19,16 +25,16 @@ See `poet help completions` for full details, but the gist is as simple as using ...@@ -19,16 +25,16 @@ See `poet help completions` for full details, but the gist is as simple as using
```bash ```bash
# Bash # Bash
$ poetry completions bash > /etc/bash_completion.d/poetry.bash-completion poetry completions bash > /etc/bash_completion.d/poetry.bash-completion
# Bash (macOS/Homebrew) # Bash (macOS/Homebrew)
$ poetry completions bash > $(brew --prefix)/etc/bash_completion.d/poetry.bash-completion poetry completions bash > $(brew --prefix)/etc/bash_completion.d/poetry.bash-completion
# Fish # Fish
$ poetry completions fish > ~/.config/fish/completions/poetry.fish poetry completions fish > ~/.config/fish/completions/poetry.fish
# Zsh # Zsh
$ poetry completions zsh > ~/.zfunc/_poetry poetry completions zsh > ~/.zfunc/_poetry
``` ```
*Note:* you may need to restart your shell in order for the changes to take *Note:* you may need to restart your shell in order for the changes to take
...@@ -68,7 +74,7 @@ keywords = ['packaging', 'poet'] ...@@ -68,7 +74,7 @@ keywords = ['packaging', 'poet']
include = ['poet/**/*', 'LICENSE'] include = ['poet/**/*', 'LICENSE']
python = ["~2.7", "^3.2"] python-versions = "~2.7 || ^3.2"
[dependencies] [dependencies]
...@@ -100,17 +106,18 @@ There are some things we can notice here: ...@@ -100,17 +106,18 @@ There are some things we can notice here:
* The dependencies sections support caret, tilde, wildcard, inequality and multiple requirements. * The dependencies sections support caret, tilde, wildcard, inequality and multiple requirements.
* You must specify the python versions for which your package is compatible. * You must specify the python versions for which your package is compatible.
`poetry` will also detect if you are inside a virtualenv and install the packages accordingly. `poetry` will also detect if you are inside a virtualenv and install the packages accordingly.
So, `poetry` can be installed globally and used everywhere. So, `poetry` can be installed globally and used everywhere.
`poetry` also comes with a full fledged dependency resolution library, inspired by [Molinillo](https://github.com/CocoaPods/Molinillo).
## Why? ## Why?
Packaging system and dependency management in Python is rather convoluted and hard to understand for newcomers. Packaging system and dependency management in Python is rather convoluted and hard to understand for newcomers.
Even for seasoned developers it might be cumbersome at times to create all files needed in a Python project: `setup.py`, Even for seasoned developers it might be cumbersome at times to create all files needed in a Python project: `setup.py`,
`requirements.txt`, `setup.cfg`, `MANIFEST.in` and the newly added `Pipfile`. `requirements.txt`, `setup.cfg`, `MANIFEST.in` and the newly added `Pipfile`.
So I wanted a tool that would limit everything to a single configuration file to do everything: So I wanted a tool that would limit everything to a single configuration file to do:
dependency management, packaging and publishing. dependency management, packaging and publishing.
It takes inspiration in tools that exist in other languages, like `composer` (PHP) or `cargo` (Rust). It takes inspiration in tools that exist in other languages, like `composer` (PHP) or `cargo` (Rust).
...@@ -127,36 +134,40 @@ and accurate to manage Python projects with just one tool. ...@@ -127,36 +134,40 @@ and accurate to manage Python projects with just one tool.
The `Pipfile` is just a replacement from `requirements.txt` but in the end you will still need to The `Pipfile` is just a replacement from `requirements.txt` but in the end you will still need to
populate your `setup.py` file (or `setup.cfg`) with the exact same dependencies you declared in your `Pipfile`. populate your `setup.py` file (or `setup.cfg`) with the exact same dependencies you declared in your `Pipfile`.
So, in the end, you will still need to manage a few configuration files to properly setup your project.
## Commands ## Commands
### init ### new
This command will help you create a `poetry.toml` file interactively
by prompting you to provide basic information about your package.
It will interactively ask you to fill in the fields, while using some smart defaults. This command will help you kickstart your new Python project by creating
a directory structure suitable for most projects.
```bash ```bash
poet init poetry new my-package
``` ```
However, if you just want a basic template and fill the information directly, you can just do: will create a folder as follows:
```bash ```text
poet init default my-project
├── poetry.toml
├── README.rst
├── my_project
└── __init__.py
├── tests
├── __init__.py
└── test_my_package
``` ```
#### Options If you want to name your project differently than the folder, you can pass
the `--name` option:
* `--name`: Name of the package. ```bash
* `--description`: Description of the package. poetry new my-folder --my-package
* `--author`: Author of the package. ```
* `--require`: Package to require with a version constraint. Should be in format `foo:1.0.0`.
* `--require-dev`: Development requirements, see `--require`.
* `--index`: Index to use when searching for packages.
### install ### install
...@@ -393,6 +404,8 @@ Only the name and a version string are required in this case. ...@@ -393,6 +404,8 @@ Only the name and a version string are required in this case.
requests = "^2.13.0" requests = "^2.13.0"
``` ```
Private repositories are not supported yet but are planned.
#### Caret requirement #### Caret requirement
**Caret requirements** allow SemVer compatible updates to a specified version. **Caret requirements** allow SemVer compatible updates to a specified version.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment