summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/flask-migrate')
-rw-r--r--dev-python/flask-migrate/Manifest1
-rw-r--r--dev-python/flask-migrate/files/flask-migrate-4.0.0-system-venv.patch174
-rw-r--r--dev-python/flask-migrate/flask-migrate-4.0.0.ebuild37
3 files changed, 212 insertions, 0 deletions
diff --git a/dev-python/flask-migrate/Manifest b/dev-python/flask-migrate/Manifest
index 1f0ca6368dd0..d4d43862405d 100644
--- a/dev-python/flask-migrate/Manifest
+++ b/dev-python/flask-migrate/Manifest
@@ -1 +1,2 @@
DIST Flask-Migrate-3.1.0.gh.tar.gz 23752 BLAKE2B c668db793813658d1486dad662869b65fc5461bc7256e2ca42ca0d11da88fc3a40618946d03c7fd4f869d0eda21af2d9fe29f146dac4d364b4642c2cd26b6d96 SHA512 4e14fa04381c4217e78c3766c86891e88cd2ff4e2eb1ab3c3a51344cbbb192a083246e60cdb6cc4c1ef42bf8108420e3befa1b59c44fe0890e5202fd275b5805
+DIST Flask-Migrate-4.0.0.gh.tar.gz 25945 BLAKE2B 79619b5b3a64b5f1e9ad887e58c135a122961527725b468ab0c95871e4b582d306706db2b3840d33b9150ef52e60a8bf1f3db516ee1434ffcd529df02bfd29d8 SHA512 199f97f87c6dbc1b3dce3cd85a8a2ce75155f359394e86dea66c9166aadc01bb03627afff20ff8478e12fd63147f28dd5898c8354e6a053d5908b1bb7f2cc192
diff --git a/dev-python/flask-migrate/files/flask-migrate-4.0.0-system-venv.patch b/dev-python/flask-migrate/files/flask-migrate-4.0.0-system-venv.patch
new file mode 100644
index 000000000000..47899909d1c7
--- /dev/null
+++ b/dev-python/flask-migrate/files/flask-migrate-4.0.0-system-venv.patch
@@ -0,0 +1,174 @@
+diff --git a/tests/test_custom_template.py b/tests/test_custom_template.py
+index fe55fe4..ade8388 100644
+--- a/tests/test_custom_template.py
++++ b/tests/test_custom_template.py
+@@ -3,12 +3,16 @@ import shutil
+ import unittest
+ import subprocess
+ import shlex
++import sys
+
+
+-def run_cmd(app, cmd):
+- """Run a command and return a tuple with (stdout, stderr, exit_code)"""
++def run_flask(app, cmd):
++ """
++ Run a flask command and return a tuple with (stdout, stderr, exit_code)
++ """
+ os.environ['FLASK_APP'] = app
+- process = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE,
++ process = subprocess.Popen([sys.executable, '-m', 'flask'] +
++ shlex.split(cmd), stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ (stdout, stderr) = process.communicate()
+ print('\n$ ' + cmd)
+@@ -54,11 +58,11 @@ class TestMigrate(unittest.TestCase):
+ self.assertTrue(isinstance(v, int))
+
+ def test_migrate_upgrade(self):
+- (o, e, s) = run_cmd('app.py', 'flask db init -t ./custom_template')
++ (o, e, s) = run_flask('app.py', 'db init -t ./custom_template')
+ self.assertTrue(s == 0)
+- (o, e, s) = run_cmd('app.py', 'flask db migrate')
++ (o, e, s) = run_flask('app.py', 'db migrate')
+ self.assertTrue(s == 0)
+- (o, e, s) = run_cmd('app.py', 'flask db upgrade')
++ (o, e, s) = run_flask('app.py', 'db upgrade')
+ self.assertTrue(s == 0)
+
+ from .app import app, db, User
+diff --git a/tests/test_migrate.py b/tests/test_migrate.py
+index 08e60c7..3f22d38 100644
+--- a/tests/test_migrate.py
++++ b/tests/test_migrate.py
+@@ -3,12 +3,16 @@ import shutil
+ import unittest
+ import subprocess
+ import shlex
++import sys
+
+
+-def run_cmd(app, cmd):
+- """Run a command and return a tuple with (stdout, stderr, exit_code)"""
++def run_flask(app, cmd):
++ """
++ Run a flask command and return a tuple with (stdout, stderr, exit_code)
++ """
+ os.environ['FLASK_APP'] = app
+- process = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE,
++ process = subprocess.Popen([sys.executable, '-m', 'flask'] +
++ shlex.split(cmd), stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ (stdout, stderr) = process.communicate()
+ print('\n$ ' + cmd)
+@@ -54,11 +58,11 @@ class TestMigrate(unittest.TestCase):
+ self.assertTrue(isinstance(v, int))
+
+ def test_migrate_upgrade(self):
+- (o, e, s) = run_cmd('app.py', 'flask db init')
++ (o, e, s) = run_flask('app.py', 'db init')
+ self.assertTrue(s == 0)
+- (o, e, s) = run_cmd('app.py', 'flask db migrate')
++ (o, e, s) = run_flask('app.py', 'db migrate')
+ self.assertTrue(s == 0)
+- (o, e, s) = run_cmd('app.py', 'flask db upgrade')
++ (o, e, s) = run_flask('app.py', 'db upgrade')
+ self.assertTrue(s == 0)
+
+ from .app import app, db, User
+@@ -67,11 +71,11 @@ class TestMigrate(unittest.TestCase):
+ db.session.commit()
+
+ def test_custom_directory(self):
+- (o, e, s) = run_cmd('app_custom_directory.py', 'flask db init')
++ (o, e, s) = run_flask('app_custom_directory.py', 'db init')
+ self.assertTrue(s == 0)
+- (o, e, s) = run_cmd('app_custom_directory.py', 'flask db migrate')
++ (o, e, s) = run_flask('app_custom_directory.py', 'db migrate')
+ self.assertTrue(s == 0)
+- (o, e, s) = run_cmd('app_custom_directory.py', 'flask db upgrade')
++ (o, e, s) = run_flask('app_custom_directory.py', 'db upgrade')
+ self.assertTrue(s == 0)
+
+ from .app_custom_directory import app, db, User
+@@ -80,11 +84,11 @@ class TestMigrate(unittest.TestCase):
+ db.session.commit()
+
+ def test_custom_directory_path(self):
+- (o, e, s) = run_cmd('app_custom_directory_path.py', 'flask db init')
++ (o, e, s) = run_flask('app_custom_directory_path.py', 'db init')
+ self.assertTrue(s == 0)
+- (o, e, s) = run_cmd('app_custom_directory_path.py', 'flask db migrate')
++ (o, e, s) = run_flask('app_custom_directory_path.py', 'db migrate')
+ self.assertTrue(s == 0)
+- (o, e, s) = run_cmd('app_custom_directory_path.py', 'flask db upgrade')
++ (o, e, s) = run_flask('app_custom_directory_path.py', 'db upgrade')
+ self.assertTrue(s == 0)
+
+ from .app_custom_directory_path import app, db, User
+@@ -93,13 +97,13 @@ class TestMigrate(unittest.TestCase):
+ db.session.commit()
+
+ def test_compare_type(self):
+- (o, e, s) = run_cmd('app_compare_type1.py', 'flask database init')
++ (o, e, s) = run_flask('app_compare_type1.py', 'database init')
+ self.assertTrue(s == 0)
+- (o, e, s) = run_cmd('app_compare_type1.py', 'flask database migrate')
++ (o, e, s) = run_flask('app_compare_type1.py', 'database migrate')
+ self.assertTrue(s == 0)
+- (o, e, s) = run_cmd('app_compare_type1.py', 'flask database upgrade')
++ (o, e, s) = run_flask('app_compare_type1.py', 'database upgrade')
+ self.assertTrue(s == 0)
+- (o, e, s) = run_cmd('app_compare_type2.py', 'flask database migrate')
++ (o, e, s) = run_flask('app_compare_type2.py', 'database migrate')
+ self.assertTrue(s == 0)
+ self.assertTrue(b'Detected type change from VARCHAR(length=128) '
+ b'to String(length=10)' in e)
+diff --git a/tests/test_multidb_migrate.py b/tests/test_multidb_migrate.py
+index 1a40c18..e65106d 100644
+--- a/tests/test_multidb_migrate.py
++++ b/tests/test_multidb_migrate.py
+@@ -4,12 +4,16 @@ import unittest
+ import subprocess
+ import shlex
+ import sqlite3
++import sys
+
+
+-def run_cmd(app, cmd):
+- """Run a command and return a tuple with (stdout, stderr, exit_code)"""
++def run_flask(app, cmd):
++ """
++ Run a flask command and return a tuple with (stdout, stderr, exit_code)
++ """
+ os.environ['FLASK_APP'] = app
+- process = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE,
++ process = subprocess.Popen([sys.executable, '-m', 'flask'] +
++ shlex.split(cmd), stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ (stdout, stderr) = process.communicate()
+ print('\n$ ' + cmd)
+@@ -43,11 +47,11 @@ class TestMigrate(unittest.TestCase):
+ pass
+
+ def test_multidb_migrate_upgrade(self):
+- (o, e, s) = run_cmd('app_multidb.py', 'flask db init --multidb')
++ (o, e, s) = run_flask('app_multidb.py', 'db init --multidb')
+ self.assertTrue(s == 0)
+- (o, e, s) = run_cmd('app_multidb.py', 'flask db migrate')
++ (o, e, s) = run_flask('app_multidb.py', 'db migrate')
+ self.assertTrue(s == 0)
+- (o, e, s) = run_cmd('app_multidb.py', 'flask db upgrade')
++ (o, e, s) = run_flask('app_multidb.py', 'db upgrade')
+ self.assertTrue(s == 0)
+
+ # ensure the tables are in the correct databases
+@@ -75,7 +79,7 @@ class TestMigrate(unittest.TestCase):
+ db.session.commit()
+
+ # ensure the downgrade works
+- (o, e, s) = run_cmd('app_multidb.py', 'flask db downgrade')
++ (o, e, s) = run_flask('app_multidb.py', 'db downgrade')
+ self.assertTrue(s == 0)
+
+ conn1 = sqlite3.connect('app1.db')
diff --git a/dev-python/flask-migrate/flask-migrate-4.0.0.ebuild b/dev-python/flask-migrate/flask-migrate-4.0.0.ebuild
new file mode 100644
index 000000000000..7bcae0f8c1f8
--- /dev/null
+++ b/dev-python/flask-migrate/flask-migrate-4.0.0.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..11} )
+
+inherit distutils-r1
+
+MY_P="Flask-Migrate-${PV}"
+DESCRIPTION="SQLAlchemy database migrations for Flask applications using Alembic"
+HOMEPAGE="
+ https://github.com/miguelgrinberg/Flask-Migrate/
+ https://pypi.org/project/Flask-Migrate/
+"
+SRC_URI="
+ https://github.com/miguelgrinberg/Flask-Migrate/archive/v${PV}.tar.gz
+ -> ${MY_P}.gh.tar.gz
+"
+S=${WORKDIR}/${MY_P}
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+ >=dev-python/alembic-0.7[${PYTHON_USEDEP}]
+ >=dev-python/flask-0.9[${PYTHON_USEDEP}]
+ >=dev-python/flask-sqlalchemy-1.0[${PYTHON_USEDEP}]
+"
+
+distutils_enable_tests unittest
+
+PATCHES=(
+ "${FILESDIR}"/${P}-system-venv.patch
+)