theskumar / theskumar/python-dotenv

Do you plan to call os.path.expandvars?

オープン
#459 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Python
スター
8.9k
フォーク
581
PR マージ指標
30日以内にマージされた PR はありません

説明

I request to be able to fill in the environment variable name by calling os.path.environmentvars when setting the value in main.py#L98.

An environment variable name is, for example, %TEMP% (in Windows).

[.env]
LOG_DIR=%TEMP%\log

If possible, it would be nice if it could be called recursively. os.path.expandvars will only expand the environment variable name once.

def expandvarsRecursive(value):.
    expanded = os.path.expandvars(value)
    return value if expanded == value else expandvarsRecursive(expanded)

The reason for this is that if it is called recursively, we don't have to keep track of the same values.

[.env]
PROJECT_HOME=C:\project
LOG_DIR=%PROJECT_HOME%\log
TRACE_LOG_DIR=%LOG_DIR%\trace

Please consider this.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Start in src/dotenv/main.py around line 98 and trace how values from .env files are expanded. Check how Windows-style variables and recursive references should behave, then verify the LOG_DIR and TRACE_LOG_DIR examples resolve as requested. No linked tests or further maintainer guidance are provided.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
tooling
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。