-
-
Notifications
You must be signed in to change notification settings - Fork 703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package datasette for installation using homebrew #335
Comments
Here are some useful examples of other Python apps that have been packaged using the recipe described above: https://github.com/Homebrew/homebrew-core/search?utf8=%E2%9C%93&q=virtualenv_install_with_resources&type= |
Huh... from https://docs.brew.sh/Acceptable-Formulae
Marking this one as "help wanted" :) |
I can host a custom tap without needing to get anything accepted into homebrew-core: https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap Since my principle goal here is ensuring an easy installation path for people who are familiar with |
Here's a good example of a homebrew tap: https://github.com/saulpw/homebrew-vd |
Another useful example: https://github.com/Homebrew/homebrew-core/blob/master/Formula/trailscraper.rb |
How would plugin installation work if Datasette was installed via homebrew? |
Here's what happened when I installed It worked! And from digging around, it has a virtual environment at Which means And I tried running these commands and confirmed that I get a
So I can package Datasette as a homebrew package AND I can give people instructions for installing plugins. |
Telling people how to figure out that How about instead providing a Or It would run http://jelly.codes/articles/python-pip-module/ shows how to do this: import pip
try:
pip.main(["install", "plumbum"])
except SystemExit as e:
pass |
Quick prototype of diff --git a/datasette/cli.py b/datasette/cli.py
index 287195a..95b6eb7 100644
--- a/datasette/cli.py
+++ b/datasette/cli.py
@@ -231,6 +231,18 @@ def package(
call(args)
+@cli.command()
+@click.argument("packages", nargs=-1, required=True)
+def install(packages):
+ "Install Python packages - e.g. Datasette plugins - into the same environment as Datasett"
+ import pip
+
+ try:
+ pip.main(["install"] + list(packages))
+ except SystemExit as e:
+ pass
+
+
@cli.command()
@click.argument("files", type=click.Path(exists=True), nargs=-1)
@click.option(
|
Here's the issue that explains that warning: pypa/pip#5599 This should fix it (risky):
|
I got this almost working in |
It works!
|
https://docs.brew.sh/Python-for-Formula-Authors describes how.
It recommends using https://github.com/tdsmith/homebrew-pypi-poet
The text was updated successfully, but these errors were encountered: