Questions tagged [python]

Python is a dynamic and strongly typed programming language designed to emphasize usability.

Python is a dynamic and strongly typed programming language that is used for a wide range of applications. It is a general-purpose, high-level programming language that is designed to emphasize usability.

79 questions
17
votes
1 answer

A systematic way to test RESTful APIs with curl?

I have noticed during integration testing that I actually work on recurring use cases with restful APIs (or in general HTTP interfaces) I check here and there with bash+cURL. It starts looking quite messy and gets harder to maintain. Why deliver…
Ta Mu
  • 6,792
  • 5
  • 43
  • 83
16
votes
1 answer

Dockerized Flask: Connection reset by peer

Trying to connect to a dockerized Flask app fails with error 104, 'Connection reset by peer' using this minimal example: app.py: from flask import Flask app = Flask(__name__) @app.route("/") def hello(): return "Hello World!" if __name__ ==…
mcnesium
  • 375
  • 1
  • 2
  • 7
8
votes
2 answers

Passing variables between scripts in a Jenkins pipeline

I have a declarative Jenkins pipeline that looks like the following: pipeline{ agent { ... } stages { stage("Provision EC2 Instance and Set ENV Variable"){ steps { dir("docker-image-builder"){ …
Preston Martin
  • 3,288
  • 4
  • 18
  • 39
8
votes
3 answers

What's a good devops approach for a single developer writing python web applications?

I'm guessing this question will seem incredibly trivial for some readers, but as someone who is a developer but with little experience of deploying apps in anything other than a manual, hit and hope sort of a way, I hope you will understand that…
Auspice
  • 181
  • 7
7
votes
3 answers

Re-using Python virtual environments on a build server

Currently, every time we run a build through Jenkins+Ansible, we are re-creating a virtual environment and re-installing all the dependencies listed inside the requirements.txt file. This is very slow and does not scale well. How can we improve and…
alecxe
  • 849
  • 1
  • 16
  • 36
7
votes
2 answers

What are the pros and cons of running application testing during vs. after a docker build?

Our dockerfile creates the application environment (e.g. env variables, install libraries with apt-get etc.). It also pulls and copies the python application code from its git repo. However, we are debating whether the application tests (some unit,…
cammil
  • 171
  • 1
6
votes
1 answer

What's the benefit of using Nginx to serve a Flask API on AWS?

I want to deploy a Flask API on AWS using Docker. A common way seems to be using a combination of Nginx + app server (e.g Gunicorn) + Flask app. The reason to use app server seems obvious to me. However, since I plan to use AWS ALB I'm not sure if…
Domen P
  • 61
  • 1
6
votes
1 answer

Re-using Python virtual environment vs Re-building it

Currently, we build our application on a build server where we create a virtual environment using virtualenv command, install all the Python dependencies into it, then "patch" it using the following bash commands to make it relocatable: # Adopt…
alecxe
  • 849
  • 1
  • 16
  • 36
5
votes
2 answers

Recommendations about release convention or standard for Python scripts?

I have a lot of python scripts which I release to a python virtual environment on a remote machine. The virtual environment is rarely updated. The scripts are pulled from a git repository and a makefile is used to deploy them into the virtual…
5
votes
2 answers

How to automate Powershell's interactive Get-Credential method?

I am trying to write a python script which automates the powershell's Get-Credential method. Here is something i wrote: import subprocess COMMAND_LINE = 'powershell' powershell = subprocess.Popen(COMMAND_LINE, shell=True, …
Vivek Lohiya
  • 51
  • 1
  • 2
5
votes
3 answers

Parametrize gitlab ci pipeline

There is the following simple pipeline: build → test → deploy that uses specified python version for all stages, for example 3.8. How can I scale (parametrize) it for python with versions: 3.7, 3.8 and 3.9? Simplest solution that comes to mind is to…
Arseny
  • 51
  • 1
4
votes
1 answer

How to install aws cli on a self-hosted azure DevOps Windows agent?

I have quite some difficulties installing aws cli on a self-hosted Azure DevOps Windows agent as part of a pipeline. Does anyone have a working solution? What I have tried so far: a) install aws cli via pip Firstly, I install Python (tried both;…
hey
  • 141
  • 1
  • 4
4
votes
1 answer

How to share variables across instances?

I'm writing TestInfra test scripts for mongo cluster instances using Molecule Ansible. I want to share variables across all the instances. I created a python class, and initialise and update the variables. Every time molecule verify, each test will…
Abel
  • 141
  • 2
4
votes
1 answer

How to connect to host during a Docker build?

I have a Dockerfile which I want to run some tests inside of as part of a multistage build. The tests attempt to make a connection to localhost, however it appears that they're not able to connect to the specific port (which is ready on the host…
Madden
  • 223
  • 1
  • 3
  • 6
4
votes
2 answers

Best way to isolate programming projects?

Not sure if this is the best place for the question but I have multiple development projects with different dependencies.. I want to know what the best practice is to isolate each project? I have many unrelated projects that a designed and updated…
blah
  • 43
  • 4
1
2 3 4 5 6