From 582593d2c4dca1e8371ddc3b257192a60b23e1fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20R=C3=BCedlinger?= Date: Sun, 13 Dec 2020 18:18:58 +0100 Subject: [PATCH 1/4] added pipenv --- README.md | 56 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 211aa8c..7ed995f 100644 --- a/README.md +++ b/README.md @@ -4,29 +4,53 @@ These __Python Snippets__ are tested with Python 3.6.x. All snippets are available as Jupyter notebooks (http://jupyter.org/). -## Get started... -To get started create a virtual environment and install the required packages. +## Getting Started +All the required Python packages can be installed with `pipenv`. -- Juypter Notebook -- pandas -- geojson -- beautifulsoup4 -- feedparser -- scikit-image -- matplotlib +### Project Setup +First you nee to install `pipenv`. +```bash +$ pip install --user pipenv +``` -### Conda -The following example shows how to create an environment with _"conda"_ -(http://conda.pydata.org/) and Python 3.6 with -the required packages. +Install all the required packages ```bash -conda create -n py36-ps python=3.6 +$ pipenv install --dev +``` + +### Run the Notebook +You can start `jupyter-lab` to play around with the Juypter notebooks. + + +```bash +pipenv run jupyter-lab +``` + +### Run the Tests (nbval) +To test the Jupyter notebooks this project uses [nbval](https://github.com/computationalmodelling/nbval), which is a `py.test` +plugin for validating Jupyter notebooks. + -source activate py36-ps +This will check all Jupyter notebooks for errors. -``` +```bash +pipenv run py.test --nbval-lax +``` + +### Upgrade Python Packages +Check which packages have changed. + +``` +pipenv update --outdated +``` + +This will upgrade everything. + +```bash +pipenv update +``` ## The Python Snippets The Python snippets are organized by topic. From d58e500e3b4345718a677624b1a0cb7a41457006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20R=C3=BCedlinger?= Date: Sun, 13 Dec 2020 19:04:33 +0100 Subject: [PATCH 2/4] added github action build --- .github/{ => workflows}/build.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/build.yml (100%) diff --git a/.github/build.yml b/.github/workflows/build.yml similarity index 100% rename from .github/build.yml rename to .github/workflows/build.yml From 7fbb2c1e51ae878a3e7ec1200f4a59152f8ee9ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20R=C3=BCedlinger?= Date: Sun, 13 Dec 2020 19:07:49 +0100 Subject: [PATCH 3/4] udpated readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 7ed995f..ad128ff 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,9 @@ This will upgrade everything. pipenv update ``` +## CI Build (GitHub Actions) +- ![CI Build](https://github.com/rueedlinger/python-snippets/workflows/CI%20Build/badge.svg) + ## The Python Snippets The Python snippets are organized by topic. From 505837113c9e5e5674cc99a64e85815ff09d7db6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20R=C3=BCedlinger?= Date: Sun, 13 Dec 2020 19:14:26 +0100 Subject: [PATCH 4/4] udpated readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ad128ff..d55a080 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Python Snippets -These __Python Snippets__ are tested with Python 3.6.x. All snippets are +These __Python Snippets__ are tested with Python 3.7.x. and are available as Jupyter notebooks (http://jupyter.org/).