File tree Expand file tree Collapse file tree 3 files changed +22
-14
lines changed
Expand file tree Collapse file tree 3 files changed +22
-14
lines changed Original file line number Diff line number Diff line change 11venv :
2- python3 -m venv venv
3- source venv/bin/activate ; pip install --upgrade pip ; python3 -m pip install -r requirements-dev.txt
4- source venv/bin/activate ; pip freeze > requirements_freeze.txt
2+ # Install uv on macOS and Linux:
3+ # $ curl -LsSf https://astral.sh/uv/install.sh | sh
4+ uv venv
5+ uv pip install -r requirements-dev.txt
6+
7+ # venv:
8+ # python3 -m venv .venv
9+ # source .venv/bin/activate ; pip install --upgrade pip ; python3 -m pip install -r requirements-dev.txt
10+ # source .venv/bin/activate ; pip freeze > requirements_freeze.txt
511
612clean :
7- rm -rf venv
13+ rm -rf . venv
814
915run :
10- source venv/bin/activate ; PYTHONPATH=' ./src' python -m app reqarg1
16+ # source .venv/bin/activate ; PYTHONPATH='./src' python -m app reqarg1
17+ uv run src/app.py reqarg1
1118
1219jupyter :
13- source venv/bin/activate; PYTHONPATH=' ./src' jupyter lab
20+ source . venv/bin/activate; PYTHONPATH=' ./src' jupyter lab
1421
1522black-check :
16- source venv/bin/activate ; black src --check --verbose --line-length 120
23+ source . venv/bin/activate ; black src --check --verbose --line-length 120
1724
1825black :
19- source venv/bin/activate ; black src --line-length 120
26+ source . venv/bin/activate ; black src --line-length 120
2027
2128ruff-check :
22- source venv/bin/activate ; ruff check .
29+ source . venv/bin/activate ; ruff check .
2330
2431ruff :
25- source venv/bin/activate ; ruff check . --fix
32+ source . venv/bin/activate ; ruff check . --fix
2633
2734test :
28- source venv/bin/activate ; PYTHONPATH=' ./src' pytest -vv --capture=no tests
35+ source . venv/bin/activate ; PYTHONPATH=' ./src' pytest -vv --capture=no tests
2936
3037.DEFAULT_GOAL := help
3138.PHONY : help
Original file line number Diff line number Diff line change 11# minimal-python-project-template
22
3- A minimal quick-start Python project template.
3+ A minimal quick-start Python project template, using [ uv ] ( https://github.com/astral-sh/uv ) package manager.
44
5- Uses the following 3rd party libraries:
5+ Uses the following 3rd party libraries:
66
77- APP - https://github.com/tiangolo/typer - For building CLI applications
88- APP - https://github.com/Delgan/loguru - Python logging made (stupidly) simple
99- APP - https://github.com/theskumar/python-dotenv - Reads key-value pairs from a .env file and can set them as environment variables.
10+ - DEV - https://github.com/astral-sh/uv - An extremely fast Python package and project manager
1011- DEV - https://github.com/psf/black - The uncompromising Python code formatter
1112- DEV - https://github.com/pytest-dev/pytest - makes it easy to write small tests, yet scales to support complex functional testing
1213
Original file line number Diff line number Diff line change 88
99
1010def main (required_arg : str , optional_arg : str = None ):
11- token = os .getenv ("EXAMPLE_TOKEN" )
11+ # token = os.getenv("EXAMPLE_TOKEN")
1212 logger .debug (f"Hello! required_arg = { required_arg } , optional_arg = { optional_arg } " )
1313 logger .debug (f"PYTHONPATH = { os .getenv ('PYTHONPATH' , 'Not set' )} " )
1414 logger .info (f"LOG_STDERR_LEVEL = { os .getenv ('LOG_STDERR_LEVEL' , 'Not set. Copy `.env_template` to `.env`' )} " )
You can’t perform that action at this time.
0 commit comments