Skip to content

Commit

Permalink
Switch to a new continuous integration service to build and test this…
Browse files Browse the repository at this point in the history
… python package
  • Loading branch information
vladpunko committed Oct 9, 2023
1 parent e853024 commit 3cf298d
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 46 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: python testing and linting

on:
push:
branches:
- "master"

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- name: Step -- 1.
uses: actions/checkout@v3

- name: Step -- 2.
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Step -- 3.
run: pip3 install --upgrade pip && pip3 install --no-cache-dir --upgrade tox

- name: Step -- 4.
run: tox && tox -e lint
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions README.markdown → README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# notebook-environments

![tests](https://github.com/vladpunko/notebook-environments/actions/workflows/tests.yml/badge.svg)

Manage python virtual environments on the working notebook server.

![usage-example](https://raw.githubusercontent.com/vladpunko/notebook-environments/master/notebook_environments.gif)
Expand Down
10 changes: 5 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ fi

workdir="$(mktemp -d)"

_cleanup() {
rm -f -r -- "${workdir}"
}
trap _cleanup 0 1 2 3 6

# Step -- 1.
git clone --depth=1 --branch=master -- https://github.com/vladpunko/notebook-environments.git "${workdir}" > /dev/null 2>&1 || {
echo 'An error occurred while downloading the source code to the current machine.' >&2
Expand All @@ -25,8 +30,3 @@ install -m 755 "${workdir}/n.sh" /usr/local/bin/n

# Step -- 3.
install -m 755 "${workdir}/notebook_environments.py" /usr/local/bin/notebook-environments

_cleanup() {
rm -f -r -- "${workdir}"
}
trap _cleanup 0 1 2 3 6
8 changes: 6 additions & 2 deletions notebook_environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import subprocess
import sys
import tempfile
import warnings

try:
_to_unicode = unicode
Expand Down Expand Up @@ -148,7 +149,7 @@
"show_kernels",
)

__version__ = "0.8.11"
__version__ = "0.8.12"


def _in_virtual_environment():
Expand Down Expand Up @@ -363,7 +364,10 @@ def initialize_new_notebook_environment():
sys.exit(errno.EPERM)

try:
from jupyter_core.paths import jupyter_path # noqa
with warnings.catch_warnings():
warnings.simplefilter("ignore")

from jupyter_core.paths import jupyter_path # noqa
except ImportError:
def jupyter_path(subdirs): # this function is to return a list
return [_get_data_path(subdirs)]
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
raise RuntimeError("The notebook-environments program doesn't support windows at this moment.")


with io.open("README.markdown", mode="rt", encoding="utf-8") as stream_in:
with io.open("README.md", mode="rt", encoding="utf-8") as stream_in:
# Load the readme file and use it as the long description for this python package.
long_description = stream_in.read()

Expand Down Expand Up @@ -67,6 +67,7 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",

"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{27,35,36,37,38,39,310}
envlist = py{27,35,36,37,38,39,310,311}

# Ignore errors related to absence of some python interpreters on the current machine.
skip_missing_interpreters = true
Expand All @@ -13,12 +13,13 @@ deps =
pytest-cov
six
py{27,35}: pyfakefs<4.5.0 # mock the python file system modules for some previous interpreter versions
py{36,37,38,39,310}: pyfakefs
py{36,37,38,39,310,311}: pyfakefs

[testenv:lint]
commands = python -m pre_commit run --all-files --config .githooks.yml
deps =
pre-commit
skip_install = true

[coverage:run]
source = notebook_environments
Expand Down

0 comments on commit 3cf298d

Please sign in to comment.