Skip to content

Commit b6f0400

Browse files
authored
setup: access version w/o __init__ to avoid circular imports (#56)
+ 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.
1 parent 4bdd4cf commit b6f0400

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

setup.cfg

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[metadata]
22
name = s1reader
3-
version = attr: s1reader.__version__
4-
description = A Sentinel1 metadata reader
3+
version = attr: s1reader.version.release_version
4+
description = A Sentinel-1 reader for ISCE3
55
long_description = file: README.md
66
long_description_content_type = text/markdown
77
url = https://github.com/opera-adt/s1-reader
@@ -16,10 +16,12 @@ classifiers =
1616
package_dir =
1717
= src
1818
packages = find:
19-
python_requires = >=3.9
2019
include_package_data = True
20+
python_requires = >=3.9
21+
install_requires =
22+
setuptools
23+
importlib_resources
2124

2225
[options.packages.find]
2326
where = src
24-
[options.package_data]
2527

src/s1reader/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# version info
2-
from .version import release_version as __version__
2+
from s1reader.version import release_version as __version__
33

44
# top-level functions to be easily used
5-
from .s1_burst_slc import Sentinel1BurstSlc
6-
from .s1_reader import load_bursts
7-
from .s1_orbit import get_orbit_file_from_dir
5+
from s1reader.s1_burst_slc import Sentinel1BurstSlc
6+
from s1reader.s1_reader import load_bursts
7+
from s1reader.s1_orbit import get_orbit_file_from_dir

src/s1reader/version.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,3 @@
1414
release_version = release_history[0].version
1515
release_date = release_history[0].date
1616

17-
# variable
18-
__version__ = release_version

0 commit comments

Comments
 (0)