python-dotenvx 0.2.2__tar.gz → 0.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_dotenvx-0.2.2 → python_dotenvx-0.2.3}/CHANGELOG.md +7 -1
- python_dotenvx-0.2.3/MANIFEST.in +2 -0
- {python_dotenvx-0.2.2/src/python_dotenvx.egg-info → python_dotenvx-0.2.3}/PKG-INFO +18 -4
- {python_dotenvx-0.2.2 → python_dotenvx-0.2.3}/README.md +10 -2
- {python_dotenvx-0.2.2 → python_dotenvx-0.2.3}/setup.py +6 -22
- {python_dotenvx-0.2.2 → python_dotenvx-0.2.3}/src/dotenvx/__version__.py +1 -1
- python_dotenvx-0.2.3/src/dotenvx/bin/dotenvx +3 -0
- python_dotenvx-0.2.3/src/dotenvx/main.py +61 -0
- {python_dotenvx-0.2.2 → python_dotenvx-0.2.3/src/python_dotenvx.egg-info}/PKG-INFO +18 -4
- {python_dotenvx-0.2.2 → python_dotenvx-0.2.3}/src/python_dotenvx.egg-info/SOURCES.txt +2 -0
- python_dotenvx-0.2.3/src/python_dotenvx.egg-info/entry_points.txt +2 -0
- python_dotenvx-0.2.2/MANIFEST.in +0 -1
- python_dotenvx-0.2.2/src/dotenvx/main.py +0 -2
- {python_dotenvx-0.2.2 → python_dotenvx-0.2.3}/LICENSE +0 -0
- {python_dotenvx-0.2.2 → python_dotenvx-0.2.3}/pyproject.toml +0 -0
- {python_dotenvx-0.2.2 → python_dotenvx-0.2.3}/setup.cfg +0 -0
- {python_dotenvx-0.2.2 → python_dotenvx-0.2.3}/src/dotenvx/__init__.py +0 -0
- {python_dotenvx-0.2.2 → python_dotenvx-0.2.3}/src/python_dotenvx.egg-info/dependency_links.txt +0 -0
- {python_dotenvx-0.2.2 → python_dotenvx-0.2.3}/src/python_dotenvx.egg-info/top_level.txt +0 -0
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
## [Unreleased](https://github.com/dotenvx/python-dotenvx/compare/v0.2.
|
|
5
|
+
## [Unreleased](https://github.com/dotenvx/python-dotenvx/compare/v0.2.3...main)
|
|
6
|
+
|
|
7
|
+
## [0.2.3](https://github.com/dotenvx/dotenvx/compare/v0.2.2...v0.2.3)
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
* Patch `dotenvx` binary install across multiple edge cases
|
|
6
12
|
|
|
7
13
|
## [0.2.2](https://github.com/dotenvx/dotenvx/compare/v0.2.1...v0.2.2)
|
|
8
14
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-dotenvx
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: [dotenvx.com] a better dotenv–from the creator of `dotenv`
|
|
5
5
|
Home-page: https://github.com/dotenvx/python-dotenvx
|
|
6
6
|
Author: dotenv
|
|
@@ -46,23 +46,37 @@ Install and use it in code just like `python-dotenv`.
|
|
|
46
46
|
```sh
|
|
47
47
|
pip install python-dotenvx
|
|
48
48
|
```
|
|
49
|
+
|
|
50
|
+
Then run `dotenvx-postinstall` to install the `dotenvx` binary (python-dotenvx is a wrapper).
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
dotenvx-postinstall
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Then use it in code.
|
|
57
|
+
|
|
49
58
|
```python
|
|
50
59
|
# main.py
|
|
51
60
|
import os
|
|
52
61
|
from dotenvx import load_dotenvx
|
|
53
|
-
load_dotenvx()
|
|
62
|
+
load_dotenvx() # take environment variables from .env.
|
|
54
63
|
|
|
55
64
|
print(os.getenv("S3_BUCKET"))
|
|
56
65
|
```
|
|
57
66
|
|
|
58
67
|
|
|
59
68
|
|
|
60
|
-
|
|
61
69
|
# Changelog
|
|
62
70
|
|
|
63
71
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
64
72
|
|
|
65
|
-
## [Unreleased](https://github.com/dotenvx/python-dotenvx/compare/v0.2.
|
|
73
|
+
## [Unreleased](https://github.com/dotenvx/python-dotenvx/compare/v0.2.3...main)
|
|
74
|
+
|
|
75
|
+
## [0.2.3](https://github.com/dotenvx/dotenvx/compare/v0.2.2...v0.2.3)
|
|
76
|
+
|
|
77
|
+
### Changed
|
|
78
|
+
|
|
79
|
+
* Patch `dotenvx` binary install across multiple edge cases
|
|
66
80
|
|
|
67
81
|
## [0.2.2](https://github.com/dotenvx/dotenvx/compare/v0.2.1...v0.2.2)
|
|
68
82
|
|
|
@@ -25,14 +25,22 @@ Install and use it in code just like `python-dotenv`.
|
|
|
25
25
|
```sh
|
|
26
26
|
pip install python-dotenvx
|
|
27
27
|
```
|
|
28
|
+
|
|
29
|
+
Then run `dotenvx-postinstall` to install the `dotenvx` binary (python-dotenvx is a wrapper).
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
dotenvx-postinstall
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Then use it in code.
|
|
36
|
+
|
|
28
37
|
```python
|
|
29
38
|
# main.py
|
|
30
39
|
import os
|
|
31
40
|
from dotenvx import load_dotenvx
|
|
32
|
-
load_dotenvx()
|
|
41
|
+
load_dotenvx() # take environment variables from .env.
|
|
33
42
|
|
|
34
43
|
print(os.getenv("S3_BUCKET"))
|
|
35
44
|
```
|
|
36
45
|
|
|
37
46
|
|
|
38
|
-
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import os
|
|
2
|
-
import subprocess
|
|
3
2
|
from setuptools import setup, find_packages
|
|
4
|
-
from setuptools.command.install import install
|
|
5
3
|
|
|
6
4
|
src = {}
|
|
7
5
|
dir = os.path.abspath(os.path.dirname(__file__))
|
|
@@ -17,25 +15,6 @@ def read_files(files):
|
|
|
17
15
|
|
|
18
16
|
readme = read_files(['README.md', 'CHANGELOG.md'])
|
|
19
17
|
|
|
20
|
-
class InstallBinary(install):
|
|
21
|
-
def run(self):
|
|
22
|
-
print("installing dotenvx........")
|
|
23
|
-
|
|
24
|
-
bin_dir = os.path.join(dir, 'src', 'dotenvx', 'bin')
|
|
25
|
-
os.makedirs(bin_dir, exist_ok=True)
|
|
26
|
-
|
|
27
|
-
# install dotenvx binary using your install script into bin/
|
|
28
|
-
subprocess.run(
|
|
29
|
-
['sh', '-c', f'curl -sfS "https://dotenvx.sh?directory={bin_dir}" | sh'],
|
|
30
|
-
check=True,
|
|
31
|
-
stdout=None,
|
|
32
|
-
stderr=None
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
print("installed dotenvx........")
|
|
36
|
-
|
|
37
|
-
super().run()
|
|
38
|
-
|
|
39
18
|
setup(
|
|
40
19
|
name='python-dotenvx',
|
|
41
20
|
description=src['__description__'],
|
|
@@ -45,6 +24,7 @@ setup(
|
|
|
45
24
|
license=src['__license__'],
|
|
46
25
|
author=src['__author__'],
|
|
47
26
|
author_email=src['__author_email__'],
|
|
27
|
+
include_package_data=True,
|
|
48
28
|
packages=find_packages('src'),
|
|
49
29
|
package_dir={'': 'src'},
|
|
50
30
|
url=src['__url__'],
|
|
@@ -61,5 +41,9 @@ setup(
|
|
|
61
41
|
],
|
|
62
42
|
install_requires=[
|
|
63
43
|
],
|
|
64
|
-
|
|
44
|
+
entry_points={
|
|
45
|
+
'console_scripts': [
|
|
46
|
+
'dotenvx-postinstall=dotenvx.main:postinstall',
|
|
47
|
+
],
|
|
48
|
+
}
|
|
65
49
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
__title__ = "python-dotenvx"
|
|
2
2
|
__description__ = "[dotenvx.com] a better dotenv–from the creator of `dotenv`"
|
|
3
3
|
__url__ = "https://github.com/dotenvx/python-dotenvx"
|
|
4
|
-
__version__ = "0.2.
|
|
4
|
+
__version__ = "0.2.3"
|
|
5
5
|
__author__ = "dotenv"
|
|
6
6
|
__author_email__ = "mot@dotenvx.com"
|
|
7
7
|
__license__ = "BSD-3-Clause"
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import json
|
|
3
|
+
import shutil
|
|
4
|
+
import subprocess
|
|
5
|
+
|
|
6
|
+
from dotenvx import __file__ as package_path
|
|
7
|
+
|
|
8
|
+
ERROR_MISSING_BINARY = "[MISSING_BINARY] missing dotenvx binary\n[MISSING_BINARY] https://github.com/dotenvx/dotenvx/issues/576"
|
|
9
|
+
|
|
10
|
+
def load_dotenvx():
|
|
11
|
+
output = get()
|
|
12
|
+
|
|
13
|
+
try:
|
|
14
|
+
parsed = json.loads(output)
|
|
15
|
+
for key, value in parsed.items():
|
|
16
|
+
os.environ[key] = value
|
|
17
|
+
return parsed
|
|
18
|
+
except Exception as e:
|
|
19
|
+
raise RuntimeError(f"Failed to parse dotenvx output: {e}")
|
|
20
|
+
|
|
21
|
+
def get():
|
|
22
|
+
binpath = binary()
|
|
23
|
+
output = subprocess.run(
|
|
24
|
+
[binpath, "get", "-pp"],
|
|
25
|
+
capture_output=True,
|
|
26
|
+
text=True,
|
|
27
|
+
check=True
|
|
28
|
+
)
|
|
29
|
+
return output.stdout.strip()
|
|
30
|
+
|
|
31
|
+
def binary():
|
|
32
|
+
local_bin = os.path.join(os.path.dirname(package_path), "bin", "dotenvx")
|
|
33
|
+
candidates = [local_bin, shutil.which("dotenvx")]
|
|
34
|
+
|
|
35
|
+
for candidate in candidates:
|
|
36
|
+
if candidate and os.path.isfile(candidate) and os.access(candidate, os.X_OK):
|
|
37
|
+
if is_stub_file(candidate):
|
|
38
|
+
continue
|
|
39
|
+
return candidate
|
|
40
|
+
|
|
41
|
+
print("[MISSING_BINARY] missing dotenvx binary")
|
|
42
|
+
print("[MISSING_BINARY] https://github.com/dotenvx/dotenvx/issues/576")
|
|
43
|
+
raise SystemExit(1)
|
|
44
|
+
|
|
45
|
+
def is_stub_file(path, max_stub_size=1024):
|
|
46
|
+
try:
|
|
47
|
+
return os.path.getsize(path) < max_stub_size
|
|
48
|
+
except OSError:
|
|
49
|
+
return False
|
|
50
|
+
|
|
51
|
+
def postinstall():
|
|
52
|
+
bin_dir = os.path.join(os.path.dirname(package_path), "bin")
|
|
53
|
+
os.makedirs(bin_dir, exist_ok=True)
|
|
54
|
+
|
|
55
|
+
try:
|
|
56
|
+
subprocess.run(
|
|
57
|
+
["sh", "-c", f"curl -sfS https://dotenvx.sh?directory={bin_dir} | sh"],
|
|
58
|
+
check=True
|
|
59
|
+
)
|
|
60
|
+
except subprocess.CalledProcessError as e:
|
|
61
|
+
raise SystemExit(e.returncode)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-dotenvx
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: [dotenvx.com] a better dotenv–from the creator of `dotenv`
|
|
5
5
|
Home-page: https://github.com/dotenvx/python-dotenvx
|
|
6
6
|
Author: dotenv
|
|
@@ -46,23 +46,37 @@ Install and use it in code just like `python-dotenv`.
|
|
|
46
46
|
```sh
|
|
47
47
|
pip install python-dotenvx
|
|
48
48
|
```
|
|
49
|
+
|
|
50
|
+
Then run `dotenvx-postinstall` to install the `dotenvx` binary (python-dotenvx is a wrapper).
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
dotenvx-postinstall
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Then use it in code.
|
|
57
|
+
|
|
49
58
|
```python
|
|
50
59
|
# main.py
|
|
51
60
|
import os
|
|
52
61
|
from dotenvx import load_dotenvx
|
|
53
|
-
load_dotenvx()
|
|
62
|
+
load_dotenvx() # take environment variables from .env.
|
|
54
63
|
|
|
55
64
|
print(os.getenv("S3_BUCKET"))
|
|
56
65
|
```
|
|
57
66
|
|
|
58
67
|
|
|
59
68
|
|
|
60
|
-
|
|
61
69
|
# Changelog
|
|
62
70
|
|
|
63
71
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
64
72
|
|
|
65
|
-
## [Unreleased](https://github.com/dotenvx/python-dotenvx/compare/v0.2.
|
|
73
|
+
## [Unreleased](https://github.com/dotenvx/python-dotenvx/compare/v0.2.3...main)
|
|
74
|
+
|
|
75
|
+
## [0.2.3](https://github.com/dotenvx/dotenvx/compare/v0.2.2...v0.2.3)
|
|
76
|
+
|
|
77
|
+
### Changed
|
|
78
|
+
|
|
79
|
+
* Patch `dotenvx` binary install across multiple edge cases
|
|
66
80
|
|
|
67
81
|
## [0.2.2](https://github.com/dotenvx/dotenvx/compare/v0.2.1...v0.2.2)
|
|
68
82
|
|
|
@@ -7,7 +7,9 @@ setup.py
|
|
|
7
7
|
src/dotenvx/__init__.py
|
|
8
8
|
src/dotenvx/__version__.py
|
|
9
9
|
src/dotenvx/main.py
|
|
10
|
+
src/dotenvx/bin/dotenvx
|
|
10
11
|
src/python_dotenvx.egg-info/PKG-INFO
|
|
11
12
|
src/python_dotenvx.egg-info/SOURCES.txt
|
|
12
13
|
src/python_dotenvx.egg-info/dependency_links.txt
|
|
14
|
+
src/python_dotenvx.egg-info/entry_points.txt
|
|
13
15
|
src/python_dotenvx.egg-info/top_level.txt
|
python_dotenvx-0.2.2/MANIFEST.in
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
include CHANGELOG.md
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_dotenvx-0.2.2 → python_dotenvx-0.2.3}/src/python_dotenvx.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|