Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ jobs:
python -m pip install --upgrade pip
pip install .[doc]

- name: Check installed version
# Run outside the checkout so cwd doesn't shadow site-packages
working-directory: /tmp
run: python -c "import imap_processing as m; assert m.__version__ != '0.0.0'"

- name: Build documentation
run: |
# SPHINXOPTS="-W --keep-going" is used to turn warnings into errors
Expand Down
9 changes: 4 additions & 5 deletions imap_processing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
# packet definitions directory path.
#
# This directory is used by the imap_processing package to find the packet definitions.
from importlib.metadata import PackageNotFoundError, version
from pathlib import Path

try:
from imap_processing._version import __version__ as __version__
from imap_processing._version import __version_tuple__ as __version_tuple__
except ImportError:
# _version.py is generated by poetry-dynamic-versioning at install time
__version__ = version("imap-processing")
except PackageNotFoundError:
# Running from a source tree that was never installed
__version__ = "0.0.0"
__version_tuple__ = (0, 0, 0)

# Eg. imap_module_directory = /usr/local/lib/python3.11/site-packages/imap_processing
imap_module_directory = Path(__file__).parent
Expand Down
3 changes: 1 addition & 2 deletions imap_processing/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import sys
from abc import ABC, abstractmethod
from datetime import datetime, timedelta
from importlib.metadata import version
from pathlib import Path
from time import sleep
from typing import final
Expand Down Expand Up @@ -540,7 +539,7 @@ def process(self) -> None:
3. Post-processing actions such as uploading files to the IMAP SDC.
4. Final cleanup actions.
"""
imap_processing_version = version("imap_processing")
imap_processing_version = imap_processing.__version__
logger.info(f"IMAP Processing Version: {imap_processing_version}")
logger.info(f"Processing {self.__class__.__name__} level {self.data_level}")
logger.info("Beginning preprocessing (download dependencies)")
Expand Down
11 changes: 1 addition & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ dependencies = [
[tool.poetry]
# Exclude tests from build
exclude = ["imap_processing/tests"]
include = ["imap_processing/_version.py",
"imap_processing/ultra/l1c/sim_spice_kernels/*"]
include = ["imap_processing/ultra/l1c/sim_spice_kernels/*"]
version = "0.0.0"

[tool.poetry.requires-plugins]
Expand Down Expand Up @@ -124,14 +123,6 @@ ignore-words-list = "livetime,nd"
enable = true
vcs = "git"

[tool.poetry-dynamic-versioning.files."imap_processing/_version.py"]
persistent-substitution = true
initial-content = """
# These version placeholders will be replaced later during substitution.
__version__ = "0.0.0"
__version_tuple__ = (0, 0, 0)
"""

[tool.numpydoc_validation]
checks = ["all", #report on all checks, except the following
"EX01", # Ignore No examples section found
Expand Down
Loading