Skip to content

Commit

Permalink
Make __all__ exports static and internal modules private
Browse files Browse the repository at this point in the history
  • Loading branch information
jodal committed Nov 15, 2023
1 parent 15b1ee0 commit 0de4dcc
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 19 deletions.
11 changes: 6 additions & 5 deletions src/brreg/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
__version__ = "1.0.0a1"

from brreg.exceptions import * # noqa: F403, I001
from brreg._exceptions import BrregError, BrregRestError

# Must come after reexport
from brreg import exceptions

__all__ = exceptions.__all__
__all__ = [
# From _exceptions module:
"BrregError",
"BrregRestError",
]
3 changes: 0 additions & 3 deletions src/brreg/exceptions.py → src/brreg/_exceptions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
__all__ = ["BrregError", "BrregRestError"]


from typing import Optional


Expand Down
25 changes: 17 additions & 8 deletions src/brreg/enhetsregisteret/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@
See https://data.brreg.no/enhetsregisteret/api/docs/index.html for API details.
"""

from brreg.enhetsregisteret.client import * # noqa: F403, I001
from brreg.enhetsregisteret.types import * # noqa: F403

# Must come after reexport imports
from brreg.enhetsregisteret import (
client,
types,
from brreg.enhetsregisteret._client import get_enhet
from brreg.enhetsregisteret._types import (
Adresse,
Enhet,
InstitusjonellSektorkode,
Naeringskode,
Organisasjonsform,
)

__all__ = client.__all__ + types.__all__
__all__ = [
# From _client module:
"get_enhet",
# From _types module:
"Adresse",
"Enhet",
"InstitusjonellSektorkode",
"Naeringskode",
"Organisasjonsform",
]
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import requests

from brreg import BrregError, BrregRestError
from brreg.enhetsregisteret.types import Enhet

__all__ = ["get_enhet"]

from ._types import Enhet

BASE_URL = "https://data.brreg.no/enhetsregisteret/api"

Expand Down
File renamed without changes.

0 comments on commit 0de4dcc

Please sign in to comment.