GithubHelp home page GithubHelp logo

alparibal / poetry Goto Github PK

View Code? Open in Web Editor NEW

This project forked from python-poetry/poetry

1.0 0.0 1.0 13.15 MB

Python dependency management and packaging made easy.

Home Page: https://python-poetry.org

License: MIT License

Python 86.51% HTML 13.49%

poetry's Introduction

Poetry: Dependency Management for Python

Tests Status Stable Version Pre-release Version Downloads Discord

Poetry helps you declare, manage and install dependencies of Python projects, ensuring you have the right stack everywhere.

It requires Python 3.7+ to run.

Poetry Install

Documentation

The complete documentation is available on the official website.

Installation

Instructions on how to install poetry can be found here. You can also refer here for information on how to enable tab completion in your environment.

Introduction

poetry is a tool to handle dependency installation as well as building and packaging of Python packages. It only needs one file to do all of that: the new, standardized pyproject.toml.

In other words, poetry uses pyproject.toml to replace setup.py, requirements.txt, setup.cfg, MANIFEST.in and Pipfile.

[tool.poetry]
name = "my-package"
version = "0.1.0"
description = "The description of the package"

license = "MIT"

authors = [
    "Sébastien Eustace <[email protected]>"
]

readme = "README.md"

repository = "https://github.com/python-poetry/poetry"
homepage = "https://python-poetry.org"

keywords = ["packaging", "poetry"]

[tool.poetry.dependencies]
python = "^3.8"  # Compatible python versions must be declared here
aiohttp = "^3.8.1"
# Dependencies with extras
requests = { version = "^2.28", extras = [ "security" ] }
# Python specific dependencies with prereleases allowed
tomli = { version = "^2.0.1", python = "<3.11", allow-prereleases = true }
# Git dependencies
cleo = { git = "https://github.com/python-poetry/cleo.git", branch = "master" }

# Optional dependencies (extras)
pendulum = { version = "^2.1.2", optional = true }

[tool.poetry.dev-dependencies]
pytest = "^7.1.2"
pytest-cov = "^3.0"

[tool.poetry.scripts]
my-script = "my_package:main"

There are some things we can notice here:

  • It will try to enforce semantic versioning as the best practice in version naming.
  • You can specify the readme, included and excluded files: no more MANIFEST.in. poetry will also use VCS ignore files (like .gitignore) to populate the exclude section.
  • Keywords can be specified and will act as tags on the packaging site.
  • The dependencies sections support caret, tilde, wildcard, inequality and multiple requirements.
  • 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. So, poetry can be installed globally and used everywhere.

poetry also comes with a full fledged dependency resolution library.

Why?

Packaging systems and dependency management in Python are 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, requirements.txt, setup.cfg, MANIFEST.in and Pipfile.

So I wanted a tool that would limit everything to a single configuration file to do: dependency management, packaging and publishing.

It takes inspiration in tools that exist in other languages, like composer (PHP) or cargo (Rust).

And, finally, I started poetry to bring another exhaustive dependency resolver to the Python community apart from Conda's.

Resources

poetry's People

Contributors

sdispater avatar abn avatar finswimmer avatar dimbleby avatar neersighted avatar radoering avatar mkniewallner avatar branchvincent avatar pre-commit-ci[bot] avatar kasteph avatar cauebs avatar secrus avatar danieleades avatar darsstar avatar caligatio avatar brycedrennan avatar estyxx avatar fredrikaverpil avatar trim21 avatar stinodego avatar raptdept avatar cereblanco avatar tgolsson avatar tommilligan avatar apollo13 avatar dmerejkowsky avatar kgb33 avatar jamim avatar ttamg avatar yamagen0915 avatar

Stargazers

Sourcery AI avatar

Forkers

sourcery-ai-bot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.