Don't recommend to sudo pip install
#163
No reviewers
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#163
Loadingβ¦
Reference in New Issue
No description provided.
Delete Branch ":docsfix/no-sudo-pip"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Running a
sudo pip install
might bork a user's system Python configuration. It is safer to recommend a user site installation and note the $PATH issue. We could also recommend a virtual environment via https://virtualenv.pypa.io/en/stable/#introduction. Thoughts?I generally share the sentiment of: You should use a virtualenv (or
pip install --user
or Docker container) wherever possible rather than installing things at the system level. However, I didn't originally do that in the documentation because that'd require: 1. A possible dependency on additional tooling that doesn't come with borgmatic (although that doesn't apply to--user
), and 2. Would require selecting a particular method (likevirtualenv
) on behalf of the user. I kind of consider system installs the lowest common denominator way to install, even if they're generally not recommended.I also kind of figure that people who are more worried about isolation may just use a Docker container or distro-specific package.
Having said all that, I'm not averse to switching things up. Interested in your thoughts here. Do you think
--user
or virtualenv is common enough these days that it's worth 1. Taking a documentation-level dependency, and 2. Making the documentation select an implicit winner?One other consideration: The default config files (
/etc/borgmatic/config.yaml
, etc.) are expected to exist at the "system level", even if it's not system Python. So it might be a little weird, for instance, to instruct the user topip install --user borgmatic
and then use borgmatic to consume config files that only root has access to.Good points!
The
--user
recommendation will not suffice with the current documentation patch as is ...I don't think we should select "a winner", so to speak, but perhaps show a variety of recommended Python community practices. I don't want to overwhelm a new user but it's a structural issue of Python packaging and nothing borgmatic can solve.
How about:
And then linking out to standard Python documentation around virtual environments and user package installs where needed. I'll try another patch ...
Actually, the "using a virtual environment" documentation is perhaps a bridge too far. I've got a new patch pushed now that uses the root account with a
--user
install. I think this sticks with what you have already (using the root account) but also mitigates against a global package installation problem. See what you think.Seems like a reasonable iterative improvement! Thanks for taking the time to do this.
@ -8,3 +8,3 @@
least version 1.1.
Then, run the following command to download and install borgmatic:
Borgmatic generates configurations in `/etc/borgmatic/` and `/etc/borgmatic.d/`
Technically this should probably be something like: "Borgmatic consumes configuration files from ...". Because it doesn't (by default) generate anything into
/etc/borgmatic.d/
.@ -11,3 +15,3 @@
```bash
sudo pip3 install --upgrade borgmatic
sudo pip3 install --user --upgrade borgmatic
The
docs/how-to/upgrade.md
file probably also needs this same treatment in a couple of places?And maybe
docs/how-to/develop-on-borgmatic.md
as well. I'm thinking about thetox
install instructions.Comments addressed π
Thank you! Note that these changes won't go "live" on https://torsion.org/borgmatic/ until I manually re-deploy there. (That's actually something that would be worth putting in CI at some point.)
FWIW, I've been using a separate
pipenv
forborgmatic
&borgbackup
for a week now and it's running smoothly after initial setup troubles (environment activation in cron, by different users, etc.).Each method has its own kinks and pitfalls, so I don't know if there's a "best solution". π
Glad to hear it
pipenv
is working well for you! Agreed that each method has its pros/cons, and trying to enumerate them all in borgmatic docs would probably be too much. I'm happy to include links though.