You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* [Doc] How to Include Private Packages
* `yml` parser is unknown -> use `yaml`
* deprecation: missing `configuration` key for `sphinx`
* wrong dir name
* fix from testing the docs
Copy file name to clipboardExpand all lines: doc/faq/faq.md
+73Lines changed: 73 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,79 @@ pip freeze > requirements.txt
72
72
This will produce a new `requirements.txt` file with specific versions
73
73
for each package, ensuring that upgrades to the dependencies don't break your app.
74
74
75
+
(private-packages)=
76
+
## Including Private Packages
77
+
78
+
### UI & CLI
79
+
To use a private packages, you'll have to do it via Docker:
80
+
81
+
1. Copy your framework's base Dockerfile to project root ([Streamlit](https://github.com/ploomber/doc/blob/main/examples/streamlit/docker-based/Dockerfile), [Dash](https://github.com/ploomber/doc/blob/main/examples/dash/docker-based/Dockerfile), other framework Dockerfile can be find in our [examples](https://github.com/ploomber/doc/tree/main/examples))
82
+
83
+
2. Clone your `package` to root directory (`git clone https://githib.com/org/package.git`), and **remove it from your `requirements.txt`**
84
+
85
+
3. Update Dockerfile:
86
+
```Dockerfile
87
+
FROM python:3.11-slim
88
+
89
+
WORKDIR /app
90
+
91
+
# ~~~~~~~~~~~~~ NEW ~~~~~~~~~~~~~~~~
92
+
COPY package/ package/
93
+
RUN pip install -e package/
94
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
95
+
96
+
COPY requirements.txt /app/
97
+
RUN pip install -r requirements.txt --no-cache-dir
98
+
99
+
COPY . /app/
100
+
101
+
CMD ["streamlit", "run", "app.py"]
102
+
```
103
+
104
+
4. Zip your project and deploy it (CLI users, simply do: `ploomber-cloud deploy`)
105
+
106
+
### GitHub Workflow
107
+
For GitHub deployments, we need to add a package download step before the deployment step. Other steps remain same as UI/CLI method.
108
+
109
+
For this, you'll need to generate a personnal access token with access to the targeted repo.
110
+
-[How to generate a Personnal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)
111
+
-[How to securely give CI access to private Git repos using a **Machine User**](https://github.com/orgs/gruntwork-io/discussions/784#discussioncomment-7644683)
0 commit comments