Skip to content

Commit

Permalink
Stop bundling configobj (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamJamieson authored Nov 7, 2023
1 parent 0b7e4ca commit 99a828f
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 3,969 deletions.
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
==================

- Update style and linting checking [#103]
- Fix regex issue in internal configobj [#108]
- Remove bundled ``configobj`` package in favor of the ``configobj`` package
bundled into ``astropy``. [#122]

0.5.1 (2023-10-02)
==================
Expand All @@ -11,7 +14,6 @@
- Move ``strun`` to entrypoints [#101]
- Deprecate ``preserve_comments`` fix spec parsing for inline comments with
a closing parenthesis [#107]
- Fix regex issue in internal configobj [#108]

0.5.0 (2023-04-19)
==================
Expand Down
8 changes: 0 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ addopts = [
"-ra",
"--color=yes"
]
norecursedirs = [
'src/stpipe/extern',
]
testpaths = [
'tests',
]
Expand All @@ -96,7 +93,6 @@ src = [
line-length = 88
extend-exclude = [
'docs',
'src/stpipe/extern',
'scripts/strun',
]

Expand Down Expand Up @@ -156,14 +152,10 @@ force-exclude = '''
| \.git
| \.pytest_cache
| \.tox
| src/stpipe/extern
)/
)
'''

[tool.flynt]
exclude = ["src/stpipe/extern/*"]

[tool.codespell]
skip="*.pdf,*.fits,*.asdf,.tox,build,./tags,.git,docs/_build"
# ignore-words-list="""
Expand Down
12 changes: 6 additions & 6 deletions src/stpipe/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@

from asdf import ValidationError as AsdfValidationError
from asdf import open as asdf_open

from . import utilities
from .config import StepConfig
from .datamodel import AbstractDataModel
from .extern.configobj.configobj import (
from astropy.extern.configobj.configobj import (
ConfigObj,
Section,
flatten_errors,
get_extra_values,
)
from .extern.configobj.validate import ValidateError, Validator, VdtTypeError
from astropy.extern.configobj.validate import ValidateError, Validator, VdtTypeError

from . import utilities
from .config import StepConfig
from .datamodel import AbstractDataModel
from .utilities import _not_set

# Configure logger
Expand Down
8 changes: 0 additions & 8 deletions src/stpipe/extern/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +0,0 @@
"""
This package contains python package(s) that are bundled with jwst but are
external to jwst, and hence are developed in a separate source tree.
Currently the bundled external dependencies are:
.. _ConfigObj: https://github.com/DiffSK/configobj
"""
20 changes: 20 additions & 0 deletions src/stpipe/extern/configobj.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import inspect
import sys
import warnings

from astropy.extern import configobj

# Add submodules to system modules so they are available under the same path
for mod in inspect.getmembers(configobj, inspect.ismodule):
# add as a local variable
locals()[mod[0]] = mod[1]
# Add the submodule to the system modules so it can be imported
sys.modules[f"stpipe.extern.configobj.{mod[0]}"] = mod[1]


warnings.warn(
"stpipe.extern.configobj is deprecated in favor of astropy.extern.configobj, "
"please use that instead.",
DeprecationWarning,
stacklevel=2,
)
Empty file.
Loading

0 comments on commit 99a828f

Please sign in to comment.