Skip to content

Commit e15cece

Browse files
Merge pull request #64 from paxtonfitzpatrick/main
final tweaks to code, tests, paper draft
2 parents 1597bb5 + 3311beb commit e15cece

File tree

7 files changed

+21
-23
lines changed

7 files changed

+21
-23
lines changed

.github/workflows/ci-tests-jupyter.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ jobs:
4242
- python-version: 3.7
4343
ipython-version: 5.5.0 # earliest version supported by davos
4444
- python-version: 3.7
45-
ipython-version: latest
45+
ipython-version: 7.31 # latest version to support Python 3.7
4646
- python-version: 3.8
47-
ipython-version: 7.3.0 # earliest version to support Python 3.8
47+
ipython-version: 7.3.0 # earliest version to support Python 3.8
4848
- python-version: 3.8
4949
ipython-version: latest
5050
- python-version: 3.9
51-
ipython-version: 7.15 # earliest version to support Python 3.9
51+
ipython-version: 7.15 # earliest version to support Python 3.9
5252
- python-version: 3.9
5353
ipython-version: latest
5454
env:
@@ -111,7 +111,7 @@ jobs:
111111
if [[ "$PYTHON_VERSION" =~ ^3.(6|7)$ ]]; then
112112
pip install typing-extensions
113113
fi
114-
[[ "$PYTHON_VERSION" == "3.6" ]] || pip install numpy==1.20.3
114+
[[ "$PYTHON_VERSION" == "3.6" ]] || pip install numpy==1.20.3
115115
pip install "ipykernel==5.0.0" ipython-genutils requests scipy fastdtw==0.3.4 tqdm==4.41.1
116116
if [[ "$IPYTHON_VERSION" == "latest" ]]; then
117117
pip install --upgrade IPython

davos/core/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ def smuggle(
854854
install_pkg = True
855855

856856
if install_pkg:
857-
# TODO: check for --yes (conda) and bypass if passed
857+
# TODO: for v0.2 conda implementation: bypass if -y/--yes passed
858858
if config.confirm_install and not installer_kwargs.get('no_input'):
859859
msg = (f"package '{pkg_name}' will be installed with the "
860860
f"following command:\n\t`{onion.install_cmd}`\n"

davos/core/parsers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ def __call__(self, parser, namespace, values, option_string=None):
453453
action='store_true',
454454
help="Do not warn about broken dependencies"
455455
)
456-
# NOTE: in the actual pip-install implementation, `--no-binary`,
456+
# note: in the actual pip-install implementation, `--no-binary`,
457457
# `--only-binary`, and `--prefer-binary` triggers a fairly complex
458458
# callback. But fortunately, we can just store all invocations and
459459
# forward them to the real pip-install parser

davos/implementations/jupyter.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import ipykernel
1515
import zmq
1616
from IPython.display import display, Javascript
17-
from ipython_genutils import py3compat
1817

1918
from davos import config
2019
from davos.implementations.js_functions import JS_FUNCTIONS
@@ -132,7 +131,7 @@ def prompt_restart_rerun_buttons(pkgs):
132131
in notebook environments.
133132
134133
"""
135-
# TODO: remove warning message when button is clicked
134+
# UI: could remove warning message when "continue" button is clicked
136135
msg = (
137136
"WARNING: The following packages were previously imported by the "
138137
"interpreter and could not be reloaded because their compiled modules "
@@ -213,7 +212,7 @@ def prompt_restart_rerun_buttons(pkgs):
213212

214213
# noinspection PyBroadException
215214
try:
216-
value = py3compat.unicode_to_str(reply['content']['value'])
215+
value = reply['content']['value']
217216
except Exception: # pylint: disable=broad-except
218217
if ipykernel.version_info[0] >= 6:
219218
_parent_header = kernel._parent_ident['shell']

paper/paper.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,16 @@ Google Colaboratory], community-maintained libraries for data manipulation
127127
visualization [e.g., `Matplotlib`, @Hunt07; `seaborn`, @Wask21], and myriad
128128
other tools.
129129

130-
However, one impediment to sharing and reproducing computational work
131-
implemented in Python is that different versions of a given package or library
132-
can behave differently, use different syntax, add or drop support for specific
133-
functions or other libraries, address (or introduce) bugs, and so on. While
134-
these challenges are present to some extent in any language or ecosystem, they
135-
have a particular impact on the Python community due to its unusually rapid
136-
growth relative to other languages. Ensuring stable and reproducible results
137-
across users typically requires ensuring that shared code is always run with the
138-
same set of versions for each package used. One common approach to solving this
139-
problem is to create containerized or virtualized environments (e.g., using
130+
One impediment to sharing and reproducing computational work implemented in
131+
Python is that different versions of a given package or library can behave
132+
differently, use different syntax, add or drop support for specific functions or
133+
other libraries, address (or introduce) bugs, and so on. While these challenges
134+
are present to some extent in any language or ecosystem, they have a particular
135+
impact on the Python community due to its unusually rapid growth relative to
136+
other languages. Ensuring stable and reproducible results across users typically
137+
requires ensuring that shared code is always run with the same set of versions
138+
for each package used. One common approach to solving this problem is to create
139+
containerized or virtualized environments (e.g., using
140140
[Docker](https://www.docker.com/),
141141
[Singularity](https://sylabs.io/singularity/), or
142142
[conda](https://docs.conda.io/en/latest/)) that house fully isolated Python
@@ -171,7 +171,7 @@ are satisfied after they are initially installed. Most dependency specification
171171
schemes follow a common strategy: required packages and package versions are
172172
listed in a configuration file (e.g., a `requirements.txt`, `pyproject.toml`,
173173
`environment.yml`, `Pipfile`, `RUN` instructions in a `Dockerfile`, etc.) which
174-
is used to install them in a Python environment upfront. After this initial
174+
is used to install them in a Python environment up front. After this initial
175175
setup, however, this method generally does not ensure that the specified
176176
requirements *remain* installed, allowing them to be easily
177177
altered—sometimes inadvertently. This can lead to subtle issues when

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = davos
3-
version = 0.0.1
3+
version = 0.1.0
44
description = Install and manage Python packages at runtime using the "smuggle" statement.
55
long_description = file: README.md
66
long_description_content_type = text/markdown

tests/conftest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
'xpath'
5959
]
6060
_E = TypeVar('_E', bound=BaseException)
61-
_IpyVersions = Literal['5.5.0', '7.3.0', '7.15', '7.16', 'latest']
61+
_IpyVersions = Literal['5.5.0', '7.3.0', '7.15', '7.16', '7.31', 'latest']
6262
_NbTypes = Literal['colab', 'jupyter']
6363
_PyVersions = Literal['3.6', '3.7', '3.8', '3.9']
6464

@@ -569,7 +569,6 @@ def collect(self) -> Iterator[NotebookTest]:
569569
yield test_obj
570570

571571
def setup(self) -> None:
572-
# TODO: refactor this to call self.driver.<setup_func>()?
573572
super().setup()
574573
self.driver = self.driver_cls(self.notebook_path)
575574
self.driver.clear_all_outputs()

0 commit comments

Comments
 (0)