RUVIDEO
Поделитесь видео 🙏

Python Poetry for a Noob - Getting started

? ⋆ ? ? ??????? ? ? ⋆ ?
Managing packages and dependencies in Python can be overwhelming and resource intensive. Poetry will help with starting new projects, maintaining existing ones and provide centralized dependency management. Like most Python projects, it relies on external packages. The maintenance work falls on the developer to make sure each version of each package is updated and working after each update. By leveraging Poetry, a dependency manager, we can specify, install and resolve external packages in one source location known as out project file. This way we can ensure we always have the right dependencies,lol versions and configurations, and dependencies of dependencies, with the added value of central management.

? ⋆ ? ? ????? ??? ???? ????? ? ? ⋆ ?
Typically with a python project we have to track setup.py, requirements.txt, setup.cfg, MANIFEST.in and a pipfile. Let's take a look at them below.

setup.py - Is a python file that indicates the modules/packages you are about to install. Simply calling "pip install setup.py" and our modules will be installed.

requirements.txt - is a file that lists all dependencies for a specific Python project. It can also specify specific versions.

setup.cfg - Contains options for the setup.py

MANIFEST.in - Specifies metadata for accompanying files

Pipfile - Dedicated file for project dependencies

? ⋆ ? ? ???? ?????? ???? ??? ??? ? ? ⋆ ?
After implementing Poetry, you will have 2 new files.

pyproject.toml - List the details of packages added to the poetry tree
poetry.lock - Basic overview packages in the poetry tree

? ⋆ ? ? ℂ??????? ? ??? ?????? ??????? ? ? ⋆ ?
Creating our first poetry package is very simple.
$poetry new dolphin-poetry-project

A folder will be created "rp-poetry". Poetry will normalize packages for you automatically. The Poetry file structure is formatted as below.

dolphin-poetry-project
├── dolphin-poetry-project
│ └── __init__.py
├── tests/
│ ├── __init__.py
│ └── test_dolphin-poetry-project.py

├── README.md
└── pyproject.toml

A toml and a lock file will be created to track all our packages, dependencies and version. See examples below.

------------------------------------------------------------------------------------------------------------
? ⋆ ? ?pyproject.toml - This file will display our packages
[tool.poetry]
name = "dolphin-poetry-project"
version = "0.1.5"
description = "Dolphin test project"
authors = ["Dolphin [email protected]"]

[tool.poetry.dependencies]
python = "^3.7"

[tool.poetry.dev-dependencies]
pytest = "^4.6"
invoke = "^1.8"
pycrypto = "^4.3"
strings = "^4.1"

[tool.strings]
remove-empty-directories = true

[build-system]
requires = ["poetry=0.12"]
build-backend = "poetry.masonry.api"

[tool.poetry.scripts]
run = "wsgi:main"

[tool.poetry.urls]
issues = "https://github.com/hackersandslackers/python-poetry-tutorial/issues"
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
? ⋆ ? ?poetry-project/poetry.lock
[[package]]name = "pytest"
version = "0.17.2"
description = "Python graph [network] package"
category = "dev"
optional = false
python-versions = "*"[[package]]
name = "attrs"
version = "20.3.0"
description = ""
category = "dev"
optional = false
python-versions = "=2.7, !

[package.dependencies]
pytesting = "=1.1.0"

[package.extras]

[[package]]name = "invoke"
version = "0.17.2"
description = "Python graph [network] package"
category = "dev"
optional = false
python-versions = "*"[[package]]
name = "attrs"
version = "20.3.0"
description = ""
category = "dev"
optional = false

[package.dependencies]

[package.extras]
------------------------------------------------------------------------------------------------------------
? ⋆ ? ? The workflow
This can be allot to take in, so lets look at the workflow.
1. Install Poetry
2. Create a Poetry package
3. Add a package
4. Update the packages
5. Track/list the packages
6. Build the package
7. Install the package

? ⋆ ? ? Workflow specifics
1. Installing on linux
A. curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3
B. Check version with - poetry --version
C. Set environment variable - export PATH="$HOME/.poetry/bin:${PATH}"

2. Create a Poetry package
poetry new mypoetryproject

3. Adding packages
poetry add "package name"

4. Update the packages
Poetry update

5. Track/list the packages
poetry show --tree

6. Build the packages
Poetry build

7. Publishing Packages
poetry publish

8. Publishing Packages
poetry publish


References:
https://python-poetry.org/
https://github.com/python-poetry/poetry
https://python-poetry.org/docs/
https://hackersandslackers.com/python-poetry-package-manager/

Music:- ASHUTOSH - Chile
Watch:- https://youtu.be/fnOW-AdFY6I
https://www.ashutoshmusic.com/music

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Python Poetry for a Noob - Getting started», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.