-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for virtual environments (#392)
* Initial virtual env support * Make import ignoring part of model * Add migrations * Improve stdout/stderr behavior * Fix stderr append * Move venv setup to separate function * Handle pip setup * unit tests * Add more settings and help text * maybe windows * windows stuff * win * dows * more windows.... * Add test case for running script in venv * test setup * Remove debug print
- Loading branch information
Showing
18 changed files
with
450 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Generated by Django 3.2.23 on 2023-11-22 02:05 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("wooey", "0050_add_api_keys"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="VirtualEnvironment", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("name", models.CharField(max_length=25)), | ||
("python_binary", models.CharField(max_length=1024)), | ||
("requirements", models.TextField(null=True, blank=True)), | ||
("venv_directory", models.CharField(max_length=1024)), | ||
], | ||
options={ | ||
"verbose_name": "virtual environment", | ||
"verbose_name_plural": "virtual environments", | ||
}, | ||
), | ||
migrations.AddField( | ||
model_name="script", | ||
name="virtual_environment", | ||
field=models.ForeignKey( | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
to="wooey.virtualenvironment", | ||
), | ||
), | ||
] |
21 changes: 21 additions & 0 deletions
21
wooey/migrations/0052_add_ignore_bad_imports_to_script_model.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Generated by Django 3.2.23 on 2023-11-22 22:37 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("wooey", "0051_add_virtual_env"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="script", | ||
name="ignore_bad_imports", | ||
field=models.BooleanField( | ||
default=False, | ||
help_text="Ignore bad imports when adding scripts. This is useful if a script is under a virtual environment.", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.