Skip to content

Commit

Permalink
Added optional support for loading .env
Browse files Browse the repository at this point in the history
  • Loading branch information
rudyryk committed Nov 9, 2023
1 parent 46922f4 commit 8cbd4a5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Changelog

* Changed packaging configuration to `pyproject.toml` format
* Added support for custom `endpoint_url` for AWS resources
* Optional support for `.env` file

## 0.6

Expand Down
6 changes: 6 additions & 0 deletions coverme.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
import urllib.parse
urlparse = urllib.parse.urlparse

try:
import dotenv
dotenv.load_dotenv()
except ImportError:
pass

import boto3.session
import yaml

Expand Down
11 changes: 7 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,16 @@ dependencies = [
]
dynamic = ["version", "readme"]

[project.optional-dependencies]
dotenv = ["python-dotenv>=1.0.0"]

[project.scripts]
coverme = "coverme:main"

[project.urls]
"Homepage" = "https://github.com/05bit/coverme"
"Bug Tracker" = "https://github.com/05bit/coverme/issues"

[tool.setuptools]
py-modules = ["coverme"]

Expand All @@ -36,7 +43,3 @@ readme = {file = ["README.md"], content-type = "text/markdown"}
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project.urls]
"Homepage" = "https://github.com/05bit/coverme"
"Bug Tracker" = "https://github.com/05bit/coverme/issues"

0 comments on commit 8cbd4a5

Please sign in to comment.