Skip to content
Open
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
6 changes: 1 addition & 5 deletions .github/workflows/CI-CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

- name: Install linting tools
run: |
python -m pip install shyaml flake8 black black-nb flake8-nb ruff
python -m pip install ruff

- name: Check Ruff formatting
id: ruff-format
Expand All @@ -47,10 +47,6 @@ jobs:
run: |
echo "::warning::Ruff formatting issues detected. Run 'ruff format .' locally to apply formatting fixes."

- name: Run black formatter
run: |
black -l 99 . --exclude '\.ipynb$'

- name: Install pytest and run tests
run: |
pip install pytest pytest-cov
Expand Down
12 changes: 0 additions & 12 deletions .lgtm.yml

This file was deleted.

1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
include LICENSE
include MANIFEST.in
include versioneer.py

graft openmmdl
global-exclude *.py[cod] __pycache__ *.so
35 changes: 0 additions & 35 deletions devtools/conda-envs/test_env.yaml

This file was deleted.

97 changes: 0 additions & 97 deletions devtools/scripts/create_conda_env.py

This file was deleted.

1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ channels:
dependencies:
- pip
- setuptools>=61.0
- versioningit~=2.0
- sqlite>=3.40
- pytest>=6.1.2
- pytest-runner
Expand Down
27 changes: 7 additions & 20 deletions openmmdl/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,30 +77,17 @@ def _normalize_help_tokens(argv: List[str]) -> List[str]:

def _run_target(target: str, forwarded: List[str], prog: str) -> int:
"""
Import target and call either:
- module:function (callable)
- module (expects main())
Forward argv via sys.argv.
Import 'module:function' target, call it, and forward argv via sys.argv.
"""
old_argv = sys.argv
sys.argv = [prog, *forwarded]
try:
if ":" in target:
mod_name, func_name = target.split(":", 1)
mod = importlib.import_module(mod_name)
fn = getattr(mod, func_name, None)
if fn is None or not callable(fn):
raise RuntimeError(f"Module '{mod_name}' does not expose callable '{func_name}'.")
rc = fn()
return 0 if rc is None else int(rc)

mod = importlib.import_module(target)
if not hasattr(mod, "main"):
raise RuntimeError(
f"Module '{target}' does not expose a main() function. "
"Add def main(argv=None) and call it from __main__."
)
rc = mod.main() # type: ignore[attr-defined]
mod_name, func_name = target.split(":", 1)
mod = importlib.import_module(mod_name)
fn = getattr(mod, func_name, None)
if fn is None or not callable(fn):
raise RuntimeError(f"Module '{mod_name}' does not expose callable '{func_name}'.")
rc = fn()
return 0 if rc is None else int(rc)
finally:
sys.argv = old_argv
Expand Down
4 changes: 0 additions & 4 deletions openmmdl/utils/logging_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ def setup_logging(
logging.getLogger("matplotlib").setLevel(logging.WARNING)


def get_logger(name: str) -> logging.Logger:
return logging.getLogger(name)


def _clear_handlers(logger: logging.Logger) -> None:
for handler in list(logger.handlers):
try:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=61.0", "versioningit"]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

# Self-descriptive entries which should always be present
Expand Down
15 changes: 0 additions & 15 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
[flake8]
max-line-length = 100
ignore = E122,E123,E126,E127,E128,E731,E722
exclude =
build,
openmmdl/_version.py,
tests,
conda.recipe,
.git,
versioneer.py,
benchmarks,
.asv

[tool:pytest]
norecursedirs = .* *.egg* build dist conda.recipe
addopts =
--junitxml=junit.xml
--ignore setup.py
--ignore run_test.py
--tb native
--strict-markers
--durations=20
Expand Down
Loading
Loading