charded
Project description
Simple project for Python 3.10+
All-in-one repository with supervisor, crontab, linters and many useful tools
Version control is handled using Astral UV tool. When building the image, uv is sourced from the official repository by copying the binary. Installation on a developer's machine can be done in various ways, which we'll cover shortly.
Managing the interpreter version, project environment variables, and setting up the virtual environment is done with the Mise tool. It automatically install any interpreter version by reading it from the project description and/or the version bound by uv. It can also fetch the appropriate uv binary for the platform and architecture.
How to install required tools?
A. Quick start for test
Therefore, the quickest and most minimal way to get touch is to install mise on your system and prepare tools with mise, not for development:
brew install mise
That's all, go to Shell configuration section.
B. Engineer full-featured setup
True engineer way it's prepare rust environment, build mise and configure shell:
- Install Cargo via Rustup.
- Do not forget add cargo path for your shell:
export PATH="~/.cargo/bin:$PATH"
- Install sccache to avoid electricity bills:
cargo install sccache
- Activate sccache:
export RUSTC_WRAPPER="~/.cargo/bin/sccache"(and add it to your shell)
- Install cargo packages updater and mise:
cargo install cargo-update mise
- Install uv:
mise install uv@latest && mise use -g uv@latest
- That's all, you have last version of optimized tools; for update all packages just run sometime:
rustup update && cargo install-update --all
Shell configuration
- Mise provide dotenv functionality (automatic read per-project environment variables from .env file and from .mise.toml config) from the box with batteries, but your shell must have entry hook, add to your shell it, example for zsh (your can replace it for bash, fish, etc):
eval "$(mise activate zsh)"
- Also you can want using autocompletion, same story for zsh:
eval "$(mise completion zsh && uv generate-shell-completion zsh)"
- Restart your shell session:
exec "$SHELL"
Kickstart
- Go to project root.
- Just run
make:- mise will mark project directory as trusted
- mise copy sample development environment variables to .env
- mise grab environment variables defined in project .env, evaluate it and provide to current shell session
- mise checks what project python versions is installed, otherwise download and install it
- uv make virtual environment in project root (
uv venv) - uv read project packages list, download, install and link it (via
uv syncrun, read Makefile) - uv install pre-commit and pre-push hooks
Work with project
Warning about pip
NEVER CALL pip, NEVER! Instead it use native uv calls, read uv manual, it's very easy, for example:
-
Set or change python version (when python 3.11 already installed), before run do not forget change your python version in pyproject.toml:
uv python pin 3.11 && make sync
-
If python 3.11 isn't installed, run
mise install python@3.11and mise download and install python 3.11, recreate virtual environment with 3.11 context. Do not forget to pin python version by uv from previous step (and, may be you need to update your pyproject.toml). -
Just add new dependency:
uv add phpbb<=1.2
-
Add some development library:
uv add --group development backyard-memleak
-
Work with locally cloned repository:
uv add --editable ~/src/lib/chrome-v8-core
Common workflow
-
make:- same as
mise install, but also callmise trust --yesfor initial deployment - call
make sync
- same as
-
make sync- drop and recreate .venv by
uv venv - read project dependencies graph from pyproject.toml and install it to virtual environment by
uv sync) - call
make freeze
- drop and recreate .venv by
-
make freeze:- dump state to uv.lock by
uv lock - for development and debugging puproses uv save all used packages in current virtual environment to
packages.json(with all development packages!) byuv pip list - for repeatable production purposes uv save project dependencies to
packages.txtwith hashes for release builds strict version checks, read Dockerfile example (only project dependencies!) byuv pip compile
- dump state to uv.lock by
-
make upgrade:- read project dependencies graph from pyproject.toml
- fetch information about all updated packages, recreate dependencies graph and install it to virtual environment by
uv sync --upgrade - update
uv.lockwith updated packages version byuv lock --upgrade - call
make freeze - show all installed packages in local virtual environment
- all you need it's just manually update versions in pyproject.toml
-
make check: It's non-destructive action, just run all checks and stop at first fail. -
make lint: Destructive action, always commit all changes before run it. Runs all compatible linters with --fix and --edit mode, after it callmake checkfor final polishing.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file charded-0.1.0.tar.gz.
File metadata
- Download URL: charded-0.1.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f958d3b98621fa2da8985a0edb22028a2d2c92ed7a53e4bd2301df023537aa2a
|
|
| MD5 |
af39e39c5cc5ca5b34f3545618d4bd63
|
|
| BLAKE2b-256 |
c1d29317bf7843f844a075ce2d14e2526b16d6125c7a396e924cd03f51aeb121
|
File details
Details for the file charded-0.1.0-py3-none-any.whl.
File metadata
- Download URL: charded-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6ce2ae607039753321f36497c0b0592fe644e2f9a6f44b1d98a1e843e659bc8
|
|
| MD5 |
42971d77e3827741e8dd17603e440e55
|
|
| BLAKE2b-256 |
6299f0e01c529e86f1880133b35be6a4d4e946029f28f93c151cb936cf2274fd
|