This is a test python package I created to learn pip&poetry
Project description
sample-pypi
- This repository uses
poetryto 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
poetryoverrequirements.txt?
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gsamil_test-0.1.0.tar.gz.
File metadata
- Download URL: gsamil_test-0.1.0.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a3171ac64a567aba4e139210074a0dc78a309090894bc2fea1d7fef87c27923
|
|
| MD5 |
7f29753913bb4de3b841815301c766d6
|
|
| BLAKE2b-256 |
489bea5e5c3faf571e7c034ab88d0ff83cf5f2c62414956ece920c85fd2dea89
|
File details
Details for the file gsamil_test-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gsamil_test-0.1.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92f602b12d078b22d43a756a730420eb05ce2bc1d4833f44ded62a565297eaab
|
|
| MD5 |
901fcce135f7a9e270858722b5fa17dd
|
|
| BLAKE2b-256 |
edbac4c346cc75c33edffc0539fbdbfc43ca68ddcbf488dbd7be727f49aabce8
|