Django test VS pytest

I am new to django `unittest` and `pytest`. However, I started to feel that `pytest` test case is more compact and clearer. Here is my test cases: class OrderEndpointTest(TestCase): def...

Docker Compose Error "TypeError: expected string or buffer" on docker:dind (ports)

I'm triying to setup my containers with docker-compose in a docker container (docker:dind) to make the tests at gitlab ci. From yesterday to today it has begin to fail on "docker-compose up" and i...

Upload to pypi from Gitlab Pipelines

I'm trying to upload a package to pypi using a Gitlab CI job, but I cannot make it work :/ Anyone has a working example? What I have tried so far in my .gitlab-ci.yaml (from my local machine all...

How can I add files to GitLab with `python-gitlab`?

Using Django, I’d like to sync the files in the database with git repositories on my GitLab instance via python-gitlab. Here you can find my Python code: import gitlab import base64 import...

Python dependency hell: A compromise between virtualenv and global dependencies?

I've tested various ways to manage my project dependencies in Python so far: Installing everything global with pip (saves spaces, but sooner or later gets you in trouble) pip & venv or virtualenv...

GitLab CI bump Python package version

I was wondering whether is possible to bump Python package version stored in gitlab inside gitlab ci runner. I have example package structure: /package /src /__init__.py main.py ...

Coverage badge in Gitlab CI with Python coverage always unknown

I am trying to show a coverage badge for a Python project in a private Gitlab CE installation (v11.8.6), using coverage.py for Python. However, the badge always says unknown. This is the relevant...

Using gitlab cicd to automatically merge branches

gitlab has this functionality that you can use pipelines that will execute code whenever you push code to your project. this is done through their .gitlab-ci.yml file format i am trying to somehow...

Tox 0% coverage

I have a python project where I use: pipenv tox pytest and many more. Basically, I want to add tox to my gitlab pipelines. And almost everything seems to work, calling mypy, flake8 or black from...

AWS Lambda python: .so module: ModuleNotFoundError: No module named 'regex._regex' when in subshell

I'm trying to run some of my simple CI jobs (e.g: linters) into lambda functions for my python repositories. I'm using gitlab-ci for this, and the basic architecture (not directly related to the...

Permission denied while deploying an app to App Engine from GitLab CI

I'm having problems using GitLab CI to automate deployments of a Python 3 app to App Engine standard. The following error is raised: DEBUG: (gcloud.app.deploy) Error Response: [7] Failed to create...

One line console command to set first root password in GitLab

I need to setup GitLab and runner, create user and projects, register runner - automatically via user data in terraform. It could be possible via API with bash or python scripts. To use API we...

Gitlab-CI for Python project with SonarQube

I want to set Gitlab-CI for my python project with SonarQube. I have one problem with that. I set SonarQube variables in settings gitlab-ci. This is my gitlab-ci.yml file: variables: ...

AWS: Unable to import module 'handler': No module named 'numpy'

AWS Newbie here I have to host my python scripts via gitlab CI as a lambda and trigger it by cloudwatch on AWS. I am following the following...

pip freeze doesn't show package version

Over the weekends I have upgraded my Ubuntu to 20.04, and I tried creating virtualenvironment with python 3.8.2, and pip install requirements.txt. In requirement.txt, I am installing some code...

Gitlab Api Commits Behind/Ahead Master

On the Gitlab webpage you have the possibility to check how many commits a branch is behind or ahead of the master branch. My question is if it is possible to get information about this with the...

Is jq installed and available on PATH?

I am trying to read a yaml file in gitlab CI. I installed jq==1.0.2 and yq==2.10.1 using pip in my CI job and I use python:3.7 image. When I tried to read the yaml file, it has the error yq: Error...

How to deploy Python packages to Gitlab Package Registry with Poetry?

I'm trying to set up Poetry to deploy packages to our internal Gitlab Package Registry. According to other sources online the repository ID should be https://gitlab.com/api/v4/projects/<project...

How to setup Gitlab CI E2E tests using Multiple dockers

I am a bit lost with the automated testing using Gitlab CI. I hope I can explain my problem so somebody can help me. I'll try to explain the situation first, after which I'll try to ask a question...

How to install multiple python namespace packages in editable mode

I created multiple packages according to the PEP420 implicit namespace packaging method. Two of those distribution packages are dende-github-api and dende-gitlab-api. Each of those distributions...

Gitlab-PythonApi Merge request

How to check the merge request status in GitLab using a python API call, I want to check the status of approval before merging, based on the status of approval have to do some checks, once checks...

How to write .gitlab-ci.yml to build/deploy with conditions

I am new to CI/CD and Gitlab. I have a CI/CD script to test, build and deploy and I use 2 branches and 2 EC2. My goal is to have a light and not redundant script to build and deploy my changes in...

Selenium Pytest GitLab CI - pytest problem

I have a problem with Gitlab Ci. I'm completely green at this. I have run a test that works fine locally.(python 3.8) After placing Ci in gitlab - unfortunately it is not so colorful anymore. I...

How to access previous GitLab CI artifacts, process them and save file in "main" repository?

My application for this is to visualize the performance of my software. Therefore I briefly describe what I'm doing and where I'm stuck. I have my source code in GitLab Compile and run some tests...

Activating Conda environment in GitLab Config yml file for CI-CD using Shell Executor

I want to activate conda environment in my Gitlab CI-CD process. I registered Gitlab runner (v13.10) with Shell Executor on a local machine (UNIX) different from my work laptop I am trying to...

How to ignore certain scripts while testing flask app using pytest in gitlab CI/CD pipeline?

I have a flask-restx folder with the following structure . ├── app │   ├── extensions.py │   ├── __init__.py │   └── pv_dimensioning │   ├──...

Gitlab CI/CD: New runner has not been connected yet

I am very new to Gitlab CI/CD and I have read its documentation very carefully about creating a new CI/CD process using .gitlab-ci.yml file. As I have found out in order to have Continuous...

Terraform init problem: too many command line arguments

What I'm trying to do: I have set up a self hosted gitlab instance, and I'm working on automating the terraform process with GitLab CI, for which I have to set up a terraform backend. I followed...

GitLab test coverage visualization is not working on a simple example

I have created a very simple example: https://gitlab.com/mvfwd/gitlab-coverage. Unfortunately gitlab does not show Cobertura coverage visualisation. Here is my .gitlab-ci.yml: image:...

Nameserver problems in WSL 2 Ubuntu 20.04

Windows Version: 10 Pro, Version 20H2 (OS Build 19042.1165) WSL Version: 2 Ubuntu Version: 20.04 I'm working with WSL 2 on my Windows laptop and am trying to install some Python packages (pytest)...