Skip to content

Commit

Permalink
Merge pull request #64 from paxtonfitzpatrick/main
Browse files Browse the repository at this point in the history
final tweaks to code, tests, paper draft
  • Loading branch information
paxtonfitzpatrick authored Jan 21, 2022
2 parents 1597bb5 + 3311beb commit e15cece
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 23 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci-tests-jupyter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ jobs:
- python-version: 3.7
ipython-version: 5.5.0 # earliest version supported by davos
- python-version: 3.7
ipython-version: latest
ipython-version: 7.31 # latest version to support Python 3.7
- python-version: 3.8
ipython-version: 7.3.0 # earliest version to support Python 3.8
ipython-version: 7.3.0 # earliest version to support Python 3.8
- python-version: 3.8
ipython-version: latest
- python-version: 3.9
ipython-version: 7.15 # earliest version to support Python 3.9
ipython-version: 7.15 # earliest version to support Python 3.9
- python-version: 3.9
ipython-version: latest
env:
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
if [[ "$PYTHON_VERSION" =~ ^3.(6|7)$ ]]; then
pip install typing-extensions
fi
[[ "$PYTHON_VERSION" == "3.6" ]] || pip install numpy==1.20.3
[[ "$PYTHON_VERSION" == "3.6" ]] || pip install numpy==1.20.3
pip install "ipykernel==5.0.0" ipython-genutils requests scipy fastdtw==0.3.4 tqdm==4.41.1
if [[ "$IPYTHON_VERSION" == "latest" ]]; then
pip install --upgrade IPython
Expand Down
2 changes: 1 addition & 1 deletion davos/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ def smuggle(
install_pkg = True

if install_pkg:
# TODO: check for --yes (conda) and bypass if passed
# TODO: for v0.2 conda implementation: bypass if -y/--yes passed
if config.confirm_install and not installer_kwargs.get('no_input'):
msg = (f"package '{pkg_name}' will be installed with the "
f"following command:\n\t`{onion.install_cmd}`\n"
Expand Down
2 changes: 1 addition & 1 deletion davos/core/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ def __call__(self, parser, namespace, values, option_string=None):
action='store_true',
help="Do not warn about broken dependencies"
)
# NOTE: in the actual pip-install implementation, `--no-binary`,
# note: in the actual pip-install implementation, `--no-binary`,
# `--only-binary`, and `--prefer-binary` triggers a fairly complex
# callback. But fortunately, we can just store all invocations and
# forward them to the real pip-install parser
Expand Down
5 changes: 2 additions & 3 deletions davos/implementations/jupyter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import ipykernel
import zmq
from IPython.display import display, Javascript
from ipython_genutils import py3compat

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

# noinspection PyBroadException
try:
value = py3compat.unicode_to_str(reply['content']['value'])
value = reply['content']['value']
except Exception: # pylint: disable=broad-except
if ipykernel.version_info[0] >= 6:
_parent_header = kernel._parent_ident['shell']
Expand Down
22 changes: 11 additions & 11 deletions paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,16 @@ Google Colaboratory], community-maintained libraries for data manipulation
visualization [e.g., `Matplotlib`, @Hunt07; `seaborn`, @Wask21], and myriad
other tools.

However, one impediment to sharing and reproducing computational work
implemented in Python is that different versions of a given package or library
can behave differently, use different syntax, add or drop support for specific
functions or other libraries, address (or introduce) bugs, and so on. While
these challenges are present to some extent in any language or ecosystem, they
have a particular impact on the Python community due to its unusually rapid
growth relative to other languages. Ensuring stable and reproducible results
across users typically requires ensuring that shared code is always run with the
same set of versions for each package used. One common approach to solving this
problem is to create containerized or virtualized environments (e.g., using
One impediment to sharing and reproducing computational work implemented in
Python is that different versions of a given package or library can behave
differently, use different syntax, add or drop support for specific functions or
other libraries, address (or introduce) bugs, and so on. While these challenges
are present to some extent in any language or ecosystem, they have a particular
impact on the Python community due to its unusually rapid growth relative to
other languages. Ensuring stable and reproducible results across users typically
requires ensuring that shared code is always run with the same set of versions
for each package used. One common approach to solving this problem is to create
containerized or virtualized environments (e.g., using
[Docker](https://www.docker.com/),
[Singularity](https://sylabs.io/singularity/), or
[conda](https://docs.conda.io/en/latest/)) that house fully isolated Python
Expand Down Expand Up @@ -171,7 +171,7 @@ are satisfied after they are initially installed. Most dependency specification
schemes follow a common strategy: required packages and package versions are
listed in a configuration file (e.g., a `requirements.txt`, `pyproject.toml`,
`environment.yml`, `Pipfile`, `RUN` instructions in a `Dockerfile`, etc.) which
is used to install them in a Python environment upfront. After this initial
is used to install them in a Python environment up front. After this initial
setup, however, this method generally does not ensure that the specified
requirements *remain* installed, allowing them to be easily
altered—sometimes inadvertently. This can lead to subtle issues when
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = davos
version = 0.0.1
version = 0.1.0
description = Install and manage Python packages at runtime using the "smuggle" statement.
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down
3 changes: 1 addition & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
'xpath'
]
_E = TypeVar('_E', bound=BaseException)
_IpyVersions = Literal['5.5.0', '7.3.0', '7.15', '7.16', 'latest']
_IpyVersions = Literal['5.5.0', '7.3.0', '7.15', '7.16', '7.31', 'latest']
_NbTypes = Literal['colab', 'jupyter']
_PyVersions = Literal['3.6', '3.7', '3.8', '3.9']

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

def setup(self) -> None:
# TODO: refactor this to call self.driver.<setup_func>()?
super().setup()
self.driver = self.driver_cls(self.notebook_path)
self.driver.clear_all_outputs()
Expand Down

0 comments on commit e15cece

Please sign in to comment.