Skip to main content

6 posts tagged with "python"

View All Tags

How To Attach a Debugger to a Running FastAPI Server in VS Code

· 4 min read
Morgan Moneywise
CEO at Morgan Moneywise, Inc.

picture of a cute bug hacking into a server

Introduction

In the realm of software development, debugging is not only inevitable but can also be a complex endeavor.

Picture this: you're faced with the task of deciphering what's occurring within a server that's already humming along. Relaunching it with an attached debugger, the usual go-to method, isn't an option.

In this post, we'll navigate this challenge, zeroing in on how to debug an already running FastAPI server in the rag-stack project as an example. And for those on a tight schedule, here's a quick video tutorial breaking down the process:

How to Simplify Docker Container Management in Integration Tests Using Pytest-Docker

· 4 min read
Morgan Moneywise
CEO at Morgan Moneywise, Inc.

picture of gears to represent integration tests

Introduction

Today, we're going to discuss an efficient way to set up your automated integration test workflows using Docker and Pytest.

Motivation

In an era where software complexity is rapidly growing, developing an efficient testing strategy is more than a mere best practice — it's the bedrock of stable and reliable applications.

One common strategy involves using Docker to set up a test version of a software component, such as a vector database. There are two popular variations to this strategy, both of which have their own limitations.

AI Pair Programming Showdown: ChatGPT vs Google Bard vs Bing Chat

· 2 min read
Morgan Moneywise
CEO at Morgan Moneywise, Inc.

Ever since large language models have taken the world by storm, I've been curious about how helpful these AI-powered chatbots can be to programmers like myself.

To put them to the test, I decided to build a couple of simple API endpoints using FastAPI and see how ChatGPT, Google Bard, and Bing Chat can assist me in the process.

Here's how they fared:

Effortless VSCode Setup: Debug 3rd Party Libraries with Pytest in Minutes!

· One min read
Morgan Moneywise
CEO at Morgan Moneywise, Inc.

Every time I work on a Python project, I find myself having to look up the VS Code launch configuration to enable Pytest to step into 3rd party libraries when using the interactive debugger. It became quite frustrating, and I knew I couldn't be the only one facing this issue. So, I decided to create a video tutorial to share my knowledge and help fellow developers set up their projects more efficiently.

My VS Code Setup To Practice TDD When Developing REST APIs

· One min read
Morgan Moneywise
CEO at Morgan Moneywise, Inc.

A lot of people I know will repeatedly alternate between writing an endpoint in their IDE and Postman/Swagger to test it. I do not like this workflow because of the constant context switching. I also find that it's easy to forget to test a scenario or to test the wrong scenario. I've found that it's much easier to test the API in the IDE itself.

I personally prefer the Test Driven Development (TDD) approach. I find that it helps me to write better code and to think about the API design before I actually start writing code. I also find that it helps me to write better tests and to think about the different scenarios that I need to test for.

So, how can we do this in VS Code?

How Copilot Won Me Over

· 2 min read
Morgan Moneywise
CEO at Morgan Moneywise, Inc.

Copilot is a service from GitHub that uses machine learning to help you write code. It was made generally available to the public on 21 June 2022.

As a person working in AI, I was very skeptical about this feature, and did not bother trying it for a long time. I expected it would generate code that is so buggy that it would be more productive to write the code by hand.

Until one day, a colleague whom I had a lot of respect for was singing praises about how Copilot helped him write a complex piece of code, and I decided to give it a try.