Skip to content

Commit

Permalink
setup: access version w/o __init__ to avoid circular imports (#56)
Browse files Browse the repository at this point in the history
+ setup.cfg: setup the version number via `version.release_version`, instead of going through `__init__`, to avoid the circular imports that causes the pip install "ModuleNotFoundError"
+ setup.cfg: add `install_requires` and remove `[opptions.package_data]` to be consistent with compass
+ __inti__.py: use absolute module import, to be consistent with the good style from pyresample module
+ version.py: remove the duplicated `__version__` variable.
  • Loading branch information
yunjunz authored Jul 22, 2022
1 parent 4bdd4cf commit b6f0400
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 6 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[metadata]
name = s1reader
version = attr: s1reader.__version__
description = A Sentinel1 metadata reader
version = attr: s1reader.version.release_version
description = A Sentinel-1 reader for ISCE3
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/opera-adt/s1-reader
Expand All @@ -16,10 +16,12 @@ classifiers =
package_dir =
= src
packages = find:
python_requires = >=3.9
include_package_data = True
python_requires = >=3.9
install_requires =
setuptools
importlib_resources

[options.packages.find]
where = src
[options.package_data]

8 changes: 4 additions & 4 deletions src/s1reader/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# version info
from .version import release_version as __version__
from s1reader.version import release_version as __version__

# top-level functions to be easily used
from .s1_burst_slc import Sentinel1BurstSlc
from .s1_reader import load_bursts
from .s1_orbit import get_orbit_file_from_dir
from s1reader.s1_burst_slc import Sentinel1BurstSlc
from s1reader.s1_reader import load_bursts
from s1reader.s1_orbit import get_orbit_file_from_dir
2 changes: 0 additions & 2 deletions src/s1reader/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@
release_version = release_history[0].version
release_date = release_history[0].date

# variable
__version__ = release_version

0 comments on commit b6f0400

Please sign in to comment.