Skip to content
This repository was archived by the owner on Feb 20, 2026. It is now read-only.

Commit 7cba080

Browse files
authored
Changed supported Python version to >= 3.6
2 parents dcb4964 + c54dcfa commit 7cba080

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

setup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from codecs import open
1010
from os import path
1111

12-
from setuptools import setup, find_packages
12+
from setuptools import setup
1313

1414
here = path.abspath(path.dirname(__file__))
1515

@@ -21,8 +21,8 @@ def long_description():
2121

2222
setup(
2323
name='doppler_env',
24-
version='0.2.1',
25-
python_requires='>=3.8',
24+
version='0.2.2',
25+
python_requires='>=3.6',
2626
description='Inject Doppler secrets as environment variables into your Python application during local development with debugging support for PyCharm and Visual Studio Code.',
2727
long_description=long_description(),
2828
long_description_content_type='text/markdown',
@@ -40,6 +40,8 @@ def long_description():
4040
'Topic :: Software Development :: Build Tools',
4141
'Topic :: Utilities',
4242
'License :: OSI Approved :: Apache Software License',
43+
'Programming Language :: Python :: 3.6',
44+
'Programming Language :: Python :: 3.7',
4345
'Programming Language :: Python :: 3.8',
4446
'Programming Language :: Python :: 3.9',
4547
],

src/doppler_env/__init__.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,19 @@
77
def doppler_secrets_env():
88
import io
99
import subprocess
10-
import logging
1110
from dotenv import load_dotenv
1211

1312
DOPPLER_ENV_COMMAND = os.environ.get(
1413
'DOPPLER_ENV_COMMAND', 'doppler secrets download --no-file --format env'
1514
)
16-
process = subprocess.run(DOPPLER_ENV_COMMAND, shell=True, capture_output=True)
17-
if process.returncode != 0:
18-
logging.error('Doppler secrets fetch failed {process.returncode}')
19-
if process.stderr:
20-
logging.error(process.stderr)
21-
if process.stdout:
22-
logging.error(process.stdout)
23-
else:
24-
config = io.StringIO(process.stdout.decode('utf-8'))
25-
load_dotenv(stream=config)
15+
16+
# If non-zero exit code, catch Python exception so only output is stderr from Doppler CLI
17+
try:
18+
env_vars = subprocess.check_output(DOPPLER_ENV_COMMAND.split()).decode('utf-8')
19+
except subprocess.CalledProcessError as err:
20+
exit(err.returncode)
21+
22+
load_dotenv(stream=io.StringIO(env_vars))
2623

2724

2825
if os.environ.get('DOPPLER_ENV') is not None:

0 commit comments

Comments
 (0)