Metadata-Version: 2.1
Name: gsamil-test
Version: 0.1.0
Summary: This is a test python package I created to learn pip&poetry
Home-page: https://github.com/gsamil/sample-pypi
License: MIT
Author: gsamil
Author-email: abdullah-s-guser@hotmail.com
Requires-Python: >=3.8,<4.0
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.7
Requires-Dist: pytest (==7.2.0)
Description-Content-Type: text/markdown

# 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](https://python-poetry.org/docs/)).

Because of the above:

First we create a virtual environment:

```bash
python -m venv venv
```

Then we activate it:

```bash
source venv/bin/activate
```

### 2. install `pipx` if not installed

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

```bash
pip install --user pipx
```

### 3. install `poetry`

Then install `poetry` with `pipx`:

```bash
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:

```bash
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`

```bash
poetry init
```

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

### 2. add dependencies

```bash
poetry add <dependency>
```

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

### 3. install dependencies

```bash
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`?

