Skip to content
Snippets Groups Projects
Commit 28ab6557 authored by Corné Lukken's avatar Corné Lukken
Browse files

L2SS-1428: Ensure installing package also install requirements.txt dependencies

parent 95128caa
No related branches found
No related tags found
1 merge request!3L2SS-1428: Ensure installing package also install requirements.txt dependencies
default: default:
image: $CI_REGISTRY/lofar2.0/attributewrapper/ci_python37:$CI_COMMIT_SHORT_SHA # minimum supported version image: $CI_REGISTRY/lofar2.0/attributewrapper/ci_python38:$CI_COMMIT_SHORT_SHA # minimum supported version
# Make sure each step is executed in a virtual environment with some basic dependencies present # Make sure each step is executed in a virtual environment with some basic dependencies present
before_script: before_script:
- python --version # For debugging - python --version # For debugging
- tox --version
- pip --version
cache: cache:
paths: paths:
- .cache/pip - .cache/pip
...@@ -10,8 +12,6 @@ default: ...@@ -10,8 +12,6 @@ default:
stages: stages:
- image - image
- lint - lint
# check if this needs to be a separate step
# - build_extensions
- test - test
- package - package
- integration - integration
...@@ -21,7 +21,7 @@ stages: ...@@ -21,7 +21,7 @@ stages:
variables: variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
build_test_image_python37: build_test_image_python38:
stage: image stage: image
image: docker image: docker
services: services:
...@@ -31,8 +31,8 @@ build_test_image_python37: ...@@ -31,8 +31,8 @@ build_test_image_python37:
before_script: before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script: script:
- docker build -t $CI_REGISTRY/lofar2.0/attributewrapper/ci_python37:$CI_COMMIT_SHORT_SHA -f docker/Dockerfile.ci_python37 docker - docker build -t $CI_REGISTRY/lofar2.0/attributewrapper/ci_python38:$CI_COMMIT_SHORT_SHA -f docker/Dockerfile.ci_python38 docker
- docker push $CI_REGISTRY/lofar2.0/attributewrapper/ci_python37:$CI_COMMIT_SHORT_SHA - docker push $CI_REGISTRY/lofar2.0/attributewrapper/ci_python38:$CI_COMMIT_SHORT_SHA
run_black: run_black:
stage: lint stage: lint
...@@ -50,11 +50,6 @@ run_pylint: ...@@ -50,11 +50,6 @@ run_pylint:
- tox -e pylint - tox -e pylint
allow_failure: true allow_failure: true
# build_extensions:
# stage: build_extensions
# script:
# - echo "build fortran/c/cpp extension source code"
run_unit_tests_coverage: run_unit_tests_coverage:
stage: test stage: test
script: script:
...@@ -67,11 +62,11 @@ run_unit_tests_coverage: ...@@ -67,11 +62,11 @@ run_unit_tests_coverage:
paths: paths:
- htmlcov/* - htmlcov/*
run_unit_tests_py37: run_unit_tests_py38:
stage: test stage: test
script: script:
- echo "run python3.7 unit tests /w coverage" - echo "run python3.7 unit tests /w coverage"
- tox -e py37 - tox -e py38
.run_unit_tests_pyXX: .run_unit_tests_pyXX:
# installs the prerequisites explicitly, instead of piggy backing # installs the prerequisites explicitly, instead of piggy backing
...@@ -79,29 +74,22 @@ run_unit_tests_py37: ...@@ -79,29 +74,22 @@ run_unit_tests_py37:
# images with different python versions. # images with different python versions.
stage: test stage: test
before_script: before_script:
- apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y git python3-pip libboost-python-dev libtango-dev # Needed to install pytango - apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y git python3-pip
- python3 -m pip install --upgrade pip - python3 -m pip install --upgrade pip
- pip install --upgrade tox - pip install --upgrade tox
run_unit_tests_py38:
extends: .run_unit_tests_pyXX
image: python:3.8-buster
script:
- echo "run python3.8 unit tests /w coverage"
- tox -e py38
run_unit_tests_py39: run_unit_tests_py39:
extends: .run_unit_tests_pyXX extends: .run_unit_tests_pyXX
image: python:3.9-bullseye image: python:3.9-bullseye
script: script:
- echo "run python3.9 unit tests /w coverage" - echo "run python3.8 unit tests /w coverage"
- tox -e py39 - tox -e py39
run_unit_tests_py310: run_unit_tests_py310:
extends: .run_unit_tests_pyXX extends: .run_unit_tests_pyXX
image: ubuntu:jammy image: ubuntu:jammy
script: script:
- echo "run python3.10 unit tests /w coverage" - echo "run python3.9 unit tests /w coverage"
- tox -e py310 - tox -e py310
run_unit_tests_py311: run_unit_tests_py311:
...@@ -114,6 +102,16 @@ run_unit_tests_py311: ...@@ -114,6 +102,16 @@ run_unit_tests_py311:
- echo "run python3.11 unit tests /w coverage" - echo "run python3.11 unit tests /w coverage"
- tox -e py311 - tox -e py311
run_unit_tests_py312:
extends: .run_unit_tests_pyXX
image: python:3.12-bullseye
script:
# Debian Bullseye ships with libboost-python linked to Python 3.9. Use the one from Debian Sid instead.
- echo 'deb http://deb.debian.org/debian sid main' >> /etc/apt/sources.list
- apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y libboost-python1.74-dev
- echo "run python3.12 unit tests /w coverage"
- tox -e py312
package_files: package_files:
stage: package stage: package
artifacts: artifacts:
...@@ -125,21 +123,25 @@ package_files: ...@@ -125,21 +123,25 @@ package_files:
package_docs: package_docs:
stage: package stage: package
allow_failure: true
artifacts: artifacts:
expire_in: 1w expire_in: 1w
paths: paths:
- docs/* # update path to match the dest dir for documentation - docs/* # update path to match the dest dir for documentation
script: script:
- echo "build and collect docs" - echo "build and collect docs"
- exit 1
run_integration_tests: run_integration_tests:
stage: integration stage: integration
allow_failure: true
needs: needs:
- package_files - package_files
script: script:
- echo "make sure to move out of source dir" - echo "make sure to move out of source dir"
- echo "install package from filesystem (or use the artefact)" - echo "install package from filesystem (or use the artefact)"
- echo "run against foreign systems (e.g. databases, cwl etc.)" - echo "run against foreign systems (e.g. databases, cwl etc.)"
- exit 1
publish_on_gitlab: publish_on_gitlab:
stage: publish stage: publish
...@@ -193,6 +195,7 @@ publish_on_pypi: ...@@ -193,6 +195,7 @@ publish_on_pypi:
publish_to_readthedocs: publish_to_readthedocs:
stage: publish stage: publish
allow_failure: true
environment: readthedocs environment: readthedocs
needs: needs:
- package_docs - package_docs
...@@ -201,3 +204,4 @@ publish_to_readthedocs: ...@@ -201,3 +204,4 @@ publish_to_readthedocs:
- if: $CI_COMMIT_TAG - if: $CI_COMMIT_TAG
script: script:
- echo "scp docs/* ???" - echo "scp docs/* ???"
- exit 1
...@@ -43,4 +43,5 @@ This project is licensed under the Apache License Version 2.0 ...@@ -43,4 +43,5 @@ This project is licensed under the Apache License Version 2.0
## Releases ## Releases
- 0.2 - Ensure requirements.txt dependencies are installed
- 0.1 - Initial release from separating into own repository - 0.1 - Initial release from separating into own repository
FROM python:3.7-buster FROM python:3.8-buster
# Install PyTango dependencies # Install PyTango dependencies
RUN apt-get update -y RUN apt-get update -y
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y git python3-pip libboost-python-dev libtango-dev RUN DEBIAN_FRONTEND=noninteractive apt-get install -y git python3-pip
# Make sure we have the latest tooling for our tests # Make sure we have the latest tooling for our tests
RUN python -m pip install --upgrade pip RUN python -m pip install --upgrade pip
......
[build-system] [build-system]
requires = [ requires = [
"setuptools>=45", "setuptools>=62.6",
"setuptools_scm[toml]>=6.2", "setuptools_scm[toml]>=6.2",
"wheel" "wheel"
] ]
......
numpy >= 1.19.5 # BSD importlib-metadata>=0.12; python_version<"3.8"
pip >= 1.5
pytango >= 9.4.0
numpy >= 1.19.3; python_version >"3.9" and python_version <"3.10" # BSD
numpy >= 1.21.6; python_version >"3.10" and python_version <"3.11" # BSD
numpy >= 1.23.2; python_version >"3.11" and python_version <"3.12" # BSD
stestr >= 3.0.0 # Apache-2.0 stestr >= 3.0.0 # Apache-2.0
testscenarios >= 0.5.0 # Apache-2.0/BSD testscenarios >= 0.5.0 # Apache-2.0/BSD
testtools >= 2.4.0 # MIT testtools >= 2.4.0 # MIT
...@@ -29,9 +29,7 @@ classifiers = ...@@ -29,9 +29,7 @@ classifiers =
include_package_data = true include_package_data = true
packages = find: packages = find:
python_requires = >=3.7 python_requires = >=3.7
install_requires = install_requires = file: requirements.txt
importlib-metadata>=0.12;python_version<"3.8"
pip >= 1.5
[flake8] [flake8]
max-line-length = 88 max-line-length = 88
......
[tox] [tox]
# Generative environment list to test all supported Python versions # Generative environment list to test all supported Python versions
envlist = py3{7,8,9,10,11},black,pep8,pylint envlist = py3{7,8,9,10,11},black,pep8,pylint
minversion = 3.28.0 minversion = 4.3.3
[testenv] [testenv]
usedevelop = True usedevelop = True
...@@ -14,10 +14,6 @@ setenv = ...@@ -14,10 +14,6 @@ setenv =
deps = deps =
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
-r{toxinidir}/tests/requirements.txt -r{toxinidir}/tests/requirements.txt
commands_pre =
# required until https://gitlab.com/tango-controls/pytango/-/issues/468 is resolved
pip install 'numpy>=1.19.5'
pip install --no-cache 'PyTango>=9.3.6,<9.4.0'
commands = commands =
{envpython} --version {envpython} --version
{envpython} -m pytest {posargs} {envpython} -m pytest {posargs}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment