Skip to content

Commit

Permalink
Merge pull request #12 from FREVA-CLINT/rename-module
Browse files Browse the repository at this point in the history
Rename module
  • Loading branch information
antarcticrainforest authored Jul 5, 2024
2 parents 48c8b56 + 9a7c04a commit 6ca584d
Show file tree
Hide file tree
Showing 14 changed files with 70 additions and 16 deletions.
35 changes: 35 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# .coveragerc to control coverage.py
[run]
branch = False
omit = .converage*
*/tests/*
*/__main__.py
[report]
fail_under = 95
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code:
def __repr__
if self\.debug
def _post_url(self)

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError
except KeyboardInterrupt:
except ImportError:
except RuntimeError
raise SystemExit

# Don't complain if non-runnable code isn't run:
if 0:
if perf_file *:
p_col = *
f_col = *
q_col = *
if __name__ == .__main__.:

ignore_errors = False
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog

All notable changes to this project will be documented in this file.
## [v2407.0.0]
### Changed
- Renamed python module `kernel_install` -> `jupyter_kernel_install`

## [v2404.0.1]
### Added
- Initial release of the project.
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ Options:
The display name of the kernel (default: None)
--version, -V Display version and exit
```
Alternatively you can use:

```console
python -m jupyter_kernel_install --help
```

The following kernel specifications are supported:
- python3
Expand Down
14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["flit_core >=3.2"]
build-backend = "flit_core.buildapi"

[project]
name = "kernel-install"
name = "jupyter-kernel-install"
authors = [{name = "DKRZ, Clint", email = "[email protected]"}]
readme = "README.md"
license = {file = "LICENSE"}
Expand Down Expand Up @@ -38,10 +38,10 @@ Home= "https://github.com/FREVA-CLINT/install-kernelspec"


[project.scripts]
jupyter-kernel-install = "kernel_install.cli:cli"
jupyter-kernel-install = "jupyter_kernel_install.cli:cli"

[tool.mypy]
files = "src/kernel_install"
files = "src/jupyter_kernel_install"
strict = true
warn_unused_ignores = true
warn_unreachable = true
Expand Down Expand Up @@ -73,7 +73,7 @@ deps = -c {toxinidir}/.github/dependabot/constraints.txt
-e .[dev]
commands =
python3 -m pytest -vv --cov=src --cov-report=html:coverage_report --junitxml report.xml --cov-report xml src/kernel_install/tests
python3 -m pytest -vv --cov=src --cov-report=html:coverage_report --junitxml report.xml --cov-report xml src/jupyter_kernel_install/tests
python3 -m coverage report --fail-under=98.5 --precision=2
[testenv:lint]
Expand All @@ -84,8 +84,8 @@ deps = .[dev]
pylint
commands =
isort --check --profile black -t py312 -l 79 src
flake8 src/kernel_install --count --max-complexity=5 --max-line-length=88 --statistics --show-source
pylint src/kernel_install --fail-under 9
flake8 src/jupyter_kernel_install --count --max-complexity=5 --max-line-length=88 --statistics --show-source
pylint src/jupyter_kernel_install --fail-under 9
[testenv:types]
deps = .[dev]
mypy
Expand All @@ -96,7 +96,7 @@ deps = git-python
packaging
requests
tomli
commands = python3 bump.py tag kernel_install -b main
commands = python3 bump.py tag jupyter_kernel_install -b main
allowlist_externals = rm
curl
commands_pre = curl -H 'Cache-Control: no-cache' -Ls -o bump.py https://raw.githubusercontent.com/FREVA-CLINT/freva-deployment/versions/release.py
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@

from .install import bash, python, r

__version__ = "2404.0.1"
__version__ = "2407.0.0"
__all__ = ["bash", "r", "python"]
10 changes: 10 additions & 0 deletions src/jupyter_kernel_install/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Command line interface for jupyter_kernel_install."""

import re
import sys

from .cli import cli

if __name__ == "__main__":
sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])
cli(sys.argv[1:])
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from rich import print as pprint
from rich_argparse import ArgumentDefaultsRichHelpFormatter

from kernel_install import __version__, install
from jupyter_kernel_install import __version__, install

from .install import __all__ as methods
from .logger import logger, logger_stream_handle
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@

import pytest

import kernel_install
import jupyter_kernel_install


@pytest.fixture(scope="function")
def r_kernel() -> Iterator[Path]:
"""Set the name of the python kernel."""
out = kernel_install.install.KERNEL_DIR / "r_test"
out = jupyter_kernel_install.install.KERNEL_DIR / "r_test"
yield out


@pytest.fixture(scope="function")
def bash_kernel() -> Iterator[Path]:
"""Set the name of the python kernel."""
out = kernel_install.install.KERNEL_DIR / "bash_test"
out = jupyter_kernel_install.install.KERNEL_DIR / "bash_test"
yield out


@pytest.fixture(scope="function")
def python_kernel() -> Iterator[Path]:
"""Set the name of the python kernel."""
out = kernel_install.install.KERNEL_DIR / "python_test"
out = jupyter_kernel_install.install.KERNEL_DIR / "python_test"
yield out
for r in out.rglob("*.*"):
r.unlink()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from pathlib import Path

from kernel_install.cli import cli
from jupyter_kernel_install.cli import cli


def test_cli(python_kernel: Path) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import mock
import pytest

from kernel_install import bash, python, r
from kernel_install.install import get_ld_library_path_from_bin
from jupyter_kernel_install import bash, python, r
from jupyter_kernel_install.install import get_ld_library_path_from_bin


def test_ld_library_path() -> None:
Expand Down

0 comments on commit 6ca584d

Please sign in to comment.