Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jellydn/modern-python-2024-demo

Modern development with Python in 2024
https://github.com/jellydn/modern-python-2024-demo

python ruff rye uv

Last synced: 7 days ago
JSON representation

Modern development with Python in 2024

Awesome Lists containing this project

README

        

Welcome to modern-python-2024-demo 👋



This project is a demo for modern Python 2024 with FastAPI. The project also utilizes the rye, uv, and ruff packages for a hassle-free Python experience.

[![Rye](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/rye/main/artwork/badge.json)](https://rye-up.com)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

[![IT Man - Modern development with Python in 2024](https://i.ytimg.com/vi/A8xdhC_0Hcc/hqdefault.jpg)](https://www.youtube.com/watch?v=A8xdhC_0Hcc)

## Pre-requisites

- [astral-sh/rye: a Hassle-Free Python Experience](https://github.com/astral-sh/rye)
- [astral-sh/uv: An extremely fast Python package installer and resolver, written in Rust.](https://github.com/astral-sh/uv)
- [astral-sh/ruff: An extremely fast Python linter and code formatter, written in Rust.](https://github.com/astral-sh/ruff)

## Install

```sh
rye sync
rye run basedpyright --createStub fastapi
```

## Usage

```sh
rye run devserver
```

[![Run dev command](https://i.gyazo.com/aece13aeaf4ab3b984ea04d3c3137113.gif)](https://gyazo.com/aece13aeaf4ab3b984ea04d3c3137113)

## Run tests

```sh
rye test
```

## Format code

```sh
rye fmt
```

[![Format code](https://i.gyazo.com/a8765a6625a1adc5287f108ae6f43214.png)](https://gyazo.com/a8765a6625a1adc5287f108ae6f43214)

## Lint code

```sh
rye lint
```

[![Lint code](https://i.gyazo.com/2a87caee50e46ef96dbd4b940b0506f9.png)](https://gyazo.com/2a87caee50e46ef96dbd4b940b0506f9)

## Docker

```sh
docker-compose up
```

Refer [Docker](https://rye-up.com/guide/docker/) for more information.

## Deploy to Fly.io

```sh
fly launch
```

## Resources

- [Introduction - Rye](https://rye-up.com/guide/)
- [Announcing Astral, the company behind Ruff](https://astral.sh/blog/announcing-astral-the-company-behind-ruff)
- [The Ruff Formatter: An extremely fast, Black-compatible Python formatter](https://astral.sh/blog/the-ruff-formatter)
- [uv: Python packaging in Rust](https://astral.sh/blog/uv)
- [DetachHead/basedpyright: pyright fork with various type checking improvements, improved vscode support and pylance features built into the language server](https://github.com/DetachHead/basedpyright)
- [FastAPI](https://fastapi.tiangolo.com/)

## Author

👤 **Huynh Duc Dung**

- Website: https://productsway.com/
- Twitter: [@jellydn](https://twitter.com/jellydn)
- Github: [@jellydn](https://github.com/jellydn)

## Show your support

Give a ⭐️ if this project helped you!

[![kofi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge&logo=ko-fi&logoColor=white)](https://ko-fi.com/dunghd)
[![paypal](https://img.shields.io/badge/PayPal-00457C?style=for-the-badge&logo=paypal&logoColor=white)](https://paypal.me/dunghd)
[![buymeacoffee](https://img.shields.io/badge/Buy_Me_A_Coffee-FFDD00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/dunghd)