Skip to main content

This is a test python package I created to learn pip&poetry

Project description

sample-pypi

  • This repository uses poetry to manage dependencies and packaging.

poetry installation

1. virtual environment

⛔️ Poetry should always be installed in a dedicated virtual environment to isolate it from the rest of your system. In no case, it should be installed in the environment of the project that is to be managed by Poetry. This ensures that Poetry’s own dependencies will not be accidentally upgraded or uninstalled. (See reference).

Because of the above:

First we create a virtual environment:

python -m venv venv

Then we activate it:

source venv/bin/activate

2. install pipx if not installed

First check if you have pipx installed. If not, install it with pip:

pip install --user pipx

3. install poetry

Then install poetry with pipx:

pipx install poetry

If you want to use poetry as a command, you can add an alias to your .bashrc (or .zshrc).

This is what it looks like on my machine:

alias poetry='/Users/abdullahguser/Library/Application\ Support/pipx/venvs/poetry/bin/poetry'

poetry usage

I assume you already have a project that you want to manage with poetry. First cd into the project directory.

1. initialize poetry

poetry init

This will create a pyproject.toml file in your project directory.

2. add dependencies

poetry add <dependency>

This will add the dependency to your pyproject.toml file and install it in your virtual environment.

3. install dependencies

poetry install

This will install all the dependencies listed in your pyproject.toml file and create a poetry.lock file. (You can commit this file to your repository to ensure that all developers use the same versions of the dependencies.)

TODOs

  • What is the advantage of using poetry over requirements.txt?

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gsamil_test-0.1.7.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gsamil_test-0.1.7-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file gsamil_test-0.1.7.tar.gz.

File metadata

  • Download URL: gsamil_test-0.1.7.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for gsamil_test-0.1.7.tar.gz
Algorithm Hash digest
SHA256 465abcea9ce22f02749703a3cf83d2cc3514aa26e9cb588260a4a8c7b6c1ea64
MD5 dff7fcf673bce71c1c9c8ba9782d652d
BLAKE2b-256 df9a3082badd1b225e03654960df01bd45af1cfc0a63f5eae231fe20e861b991

See more details on using hashes here.

File details

Details for the file gsamil_test-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: gsamil_test-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for gsamil_test-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 5330664259482e2840fa40457d17005b62c0f27b832fcb0667d63cdea27134b3
MD5 fec2e26788adb81e3709bdf5f1515a50
BLAKE2b-256 f3b37f7a0038f6003c43c9107b16927644b8f96d55d35edf4a4e04c2a403a5f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page