dotenv-loader

πŸ›  CONTRIBUTING.md

πŸ“Œ Purpose

This guide provides all necessary instructions for developers who want to:

If you plan to submit a pull request or maintain the package β€” this is your go-to reference.

🧩 Requirements

Optional (but recommended):

πŸ“¦ Project Setup

1. Clone the Repository

git clone https://github.com/dbdeveloper/dotenv-loader.git
cd dotenv-loader

2. Create Virtual Environment

python3 -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

3. Install Dev Dependencies

pip install -r requirements-dev.txt

Or manually:

pip install -e .[dev,test]

Optional (for static checking and formatting):

black
flake8
mypy

πŸͺͺ Running Tests

Run all tests:

pytest

Run with verbose output:

pytest -v

Run with code coverage:

pytest --cov=dotenv_loader --cov-report=term-missing

The .coveragerc file (optional) can be added if you want to fine-tune what’s included.

🧼 Cleaning Up

To remove Python cache and temporary test files:

find . -type d -name "__pycache__" -exec rm -r {} +
rm -rf .pytest_cache .coverage dist build

🧲 What’s Tested


πŸ“ Project Structure (Developer View)

dotenv-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

πŸ“¦ Publishing to PyPI

Ensure the following before publishing:

πŸ“œ Publishing Steps

  1. Build the package:
python -m build
  1. Inspect the output under dist/. It should include:
dist/dotenv_loader-X.Y.Z.tar.gz
dist/dotenv_loader-X.Y.Z-py3-none-any.whl
  1. Upload to PyPI:
twine upload dist/*
  1. (Optional) If publishing for the first time, create an account at https://pypi.org/account/register

πŸ›‘ Notes

twine upload --repository-url https://test.pypi.org/legacy/ dist/*

πŸ’» Automate it (Optional)

Steps 1,2,3 can be automated by executing the script tools/publish.sh

Your ci.yml workflow ensures:

You can enable code coverage via codecov.io for 100% badges.


🀝 Contribution Guidelines


πŸ€– Acknowledgment

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.