Commit 15f31faa by Sébastien Eustace

Start documentation

parent e80348e1
......@@ -27,4 +27,5 @@ pip-log.txt
setup.cfg
MANIFEST.in
setup.py
/docs/site/*
pyproject.lock
# Basic usage
For the basic usage introduction we will be installing `pendulum`, a datetime library.
If you have not yet installed Poetry, refer to the [Introduction](/docs/#introduction) chapter.
## Project setup
First, let's create our new project, let's call it `poetry-demo`:
```bash
poetry new poetry-demo
```
This will create the `poetry-demo` directory with the following content:
```text
poetry-demo
├── pyproject.toml
├── README.rst
├── poetry_demo
│ └── __init__.py
└── tests
├── __init__.py
└── test_poetry_demo
```
The `pyproject.toml` file is what is the most important here. This will orchestrate
your project and its dependencies. For now, it looks like this:
```toml
[tool.poetry]
name = "poetry-demo"
version = "0.1.0"
authors = [ "Sébastien Eustace <sebastien@eustace.io>",]
[tool.poetry.dependencies]
[tool.poetry.dev-dependencies]
pytest = "^3.4"
```
### Specifying dependencies
If you want to add dependencies to your project, you can specify them in the `tool.poetry.dependencies` section.
```toml
[tool.poetry.dependencies]
requests = "^2.18"
```
As you can see, it takes a mapping of **package names** and **version constraints**.
Poetry uses this information to search for the right set of files in package "repositories" that you register
in the `tool.poetry.repositories` section, or on [PyPI](https://pypi.org) by default.
Also, instead of modifying the `pyproject.toml` file by hand, you can use the `add` command.
```bash
$ poetry add pendulum
```
It will automatically find a suitable version constraint.
# Introduction
Poetry is a tool for dependency management and packaging in Python.
It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.
## System requirements
Poetry requires Python 3.6+. It is multi-platform and the goal is to make it work equally well
on Windows, Linux and OSX.
## Installation
Installing Poetry is as simple as:
```bash
pip install --user poetry
```
!!!note
In the future, Poetry will come with its standalone installer.
site_name: Poetry documentation
theme:
name: null
custom_dir: theme
extra:
version: 2.0
pages:
- Home: index.md
- Basic Usage: basic-usage.md
markdown_extensions:
- codehilite
- admonition
- pymdownx.superfences
- toc:
permalink:
---
layout: documentation
title: {{ config.site_name|striptags|e }}
---
<section class="p-b-50 p-t-50 documentation-content">
<div class="container">
<div class="panel panel-transparent">
<div class="bg-white row p-l-20 p-r-20 p-b-20 p-t-5 xs-no-padding">
<div class="row">
<div class="col-md-3 documentation-toc">
{% include "toc.html" %}
</div>
<div class="col-md-9 documentation-body">
{{page.content}}
</div>
</div>
</div>
</div>
</div>
</section>
<ul class="nav bs-sidenav">
{%- for toc_item in page.toc %}
<li class="main {% if toc_item.active %}active{% endif %}"><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></li>
{%- for toc_item in toc_item.children %}
<li><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></li>
{%- endfor %}
{%- endfor %}
</ul>
......@@ -28,6 +28,9 @@ requests-toolbelt = "^0.8.0"
[tool.poetry.dev-dependencies]
pytest = "~3.4"
pytest-cov = "^2.5"
mkdocs = "^0.17.3"
pymdown-extensions = "^4.9"
pygments = "^2.2"
[tool.poetry.scripts]
......
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