From dbaae1045d72238c87f082f05b05d567ac11775f Mon Sep 17 00:00:00 2001 From: Christoph Knote Date: Thu, 28 Apr 2022 14:27:46 +0200 Subject: [PATCH 1/9] Conditional docs deploy job --- .gitlab-ci.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e36c8f1..b1db518 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,6 +9,7 @@ stages: - build_package - testing - create_docs + - deploy build_package: stage: build_package @@ -34,6 +35,17 @@ create_docs: - poetry install - cd docs - poetry run sphinx-build -b html . ../public + artifacts: + paths: + - public + +deploy_docs: + stage: deploy + needs: [create_docs] + variables: + docs_upload_host: hosted-024-173.rz.uni-augsburg.de + docs_path_component: icartt + script: # Following lines are ssh-agent setup and key injection, to allow upload of docs - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )' - 'command -v rsync >/dev/null || ( apt-get update -y && apt-get install --no-install-recommends rsync -y )' @@ -43,7 +55,7 @@ create_docs: - echo "$docs_ssh_key" | tr -d ' ' | base64 --decode | ssh-add - - mkdir -p ~/.ssh && chmod 700 ~/.ssh - ssh-keyscan ${docs_upload_host} > ~/.ssh/known_hosts - - rsync -ax ../public/ ${CI_PROJECT_NAME}-docs@${docs_upload_host}:/srv/docs/${docs_path_component}/public/$(poetry version -s)/ - artifacts: - paths: - - public + - rsync -ax public/ ${CI_PROJECT_NAME}-docs@${docs_upload_host}:/srv/docs/${docs_path_component}/public/$(poetry version -s)/ + rules: + # only deploy docs if the SSH key masked variable is set. + - if: $docs_ssh_key -- GitLab From e0e88bef50631e9159a653972c6c7ac571728af2 Mon Sep 17 00:00:00 2001 From: Christoph Knote Date: Thu, 28 Apr 2022 14:33:14 +0200 Subject: [PATCH 2/9] Doc updates --- README.md | 2 +- docs/conf.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0418ea0..4172b6e 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ poetry shell # Changelog -## 2.0.0 (2022-04-x) +## 2.0.0 (2022-04-28) - Compatible with ICARTT v2 standard - Formats 1001 and 2110 diff --git a/docs/conf.py b/docs/conf.py index c923536..49331ae 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,11 +18,11 @@ # -- Project information ----------------------------------------------------- project = "ICARTT" -copyright = "2022, Christoph Knote" +copyright = "2022, Christoph Knote, Model-based Environmental Exposure Science, University Augsburg, Augsburg, Germany" author = "Christoph Knote" # The full version, including alpha/beta/rc tags -release = "2.0" +release = "2.0.0" # -- General configuration --------------------------------------------------- -- GitLab From dc849c0eecf62add17812a0f6ddc1bfe3ae1b42c Mon Sep 17 00:00:00 2001 From: Christoph Knote Date: Thu, 28 Apr 2022 15:36:26 +0200 Subject: [PATCH 3/9] Update dependencies, version bump --- pyproject.toml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 345808f..6710aef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,23 +1,21 @@ [tool.poetry] name = "icartt" -version = "2.0.0-rc1" +version = "2.0.0-rc.2" description = "ICARTT format reader and writer" license = "GPL-3.0-or-later" authors = ["Christoph Knote ", "Florian Obersteiner "] readme = "README.md" homepage = "https://mbees.med.uni-augsburg.de/" repository = "https://mbees.med.uni-augsburg.de/gitlab/mbees/icartt_pypackage" -documentation = "https://mbees.med.uni-augsburg.de/docs/icartt/" +documentation = "https://mbees.med.uni-augsburg.de/docs/icartt/2.0.0-rc.2/" keywords = [ "atmosphere", "file format", "ames", "nasa" ] classifiers = [ - "Programming Language :: Python :: 3", "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: End Users/Desktop", "Intended Audience :: Science/Research", - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: POSIX", "Topic :: Education", "Topic :: Scientific/Engineering", @@ -33,18 +31,19 @@ packages = [ [tool.poetry.dependencies] -python = ">=3.8,<4.0" -numpy = ">= 1.12" +python = "^3.5" +numpy = ">= 1.17" [tool.poetry.dev-dependencies] -pytest = "^5.2" -coverage = ">= 6.3.2" -sphinx = ">= 4.4" -sphinx-rtd-theme = ">= 1.0" -enum-tools = ">= 0.9" -sphinx-toolbox = ">= 2.16.0" -black = "^22.3.0" +pytest = { version = "^5.2", python = ">=3.5" } +coverage = { version = ">= 6.3.2", python = ">=3.7" } +sphinx = { version = ">= 4.4", python = ">=3.6" } +sphinx-rtd-theme = { version = ">= 1.0", python = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" } +enum-tools = { version = ">=0.9", python = ">=3.6" } +sphinx-toolbox = { version = ">= 2.16.0", python = ">=3.6.1" } +black = { version = "^22.3.0", python = "^3.6.2" } +numpy = { version = ">=1.22", python = ">=3.8" } [tool.black] -- GitLab From e7c24a4fc38d1e313c234bff3836382740299219 Mon Sep 17 00:00:00 2001 From: Christoph Knote Date: Thu, 28 Apr 2022 15:42:59 +0200 Subject: [PATCH 4/9] Rename utils class --- src/icartt/dataset.py | 12 ++++++------ src/icartt/{ictutils.py => utils.py} | 0 2 files changed, 6 insertions(+), 6 deletions(-) rename src/icartt/{ictutils.py => utils.py} (100%) diff --git a/src/icartt/dataset.py b/src/icartt/dataset.py index d49ceaf..e4a685b 100644 --- a/src/icartt/dataset.py +++ b/src/icartt/dataset.py @@ -8,7 +8,7 @@ from enum import IntEnum import numpy as np -from . import ictutils as utl +from . import utils DEFAULT_NUM_FORMAT = "%g" """Default number format for output. Provides the `fmt` parameter of :func:`numpy.savetxt` internally.""" @@ -504,7 +504,7 @@ class Dataset: if self.inputFhandle: if self.inputFhandle.closed: self.inputFhandle = open(self.inputFhandle.name, encoding="utf-8") - f = utl.FilehandleWithLinecounter(self.inputFhandle, delimiter) + f = utils.FilehandleWithLinecounter(self.inputFhandle, delimiter) self._readHeader(f) self.inputFhandle.close() @@ -569,7 +569,7 @@ class Dataset: if self.format == Formats.FFI2110: dmp = f.readline() - shortname, units, standardname, longname = utl.extractVardesc(dmp) + shortname, units, standardname, longname = utils.extractVardesc(dmp) self.independentBoundedVariable = Variable( shortname, units, @@ -579,7 +579,7 @@ class Dataset: ) dmp = f.readline() - shortname, units, standardname, longname = utl.extractVardesc(dmp) + shortname, units, standardname, longname = utils.extractVardesc(dmp) self.independentVariable = Variable( shortname, units, @@ -612,7 +612,7 @@ class Dataset: # the name used for that variable as a column header, i.e., the last header # line prior to start of data.). dmp = f.readline() - shortname, units, standardname, longname = utl.extractVardesc(dmp) + shortname, units, standardname, longname = utils.extractVardesc(dmp) vshortname = [shortname] vunits = [units] vstandardname = [standardname] @@ -620,7 +620,7 @@ class Dataset: for _ in range(1, nvar): dmp = f.readline() - shortname, units, standardname, longname = utl.extractVardesc(dmp) + shortname, units, standardname, longname = utils.extractVardesc(dmp) vshortname += [shortname] vunits += [units] vstandardname += [standardname] diff --git a/src/icartt/ictutils.py b/src/icartt/utils.py similarity index 100% rename from src/icartt/ictutils.py rename to src/icartt/utils.py -- GitLab From 2a0d4a364459eda5bbe814185b3c6b85e3e60f88 Mon Sep 17 00:00:00 2001 From: Christoph Knote Date: Thu, 28 Apr 2022 15:43:19 +0200 Subject: [PATCH 5/9] Test test dep resolver issue --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b1db518..a722aa1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,7 +20,7 @@ test: stage: testing needs: [build_package] script: - - poetry update + - poetry update -vvv - poetry install - poetry run coverage run --source=tests -m unittest discover - poetry run coverage report -- GitLab From 0cc8a8eb3cdcb3f1a81676a095b96066b0e47e65 Mon Sep 17 00:00:00 2001 From: Christoph Knote Date: Thu, 28 Apr 2022 15:59:32 +0200 Subject: [PATCH 6/9] Possible fix for version mess --- pyproject.toml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6710aef..6eba249 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,19 +31,18 @@ packages = [ [tool.poetry.dependencies] -python = "^3.5" -numpy = ">= 1.17" +python = ">= 3.7, < 4" +numpy = ">= 1.19" [tool.poetry.dev-dependencies] -pytest = { version = "^5.2", python = ">=3.5" } -coverage = { version = ">= 6.3.2", python = ">=3.7" } -sphinx = { version = ">= 4.4", python = ">=3.6" } -sphinx-rtd-theme = { version = ">= 1.0", python = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" } -enum-tools = { version = ">=0.9", python = ">=3.6" } -sphinx-toolbox = { version = ">= 2.16.0", python = ">=3.6.1" } -black = { version = "^22.3.0", python = "^3.6.2" } -numpy = { version = ">=1.22", python = ">=3.8" } +pytest = "^5.2" +coverage = ">= 6.3.2" +sphinx = ">= 4.4" +sphinx-rtd-theme = ">= 1.0" +enum-tools = ">=0.9" +sphinx-toolbox = ">= 2.16.0" +black = "^22.3.0" [tool.black] -- GitLab From b6fca14772f1e942ea1464f65ed379deec84f5a4 Mon Sep 17 00:00:00 2001 From: Christoph Knote Date: Thu, 28 Apr 2022 16:09:12 +0200 Subject: [PATCH 7/9] Caching poetry packages --- .gitlab-ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a722aa1..28ba148 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,6 +4,11 @@ before_script: - curl -sSL https://install.python-poetry.org | python3 - - export PATH="/root/.local/bin:$PATH" - poetry --version + - poetry config virtualenvs.in-project true + +cache: + paths: + - .venv stages: - build_package @@ -20,7 +25,7 @@ test: stage: testing needs: [build_package] script: - - poetry update -vvv + - poetry update - poetry install - poetry run coverage run --source=tests -m unittest discover - poetry run coverage report -- GitLab From 720e7f8bf44703733072f94ba6aecac30927bdfb Mon Sep 17 00:00:00 2001 From: Christoph Knote Date: Thu, 28 Apr 2022 16:17:37 +0200 Subject: [PATCH 8/9] cache pip package store... --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 28ba148..404ebee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,8 @@ image: python:latest +variables: + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" + before_script: - curl -sSL https://install.python-poetry.org | python3 - - export PATH="/root/.local/bin:$PATH" @@ -8,6 +11,7 @@ before_script: cache: paths: + - .cache/pip - .venv stages: -- GitLab From 253e128270f115184c9931d207e8fa4d34b2d228 Mon Sep 17 00:00:00 2001 From: Christoph Knote Date: Thu, 28 Apr 2022 16:28:56 +0200 Subject: [PATCH 9/9] Ready for primetime --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6eba249..71144d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,13 @@ [tool.poetry] name = "icartt" -version = "2.0.0-rc.2" +version = "2.0.0" description = "ICARTT format reader and writer" license = "GPL-3.0-or-later" authors = ["Christoph Knote ", "Florian Obersteiner "] readme = "README.md" homepage = "https://mbees.med.uni-augsburg.de/" repository = "https://mbees.med.uni-augsburg.de/gitlab/mbees/icartt_pypackage" -documentation = "https://mbees.med.uni-augsburg.de/docs/icartt/2.0.0-rc.2/" +documentation = "https://mbees.med.uni-augsburg.de/docs/icartt/2.0.0/" keywords = [ "atmosphere", "file format", "ames", "nasa" ] classifiers = [ "Development Status :: 5 - Production/Stable", -- GitLab