diff --git a/MANIFEST.in b/MANIFEST.in index 78e43e9b..98eaa40b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,7 @@ include LICENSE *.md *.yml *.toml include tox.ini +recursive-include docs *.md recursive-include tests *.py include .bumpversion.cfg diff --git a/docs/changelog.md b/docs/changelog.md new file mode 120000 index 00000000..04c99a55 --- /dev/null +++ b/docs/changelog.md @@ -0,0 +1 @@ +../CHANGELOG.md \ No newline at end of file diff --git a/docs/contributing.md b/docs/contributing.md new file mode 120000 index 00000000..44fcc634 --- /dev/null +++ b/docs/contributing.md @@ -0,0 +1 @@ +../CONTRIBUTING.md \ No newline at end of file diff --git a/docs/index.md b/docs/index.md new file mode 120000 index 00000000..32d46ee8 --- /dev/null +++ b/docs/index.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/docs/reference.md b/docs/reference.md new file mode 100644 index 00000000..a126448e --- /dev/null +++ b/docs/reference.md @@ -0,0 +1,3 @@ +# Reference + +::: dotenv diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 00000000..27063ca2 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,23 @@ +site_name: python-dotenv +repo_url: https://github.com/theskumar/python-dotenv +edit_uri: "" +theme: + name: material + palette: + primary: green +markdown_extensions: + - mdx_truly_sane_lists +plugins: + - mkdocstrings: + handlers: + python: + rendering: + show_root_heading: yes + show_submodules: no + separate_signature: yes + - search +nav: + - Home: index.md + - Changelog: changelog.md + - Contributing: contributing.md + - Reference: reference.md diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 64b4431f..00000000 --- a/pyproject.toml +++ /dev/null @@ -1,5 +0,0 @@ -[tool.portray] -modules = ["dotenv"] - -[tool.portray.mkdocs] -repo_url = "https://github.com/theskumar/python-dotenv" diff --git a/requirements.txt b/requirements.txt index de374f43..54354312 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,16 @@ +black~=22.3.0 bumpversion click flake8>=2.2.3 ipython +mdx_truly_sane_lists~=1.2 +mkdocs-include-markdown-plugin~=3.3.0 +mkdocs-material~=8.2.9 +mkdocstrings[python]~=0.18.1 +mkdocs~=1.3.0 pytest-cov pytest>=3.9 sh>=1.09 tox -wheel twine -portray +wheel diff --git a/src/dotenv/main.py b/src/dotenv/main.py index 76ee5993..e7ad4308 100644 --- a/src/dotenv/main.py +++ b/src/dotenv/main.py @@ -198,10 +198,10 @@ def unset_key( encoding: Optional[str] = "utf-8", ) -> Tuple[Optional[bool], str]: """ - Removes a given key from the given .env + Removes a given key from the given `.env` file. - If the .env path given doesn't exist, fails - If the given key doesn't exist in the .env, fails + If the .env path given doesn't exist, fails. + If the given key doesn't exist in the .env, fails. """ if not os.path.exists(dotenv_path): logger.warning("Can't delete from %s - it doesn't exist.", dotenv_path) @@ -316,16 +316,17 @@ def load_dotenv( ) -> bool: """Parse a .env file and then load all the variables found as environment variables. - - *dotenv_path*: absolute or relative path to .env file. - - *stream*: Text stream (such as `io.StringIO`) with .env content, used if - `dotenv_path` is `None`. - - *verbose*: whether to output a warning the .env file is missing. Defaults to - `False`. - - *override*: whether to override the system environment variables with the variables - in `.env` file. Defaults to `False`. - - *encoding*: encoding to be used to read the file. + Parameters: + dotenv_path: Absolute or relative path to .env file. + stream: Text stream (such as `io.StringIO`) with .env content, used if + `dotenv_path` is `None`. + verbose: Whether to output a warning the .env file is missing. + override: Whether to override the system environment variables with the variables + from the `.env` file. + encoding: Encoding to be used to read the file. - If both `dotenv_path` and `stream`, `find_dotenv()` is used to find the .env file. + If both `dotenv_path` and `stream` are `None`, `find_dotenv()` is used to find the + .env file. """ if dotenv_path is None and stream is None: dotenv_path = find_dotenv() @@ -356,12 +357,10 @@ def dotenv_values( `{"foo": None}` Parameters: - - - `dotenv_path`: absolute or relative path to the .env file. - - `stream`: `StringIO` object with .env content, used if `dotenv_path` is `None`. - - `verbose`: whether to output a warning if the .env file is missing. Defaults to - `False`. - - `encoding`: encoding to be used to read the file. Defaults to `"utf-8"`. + dotenv_path: Absolute or relative path to the .env file. + stream: `StringIO` object with .env content, used if `dotenv_path` is `None`. + verbose: Whether to output a warning if the .env file is missing. + encoding: Encoding to be used to read the file. If both `dotenv_path` and `stream` are `None`, `find_dotenv()` is used to find the .env file.