Skip to content
This repository has been archived by the owner on Oct 12, 2024. It is now read-only.

Commit

Permalink
📝 Improve docs explanations
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed May 27, 2021
1 parent e694753 commit d4d4f21
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ It can read the version from a file `__init__.py` with:
__version__ = "0.1.0"
```

or alternatively, it can read it from a **git tag**, set with:
or alternatively, it can read it from a **git tag**, set with a GitHub release or with:

```console
$ git tag 0.1.0
Expand Down Expand Up @@ -243,7 +243,7 @@ $ poetry --version
Poetry (version 1.2.0a1)
```

## Version in init file support
## Support for version in init file

When using a `__version__` variable in your `__init__.py` you can have more logic in that file, import modules, and do more things above and below the declaration of that variable.

Expand All @@ -262,6 +262,8 @@ This is all fine and supported in your `__init__.py`:
```python
# __init__.py

# This is all valid 👍✅

from .main import do_awesome_stuff, AwesomeClass

awesome = AwesomeClass()
Expand All @@ -283,6 +285,8 @@ This example is all valid and supported, and it includes:
* The same string `__version__` inside a comment
* If blocks around

---

But this is not supported:

```python
Expand Down

0 comments on commit d4d4f21

Please sign in to comment.