Python Poetry (https://python-poetry.org/) is a Python dependency and package management tool. It replaces PIP and removes the friction from creating a python project suitable for repackaging.
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
poetry new learn-poetry
poetry add geopandas
This updates pyproject.toml:
[tool.poetry.dependencies]
python = "^3.9"
geopandas = "^0.9.0"
poetry install
learn_poetry/geospatial.py
import geopandas
path_to_data = geopandas.datasets.get_path("nybb")
gdf = geopandas.read_file(path_to_data)
gdf["area"] = gdf.area
print(gdf[["BoroName", "area"]])
poetry run python learn_poetry/geospatial.py
poetry run pytest