python-dotenvx 0.2.3__py3-none-any.whl → 0.2.5__py3-none-any.whl

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.
dotenvx/__version__.py CHANGED
@@ -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.3"
4
+ __version__ = "0.2.5"
5
5
  __author__ = "dotenv"
6
6
  __author_email__ = "mot@dotenvx.com"
7
7
  __license__ = "BSD-3-Clause"
dotenvx/main.py CHANGED
@@ -2,6 +2,7 @@ import os
2
2
  import json
3
3
  import shutil
4
4
  import subprocess
5
+ import argparse
5
6
 
6
7
  from dotenvx import __file__ as package_path
7
8
 
@@ -29,8 +30,11 @@ def get():
29
30
  return output.stdout.strip()
30
31
 
31
32
  def binary():
32
- local_bin = os.path.join(os.path.dirname(package_path), "bin", "dotenvx")
33
- candidates = [local_bin, shutil.which("dotenvx")]
33
+ candidates = [
34
+ os.path.join(os.path.dirname(__file__), "bin", "dotenvx"), # package-local
35
+ os.path.join(os.getcwd(), "bin", "dotenvx"), # project-local
36
+ shutil.which("dotenvx") # global/system
37
+ ]
34
38
 
35
39
  for candidate in candidates:
36
40
  if candidate and os.path.isfile(candidate) and os.access(candidate, os.X_OK):
@@ -49,12 +53,23 @@ def is_stub_file(path, max_stub_size=1024):
49
53
  return False
50
54
 
51
55
  def postinstall():
52
- bin_dir = os.path.join(os.path.dirname(package_path), "bin")
56
+ parser = argparse.ArgumentParser()
57
+ parser.add_argument("--os", help="Override OS", default="")
58
+ parser.add_argument("--arch", help="Override architecture", default="")
59
+ args = parser.parse_args()
60
+
61
+ bin_dir = os.path.join(os.path.dirname(__file__), "bin")
53
62
  os.makedirs(bin_dir, exist_ok=True)
54
63
 
64
+ url = f"https://dotenvx.sh?directory={bin_dir}"
65
+ if args.os:
66
+ url += f"&os={args.os}"
67
+ if args.arch:
68
+ url += f"&arch={args.arch}"
69
+
55
70
  try:
56
71
  subprocess.run(
57
- ["sh", "-c", f"curl -sfS https://dotenvx.sh?directory={bin_dir} | sh"],
72
+ ["sh", "-c", f'curl -sfS "{url}" | sh'],
58
73
  check=True
59
74
  )
60
75
  except subprocess.CalledProcessError as e:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-dotenvx
3
- Version: 0.2.3
3
+ Version: 0.2.5
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
@@ -51,6 +51,12 @@ Then run `dotenvx-postinstall` to install the `dotenvx` binary (python-dotenvx i
51
51
 
52
52
  ```sh
53
53
  dotenvx-postinstall
54
+
55
+ # or to specify the os-arch – useful for building binaries to a specific target such as linux-x86_64 on aws lambda
56
+ dotenvx-postinstall --os linux --arch x86_64
57
+
58
+ # you might also find you need to specify PYTHONPATH depend on how/where dotenvx installs to
59
+ PYTHONPATH=. bin/dotenvx-postinstall --os linux --arch x86_64
54
60
  ```
55
61
 
56
62
  Then use it in code.
@@ -70,7 +76,19 @@ print(os.getenv("S3_BUCKET"))
70
76
 
71
77
  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.
72
78
 
73
- ## [Unreleased](https://github.com/dotenvx/python-dotenvx/compare/v0.2.3...main)
79
+ ## [Unreleased](https://github.com/dotenvx/python-dotenvx/compare/v0.2.5...main)
80
+
81
+ ## [0.2.5](https://github.com/dotenvx/dotenvx/compare/v0.2.4...v0.2.5)
82
+
83
+ ### Added
84
+
85
+ * Add additional bin/* candidate to check for dotenvx binary
86
+
87
+ ## [0.2.4](https://github.com/dotenvx/dotenvx/compare/v0.2.3...v0.2.4)
88
+
89
+ ### Added
90
+
91
+ * Add the ability to specify the `os` and `arch` on `dotenvx-postinstall`
74
92
 
75
93
  ## [0.2.3](https://github.com/dotenvx/dotenvx/compare/v0.2.2...v0.2.3)
76
94
 
@@ -0,0 +1,10 @@
1
+ dotenvx/__init__.py,sha256=rfD8JBefABV8cPWOI8_po_RG6OMpFdrQTKRZSM5QipI,31
2
+ dotenvx/__version__.py,sha256=LmZrMiECOTpessWyZ13_ExPOPMjPFoWaA1njD5lAy1g,274
3
+ dotenvx/main.py,sha256=irs9VE4HZZWiBlZR4b_lQpr3ECn6nKFQwshYj_Lg3JQ,2230
4
+ dotenvx/bin/dotenvx,sha256=s7IfiwTOzpRT1vRD1UXsI-DXGv9Lp8ujCGyiwVExP8c,90
5
+ python_dotenvx-0.2.5.dist-info/licenses/LICENSE,sha256=Lt6wCRSMNsJJcSVkhx2Cl9kglLiOQXIo5PPOfbWe6e0,1498
6
+ python_dotenvx-0.2.5.dist-info/METADATA,sha256=QwC72olQVXUN7rtVgMdlR8kvs8fu0ZuzCG8iDjP-oJQ,2954
7
+ python_dotenvx-0.2.5.dist-info/WHEEL,sha256=wXxTzcEDnjrTwFYjLPcsW_7_XihufBwmpiBeiXNBGEA,91
8
+ python_dotenvx-0.2.5.dist-info/entry_points.txt,sha256=Nub8f_4lO2T3-qRk5wJF-ii_fI9PQ7oPTjSI9e1OaXk,65
9
+ python_dotenvx-0.2.5.dist-info/top_level.txt,sha256=nl1TEgPiBhIp7rqusyvY6zlWLlcDroqH5GQxH-ImMkk,8
10
+ python_dotenvx-0.2.5.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- dotenvx/__init__.py,sha256=rfD8JBefABV8cPWOI8_po_RG6OMpFdrQTKRZSM5QipI,31
2
- dotenvx/__version__.py,sha256=Rpofp5Y61psI6C7xFGZBkHVTHn-9vlZ9PVqa4b2b0m4,274
3
- dotenvx/main.py,sha256=1n17OLgvKn2EjM6ufY8DLKBhElKHgCOM04KXQtUhj8U,1738
4
- dotenvx/bin/dotenvx,sha256=s7IfiwTOzpRT1vRD1UXsI-DXGv9Lp8ujCGyiwVExP8c,90
5
- python_dotenvx-0.2.3.dist-info/licenses/LICENSE,sha256=Lt6wCRSMNsJJcSVkhx2Cl9kglLiOQXIo5PPOfbWe6e0,1498
6
- python_dotenvx-0.2.3.dist-info/METADATA,sha256=UJbx-bGlxiVZhaKMFRtG_n3EBytYUm-n7VdsXp01fnw,2332
7
- python_dotenvx-0.2.3.dist-info/WHEEL,sha256=wXxTzcEDnjrTwFYjLPcsW_7_XihufBwmpiBeiXNBGEA,91
8
- python_dotenvx-0.2.3.dist-info/entry_points.txt,sha256=Nub8f_4lO2T3-qRk5wJF-ii_fI9PQ7oPTjSI9e1OaXk,65
9
- python_dotenvx-0.2.3.dist-info/top_level.txt,sha256=nl1TEgPiBhIp7rqusyvY6zlWLlcDroqH5GQxH-ImMkk,8
10
- python_dotenvx-0.2.3.dist-info/RECORD,,