This guide provides all necessary instructions for developers who want to:
dotenv-loader project.If you plan to submit a pull request or maintain the package β this is your go-to reference.
pip (Python package manager)Optional (but recommended):
venv or virtualenvpytest, coverage, twine, buildblack, flake8, mypy for static checks and formattinggit clone https://github.com/dbdeveloper/dotenv-loader.git
cd dotenv-loader
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements-dev.txt
Or manually:
pip install -e .[dev,test]
Optional (for static checking and formatting):
black
flake8
mypy
pytest
pytest -v
pytest --cov=dotenv_loader --cov-report=term-missing
The
.coveragercfile (optional) can be added if you want to fine-tune whatβs included.
To remove Python cache and temporary test files:
find . -type d -name "__pycache__" -exec rm -r {} +
rm -rf .pytest_cache .coverage dist build
.env loading from project rootDOTPROJECT, DOTSTAGE, and DOTENV overridesconfig_root, steps_to_project_root, and other argumentsdotenv-loader/
β
βββ src/dotenv_loader/ # Main loader logic
β βββ __init__.py
β
βββ tests/ # Tests for full path resolution logic
β βββ test_dotenv_loader.py
β βββ proj1/
β β βββ manage.py
β βββ proj2/
β β βββ app/
β β βββ manage.py
β βββ dotconfig_root/ # Configs: ~/.config/python-projects (mocked)
β βββ proj1/.env
β βββ proj2/.env
β βββ ...
β
βββ pyproject.toml # Metadata for PyPI
βββ requirements-dev.txt # Dev dependencies
βββ .gitignore
βββ .coveragerc (optional)
βββ CONTRIBUTING.md # This file
Ensure the following before publishing:
pyproject.toml is updated.README.md is correct and well-formatted (rendered by PyPI).LICENSE (MIT) is present.python -m build
dist/. It should include:dist/dotenv_loader-X.Y.Z.tar.gz
dist/dotenv_loader-X.Y.Z-py3-none-any.whl
twine upload dist/*
~/.pypirc.twine upload with:twine upload --repository-url https://test.pypi.org/legacy/ dist/*
Steps 1,2,3 can be automated by executing the script tools/publish.sh
Your ci.yml workflow ensures:
push and pull_request.You can enable code coverage via codecov.io for 100% badges.
This project was created collaboratively by Vladyslav Kozlovskyy with the help of ChatGPT (OpenAI), using models GPT-4o, GPT-4.5, and GPT-3.5 β to combine human clarity with AI precision.