rename to aerich

This commit is contained in:
long2ice 2020-05-15 13:25:28 +08:00
parent 00764c1b3d
commit b767f409f4
16 changed files with 72 additions and 68 deletions

View File

@ -2,7 +2,7 @@ name: pypi
on:
push:
paths:
- 'alice/__init__.py'
- 'aerich/__init__.py'
- '.github/workflows/pypi.yml'
jobs:
build:

View File

@ -7,4 +7,4 @@ ChangeLog
===
0.1.1
-----
- Now alice is basic worked.
- Now aerich is basic worked.

View File

@ -1,9 +1,9 @@
checkfiles = alice/ tests/
checkfiles = aerich/ tests/
black_opts = -l 100 -t py38
py_warn = PYTHONDEVMODE=1
help:
@echo "Alice development makefile"
@echo "Aerich development makefile"
@echo
@echo "usage: make <target>"
@echo "Targets:"

View File

@ -1,13 +1,13 @@
=====
Alice
=====
======
Aerich
======
.. image:: https://img.shields.io/pypi/v/alice.svg?style=flat
:target: https://pypi.python.org/pypi/alice
.. image:: https://img.shields.io/github/license/long2ice/alice
:target: https://github.com/long2ice/alice
.. image:: https://github.com/long2ice/alice/workflows/pypi/badge.svg
:target: https://github.com/long2ice/alice/actions?query=workflow:pypi
.. image:: https://img.shields.io/pypi/v/aerich.svg?style=flat
:target: https://pypi.python.org/pypi/aerich
.. image:: https://img.shields.io/github/license/long2ice/aerich
:target: https://github.com/long2ice/aerich
.. image:: https://github.com/long2ice/aerich/workflows/pypi/badge.svg
:target: https://github.com/long2ice/aerich/actions?query=workflow:pypi
Introduction
============
@ -19,26 +19,20 @@ This project aim to be a best migrations tool for Tortoise-ORM and which written
Install
=======
Just install from pypi (**INVALID**):
Just install from pypi:
.. code-block:: shell
$ pip install alice
So bad that pypi project name is occupied, you can only install from source:
.. code-block:: shell
$ pip install git+https://github.com/long2ice/alice.git
$ pip install aerich
Quick Start
===========
.. code-block:: shell
$ alice -h
$ aerich -h
Usage: alice [OPTIONS] COMMAND [ARGS]...
Usage: aerich [OPTIONS] COMMAND [ARGS]...
Options:
--config TEXT Tortoise-ORM config module, will auto read config dict variable
@ -65,7 +59,7 @@ Init schema and migrate location
.. code-block:: shell
$ alice --config tests.backends.mysql init
$ aerich --config tests.backends.mysql init
Success create migrate location ./migrations/models
Success init for app "models"
@ -75,7 +69,7 @@ Update models and make migrate
.. code-block:: shell
$ alice --config tests.backends.mysql migrate --name drop_column
$ aerich --config tests.backends.mysql migrate --name drop_column
Success migrate 1_202029051520102929_drop_column.json
@ -86,7 +80,7 @@ Upgrade to latest version
.. code-block:: shell
$ alice --config tests.backends.mysql upgrade
$ aerich --config tests.backends.mysql upgrade
Success upgrade 1_202029051520102929_drop_column.json
@ -97,7 +91,7 @@ Downgrade to previous version
.. code-block:: shell
$ alice --config tests.backends.mysql downgrade
$ aerich --config tests.backends.mysql downgrade
Success downgrade 1_202029051520102929_drop_column.json
@ -108,7 +102,7 @@ Show history
.. code-block:: shell
$ alice --config tests.backends.mysql history
$ aerich --config tests.backends.mysql history
1_202029051520102929_drop_column.json
@ -117,10 +111,10 @@ Show heads to be migrated
.. code-block:: shell
$ alice --config tests.backends.mysql heads
$ aerich --config tests.backends.mysql heads
1_202029051520102929_drop_column.json
License
=======
This project is licensed under the `MIT <https://github.com/long2ice/alice/blob/master/LICENSE>`_ License.
This project is licensed under the `MIT <https://github.com/long2ice/aerich/blob/master/LICENSE>`_ License.

View File

@ -8,8 +8,8 @@ import asyncclick as click
from asyncclick import BadOptionUsage, Context, UsageError
from tortoise import Tortoise, generate_schema_for_client
from alice.migrate import Migrate
from alice.utils import get_app_connection
from aerich.migrate import Migrate
from aerich.utils import get_app_connection
class Color(str, Enum):
@ -145,9 +145,7 @@ def history(ctx):
click.secho(version, fg=Color.yellow)
@cli.command(
help="Init migrate location and generate schema, you must exec first."
)
@cli.command(help="Init migrate location and generate schema, you must exec first.")
@click.option(
"--safe",
is_flag=True,

View File

@ -4,7 +4,7 @@ from tortoise import ForeignKeyFieldInstance, Model
from tortoise.backends.mysql.schema_generator import MySQLSchemaGenerator
from tortoise.fields import Field, JSONField, TextField, UUIDField
from alice.ddl import BaseDDL
from aerich.ddl import BaseDDL
class MysqlDDL(BaseDDL):

View File

@ -9,10 +9,10 @@ from tortoise import BackwardFKRelation, ForeignKeyFieldInstance, Model, Tortois
from tortoise.backends.mysql.schema_generator import MySQLSchemaGenerator
from tortoise.fields import Field
from alice.ddl import BaseDDL
from alice.ddl.mysql import MysqlDDL
from alice.exceptions import ConfigurationError
from alice.utils import get_app_connection
from aerich.ddl import BaseDDL
from aerich.ddl.mysql import MysqlDDL
from aerich.exceptions import ConfigurationError
from aerich.utils import get_app_connection
class Migrate:

View File

@ -1,6 +1,6 @@
[tool.poetry]
name = "alice"
version = "0.1.0"
name = "aerich"
version = "0.1.1"
description = "A database migrations tool for Tortoise ORM."
authors = ["long2ice <long2ice@gmail.com>"]

View File

@ -1,19 +1,31 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# make up
#
aiomysql==0.0.20 # via alice (setup.py)
aiosqlite==0.13.0 # via alice (setup.py)
anyio==1.3.0 # via alice (setup.py), asyncclick
async-generator==1.10 # via alice (setup.py), anyio
asyncclick==7.0.9 # via alice (setup.py)
cffi==1.14.0 # via alice (setup.py), cryptography
cryptography==2.9.2 # via alice (setup.py), pymysql
pycparser==2.20 # via alice (setup.py), cffi
pymysql==0.9.2 # via aiomysql, alice (setup.py)
pypika==0.37.6 # via alice (setup.py)
six==1.14.0 # via alice (setup.py), cryptography
sniffio==1.1.0 # via alice (setup.py), anyio
typing-extensions==3.7.4.2 # via alice (setup.py)
aiomysql==0.0.20
aiosqlite==0.13.0
anyio==1.3.0
appdirs==1.4.4
async-generator==1.10
asyncclick==7.0.9
asynctest==0.13.0
attrs==19.3.0
black==19.10b0
cffi==1.14.0
ciso8601==2.1.3; sys_platform != "win32" and implementation_name == "cpython"
click==7.1.2
cryptography==2.9.2
flake8==3.8.1
iso8601==0.1.12; sys_platform == "win32" or implementation_name != "cpython"
isort==4.3.21
mccabe==0.6.1
pathspec==0.8.0
pycodestyle==2.6.0
pycparser==2.20
pyflakes==2.2.0
pymysql==0.9.2
pypika==0.37.6
regex==2020.5.14
six==1.14.0
sniffio==1.1.0
taskipy==1.2.1
toml==0.10.1
-e git+https://github.com/tortoise/tortoise-orm.git@95c384a4742ee5980f8e4ae934bfdb0d8137bb40#egg=tortoise-orm
typed-ast==1.4.1
typing-extensions==3.7.4.2

View File

@ -4,7 +4,7 @@ from setuptools import find_packages, setup
def version():
ver_str_line = open('alice/__init__.py', 'rt').read()
ver_str_line = open('aerich/__init__.py', 'rt').read()
mob = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", ver_str_line, re.M)
if not mob:
raise RuntimeError("Unable to find version string")
@ -20,20 +20,20 @@ def requirements():
setup(
name='alice',
name='aerich',
version=version(),
description='A database migrations tool for Tortoise-ORM.',
author='long2ice',
long_description_content_type='text/x-rst',
long_description=long_description,
author_email='long2ice@gmail.com',
url='https://github.com/long2ice/alice',
url='https://github.com/long2ice/aerich',
license='MIT License',
packages=find_packages(include=['alice*']),
packages=find_packages(include=['aerich*']),
include_package_data=True,
zip_safe=True,
entry_points={
'console_scripts': ['alice = alice.cli:main'],
'console_scripts': ['aerich = aerich.cli:main'],
},
platforms='any',
keywords=(

View File

@ -1,7 +1,7 @@
from asynctest import TestCase
from tortoise import Tortoise
from alice.ddl.mysql import MysqlDDL
from aerich.ddl.mysql import MysqlDDL
TORTOISE_ORM = {
"connections": {"default": "mysql://root:123456@127.0.0.1:3306/test",},

View File

@ -1,7 +1,7 @@
from asynctest import TestCase
from tortoise import Tortoise
from alice.migrate import Migrate
from aerich.migrate import Migrate
from tests.backends.mysql import TORTOISE_ORM