]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
CI: container with pydbus dependencies + small README update
authorVasek Sraier <git@vakabus.cz>
Thu, 25 Feb 2021 16:34:36 +0000 (17:34 +0100)
committerAleš Mrázek <ales.mrazek@nic.cz>
Fri, 8 Apr 2022 14:17:51 +0000 (16:17 +0200)
manager/.gitlab-ci.yml
manager/README.md
manager/ci/devenv/Dockerfile

index 99f62b722b9257d7654ca225e083163c4270512e..49a976895b2ebefe5bf5f4d98356e3a874866856 100644 (file)
@@ -22,15 +22,17 @@ image: registry.nic.cz/knot/knot-resolver-manager/devenv:latest
 #     - docker build -t $IMAGE_TAG ci/devenv
 #     - docker push $IMAGE_TAG
 
-# FIXME - use custom Docker image, so that we don't rebuild it all every single time
+
+# agressively cache Poetry's and NPM's data
+cache:
+  key: "always-the-same-cache"
+  paths:
+    - node_modules/
+    - .venv/
+  policy: pull-push
+
 lint:
   stage: check
-
-  cache:
-    key: "check:always-the-same-cache"
-    paths:
-      - node_modules/
-    policy: pull-push
   script:
     # run the actual tests
     - poetry env use $(pyenv which python)
index b86c66faac476f58466e3ec2427e2023a07fc6a0..6ae0f4c66cb5ad5c91804088436f20cc917b5423 100644 (file)
@@ -7,8 +7,8 @@
 Because we want to support multiple versions of Python with one codebase, we develop against the oldest supported version and then check in our CI that it works for newer Python versions.
 
 Install these tools:
-* [pyenv](https://github.com/pyenv/pyenv#installation)
-* [Poetry](https://python-poetry.org/docs/#installation)
+* [pyenv](https://github.com/pyenv/pyenv#installation) (can be installed using distro's package manager)
+* [Poetry](https://python-poetry.org/docs/#installation) (Note: do not install the package via pip, follow instructions in Poetry's official documentation)
 * [Yarn](https://yarnpkg.com/) (See FAQ for why do we need JS in Python project) or NPM
 
 Be careful, that you need the latest version of Poetry. The setup was tested with Poetry version 1.1.4. Due to it's ability to switch between Python versions, it has to be installed separately to work correctly. Make sure to follow [the latest setup guide](https://python-poetry.org/docs/#installation).
@@ -96,4 +96,4 @@ We would like to use a type checker. As of writing this, there are 4 possible op
 * [pyre](https://pyre-check.org/) - supports type inference, contains security focused static analysis tool, written in Python, does not work in Python 3.6
 * [pyright](https://github.com/Microsoft/pyright) - not that advanced as pyre and pytype, reports correct code as broken, basic type inference when no typehints are provided, written in TypeScript, great integration with VSCode, works regardless of current Python version
 
-Type inference is really handy when it comes to libraries without type hints or when you use internal functions without specifiing their types. This is why we use pyright instead of the more classical approach with mypy.
\ No newline at end of file
+Type inference is really handy when it comes to libraries without type hints or when you use internal functions without specifiing their types. This is why we use pyright instead of the more classical approach with mypy.
index 34446ecf706cf05c01de4b2b04311bc730c806ef..a51e16f956b154ddfb4de6b915991ffe541dffc3 100644 (file)
@@ -44,3 +44,11 @@ RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-
 ENV PATH="/home/user/.poetry/bin:$PATH"
 # force Poetry to run under python3
 RUN sed -i 's/env python/env python3/' .poetry/bin/poetry
+# force Poetry to use local .venv/ directory that we can cache
+ENV POETRY_VIRTUALENVS_IN_PROJECT=true
+
+
+# install additional project dependencies
+USER root
+RUN apt-get update && apt-get install --no-install-recommends --no-install-suggests -y libcairo2-dev libglib2.0-0 libgirepository1.0-dev
+USER user