Skip to content

Instantly share code, notes, and snippets.

View AFirooz's full-sized avatar

Ali Firooz AFirooz

View GitHub Profile
@AFirooz
AFirooz / list-groups.py
Last active April 29, 2025 05:12
Poetry Scripts
#! /usr/bin/env python3
# =================================================================================
# Name : list-groups.py
# Author : Ali Firooz
# Version : 0.0.2
# Copyright : Copyright © 2025 Ali Firooz. All Rights Reserved.
# Description : Adding the function of listing available groups in poetry.
# Can be used by running `$ poetry run groups` or
# `$ poetry run groups "<pyproject.toml path>"`.

Method 1: Bash Script

This script is used to enable importing local Python modules from your project directory without having to install the project in development mode or modify PYTHONPATH environment variable manually every time. The .pth file, is a special file that Python looks for when determining import paths.

Note that you need to be in your local module dir, then run these commands.

CURRENT_FOLDER=$(pwd) && echo "$CURRENT_FOLDER"