Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable fastenv to manage environment variables and .env files #2

Merged
merged 9 commits into from
Jul 27, 2021
Prev Previous commit
Next Next commit
Remove AnyIO file I/O # type: ignore[arg-type]
Typing was corrected by agronholm/anyio#338 in version 3.3.0.
  • Loading branch information
br3ndonland committed Jul 24, 2021
commit 347da2a35d3a8ff5b7a2569cbae9e1274eae7930
2 changes: 1 addition & 1 deletion fastenv/dotenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ async def dump_dotenv(

# TODO: `pathlib.Path.write_text` https://github.com/agronholm/anyio/pull/327
async with await anyio.open_file(destination, "w", encoding=encoding) as f:
await f.write(str(source)) # type: ignore[arg-type]
await f.write(str(source))
logger.info(f"fastenv dumped to {destination}")

except ImportError as e:
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async def env_file(
tmp_file = tmp_dir / ".env.testing"
# TODO: `pathlib.Path.write_text` https://github.com/agronholm/anyio/pull/327
async with await anyio.open_file(tmp_file, "x") as f:
await f.write(env_str) # type: ignore[arg-type]
await f.write(env_str)
# TODO: async `pathlib.Path` https://github.com/agronholm/anyio/pull/327
return pathlib.Path(tmp_file)

Expand All @@ -55,7 +55,7 @@ async def env_file_empty(env_file: pathlib.Path) -> pathlib.Path:
tmp_file = env_file.parent / ".env.empty"
# TODO: `pathlib.Path.write_text` https://github.com/agronholm/anyio/pull/327
async with await anyio.open_file(tmp_file, "x") as f:
await f.write("\n") # type: ignore[arg-type]
await f.write("\n")
# TODO: async `pathlib.Path` https://github.com/agronholm/anyio/pull/327
return pathlib.Path(tmp_file)

Expand Down