File tree 3 files changed +22
-14
lines changed
3 files changed +22
-14
lines changed Original file line number Diff line number Diff line change 1
1
venv :
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
5
11
6
12
clean :
7
- rm -rf venv
13
+ rm -rf . venv
8
14
9
15
run :
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
11
18
12
19
jupyter :
13
- source venv/bin/activate; PYTHONPATH=' ./src' jupyter lab
20
+ source . venv/bin/activate; PYTHONPATH=' ./src' jupyter lab
14
21
15
22
black-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
17
24
18
25
black :
19
- source venv/bin/activate ; black src --line-length 120
26
+ source . venv/bin/activate ; black src --line-length 120
20
27
21
28
ruff-check :
22
- source venv/bin/activate ; ruff check .
29
+ source . venv/bin/activate ; ruff check .
23
30
24
31
ruff :
25
- source venv/bin/activate ; ruff check . --fix
32
+ source . venv/bin/activate ; ruff check . --fix
26
33
27
34
test :
28
- source venv/bin/activate ; PYTHONPATH=' ./src' pytest -vv --capture=no tests
35
+ source . venv/bin/activate ; PYTHONPATH=' ./src' pytest -vv --capture=no tests
29
36
30
37
.DEFAULT_GOAL := help
31
38
.PHONY : help
Original file line number Diff line number Diff line change 1
1
# minimal-python-project-template
2
2
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.
4
4
5
- Uses the following 3rd party libraries:
5
+ Uses the following 3rd party libraries:
6
6
7
7
- APP - https://github.com/tiangolo/typer - For building CLI applications
8
8
- APP - https://github.com/Delgan/loguru - Python logging made (stupidly) simple
9
9
- 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
10
11
- DEV - https://github.com/psf/black - The uncompromising Python code formatter
11
12
- DEV - https://github.com/pytest-dev/pytest - makes it easy to write small tests, yet scales to support complex functional testing
12
13
Original file line number Diff line number Diff line change 8
8
9
9
10
10
def main (required_arg : str , optional_arg : str = None ):
11
- token = os .getenv ("EXAMPLE_TOKEN" )
11
+ # token = os.getenv("EXAMPLE_TOKEN")
12
12
logger .debug (f"Hello! required_arg = { required_arg } , optional_arg = { optional_arg } " )
13
13
logger .debug (f"PYTHONPATH = { os .getenv ('PYTHONPATH' , 'Not set' )} " )
14
14
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