From db9a0581b10fb1ec12c892be6fc915bb1b8031dc Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Fri, 15 May 2020 14:25:42 +0100 Subject: [PATCH 01/32] Removed old static files --- .gitattributes | 1 - .../api/static/css/chunk-vendors.1800c649.css | 3 --- openflexure_microscope/api/static/css/main.24f9722e.css | 3 --- openflexure_microscope/api/static/favicon-16x16.png | 3 --- openflexure_microscope/api/static/favicon-32x32.png | 3 --- openflexure_microscope/api/static/favicon.ico | 3 --- .../api/static/fonts/MaterialIcons-Regular.012cf6a1.woff | 3 --- .../api/static/fonts/MaterialIcons-Regular.570eb838.woff2 | 3 --- .../api/static/fonts/MaterialIcons-Regular.a37b0c01.ttf | 3 --- .../api/static/fonts/MaterialIcons-Regular.e79bfd88.eot | 3 --- openflexure_microscope/api/static/index.html | 3 --- openflexure_microscope/api/static/js/chunk-vendors.3b7762c4.js | 3 --- .../api/static/js/chunk-vendors.3b7762c4.js.map | 3 --- openflexure_microscope/api/static/js/main.eaa8787b.js | 3 --- openflexure_microscope/api/static/js/main.eaa8787b.js.map | 3 --- openflexure_microscope/api/static/titleicon.svg | 3 --- 16 files changed, 46 deletions(-) delete mode 100644 openflexure_microscope/api/static/css/chunk-vendors.1800c649.css delete mode 100644 openflexure_microscope/api/static/css/main.24f9722e.css delete mode 100644 openflexure_microscope/api/static/favicon-16x16.png delete mode 100644 openflexure_microscope/api/static/favicon-32x32.png delete mode 100644 openflexure_microscope/api/static/favicon.ico delete mode 100644 openflexure_microscope/api/static/fonts/MaterialIcons-Regular.012cf6a1.woff delete mode 100644 openflexure_microscope/api/static/fonts/MaterialIcons-Regular.570eb838.woff2 delete mode 100644 openflexure_microscope/api/static/fonts/MaterialIcons-Regular.a37b0c01.ttf delete mode 100644 openflexure_microscope/api/static/fonts/MaterialIcons-Regular.e79bfd88.eot delete mode 100644 openflexure_microscope/api/static/index.html delete mode 100644 openflexure_microscope/api/static/js/chunk-vendors.3b7762c4.js delete mode 100644 openflexure_microscope/api/static/js/chunk-vendors.3b7762c4.js.map delete mode 100644 openflexure_microscope/api/static/js/main.eaa8787b.js delete mode 100644 openflexure_microscope/api/static/js/main.eaa8787b.js.map delete mode 100644 openflexure_microscope/api/static/titleicon.svg diff --git a/.gitattributes b/.gitattributes index 5f08879f..e69de29b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +0,0 @@ -openflexure_microscope/api/static/** filter=lfs diff=lfs merge=lfs -text diff --git a/openflexure_microscope/api/static/css/chunk-vendors.1800c649.css b/openflexure_microscope/api/static/css/chunk-vendors.1800c649.css deleted file mode 100644 index c967969b..00000000 --- a/openflexure_microscope/api/static/css/chunk-vendors.1800c649.css +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8605f70737729f74f48d3183b30b4a2f50706f4f750cd208aeb8c136253f7d01 -size 772 diff --git a/openflexure_microscope/api/static/css/main.24f9722e.css b/openflexure_microscope/api/static/css/main.24f9722e.css deleted file mode 100644 index b8cd1050..00000000 --- a/openflexure_microscope/api/static/css/main.24f9722e.css +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e68506e72389393d35cc47e5184459fff9a23bedea8c9ee96491f66c88e71954 -size 1375875 diff --git a/openflexure_microscope/api/static/favicon-16x16.png b/openflexure_microscope/api/static/favicon-16x16.png deleted file mode 100644 index 6f9b9751..00000000 --- a/openflexure_microscope/api/static/favicon-16x16.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ee944cc13be0a52ce48a81a09c179dac70729bd7580a516ccc8ac10b4cfa3f98 -size 1310 diff --git a/openflexure_microscope/api/static/favicon-32x32.png b/openflexure_microscope/api/static/favicon-32x32.png deleted file mode 100644 index 21fb950d..00000000 --- a/openflexure_microscope/api/static/favicon-32x32.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:710327f8b3d83c83019ed2c4b27de8caf8e4e923c9148f93c1c0a2662f683f26 -size 1659 diff --git a/openflexure_microscope/api/static/favicon.ico b/openflexure_microscope/api/static/favicon.ico deleted file mode 100644 index d55c92be..00000000 --- a/openflexure_microscope/api/static/favicon.ico +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0405ef60ab42df1c2e8721bf1f500c8c7d9e1afae130307101b8f77925ffdac1 -size 1150 diff --git a/openflexure_microscope/api/static/fonts/MaterialIcons-Regular.012cf6a1.woff b/openflexure_microscope/api/static/fonts/MaterialIcons-Regular.012cf6a1.woff deleted file mode 100644 index ebaebe27..00000000 --- a/openflexure_microscope/api/static/fonts/MaterialIcons-Regular.012cf6a1.woff +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c4a1baec300d09e03a8380b85918267ee80faae8e00c6c56b48e2e74b1d9b38d -size 57620 diff --git a/openflexure_microscope/api/static/fonts/MaterialIcons-Regular.570eb838.woff2 b/openflexure_microscope/api/static/fonts/MaterialIcons-Regular.570eb838.woff2 deleted file mode 100644 index ed48a958..00000000 --- a/openflexure_microscope/api/static/fonts/MaterialIcons-Regular.570eb838.woff2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a87d66c91b2e7dc5530aef76c03bd6a3d25ea5826110bf4803b561b811cc8726 -size 44300 diff --git a/openflexure_microscope/api/static/fonts/MaterialIcons-Regular.a37b0c01.ttf b/openflexure_microscope/api/static/fonts/MaterialIcons-Regular.a37b0c01.ttf deleted file mode 100644 index acdfd2e6..00000000 --- a/openflexure_microscope/api/static/fonts/MaterialIcons-Regular.a37b0c01.ttf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b7f4a3ab562048f28dd1fa691601bc43363a61d0f876d16d8316c52e4f32d696 -size 128180 diff --git a/openflexure_microscope/api/static/fonts/MaterialIcons-Regular.e79bfd88.eot b/openflexure_microscope/api/static/fonts/MaterialIcons-Regular.e79bfd88.eot deleted file mode 100644 index e3f70a00..00000000 --- a/openflexure_microscope/api/static/fonts/MaterialIcons-Regular.e79bfd88.eot +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8c998b4a9c0acbb9fe5dd572c206a5a33fdd5ca2b58db87fc3b893beac85068d -size 143258 diff --git a/openflexure_microscope/api/static/index.html b/openflexure_microscope/api/static/index.html deleted file mode 100644 index f9009ab2..00000000 --- a/openflexure_microscope/api/static/index.html +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:463bfdbd635ddff1d00df38b1149ffd3947b492d71cfb546549dffebd311b090 -size 843 diff --git a/openflexure_microscope/api/static/js/chunk-vendors.3b7762c4.js b/openflexure_microscope/api/static/js/chunk-vendors.3b7762c4.js deleted file mode 100644 index 47dda2fd..00000000 --- a/openflexure_microscope/api/static/js/chunk-vendors.3b7762c4.js +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a536bfa88fd1bf69284804285c5cf1da33cf05f164f175eb4085f7d057ff4f17 -size 378133 diff --git a/openflexure_microscope/api/static/js/chunk-vendors.3b7762c4.js.map b/openflexure_microscope/api/static/js/chunk-vendors.3b7762c4.js.map deleted file mode 100644 index 834b0baf..00000000 --- a/openflexure_microscope/api/static/js/chunk-vendors.3b7762c4.js.map +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:996b19391845b7cf1810f1181d935aad524897763da4c36847c7715f762b63fa -size 1597950 diff --git a/openflexure_microscope/api/static/js/main.eaa8787b.js b/openflexure_microscope/api/static/js/main.eaa8787b.js deleted file mode 100644 index 4826f329..00000000 --- a/openflexure_microscope/api/static/js/main.eaa8787b.js +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0a77d7d2e5e4220883bc1491a627435cc80d0b2574d51972bcd6b12add7a4a94 -size 116850 diff --git a/openflexure_microscope/api/static/js/main.eaa8787b.js.map b/openflexure_microscope/api/static/js/main.eaa8787b.js.map deleted file mode 100644 index 72e98b54..00000000 --- a/openflexure_microscope/api/static/js/main.eaa8787b.js.map +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1404c938e8f60b1694dd48357d486d919f5b1e32c9f226ca26fc0ee399019542 -size 395811 diff --git a/openflexure_microscope/api/static/titleicon.svg b/openflexure_microscope/api/static/titleicon.svg deleted file mode 100644 index 5307728d..00000000 --- a/openflexure_microscope/api/static/titleicon.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:187e61d8f6171eebf611502412556c707fab1d837f8763b2b60ce3915303f0ad -size 1734 From d7ca8f8ae1b11dcd6ddf4df99798a9dea68e3371 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Fri, 15 May 2020 14:57:03 +0100 Subject: [PATCH 02/32] Set up eV submodule --- .gitmodules | 4 ++++ openflexure_microscope/api/app.py | 2 +- pyproject.toml | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..57b6d2dd --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "openflexure_microscope/api/static"] + path = openflexure_microscope/api/static + url = https://gitlab.com/openflexure/openflexure-microscope-jsclient.git + branch = frame diff --git a/openflexure_microscope/api/app.py b/openflexure_microscope/api/app.py index af862b2b..195c5c06 100644 --- a/openflexure_microscope/api/app.py +++ b/openflexure_microscope/api/app.py @@ -66,7 +66,7 @@ app, labthing = create_app( description="Test LabThing-based API for OpenFlexure Microscope", types=["org.openflexure.microscope"], version=pkg_resources.get_distribution("openflexure_microscope").version, - flask_kwargs={"static_url_path": ""}, + flask_kwargs={"static_url_path": "", "static_folder": "static/dist"}, ) # Enable CORS for some routes outside of LabThings diff --git a/pyproject.toml b/pyproject.toml index 6b665705..b33108c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.masonry.api" [tool.poetry] name = "openflexure_microscope" -version = "2.1.0-dev" +version = "2.2.0-alpha" description = "Python module, and Flask-based web API, to run the OpenFlexure Microscope." authors = [ @@ -22,6 +22,8 @@ keywords = ['raspberry pi', 'arduino', 'microscope'] license = "GPL-3.0" +exclude = ["**/node_modules/"] + [tool.poetry.dependencies] python = "^3.6" Flask = "^1.0" From 3a789d2dd3fd9e84a786001209b6f6cc6c1267ee Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Fri, 15 May 2020 15:24:17 +0100 Subject: [PATCH 03/32] Added PyNPM dependency --- poetry.lock | 20 +++++++++++++++++++- pyproject.toml | 4 ++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/poetry.lock b/poetry.lock index 916e6278..37d4e9f5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -402,6 +402,7 @@ test = ["pillow", "coverage", "mock", "numpy", "pytest"] reference = "e50a34826fc8691e9f8554c529a1700662724ade" type = "git" url = "https://github.com/rwb27/picamera.git" + [[package]] category = "main" description = "Python Imaging Library (Fork)" @@ -453,6 +454,19 @@ isort = ">=4.2.5,<5" mccabe = ">=0.6,<0.7" toml = ">=0.7.1" +[[package]] +category = "main" +description = "Python interface to your NPM and package.json." +name = "pynpm" +optional = false +python-versions = "*" +version = "0.1.2" + +[package.extras] +all = ["Sphinx (>=1.5.1)", "check-manifest (>=0.25)", "coverage (>=4.0)", "isort (>=4.2.2)", "pydocstyle (>=1.0.0)", "pytest-cache (>=1.0)", "pytest-cov (>=1.8.0)", "pytest-pep8 (>=1.0.6)", "pytest (>=2.8.0)"] +docs = ["Sphinx (>=1.5.1)"] +tests = ["check-manifest (>=0.25)", "coverage (>=4.0)", "isort (>=4.2.2)", "pydocstyle (>=1.0.0)", "pytest-cache (>=1.0)", "pytest-cov (>=1.8.0)", "pytest-pep8 (>=1.0.6)", "pytest (>=2.8.0)"] + [[package]] category = "dev" description = "Python parsing module" @@ -747,7 +761,7 @@ ifaddr = "*" rpi = ["picamera", "RPi.GPIO"] [metadata] -content-hash = "7fbc27aa162c3acb7f1775b974ed87d3261e4038e0999904e9d1cf0f80ec98a2" +content-hash = "ce051db85e0994205dbe3606291d049e975939481a85c13ec9d9ce8dc0e693e0" python-versions = "^3.6" [metadata.files] @@ -1140,6 +1154,10 @@ pylint = [ {file = "pylint-2.5.2-py3-none-any.whl", hash = "sha256:dd506acce0427e9e08fb87274bcaa953d38b50a58207170dbf5b36cf3e16957b"}, {file = "pylint-2.5.2.tar.gz", hash = "sha256:b95e31850f3af163c2283ed40432f053acbc8fc6eba6a069cb518d9dbf71848c"}, ] +pynpm = [ + {file = "pynpm-0.1.2-py2.py3-none-any.whl", hash = "sha256:3f03fbf667549f8b8b7e0419eef88d1b21833ce288f96de66fbb761b9f4c4061"}, + {file = "pynpm-0.1.2.tar.gz", hash = "sha256:8a6d3f9423760cf3c142db3bf9bda5a075e8a91837e7d2e2b0a3de5be5e26da2"}, +] pyparsing = [ {file = "pyparsing-2.4.7-py2.py3-none-any.whl", hash = "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b"}, {file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"}, diff --git a/pyproject.toml b/pyproject.toml index b33108c7..7334c251 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,6 +42,10 @@ opencv-python-headless = [ {version = "4.2.0.34", python = "^3.8"} # Latest for Py38 systems ] labthings = "0.6.1" +pynpm = "^0.1.2" + +[tool.poetry.scripts] +build = 'openflexure_microscope.install:build' [tool.poetry.extras] rpi = ["picamera", "RPi.GPIO"] From e84dfb5809c02c8a323d15b6b7de6b92b2e5ead2 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Fri, 15 May 2020 15:24:30 +0100 Subject: [PATCH 04/32] Added eV build script --- openflexure_microscope/install.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 openflexure_microscope/install.py diff --git a/openflexure_microscope/install.py b/openflexure_microscope/install.py new file mode 100644 index 00000000..e73037cc --- /dev/null +++ b/openflexure_microscope/install.py @@ -0,0 +1,14 @@ +from pynpm import NPMPackage +import os + +dir_path = os.path.dirname(os.path.realpath(__file__)) +pkg_path = os.path.join(dir_path, "api", "static", "package.json") + +pkg = NPMPackage(pkg_path) + +def install(): + pkg.install() + +def build(): + pkg.install() + pkg.run_script('build') \ No newline at end of file From c2d37cf61fb7f43c0a45be8dcaa4df6e4e009396 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Fri, 15 May 2020 15:25:33 +0100 Subject: [PATCH 05/32] Updated installation instructions in readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index acb4fd60..8f02cfc5 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,10 @@ This includes basic installation instructions suitable for most users. Full developer documentation can be found on [**ReadTheDocs**](https://openflexure-microscope-software.readthedocs.io/en/stable/). This includes installing the server in a mode better suited for active development. +## Installation +* `poetry install` +* `poetry run build` + ## Build-system As of 1.0.0b0, we're using [Poetry](https://github.com/sdispater/poetry) to manage dependencies, build, and distribute the package. All package information and dependencies are found in `pyproject.toml`, in line with [PEP 518](https://www.python.org/dev/peps/pep-0518/). If you're developing this package, make use of `poetry.lock` to ensure you're using the latest locked dependency list. From ff368c7fc97fd59e92aa8ad925ee77ae95aa41fc Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Fri, 15 May 2020 15:27:13 +0100 Subject: [PATCH 06/32] Added submodule clone to instrutions --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8f02cfc5..c97bd772 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Full developer documentation can be found on [**ReadTheDocs**](https://openflexu This includes installing the server in a mode better suited for active development. ## Installation +* `git clone --recurse-submodules https://gitlab.com/openflexure/openflexure-microscope-server.git` * `poetry install` * `poetry run build` From 54ee94042dfc89eb85d6a5c6c1bed11e91ca3dbb Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Fri, 15 May 2020 17:14:49 +0100 Subject: [PATCH 07/32] Lock picamera dependency to wheel --- poetry.lock | 18 +++++++----------- pyproject.toml | 9 +++------ 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/poetry.lock b/poetry.lock index 37d4e9f5..8d8257c2 100644 --- a/poetry.lock +++ b/poetry.lock @@ -389,20 +389,19 @@ six = "*" category = "main" description = "A pure Python interface for the Raspberry Pi camera module." name = "picamera" -optional = true +optional = false python-versions = "*" version = "1.13.2b0" [package.extras] array = ["numpy"] doc = ["sphinx"] -test = ["pillow", "coverage", "mock", "numpy", "pytest"] +test = ["coverage", "pytest", "mock", "pillow", "numpy"] [package.source] -reference = "e50a34826fc8691e9f8554c529a1700662724ade" -type = "git" -url = "https://github.com/rwb27/picamera.git" - +reference = "" +type = "url" +url = "https://github.com/rwb27/picamera/releases/download/v1.13.2b0/picamera-1.13.2b0-py3-none-any.whl" [[package]] category = "main" description = "Python Imaging Library (Fork)" @@ -532,7 +531,7 @@ version = "0.14.0" category = "main" description = "A module to control Raspberry Pi GPIO channels" name = "rpi.gpio" -optional = true +optional = false python-versions = "*" version = "0.6.5" @@ -757,11 +756,8 @@ version = "0.26.1" [package.dependencies] ifaddr = "*" -[extras] -rpi = ["picamera", "RPi.GPIO"] - [metadata] -content-hash = "ce051db85e0994205dbe3606291d049e975939481a85c13ec9d9ce8dc0e693e0" +content-hash = "2d2cb1c884a9f873a5b7d2f617a54ddcbba60e42b6131a373b906849ff165d96" python-versions = "^3.6" [metadata.files] diff --git a/pyproject.toml b/pyproject.toml index 7334c251..ad758be3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,8 +31,7 @@ numpy = "1.18.2" Pillow = "^5.4" scipy = "1.4.1" # Exact version so we can guarantee a wheel -picamera = { git = "https://github.com/rwb27/picamera.git", branch = "master", optional = true } # Lens shading requires >1.14 or RWB fork, lens-shading branch. -"RPi.GPIO" = { version = "^0.6.5", optional = true } +"RPi.GPIO" = { version = "^0.6.5" } pyserial = "^3.4" # Used for sangaboard (basic_serial_instrument) until we move to sangaboard pip library python-dateutil = "^2.8" @@ -43,12 +42,10 @@ opencv-python-headless = [ ] labthings = "0.6.1" pynpm = "^0.1.2" +picamera = {url = "https://github.com/rwb27/picamera/releases/download/v1.13.2b0/picamera-1.13.2b0-py3-none-any.whl" } [tool.poetry.scripts] -build = 'openflexure_microscope.install:build' - -[tool.poetry.extras] -rpi = ["picamera", "RPi.GPIO"] +build_static = 'openflexure_microscope.install:build' [tool.poetry.dev-dependencies] sphinxcontrib-httpdomain = "^1.7" From 34b1c66cdf5f621e3ccc51c34da2dc8667d543fe Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Fri, 15 May 2020 17:15:01 +0100 Subject: [PATCH 08/32] Updated build instructions --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index c97bd772..d2da91c6 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,11 @@ This includes installing the server in a mode better suited for active developme ## Installation * `git clone --recurse-submodules https://gitlab.com/openflexure/openflexure-microscope-server.git` * `poetry install` +* `poetry run build_static` + +### Distributing * `poetry run build` + * Dist files will then be in `/dist` ## Build-system As of 1.0.0b0, we're using [Poetry](https://github.com/sdispater/poetry) to manage dependencies, build, and distribute the package. All package information and dependencies are found in `pyproject.toml`, in line with [PEP 518](https://www.python.org/dev/peps/pep-0518/). If you're developing this package, make use of `poetry.lock` to ensure you're using the latest locked dependency list. From 00fe147b8d3e79fe27972c46e027623900af7f33 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Fri, 15 May 2020 17:15:13 +0100 Subject: [PATCH 09/32] Draft wheel dist CI --- .gitlab-ci.yml | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..553d3146 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,67 @@ +stages: + - build + - deploy + + +# Cache modules in between jobs +cache: + key: ${CI_COMMIT_REF_SLUG} + paths: + - node_modules/ + + +# Electron app build +build: + stage: build + image: nikolaik/python-nodejs:python3.7-nodejs14 + + variables: + GIT_SUBMODULE_STRATEGY: recursive + + before_script: + - curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python + + script: + - poetry install + - poetry run build_static + - poetry run build + + artifacts: + name: "dist" + expire_in: 1 week + paths: + - "./dist/*" + + only: + - merge_requests + - stable + - master + - web + + +# Deploy to builds.openflexure.org +deploy: + stage: deploy + dependencies: + - build + image: ubuntu:latest + + before_script: + - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + - eval $(ssh-agent -s) + - ssh-add <(echo "$SSH_PRIVATE_KEY_BATH_OPENFLEXURE_BASE64" | base64 --decode) + - mkdir -p ~/.ssh + - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config + + script: + # Install rsync if not already installed + - 'which rsync || ( apt-get update -y && apt-get install rsync -y )' + + # Upload the builds folder to openflexure-microscope builds + - rsync -hrvz -e ssh dist/ ci-user@openflexure.bath.ac.uk:/var/www/build/openflexure-microscope-server/ + + # Run update-latest.py on the build server + - ssh -t ci-user@openflexure.bath.ac.uk "/var/www/build/update-latest.py" + + only: + - stable From bbd022b84315d6ec33d50836a431619fd4ba4bf8 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Fri, 15 May 2020 17:23:13 +0100 Subject: [PATCH 10/32] Fix poetry path --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 553d3146..739dfbd1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,9 +22,9 @@ build: - curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python script: - - poetry install - - poetry run build_static - - poetry run build + - $HOME/.poetry/bin/poetry install + - $HOME/.poetry/bin/poetry run build_static + - $HOME/.poetry/bin/poetry run build artifacts: name: "dist" From 6aa1ceeaa92480962b9dbcef39d3ad9917f06143 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Fri, 15 May 2020 17:27:59 +0100 Subject: [PATCH 11/32] Explicit submodules --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 739dfbd1..a0704f8e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,6 +19,8 @@ build: GIT_SUBMODULE_STRATEGY: recursive before_script: + - git submodule sync --recursive + - git submodule update --init --recursive - curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python script: From dac3632c28035d7a8dbf734a3dfbeda33648f16d Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Fri, 15 May 2020 17:36:26 +0100 Subject: [PATCH 12/32] Remove CI file from frame branch --- .gitlab-ci.yml | 69 -------------------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index a0704f8e..00000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,69 +0,0 @@ -stages: - - build - - deploy - - -# Cache modules in between jobs -cache: - key: ${CI_COMMIT_REF_SLUG} - paths: - - node_modules/ - - -# Electron app build -build: - stage: build - image: nikolaik/python-nodejs:python3.7-nodejs14 - - variables: - GIT_SUBMODULE_STRATEGY: recursive - - before_script: - - git submodule sync --recursive - - git submodule update --init --recursive - - curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - - script: - - $HOME/.poetry/bin/poetry install - - $HOME/.poetry/bin/poetry run build_static - - $HOME/.poetry/bin/poetry run build - - artifacts: - name: "dist" - expire_in: 1 week - paths: - - "./dist/*" - - only: - - merge_requests - - stable - - master - - web - - -# Deploy to builds.openflexure.org -deploy: - stage: deploy - dependencies: - - build - image: ubuntu:latest - - before_script: - - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' - - eval $(ssh-agent -s) - - ssh-add <(echo "$SSH_PRIVATE_KEY_BATH_OPENFLEXURE_BASE64" | base64 --decode) - - mkdir -p ~/.ssh - - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config - - script: - # Install rsync if not already installed - - 'which rsync || ( apt-get update -y && apt-get install rsync -y )' - - # Upload the builds folder to openflexure-microscope builds - - rsync -hrvz -e ssh dist/ ci-user@openflexure.bath.ac.uk:/var/www/build/openflexure-microscope-server/ - - # Run update-latest.py on the build server - - ssh -t ci-user@openflexure.bath.ac.uk "/var/www/build/update-latest.py" - - only: - - stable From b06ca88ad167414768bca830b4b9881576542859 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Fri, 15 May 2020 17:42:33 +0100 Subject: [PATCH 13/32] Removed broken gitmodules --- .gitmodules | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 57b6d2dd..00000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "openflexure_microscope/api/static"] - path = openflexure_microscope/api/static - url = https://gitlab.com/openflexure/openflexure-microscope-jsclient.git - branch = frame From 9217628e0c676b9c195dc777b6ec2d11d3e5e119 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Fri, 15 May 2020 17:49:30 +0100 Subject: [PATCH 14/32] Fixed submodules --- .gitmodules | 4 ++++ openflexure_microscope/api/static | 1 + 2 files changed, 5 insertions(+) create mode 100644 .gitmodules create mode 160000 openflexure_microscope/api/static diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..57b6d2dd --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "openflexure_microscope/api/static"] + path = openflexure_microscope/api/static + url = https://gitlab.com/openflexure/openflexure-microscope-jsclient.git + branch = frame diff --git a/openflexure_microscope/api/static b/openflexure_microscope/api/static new file mode 160000 index 00000000..df7169ba --- /dev/null +++ b/openflexure_microscope/api/static @@ -0,0 +1 @@ +Subproject commit df7169ba6833fa213f497ff71594dc4330af0792 From c04ff1b891ba6288536c59e9f662702d96e16288 Mon Sep 17 00:00:00 2001 From: Joel Collins <2579603-jtc42@users.noreply.gitlab.com> Date: Fri, 15 May 2020 16:50:38 +0000 Subject: [PATCH 15/32] Revert "Remove CI file from frame branch" This reverts commit dac3632c28035d7a8dbf734a3dfbeda33648f16d --- .gitlab-ci.yml | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..a0704f8e --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,69 @@ +stages: + - build + - deploy + + +# Cache modules in between jobs +cache: + key: ${CI_COMMIT_REF_SLUG} + paths: + - node_modules/ + + +# Electron app build +build: + stage: build + image: nikolaik/python-nodejs:python3.7-nodejs14 + + variables: + GIT_SUBMODULE_STRATEGY: recursive + + before_script: + - git submodule sync --recursive + - git submodule update --init --recursive + - curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python + + script: + - $HOME/.poetry/bin/poetry install + - $HOME/.poetry/bin/poetry run build_static + - $HOME/.poetry/bin/poetry run build + + artifacts: + name: "dist" + expire_in: 1 week + paths: + - "./dist/*" + + only: + - merge_requests + - stable + - master + - web + + +# Deploy to builds.openflexure.org +deploy: + stage: deploy + dependencies: + - build + image: ubuntu:latest + + before_script: + - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + - eval $(ssh-agent -s) + - ssh-add <(echo "$SSH_PRIVATE_KEY_BATH_OPENFLEXURE_BASE64" | base64 --decode) + - mkdir -p ~/.ssh + - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config + + script: + # Install rsync if not already installed + - 'which rsync || ( apt-get update -y && apt-get install rsync -y )' + + # Upload the builds folder to openflexure-microscope builds + - rsync -hrvz -e ssh dist/ ci-user@openflexure.bath.ac.uk:/var/www/build/openflexure-microscope-server/ + + # Run update-latest.py on the build server + - ssh -t ci-user@openflexure.bath.ac.uk "/var/www/build/update-latest.py" + + only: + - stable From dff8a0d217c51e87279910b55e59d5b2ef348af6 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Fri, 15 May 2020 17:55:37 +0100 Subject: [PATCH 16/32] Fixed build command --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a0704f8e..5a739994 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,7 @@ build: script: - $HOME/.poetry/bin/poetry install - $HOME/.poetry/bin/poetry run build_static - - $HOME/.poetry/bin/poetry run build + - $HOME/.poetry/bin/poetry build artifacts: name: "dist" From 76c87184a188f68e9ce9f77ee809f1c68a869392 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Sat, 16 May 2020 17:15:43 +0100 Subject: [PATCH 17/32] Added requirements.txt generation --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d2da91c6..e941296f 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,8 @@ This includes installing the server in a mode better suited for active developme ### Distributing * `poetry run build` - * Dist files will then be in `/dist` +* `poetry export --without-hashes -f requirements.txt > dist/requirements.txt` +* Distribution files will then be in `/dist` ## Build-system As of 1.0.0b0, we're using [Poetry](https://github.com/sdispater/poetry) to manage dependencies, build, and distribute the package. All package information and dependencies are found in `pyproject.toml`, in line with [PEP 518](https://www.python.org/dev/peps/pep-0518/). If you're developing this package, make use of `poetry.lock` to ensure you're using the latest locked dependency list. From 19c7b7a20cbc0b1acf1cc3ae13f3b2c5db78941e Mon Sep 17 00:00:00 2001 From: Joel Collins <2579603-jtc42@users.noreply.gitlab.com> Date: Sat, 16 May 2020 16:36:24 +0000 Subject: [PATCH 18/32] Add requirements.txt to dist --- .gitlab-ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5a739994..714667bc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,6 +27,7 @@ build: - $HOME/.poetry/bin/poetry install - $HOME/.poetry/bin/poetry run build_static - $HOME/.poetry/bin/poetry build + - $HOME/.poetry/bin/poetry export --without-hashes -f requirements.txt > dist/requirements.txt artifacts: name: "dist" @@ -36,8 +37,7 @@ build: only: - merge_requests - - stable - - master + - tags - web @@ -60,10 +60,11 @@ deploy: - 'which rsync || ( apt-get update -y && apt-get install rsync -y )' # Upload the builds folder to openflexure-microscope builds - - rsync -hrvz -e ssh dist/ ci-user@openflexure.bath.ac.uk:/var/www/build/openflexure-microscope-server/ + - rsync -hrvz -e ssh dist/ ci-user@openflexure.bath.ac.uk:/var/www/build/openflexure-microscope-server/${CI_COMMIT_REF_NAME} --delete # Run update-latest.py on the build server - ssh -t ci-user@openflexure.bath.ac.uk "/var/www/build/update-latest.py" only: - - stable + - tags + - web From 2059cc0a55f95f49887b2eb31daaba05d0321811 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Sat, 16 May 2020 20:48:09 +0100 Subject: [PATCH 19/32] More broadly catch picamera import errors --- openflexure_microscope/microscope.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openflexure_microscope/microscope.py b/openflexure_microscope/microscope.py index 8a401b86..55097088 100644 --- a/openflexure_microscope/microscope.py +++ b/openflexure_microscope/microscope.py @@ -15,7 +15,8 @@ from openflexure_microscope.stage.sanga import SangaStage try: from openflexure_microscope.camera.pi import PiCameraStreamer -except ImportError: +except Exception as e: + logging.error(e) logging.warning("Unable to import PiCameraStreamer") from openflexure_microscope.camera.mock import MissingCamera From 6d0f325165fcbffa2fc036827e28ee18c71fe05e Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Sat, 16 May 2020 20:48:28 +0100 Subject: [PATCH 20/32] Renamed Poetry project and fixed optional dependencies --- poetry.lock | 7 +++++-- pyproject.toml | 10 +++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index 8d8257c2..cae6d5a8 100644 --- a/poetry.lock +++ b/poetry.lock @@ -531,7 +531,7 @@ version = "0.14.0" category = "main" description = "A module to control Raspberry Pi GPIO channels" name = "rpi.gpio" -optional = false +optional = true python-versions = "*" version = "0.6.5" @@ -756,8 +756,11 @@ version = "0.26.1" [package.dependencies] ifaddr = "*" +[extras] +rpi = ["picamera", "RPi.GPIO"] + [metadata] -content-hash = "2d2cb1c884a9f873a5b7d2f617a54ddcbba60e42b6131a373b906849ff165d96" +content-hash = "4e7a6bf95f6780d1f155ceecee8fccff5b5d44c3034907cbe2f8ed3e634cfdb1" python-versions = "^3.6" [metadata.files] diff --git a/pyproject.toml b/pyproject.toml index ad758be3..7f5ea405 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["poetry>=0.12"] build-backend = "poetry.masonry.api" [tool.poetry] -name = "openflexure_microscope" +name = "openflexure-microscope-server" version = "2.2.0-alpha" description = "Python module, and Flask-based web API, to run the OpenFlexure Microscope." @@ -31,7 +31,9 @@ numpy = "1.18.2" Pillow = "^5.4" scipy = "1.4.1" # Exact version so we can guarantee a wheel -"RPi.GPIO" = { version = "^0.6.5" } +"RPi.GPIO" = { version = "^0.6.5", optional = true } +picamera = {url = "https://github.com/rwb27/picamera/releases/download/v1.13.2b0/picamera-1.13.2b0-py3-none-any.whl", optional = true } + pyserial = "^3.4" # Used for sangaboard (basic_serial_instrument) until we move to sangaboard pip library python-dateutil = "^2.8" @@ -42,7 +44,9 @@ opencv-python-headless = [ ] labthings = "0.6.1" pynpm = "^0.1.2" -picamera = {url = "https://github.com/rwb27/picamera/releases/download/v1.13.2b0/picamera-1.13.2b0-py3-none-any.whl" } + +[tool.poetry.extras] +rpi = ["picamera", "RPi.GPIO"] [tool.poetry.scripts] build_static = 'openflexure_microscope.install:build' From 58e456a33b7f01c60be6fa89b90316cb40666359 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Sat, 16 May 2020 20:52:32 +0100 Subject: [PATCH 21/32] Added explicit packages --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 7f5ea405..06aec50c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,10 @@ license = "GPL-3.0" exclude = ["**/node_modules/"] +packages = [ + { include = "openflexure_microscope" }, +] + [tool.poetry.dependencies] python = "^3.6" Flask = "^1.0" From fb51930cc4f2f00b60dab4f9838ec6b51f483cd5 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Sat, 16 May 2020 21:26:20 +0100 Subject: [PATCH 22/32] Updated tar distribution command --- .tarignore | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 5 ++-- 2 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 .tarignore diff --git a/.tarignore b/.tarignore new file mode 100644 index 00000000..1c4227bf --- /dev/null +++ b/.tarignore @@ -0,0 +1,79 @@ +Distribution archive rules +node_modules +.gitlab-ci.yml +./dist +!openflexure_microscope/api/static/dist + +# Pyenv files +.python-version +.venv* +.env* + +# Byte-compiled / optimized / DLL files +__pycache__ +*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Pytho +env/ +build +develop-eggs +downloads +eggs +lib +lib64 +parts +sdist +var +*.egg-info +.installed.cfg +*.egg +pip-wheel-metadata + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov +.tox +.coverage +.cache +nosetests.xml +coverage.xml + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build + +# PyBuilder +target + +#Big-o files +capture +record +*.data + +#IDE files +.vscode +.idea +activate + +# UML diagrams +classes.png +packages.png diff --git a/README.md b/README.md index e941296f..6982d860 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,8 @@ This includes installing the server in a mode better suited for active developme * `poetry run build_static` ### Distributing -* `poetry run build` -* `poetry export --without-hashes -f requirements.txt > dist/requirements.txt` -* Distribution files will then be in `/dist` +* `mkdir -p dist` +* `tar -c --exclude-vcs --exclude-from .tarignore -vzf dist/openflexure-microscope-server.tar.gz .` ## Build-system As of 1.0.0b0, we're using [Poetry](https://github.com/sdispater/poetry) to manage dependencies, build, and distribute the package. All package information and dependencies are found in `pyproject.toml`, in line with [PEP 518](https://www.python.org/dev/peps/pep-0518/). If you're developing this package, make use of `poetry.lock` to ensure you're using the latest locked dependency list. From 1b3e25be9beb7b81d2f333bd029366738e304ca1 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Sat, 16 May 2020 21:29:40 +0100 Subject: [PATCH 23/32] Updated CI to build dist archive --- .gitlab-ci.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 714667bc..bd947a73 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,10 +24,13 @@ build: - curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python script: + # Install server - $HOME/.poetry/bin/poetry install + # Run static build script - $HOME/.poetry/bin/poetry run build_static - - $HOME/.poetry/bin/poetry build - - $HOME/.poetry/bin/poetry export --without-hashes -f requirements.txt > dist/requirements.txt + # Build distribution archive + - mkdir -p dist + - tar -c --exclude-vcs --exclude-from .tarignore -vzf dist/openflexure-microscope-server-${CI_COMMIT_REF_NAME}.tar.gz . artifacts: name: "dist" @@ -60,7 +63,7 @@ deploy: - 'which rsync || ( apt-get update -y && apt-get install rsync -y )' # Upload the builds folder to openflexure-microscope builds - - rsync -hrvz -e ssh dist/ ci-user@openflexure.bath.ac.uk:/var/www/build/openflexure-microscope-server/${CI_COMMIT_REF_NAME} --delete + - rsync -hrvz -e ssh dist/ ci-user@openflexure.bath.ac.uk:/var/www/build/openflexure-microscope-server # Run update-latest.py on the build server - ssh -t ci-user@openflexure.bath.ac.uk "/var/www/build/update-latest.py" From 7655b23a5a235e7bd9d8b797b267d1907c6949c1 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Sat, 16 May 2020 21:39:20 +0100 Subject: [PATCH 24/32] Fixed dependencies --- poetry.lock | 4 ++-- pyproject.toml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/poetry.lock b/poetry.lock index cae6d5a8..20340fca 100644 --- a/poetry.lock +++ b/poetry.lock @@ -757,10 +757,10 @@ version = "0.26.1" ifaddr = "*" [extras] -rpi = ["picamera", "RPi.GPIO"] +rpi = ["RPi.GPIO"] [metadata] -content-hash = "4e7a6bf95f6780d1f155ceecee8fccff5b5d44c3034907cbe2f8ed3e634cfdb1" +content-hash = "e62efd90867a69b3385fb417a0cd0a9124fb4d23a36177ebef27903b4e78eb77" python-versions = "^3.6" [metadata.files] diff --git a/pyproject.toml b/pyproject.toml index 06aec50c..18ddd999 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ Pillow = "^5.4" scipy = "1.4.1" # Exact version so we can guarantee a wheel "RPi.GPIO" = { version = "^0.6.5", optional = true } -picamera = {url = "https://github.com/rwb27/picamera/releases/download/v1.13.2b0/picamera-1.13.2b0-py3-none-any.whl", optional = true } +picamera = {url = "https://github.com/rwb27/picamera/releases/download/v1.13.2b0/picamera-1.13.2b0-py3-none-any.whl" } pyserial = "^3.4" # Used for sangaboard (basic_serial_instrument) until we move to sangaboard pip library @@ -50,7 +50,7 @@ labthings = "0.6.1" pynpm = "^0.1.2" [tool.poetry.extras] -rpi = ["picamera", "RPi.GPIO"] +rpi = ["RPi.GPIO"] [tool.poetry.scripts] build_static = 'openflexure_microscope.install:build' From 6e62135453b98ed1e0871911b16840c0fb31964b Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Sat, 16 May 2020 21:47:18 +0100 Subject: [PATCH 25/32] Added tarignore to tarignore --- .tarignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.tarignore b/.tarignore index 1c4227bf..708114f4 100644 --- a/.tarignore +++ b/.tarignore @@ -3,6 +3,7 @@ node_modules .gitlab-ci.yml ./dist !openflexure_microscope/api/static/dist +.tarignore # Pyenv files .python-version From 8f78d9d60d36a90f17d39427b8cd7b257381bee0 Mon Sep 17 00:00:00 2001 From: Joel Collins <2579603-jtc42@users.noreply.gitlab.com> Date: Sun, 17 May 2020 16:54:40 +0000 Subject: [PATCH 26/32] Remove leading . from tar archive --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bd947a73..082a9658 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,7 +30,7 @@ build: - $HOME/.poetry/bin/poetry run build_static # Build distribution archive - mkdir -p dist - - tar -c --exclude-vcs --exclude-from .tarignore -vzf dist/openflexure-microscope-server-${CI_COMMIT_REF_NAME}.tar.gz . + - tar -c --exclude-vcs --exclude-from .tarignore -vzf dist/openflexure-microscope-server-${CI_COMMIT_REF_NAME}.tar.gz * artifacts: name: "dist" From 30f516693598e5b995ab27e9bfacd3a29e82ac08 Mon Sep 17 00:00:00 2001 From: Joel Collins <2579603-jtc42@users.noreply.gitlab.com> Date: Mon, 18 May 2020 09:10:51 +0000 Subject: [PATCH 27/32] Remove leading . from tar dir --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6982d860..f2090154 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ This includes installing the server in a mode better suited for active developme ### Distributing * `mkdir -p dist` -* `tar -c --exclude-vcs --exclude-from .tarignore -vzf dist/openflexure-microscope-server.tar.gz .` +* `tar -c --exclude-vcs --exclude-from .tarignore -vzf dist/openflexure-microscope-server.tar.gz *` ## Build-system As of 1.0.0b0, we're using [Poetry](https://github.com/sdispater/poetry) to manage dependencies, build, and distribute the package. All package information and dependencies are found in `pyproject.toml`, in line with [PEP 518](https://www.python.org/dev/peps/pep-0518/). If you're developing this package, make use of `poetry.lock` to ensure you're using the latest locked dependency list. From 1c2b0248eb3bb8970526150310b338013ee343d2 Mon Sep 17 00:00:00 2001 From: Joel Collins <2579603-jtc42@users.noreply.gitlab.com> Date: Mon, 18 May 2020 09:15:10 +0000 Subject: [PATCH 28/32] Revert "Remove leading . from tar archive" This reverts commit 8f78d9d60d36a90f17d39427b8cd7b257381bee0 --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 082a9658..bd947a73 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,7 +30,7 @@ build: - $HOME/.poetry/bin/poetry run build_static # Build distribution archive - mkdir -p dist - - tar -c --exclude-vcs --exclude-from .tarignore -vzf dist/openflexure-microscope-server-${CI_COMMIT_REF_NAME}.tar.gz * + - tar -c --exclude-vcs --exclude-from .tarignore -vzf dist/openflexure-microscope-server-${CI_COMMIT_REF_NAME}.tar.gz . artifacts: name: "dist" From 6c3274499ac45b52810999cd62e6095270bf6f85 Mon Sep 17 00:00:00 2001 From: Joel Collins <2579603-jtc42@users.noreply.gitlab.com> Date: Mon, 18 May 2020 09:15:24 +0000 Subject: [PATCH 29/32] Revert "Remove leading . from tar dir" This reverts commit 30f516693598e5b995ab27e9bfacd3a29e82ac08 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f2090154..6982d860 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ This includes installing the server in a mode better suited for active developme ### Distributing * `mkdir -p dist` -* `tar -c --exclude-vcs --exclude-from .tarignore -vzf dist/openflexure-microscope-server.tar.gz *` +* `tar -c --exclude-vcs --exclude-from .tarignore -vzf dist/openflexure-microscope-server.tar.gz .` ## Build-system As of 1.0.0b0, we're using [Poetry](https://github.com/sdispater/poetry) to manage dependencies, build, and distribute the package. All package information and dependencies are found in `pyproject.toml`, in line with [PEP 518](https://www.python.org/dev/peps/pep-0518/). If you're developing this package, make use of `poetry.lock` to ensure you're using the latest locked dependency list. From 02a9629faada04c08e423699bf80b9f2bb755cde Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Mon, 18 May 2020 10:48:10 +0100 Subject: [PATCH 30/32] Updated distribution name in version finder --- openflexure_microscope/api/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openflexure_microscope/api/app.py b/openflexure_microscope/api/app.py index 195c5c06..fbd2b042 100644 --- a/openflexure_microscope/api/app.py +++ b/openflexure_microscope/api/app.py @@ -65,7 +65,7 @@ app, labthing = create_app( title=f"OpenFlexure Microscope {api_microscope.name}", description="Test LabThing-based API for OpenFlexure Microscope", types=["org.openflexure.microscope"], - version=pkg_resources.get_distribution("openflexure_microscope").version, + version=pkg_resources.get_distribution("openflexure-microscope-server").version, flask_kwargs={"static_url_path": "", "static_folder": "static/dist"}, ) From ebdc463f49f5174556845ca475f2b0db286e25ad Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Mon, 18 May 2020 10:49:53 +0100 Subject: [PATCH 31/32] Updated version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 18ddd999..d9d6e9b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.masonry.api" [tool.poetry] name = "openflexure-microscope-server" -version = "2.2.0-alpha" +version = "2.1.0-beta" description = "Python module, and Flask-based web API, to run the OpenFlexure Microscope." authors = [ From 0f912cb064819b2a58683cb9c701612cb0dab161 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Mon, 18 May 2020 15:18:12 +0100 Subject: [PATCH 32/32] Update LabThings to 6.0.2. Closes #136 --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index 20340fca..32d27c1c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -290,7 +290,7 @@ description = "Python implementation of LabThings, based on the Flask microframe name = "labthings" optional = false python-versions = ">=3.6,<4.0" -version = "0.6.1" +version = "0.6.2" [package.dependencies] Flask = ">=1.1.1,<2.0.0" @@ -760,7 +760,7 @@ ifaddr = "*" rpi = ["RPi.GPIO"] [metadata] -content-hash = "e62efd90867a69b3385fb417a0cd0a9124fb4d23a36177ebef27903b4e78eb77" +content-hash = "4fbf4240ac033cff8c0879b570792626e29a5aa2c5ffa2ec08b825ef8c2b700c" python-versions = "^3.6" [metadata.files] @@ -929,8 +929,8 @@ jinja2 = [ {file = "Jinja2-2.11.2.tar.gz", hash = "sha256:89aab215427ef59c34ad58735269eb58b1a5808103067f7bb9d5836c651b3bb0"}, ] labthings = [ - {file = "labthings-0.6.1-py3-none-any.whl", hash = "sha256:b5e7bbcb18508e9abd5bc392773ce09e93beabe360361289b43fbe2838b31fdb"}, - {file = "labthings-0.6.1.tar.gz", hash = "sha256:77e52e7eb64bf00a1aa6a5dcbaf8e5bf791a5599ea330c5ab44acd8cd3931f1a"}, + {file = "labthings-0.6.2-py3-none-any.whl", hash = "sha256:b83997a7dd115e0bfe20c2d5c52741c0b747fe8044e12db7bf82a433f8493d8e"}, + {file = "labthings-0.6.2.tar.gz", hash = "sha256:6373e2d0fdd731752a6fabd09708adeaf233b67f0cdcabee669642f647e9d95d"}, ] lazy-object-proxy = [ {file = "lazy-object-proxy-1.4.3.tar.gz", hash = "sha256:f3900e8a5de27447acbf900b4750b0ddfd7ec1ea7fbaf11dfa911141bc522af0"}, diff --git a/pyproject.toml b/pyproject.toml index d9d6e9b1..3d4df63d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ opencv-python-headless = [ {version = "4.1.0.25", python = "~3.7"}, # PiWheels build for RPi running Py37 {version = "4.2.0.34", python = "^3.8"} # Latest for Py38 systems ] -labthings = "0.6.1" +labthings = "0.6.2" pynpm = "^0.1.2" [tool.poetry.extras]