File tree Expand file tree Collapse file tree 5 files changed +948
-18
lines changed
Expand file tree Collapse file tree 5 files changed +948
-18
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ COPY pyproject.toml uv.lock* ./
1515# Copy CLI application
1616COPY my_app ./my_app
1717
18- # Install package into system python, includes "marimo-launcher" script
18+ # Install package into the system Python environment
1919RUN uv pip install --system .
2020
2121ENTRYPOINT ["my-app" ]
Original file line number Diff line number Diff line change @@ -70,17 +70,4 @@ ruff-apply: # Resolve 'fixable errors' with 'ruff'
7070# CLI convenience commands
7171# #############################
7272my-app : # CLI without any arguments, utilizing uv script entrypoint
73- uv run my-app
74-
75-
76- # ###################################
77- # Docker
78- # ###################################
79- docker-build : # Build local image for testing
80- docker build -t python-cli-template:latest .
81-
82- docker-shell : # Shell into local container for testing
83- docker run -it --entrypoint=' bash' python-cli-template:latest
84-
85- docker-run : # Run main entrypoint + command without arguments
86- docker run python-cli-template:latest
73+ uv run my-app
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ A template repository for creating Python CLI applications.
44
55## App Setup (delete this section and above after initial application setup)
66
7- 1 . Rename "my_app" and "python-cli-template" to the desired app name across the repo. (May be helpful to do a project-wide find-and-replace).
7+ 1 . Rename "my_app" to the desired app name across the repo. (May be helpful to do a project-wide find-and-replace).
882 . Update Python version if needed.
993 . Install all dependencies with ` make install ` to create initial Pipfile.lock with latest dependency versions.
10104 . Add initial app description to README and update initial required ENV variable documentation as needed.
@@ -31,7 +31,12 @@ Description of the app
3131- To update dependencies: ` make update `
3232- To run unit tests: ` make test `
3333- To lint the repo: ` make lint `
34- - To run the app: ` uv run my-app --help ` (Note the hyphen ` - ` vs underscore ` _ ` that matches the ` project.scripts ` in ` pyproject.toml ` )
34+ - To run the app:
35+ - ` make my-app `
36+ - Utilizes ` uv ` built entrypoint (see ` project.scripts ` in [ ` pyproject.toml ` ] ( pyproject.toml ) )
37+ - Does not support loading a ` .env ` file
38+ - ` uv run --env-file .env my-app `
39+ - More verbose but supports loading a ` .env ` file
3540
3641## Environment Variables
3742
Original file line number Diff line number Diff line change 33# https://mitlibraries.atlassian.net/wiki/spaces/IN/pages/3432415247/Python+Project+Linters#Template-for-pyproject.toml
44
55[project ]
6- name = " python-cli-template "
6+ name = " my-app "
77version = " 2.0.0"
88requires-python = " >=3.12"
99
You can’t perform that action at this time.
0 commit comments